Dependency on OpenAI / Hello World
Can we remove dependency on OpenAI by default?
from langchain.tools import tool
from openai import OpenAI
from crewai import Agent, Crew, Task, Process
# Assuming the "Hello World" tool is defined as before
@tool
def hello_world_tool() -> str:
"""A simple tool that returns 'Hello World'"""
return "Hello World"
# Create an Agent with the "Hello World" Tool
greeter_agent = Agent(
role='Greeter',
goal='To greet the world',
backstory='An AI programmed to spread positivity by greeting everyone.',
tools=[hello_world_tool],
verbose=True
)
# Define a Task for the Crew (even if it's a simple demonstration)
greeting_task = Task(
description='Use the "Hello World" tool to greet.',
agent=greeter_agent,
)
# Create a Crew with the Greeter Agent and the Greeting Task
crew = Crew(
agents=[greeter_agent],
tasks=[greeting_task],
process=Process.sequential, # Using a sequential process for task execution
verbose=True
)
# Kick off the Crew's Work
# This is the code you would execute in a suitable environment:
result = crew.kickoff()
print(result)
Traceback (most recent call last):
File "/home/ivica/crewai/ivo/helloworld.py", line 12, in OPENAI_API_KEY which contains it, or pass openai_api_key as a named parameter. (type=value_error)
Easiest workaround I found was to just add a dummy OPENAI_API_KEY=DUMMY_KEY in the .env file
I encounter this issue too. I set the env with a dummy OpenAI key. Getting this error, do I just ignore it like a warning?
It seems we encountered an unexpected error while trying to use the tool. This was the error: Error code: 401 - {'error': {'message': 'Incorrect API key provided: DUMMY_KEY. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}
So the idea is can we have tasks/tools/agent that do not depend on any Gen AI LLM by default?
Not sure. The point is to be able to have a mix of AI and non AI agents
Get Outlook for Androidhttps://aka.ms/AAb9ysg
From: Tony Kipkemboi @.> Sent: Saturday, April 27, 2024 12:02:44 AM To: joaomdmoura/crewAI @.> Cc: John Jerkovic @.>; Author @.> Subject: Re: [joaomdmoura/crewAI] Dependency on OpenAI / Hello World (Issue #256)
Has anyone found a good solution for this yet? Setting the dummy key doesn't work, FYI.
— Reply to this email directly, view it on GitHubhttps://github.com/joaomdmoura/crewAI/issues/256#issuecomment-2080349854, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIFQXAVWB3MD5RZ3EB6WFW3Y7MPOJAVCNFSM6AAAAABDONPQUWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBQGM2DSOBVGQ. You are receiving this because you authored the thread.Message ID: @.***>
This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.