Skip to content

Commit

Permalink
fix: Toolcall data structure
Browse files Browse the repository at this point in the history
  • Loading branch information
naaive committed Dec 3, 2024
1 parent f0e76ca commit 31f8164
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions openagent/conf/llm_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def get_available_providers() -> Dict[str, BaseChatModel]:
providers = {}

provider_configs = [
(["gpt-4o-mini", "gpt-4o"], get_openai_provider),
(["gpt-4o-mini", "gpt-4o", "gpt-3.5-turbo"], get_openai_provider),
(["claude-3-5-sonnet"], get_anthropic_provider),
(["gemini-1.5-pro", "gemini-1.5-flash"], get_gemini_provider),
]
Expand All @@ -84,8 +84,10 @@ def get_available_providers() -> Dict[str, BaseChatModel]:
def get_openai_provider(model: str) -> BaseChatModel | None:
return ChatOpenAI(model=model) if settings.OPENAI_API_KEY else None


def get_anthropic_provider(model: str) -> BaseChatModel | None:
return ChatAnthropic(model="claude-3-5-sonnet-20240620",) if settings.ANTHROPIC_API_KEY else None
return ChatAnthropic(model="claude-3-5-sonnet-20240620", ) if settings.ANTHROPIC_API_KEY else None


def get_gemini_provider(model: str) -> BaseChatModel | None:
if settings.VERTEX_PROJECT_ID:
Expand Down
1 change: 1 addition & 0 deletions openagent/router/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class ChatCompletionResponse(BaseModel):
class DeltaMessage(BaseModel):
role: Optional[str] = None
content: Optional[str] = None
tool_calls: Optional[List[ToolCall]] = None


class StreamChoice(BaseModel):
Expand Down

0 comments on commit 31f8164

Please sign in to comment.