Skip to content

Commit 5aac93b

Browse files
author
Dylan Huang
committed
save
1 parent 944998d commit 5aac93b

4 files changed

Lines changed: 19 additions & 72 deletions

File tree

.vscode/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"python.testing.autoTestDiscoverOnSaveEnabled": true,
66
"python.defaultInterpreterPath": "./.venv/bin/python",
77
"python.testing.cwd": "${workspaceFolder}",
8-
"editor.defaultFormatter": "ms-python.black-formatter",
9-
"cursorpyright.analysis.typeCheckingMode": "recommended"
8+
"python.analysis.typeCheckingMode": "strict",
9+
"python.analysis.diagnosticMode": "workspace"
1010
}

eval_protocol/pytest/default_pydantic_ai_rollout_processor.py

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,32 @@
22
import logging
33
import types
44
from 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
117
from openai.types.chat import ChatCompletion, ChatCompletionMessageParam
128
from 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+
)
1612
from pydantic import TypeAdapter
17-
from pydantic_ai.messages import ModelMessage
18-
from pydantic_ai._utils import generate_tool_call_id
1913
from 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
2116
from 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
2725
from 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

3032
logger = 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/"):

pyproject.toml

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ dev = [
6565
"pytest-httpserver",
6666
"werkzeug>=2.0.0",
6767
"ruff>=0.5.0",
68-
"pyright>=1.1.365",
6968
"transformers>=4.0.0",
7069
"types-setuptools",
7170
"types-requests",
@@ -205,38 +204,9 @@ known-first-party = ["eval_protocol"]
205204
combine-as-imports = true
206205

207206
[tool.pyright]
208-
typeCheckingMode = "basic"
207+
typeCheckingMode = "recommended"
209208
pythonVersion = "3.10"
210-
reportMissingImports = "none"
211-
reportMissingTypeStubs = "none"
212-
reportMissingModuleSource = "none"
213209
include = ["eval_protocol", "examples", "tests"]
214210
exclude = ["vite-app", "vendor"]
215211
# Ignore diagnostics for vendored generator code
216212
ignore = ["versioneer.py"]
217-
# Relax noisy diagnostics commonly triggered in tests and dynamic libs
218-
reportAttributeAccessIssue = "none"
219-
reportCallIssue = "none"
220-
reportUnknownMemberType = "none"
221-
reportUnknownVariableType = "none"
222-
reportPossiblyUnboundVariable = "none"
223-
# Additional suppressions per request
224-
reportOptionalMemberAccess = "none"
225-
reportIndexIssue = "none"
226-
reportReturnType = "none"
227-
reportOptionalCall = "none"
228-
reportGeneralTypeIssues = "none"
229-
reportOperatorIssue = "none"
230-
reportOptionalSubscript = "none"
231-
reportUnsupportedDunderAll = "none"
232-
reportOptionalContextManager = "none"
233-
reportInvalidTypeForm = "none"
234-
reportRedeclaration = "none"
235-
reportUndefinedVariable = "none"
236-
reportPrivateImportUsage = "none"
237-
reportOptionalIterable = "none"
238-
# Make incompatibilities and argument types warnings instead of errors for now
239-
# and suppress warnings output entirely
240-
reportIncompatibleVariableOverride = "none"
241-
reportArgumentType = "none"
242-
reportAssignmentType = "none"

uv.lock

Lines changed: 0 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)