25 lines
816 B
Python
25 lines
816 B
Python
"""Construct Cloud planner clients from resolved database Provider profiles."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from cloud.llm_providers import ResolvedLlmProviderProfile
|
|
from runtime.tool_calling_client import (
|
|
AnthropicToolCallingClient,
|
|
OpenAIToolCallingClient,
|
|
ToolCallingClient,
|
|
)
|
|
|
|
|
|
def build_cloud_planner_client(
|
|
resolved: ResolvedLlmProviderProfile,
|
|
) -> ToolCallingClient:
|
|
"""Build a provider client without reading Cloud API environment variables."""
|
|
profile = resolved.profile
|
|
if profile.provider_type == "openai-compatible":
|
|
return OpenAIToolCallingClient(
|
|
model=profile.model,
|
|
api_key=resolved.api_key,
|
|
base_url=profile.base_url,
|
|
)
|
|
return AnthropicToolCallingClient(model=profile.model, api_key=resolved.api_key)
|