qwen3
This commit is contained in:
1 parent
b101fcaf41
commit
35be4770be
2 files changed
+5
-2
No files matched your search
Binary file not shown.
@@ -25,7 +25,7 @@ app = FastAPI(title="Browser Use API", version="1.0.0")
|
||||
class TaskRequest(BaseModel):
|
||||
task: str
|
||||
max_steps: Optional[int] = 20
|
||||
model: Optional[str] = Field(default_factory=lambda: os.getenv("LLM_MODEL_NAME", "openai/gpt-4o-mini"))
|
||||
model: Optional[str] = None
|
||||
|
||||
class TaskResponse(BaseModel):
|
||||
task_id: str
|
||||
@@ -67,9 +67,12 @@ async def run_browser_task(task_id: str, task: str, max_steps: int, model: str):
|
||||
if not api_key:
|
||||
raise ValueError("OPENROUTER_API_KEY not set")
|
||||
|
||||
# Читаем модель из переменной окружения в момент выполнения
|
||||
actual_model = model if model else os.getenv("LLM_MODEL_NAME", "openai/gpt-4o-mini")
|
||||
|
||||
# Используем ChatOpenAI с base_url для OpenRouter
|
||||
llm = ChatOpenAI(
|
||||
model=model,
|
||||
model=actual_model,
|
||||
base_url="https://openrouter.ai/api/v1",
|
||||
api_key=api_key
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user