Skip to content

Devika is the first open-source implementation of an Agentic Software Engineer. Initially started as an open-source alternative to Devin.

Python

fix: openai models crashing due to ambiguity in OpenAI agent classes

Andrew Bastin3ae22aed1bc5
diff --git a/src/llm/llm.py b/src/llm/llm.py
index 04c4e70..4080b5e 100644
--- a/src/llm/llm.py
+++ b/src/llm/llm.py
@@ -4,8 +4,6 @@ from .ollama_client import Ollama
from .claude_client import Claude
from .openai_client import OpenAI
-from src.state import AgentState
-
import tiktoken
TOKEN_USAGE = 0
diff --git a/src/llm/openai_client.py b/src/llm/openai_client.py
index b64d7df..9c19461 100644
--- a/src/llm/openai_client.py
+++ b/src/llm/openai_client.py
@@ -1,12 +1,12 @@
-from openai import OpenAI
+from openai import OpenAI as OAI
from src.config import Config
class OpenAI:
- def __init__(self, api_key: str):
+ def __init__(self):
config = Config()
api_key = config.get_openai_api_key()
- self.client = OpenAI(
+ self.client = OAI(
api_key=api_key,
)