mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-04-25 16:36:22 +02:00
Add support for other providers - litellm, openrouter
This commit is contained in:
parent
8c2c21a239
commit
14eee3e0c3
24 changed files with 398 additions and 95 deletions
|
|
@ -4,9 +4,8 @@ from pydantic import BaseModel, ValidationError
|
|||
from typing import List, Dict, Any, Literal
|
||||
import json
|
||||
from lib import AgentContext, PromptContext, ToolContext, ChatContext
|
||||
|
||||
openai_client = OpenAI()
|
||||
MODEL_NAME = "gpt-4.1" # OpenAI model name
|
||||
from client import PROVIDER_DEFAULT_MODEL
|
||||
from client import completions_client
|
||||
|
||||
class UserMessage(BaseModel):
|
||||
role: Literal["user"]
|
||||
|
|
@ -90,8 +89,8 @@ User: {last_message.content}
|
|||
message.model_dump() for message in messages
|
||||
]
|
||||
|
||||
return openai_client.chat.completions.create(
|
||||
model=MODEL_NAME,
|
||||
return completions_client.chat.completions.create(
|
||||
model=PROVIDER_DEFAULT_MODEL,
|
||||
messages=updated_msgs,
|
||||
temperature=0.0,
|
||||
stream=True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue