22import logging
33import types
44from typing import List , Literal
5+ from typing import Callable , Union
56
6- from openai .types .chat .chat_completion_assistant_message_param import ChatCompletionAssistantMessageParam
7-
8- from eval_protocol .models import EvaluationRow , Message
9- from eval_protocol .pytest .rollout_processor import RolloutProcessor
10- from eval_protocol .pytest .types import RolloutProcessorConfig
117from openai .types .chat import ChatCompletion , ChatCompletionMessageParam
128from openai .types .chat .chat_completion import Choice as ChatCompletionChoice
13- from pydantic_ai . models . anthropic import AnthropicModel
14- from pydantic_ai . models . openai import OpenAIModel
15- from pydantic_ai . models . google import GoogleModel
9+ from openai . types . chat . chat_completion_assistant_message_param import (
10+ ChatCompletionAssistantMessageParam ,
11+ )
1612from pydantic import TypeAdapter
17- from pydantic_ai .messages import ModelMessage
18- from pydantic_ai ._utils import generate_tool_call_id
1913from pydantic_ai import Agent
20- from pydantic_ai .usage import UsageLimits
14+ from pydantic_ai ._utils import generate_tool_call_id
15+ from pydantic_ai .messages import ModelMessage
2116from pydantic_ai .messages import (
2217 ModelRequest ,
2318 SystemPromptPart ,
2419 ToolReturnPart ,
2520 UserPromptPart ,
2621)
22+ from pydantic_ai .models .anthropic import AnthropicModel
23+ from pydantic_ai .models .google import GoogleModel
24+ from pydantic_ai .models .openai import OpenAIModel
2725from pydantic_ai .providers .openai import OpenAIProvider
28- from typing import Callable , Union
26+ from pydantic_ai .usage import UsageLimits
27+
28+ from eval_protocol .models import EvaluationRow , Message
29+ from eval_protocol .pytest .rollout_processor import RolloutProcessor
30+ from eval_protocol .pytest .types import RolloutProcessorConfig
2931
3032logger = logging .getLogger (__name__ )
3133
@@ -40,17 +42,7 @@ def __init__(self, setup_agent: Union[Callable[..., Agent], Agent], usage_limits
4042 self .setup_agent = setup_agent
4143 self .usage_limits = usage_limits
4244
43- def _map_litellm_to_pydantic_ai (
44- self , model_name : str
45- ) -> Literal [
46- "openai" ,
47- "deepseek" ,
48- "azure" ,
49- "openrouter" ,
50- "grok" ,
51- "fireworks" ,
52- "together" ,
53- ]:
45+ def _map_litellm_to_pydantic_ai (self , model_name : str ) -> str :
5446 mapping = {
5547 "fireworks_ai" : "fireworks" ,
5648 "together_ai" : "together" ,
@@ -61,7 +53,7 @@ def _map_litellm_to_pydantic_ai(
6153 model_name = model_name .removeprefix (f"{ provider } /" )
6254 if provider in mapping :
6355 provider = mapping [provider ]
64- return provider , model_name
56+ return 2
6557
6658 def _map_litellm_to_pydantic_ai_model (self , model_name : str ) -> Union [OpenAIModel , GoogleModel , AnthropicModel ]:
6759 if model_name .startswith ("anthropic/" ):
0 commit comments