diff --git a/.github/workflows/issues.yml b/.github/workflows/issues.yml index dca717752..421df5d3d 100644 --- a/.github/workflows/issues.yml +++ b/.github/workflows/issues.yml @@ -15,13 +15,14 @@ jobs: days-before-issue-stale: 7 days-before-issue-close: 3 stale-issue-label: "stale" + exempt-issue-labels: "skip-stale" stale-issue-message: "This issue is stale because it has been open for 7 days with no activity." close-issue-message: "This issue was closed because it has been inactive for 3 days since being marked as stale." any-of-issue-labels: 'question,needs-more-info' days-before-pr-stale: 10 days-before-pr-close: 7 stale-pr-label: "stale" - exempt-issue-labels: "skip-stale" + exempt-pr-labels: "skip-stale" stale-pr-message: "This PR is stale because it has been open for 10 days with no activity." close-pr-message: "This PR was closed because it has been inactive for 7 days since being marked as stale." repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index edd0d898b..bc5fa4606 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,6 +22,8 @@ jobs: enable-cache: true - name: Install dependencies run: make sync + - name: Verify formatting + run: make format-check - name: Run lint run: make lint @@ -41,6 +43,16 @@ jobs: tests: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: + - "3.10" + - "3.11" + - "3.12" + - "3.13" + # TODO: enable this https://github.com/openai/openai-agents-python/pull/1961/ + # - "3.14" env: OPENAI_API_KEY: fake-for-tests steps: @@ -50,6 +62,7 @@ jobs: uses: astral-sh/setup-uv@v5 with: enable-cache: true + python-version: ${{ matrix.python-version }} - name: Install dependencies run: make sync - name: Run tests with coverage @@ -71,7 +84,7 @@ jobs: - name: Build docs run: make build-docs - old_versions: + old_version_tests: runs-on: ubuntu-latest env: OPENAI_API_KEY: fake-for-tests diff --git a/.github/workflows/update-docs.yml b/.github/workflows/update-docs.yml new file mode 100644 index 000000000..624966a96 --- /dev/null +++ b/.github/workflows/update-docs.yml @@ -0,0 +1,76 @@ +name: "Update Translated Docs" + +# This GitHub Actions job automates the process of updating all translated document pages. Please note the following: +# 1. The translation results may vary each time; some differences in detail are expected. +# 2. When you add a new page to the left-hand menu, **make sure to manually update mkdocs.yml** to include the new item. +# 3. If you switch to a different LLM (for example, from o3 to a newer model), be sure to conduct thorough testing before making the switch. + +# To add more languages, you will update the following: +# 1. Add '!docs/{lang}/**' to `on.push.paths` in this file +# 2. Update mkdocs.yml to have the new language +# 3. Update docs/scripts/translate_docs.py to have the new language + +on: + push: + branches: + - main + paths: + - 'docs/**' + - mkdocs.yml + - '!docs/ja/**' + - '!docs/ko/**' + - '!docs/zh/**' + +permissions: + contents: write + pull-requests: write + +jobs: + update-docs: + if: "!contains(github.event.head_commit.message, 'Update all translated document pages')" + name: Build and Push Translated Docs + runs-on: ubuntu-latest + timeout-minutes: 20 + env: + PROD_OPENAI_API_KEY: ${{ secrets.PROD_OPENAI_API_KEY }} + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Setup uv + uses: astral-sh/setup-uv@v5 + with: + enable-cache: true + - name: Install dependencies + run: make sync + - name: Build full docs + run: make build-full-docs + + - name: Commit changes + id: commit + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add docs/ + if [ -n "$(git status --porcelain)" ]; then + git commit -m "Update all translated document pages" + echo "committed=true" >> "$GITHUB_OUTPUT" + else + echo "No changes to commit" + echo "committed=false" >> "$GITHUB_OUTPUT" + fi + + - name: Create Pull Request + if: steps.commit.outputs.committed == 'true' + uses: peter-evans/create-pull-request@v6 + with: + commit-message: "Update all translated document pages" + title: "Update all translated document pages" + body: | + Automated update of translated documentation. + + Triggered by commit: [${{ github.event.head_commit.id }}](${{ github.server_url }}/${{ github.repository }}/commit/${{ github.event.head_commit.id }}). + Message: `${{ github.event.head_commit.message }}` + branch: update-translated-docs-${{ github.run_id }} + delete-branch: true diff --git a/.gitignore b/.gitignore index 2e9b92379..60782274e 100644 --- a/.gitignore +++ b/.gitignore @@ -100,8 +100,10 @@ celerybeat.pid *.sage.py # Environments -.env +.python-version +.env* .venv +.venv* env/ venv/ ENV/ @@ -143,3 +145,6 @@ cython_debug/ # PyPI configuration file .pypirc .aider* + +# Redis database files +dump.rdb diff --git a/Makefile b/Makefile index 9a88f93a1..506f198a9 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ lint: .PHONY: mypy mypy: - uv run mypy . + uv run mypy . --exclude site .PHONY: tests tests: @@ -39,11 +39,13 @@ snapshots-create: uv run pytest --inline-snapshot=create .PHONY: old_version_tests -old_version_tests: +old_version_tests: + UV_PROJECT_ENVIRONMENT=.venv_39 uv sync --python 3.9 --all-extras --all-packages --group dev UV_PROJECT_ENVIRONMENT=.venv_39 uv run --python 3.9 -m pytest .PHONY: build-docs build-docs: + uv run docs/scripts/generate_ref_files.py uv run mkdocs build .PHONY: build-full-docs diff --git a/README.md b/README.md index 638f94b21..99b3f63ce 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# OpenAI Agents SDK +# OpenAI Agents SDK [![PyPI](https://img.shields.io/pypi/v/openai-agents?label=pypi%20package)](https://pypi.org/project/openai-agents/) The OpenAI Agents SDK is a lightweight yet powerful framework for building multi-agent workflows. It is provider-agnostic, supporting the OpenAI Responses and Chat Completions APIs, as well as 100+ other LLMs. @@ -17,137 +17,34 @@ The OpenAI Agents SDK is a lightweight yet powerful framework for building multi Explore the [examples](examples) directory to see the SDK in action, and read our [documentation](https://openai.github.io/openai-agents-python/) for more details. -## Sessions - -The Agents SDK provides built-in session memory to automatically maintain conversation history across multiple agent runs, eliminating the need to manually handle `.to_input_list()` between turns. - -### Quick start - -```python -from agents import Agent, Runner, SQLiteSession - -# Create agent -agent = Agent( - name="Assistant", - instructions="Reply very concisely.", -) - -# Create a session instance -session = SQLiteSession("conversation_123") - -# First turn -result = await Runner.run( - agent, - "What city is the Golden Gate Bridge in?", - session=session -) -print(result.final_output) # "San Francisco" - -# Second turn - agent automatically remembers previous context -result = await Runner.run( - agent, - "What state is it in?", - session=session -) -print(result.final_output) # "California" - -# Also works with synchronous runner -result = Runner.run_sync( - agent, - "What's the population?", - session=session -) -print(result.final_output) # "Approximately 39 million" -``` - -### Session options - -- **No memory** (default): No session memory when session parameter is omitted -- **`session: Session = DatabaseSession(...)`**: Use a Session instance to manage conversation history +## Get started -```python -from agents import Agent, Runner, SQLiteSession +To get started, set up your Python environment (Python 3.9 or newer required), and then install OpenAI Agents SDK package. -# Custom SQLite database file -session = SQLiteSession("user_123", "conversations.db") -agent = Agent(name="Assistant") +### venv -# Different session IDs maintain separate conversation histories -result1 = await Runner.run( - agent, - "Hello", - session=session -) -result2 = await Runner.run( - agent, - "Hello", - session=SQLiteSession("user_456", "conversations.db") -) +```bash +python -m venv .venv +source .venv/bin/activate # On Windows: .venv\Scripts\activate +pip install openai-agents ``` -### Custom session implementations - -You can implement your own session memory by creating a class that follows the `Session` protocol: - -```python -from agents.memory import Session -from typing import List - -class MyCustomSession: - """Custom session implementation following the Session protocol.""" - - def __init__(self, session_id: str): - self.session_id = session_id - # Your initialization here - - async def get_items(self, limit: int | None = None) -> List[dict]: - # Retrieve conversation history for the session - pass - - async def add_items(self, items: List[dict]) -> None: - # Store new items for the session - pass - - async def pop_item(self) -> dict | None: - # Remove and return the most recent item from the session - pass - - async def clear_session(self) -> None: - # Clear all items for the session - pass - -# Use your custom session -agent = Agent(name="Assistant") -result = await Runner.run( - agent, - "Hello", - session=MyCustomSession("my_session") -) -``` +For voice support, install with the optional `voice` group: `pip install 'openai-agents[voice]'`. -## Get started +For Redis session support, install with the optional `redis` group: `pip install 'openai-agents[redis]'`. -1. Set up your Python environment +### uv -- Option A: Using venv (traditional method) -```bash -python -m venv env -source env/bin/activate # On Windows: env\Scripts\activate -``` +If you're familiar with [uv](https://docs.astral.sh/uv/), using the tool would be even similar: -- Option B: Using uv (recommended) ```bash -uv venv -source .venv/bin/activate # On Windows: .venv\Scripts\activate +uv init +uv add openai-agents ``` -2. Install Agents SDK +For voice support, install with the optional `voice` group: `uv add 'openai-agents[voice]'`. -```bash -pip install openai-agents -``` - -For voice support, install with the optional `voice` group: `pip install 'openai-agents[voice]'`. +For Redis session support, install with the optional `redis` group: `uv add 'openai-agents[redis]'`. ## Hello world example @@ -263,6 +160,123 @@ The Agents SDK is designed to be highly flexible, allowing you to model a wide r The Agents SDK automatically traces your agent runs, making it easy to track and debug the behavior of your agents. Tracing is extensible by design, supporting custom spans and a wide variety of external destinations, including [Logfire](https://logfire.pydantic.dev/docs/integrations/llms/openai/#openai-agents), [AgentOps](https://docs.agentops.ai/v1/integrations/agentssdk), [Braintrust](https://braintrust.dev/docs/guides/traces/integrations#openai-agents-sdk), [Scorecard](https://docs.scorecard.io/docs/documentation/features/tracing#openai-agents-sdk-integration), and [Keywords AI](https://docs.keywordsai.co/integration/development-frameworks/openai-agent). For more details about how to customize or disable tracing, see [Tracing](http://openai.github.io/openai-agents-python/tracing), which also includes a larger list of [external tracing processors](http://openai.github.io/openai-agents-python/tracing/#external-tracing-processors-list). +## Long running agents & human-in-the-loop + +You can use the Agents SDK [Temporal](https://temporal.io/) integration to run durable, long-running workflows, including human-in-the-loop tasks. View a demo of Temporal and the Agents SDK working in action to complete long-running tasks [in this video](https://www.youtube.com/watch?v=fFBZqzT4DD8), and [view docs here](https://github.com/temporalio/sdk-python/tree/main/temporalio/contrib/openai_agents). + +## Sessions + +The Agents SDK provides built-in session memory to automatically maintain conversation history across multiple agent runs, eliminating the need to manually handle `.to_input_list()` between turns. + +### Quick start + +```python +from agents import Agent, Runner, SQLiteSession + +# Create agent +agent = Agent( + name="Assistant", + instructions="Reply very concisely.", +) + +# Create a session instance +session = SQLiteSession("conversation_123") + +# First turn +result = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session +) +print(result.final_output) # "San Francisco" + +# Second turn - agent automatically remembers previous context +result = await Runner.run( + agent, + "What state is it in?", + session=session +) +print(result.final_output) # "California" + +# Also works with synchronous runner +result = Runner.run_sync( + agent, + "What's the population?", + session=session +) +print(result.final_output) # "Approximately 39 million" +``` + +### Session options + +- **No memory** (default): No session memory when session parameter is omitted +- **`session: Session = DatabaseSession(...)`**: Use a Session instance to manage conversation history + +```python +from agents import Agent, Runner, SQLiteSession + +# SQLite - file-based or in-memory database +session = SQLiteSession("user_123", "conversations.db") + +# Redis - for scalable, distributed deployments +# from agents.extensions.memory import RedisSession +# session = RedisSession.from_url("https://github.com/user_123%22,%20url=%22redis://localhost:6379/0") + +agent = Agent(name="Assistant") + +# Different session IDs maintain separate conversation histories +result1 = await Runner.run( + agent, + "Hello", + session=session +) +result2 = await Runner.run( + agent, + "Hello", + session=SQLiteSession("user_456", "conversations.db") +) +``` + +### Custom session implementations + +You can implement your own session memory by creating a class that follows the `Session` protocol: + +```python +from agents.memory import Session +from typing import List + +class MyCustomSession: + """Custom session implementation following the Session protocol.""" + + def __init__(self, session_id: str): + self.session_id = session_id + # Your initialization here + + async def get_items(self, limit: int | None = None) -> List[dict]: + # Retrieve conversation history for the session + pass + + async def add_items(self, items: List[dict]) -> None: + # Store new items for the session + pass + + async def pop_item(self) -> dict | None: + # Remove and return the most recent item from the session + pass + + async def clear_session(self) -> None: + # Clear all items for the session + pass + +# Use your custom session +agent = Agent(name="Assistant") +result = await Runner.run( + agent, + "Hello", + session=MyCustomSession("my_session") +) +``` + ## Development (only needed if you need to edit the SDK/examples) 0. Ensure you have [`uv`](https://docs.astral.sh/uv/) installed. @@ -284,6 +298,7 @@ make check # run tests linter and typechecker ``` Or to run them individually: + ``` make tests # run tests make mypy # run typechecker @@ -296,6 +311,7 @@ make format-check # run style checker We'd like to acknowledge the excellent work of the open-source community, especially: - [Pydantic](https://docs.pydantic.dev/latest/) (data validation) and [PydanticAI](https://ai.pydantic.dev/) (advanced agent framework) +- [LiteLLM](https://github.com/BerriAI/litellm) (unified interface for 100+ LLMs) - [MkDocs](https://github.com/squidfunk/mkdocs-material) - [Griffe](https://github.com/mkdocstrings/griffe) - [uv](https://github.com/astral-sh/uv) and [ruff](https://github.com/astral-sh/ruff) diff --git a/docs/agents.md b/docs/agents.md index b11a4dd68..d401f53da 100644 --- a/docs/agents.md +++ b/docs/agents.md @@ -16,12 +16,13 @@ from agents import Agent, ModelSettings, function_tool @function_tool def get_weather(city: str) -> str: + """returns weather info for the specified city.""" return f"The weather in {city} is sunny" agent = Agent( name="Haiku agent", instructions="Always respond in haiku form", - model="o3-mini", + model="gpt-5-nano", tools=[get_weather], ) ``` @@ -33,6 +34,7 @@ Agents are generic on their `context` type. Context is a dependency-injection to ```python @dataclass class UserContext: + name: str uid: str is_pro_user: bool @@ -69,9 +71,47 @@ agent = Agent( When you pass an `output_type`, that tells the model to use [structured outputs](https://platform.openai.com/docs/guides/structured-outputs) instead of regular plain text responses. -## Handoffs +## Multi-agent system design patterns + +There are many ways to design multi‑agent systems, but we commonly see two broadly applicable patterns: + +1. Manager (agents as tools): A central manager/orchestrator invokes specialized sub‑agents as tools and retains control of the conversation. +2. Handoffs: Peer agents hand off control to a specialized agent that takes over the conversation. This is decentralized. + +See [our practical guide to building agents](https://cdn.openai.com/business-guides-and-resources/a-practical-guide-to-building-agents.pdf) for more details. + +### Manager (agents as tools) + +The `customer_facing_agent` handles all user interaction and invokes specialized sub‑agents exposed as tools. Read more in the [tools](tools.md#agents-as-tools) documentation. + +```python +from agents import Agent + +booking_agent = Agent(...) +refund_agent = Agent(...) + +customer_facing_agent = Agent( + name="Customer-facing agent", + instructions=( + "Handle all direct user communication. " + "Call the relevant tools when specialized expertise is needed." + ), + tools=[ + booking_agent.as_tool( + tool_name="booking_expert", + tool_description="Handles booking questions and requests.", + ), + refund_agent.as_tool( + tool_name="refund_expert", + tool_description="Handles refund questions and requests.", + ) + ], +) +``` + +### Handoffs -Handoffs are sub-agents that the agent can delegate to. You provide a list of handoffs, and the agent can choose to delegate to them if relevant. This is a powerful pattern that allows orchestrating modular, specialized agents that excel at a single task. Read more in the [handoffs](handoffs.md) documentation. +Handoffs are sub‑agents the agent can delegate to. When a handoff occurs, the delegated agent receives the conversation history and takes over the conversation. This pattern enables modular, specialized agents that excel at a single task. Read more in the [handoffs](handoffs.md) documentation. ```python from agents import Agent @@ -82,9 +122,9 @@ refund_agent = Agent(...) triage_agent = Agent( name="Triage agent", instructions=( - "Help the user with their questions." - "If they ask about booking, handoff to the booking agent." - "If they ask about refunds, handoff to the refund agent." + "Help the user with their questions. " + "If they ask about booking, hand off to the booking agent. " + "If they ask about refunds, hand off to the refund agent." ), handoffs=[booking_agent, refund_agent], ) @@ -113,7 +153,7 @@ Sometimes, you want to observe the lifecycle of an agent. For example, you may w ## Guardrails -Guardrails allow you to run checks/validations on user input, in parallel to the agent running. For example, you could screen the user's input for relevance. Read more in the [guardrails](guardrails.md) documentation. +Guardrails allow you to run checks/validations on user input in parallel to the agent running, and on the agent's output once it is produced. For example, you could screen the user's input and agent's output for relevance. Read more in the [guardrails](guardrails.md) documentation. ## Cloning/copying agents @@ -123,7 +163,7 @@ By using the `clone()` method on an agent, you can duplicate an Agent, and optio pirate_agent = Agent( name="Pirate", instructions="Write like a pirate", - model="o3-mini", + model="gpt-4.1", ) robot_agent = pirate_agent.clone( @@ -141,8 +181,105 @@ Supplying a list of tools doesn't always mean the LLM will use a tool. You can f 3. `none`, which requires the LLM to _not_ use a tool. 4. Setting a specific string e.g. `my_tool`, which requires the LLM to use that specific tool. +```python +from agents import Agent, Runner, function_tool, ModelSettings + +@function_tool +def get_weather(city: str) -> str: + """Returns weather info for the specified city.""" + return f"The weather in {city} is sunny" + +agent = Agent( + name="Weather Agent", + instructions="Retrieve weather details.", + tools=[get_weather], + model_settings=ModelSettings(tool_choice="get_weather") +) +``` + +## Tool Use Behavior + +The `tool_use_behavior` parameter in the `Agent` configuration controls how tool outputs are handled: + +- `"run_llm_again"`: The default. Tools are run, and the LLM processes the results to produce a final response. +- `"stop_on_first_tool"`: The output of the first tool call is used as the final response, without further LLM processing. + +```python +from agents import Agent, Runner, function_tool, ModelSettings + +@function_tool +def get_weather(city: str) -> str: + """Returns weather info for the specified city.""" + return f"The weather in {city} is sunny" + +agent = Agent( + name="Weather Agent", + instructions="Retrieve weather details.", + tools=[get_weather], + tool_use_behavior="stop_on_first_tool" +) +``` + +- `StopAtTools(stop_at_tool_names=[...])`: Stops if any specified tool is called, using its output as the final response. + +```python +from agents import Agent, Runner, function_tool +from agents.agent import StopAtTools + +@function_tool +def get_weather(city: str) -> str: + """Returns weather info for the specified city.""" + return f"The weather in {city} is sunny" + +@function_tool +def sum_numbers(a: int, b: int) -> int: + """Adds two numbers.""" + return a + b + +agent = Agent( + name="Stop At Stock Agent", + instructions="Get weather or sum numbers.", + tools=[get_weather, sum_numbers], + tool_use_behavior=StopAtTools(stop_at_tool_names=["get_weather"]) +) +``` + +- `ToolsToFinalOutputFunction`: A custom function that processes tool results and decides whether to stop or continue with the LLM. + +```python +from agents import Agent, Runner, function_tool, FunctionToolResult, RunContextWrapper +from agents.agent import ToolsToFinalOutputResult +from typing import List, Any + +@function_tool +def get_weather(city: str) -> str: + """Returns weather info for the specified city.""" + return f"The weather in {city} is sunny" + +def custom_tool_handler( + context: RunContextWrapper[Any], + tool_results: List[FunctionToolResult] +) -> ToolsToFinalOutputResult: + """Processes tool results to decide final output.""" + for result in tool_results: + if result.output and "sunny" in result.output: + return ToolsToFinalOutputResult( + is_final_output=True, + final_output=f"Final weather: {result.output}" + ) + return ToolsToFinalOutputResult( + is_final_output=False, + final_output=None + ) + +agent = Agent( + name="Weather Agent", + instructions="Retrieve weather details.", + tools=[get_weather], + tool_use_behavior=custom_tool_handler +) +``` + !!! note To prevent infinite loops, the framework automatically resets `tool_choice` to "auto" after a tool call. This behavior is configurable via [`agent.reset_tool_choice`][agents.agent.Agent.reset_tool_choice]. The infinite loop is because tool results are sent to the LLM, which then generates another tool call because of `tool_choice`, ad infinitum. - - If you want the Agent to completely stop after a tool call (rather than continuing with auto mode), you can set [`Agent.tool_use_behavior="stop_on_first_tool"`] which will directly use the tool output as the final response without further LLM processing. diff --git a/docs/assets/images/graph.png b/docs/assets/images/graph.png index 13e2d6eb4..b45a1ecec 100644 Binary files a/docs/assets/images/graph.png and b/docs/assets/images/graph.png differ diff --git a/docs/context.md b/docs/context.md index 6e54565e0..c8e393ca0 100644 --- a/docs/context.md +++ b/docs/context.md @@ -68,6 +68,51 @@ if __name__ == "__main__": 4. The context is passed to the `run` function. 5. The agent correctly calls the tool and gets the age. +--- + +### Advanced: `ToolContext` + +In some cases, you might want to access extra metadata about the tool being executed — such as its name, call ID, or raw argument string. +For this, you can use the [`ToolContext`][agents.tool_context.ToolContext] class, which extends `RunContextWrapper`. + +```python +from typing import Annotated +from pydantic import BaseModel, Field +from agents import Agent, Runner, function_tool +from agents.tool_context import ToolContext + +class WeatherContext(BaseModel): + user_id: str + +class Weather(BaseModel): + city: str = Field(description="The city name") + temperature_range: str = Field(description="The temperature range in Celsius") + conditions: str = Field(description="The weather conditions") + +@function_tool +def get_weather(ctx: ToolContext[WeatherContext], city: Annotated[str, "The city to get the weather for"]) -> Weather: + print(f"[debug] Tool context: (name: {ctx.tool_name}, call_id: {ctx.tool_call_id}, args: {ctx.tool_arguments})") + return Weather(city=city, temperature_range="14-20C", conditions="Sunny with wind.") + +agent = Agent( + name="Weather Agent", + instructions="You are a helpful agent that can tell the weather of a given city.", + tools=[get_weather], +) +``` + +`ToolContext` provides the same `.context` property as `RunContextWrapper`, +plus additional fields specific to the current tool call: + +- `tool_name` – the name of the tool being invoked +- `tool_call_id` – a unique identifier for this tool call +- `tool_arguments` – the raw argument string passed to the tool + +Use `ToolContext` when you need tool-level metadata during execution. +For general context sharing between agents and tools, `RunContextWrapper` remains sufficient. + +--- + ## Agent/LLM context When an LLM is called, the **only** data it can see is from the conversation history. This means that if you want to make some new data available to the LLM, you must do it in a way that makes it available in that history. There are a few ways to do this: diff --git a/docs/examples.md b/docs/examples.md index ae40fa909..a2dd5a6fc 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -2,44 +2,88 @@ Check out a variety of sample implementations of the SDK in the examples section of the [repo](https://github.com/openai/openai-agents-python/tree/main/examples). The examples are organized into several categories that demonstrate different patterns and capabilities. - ## Categories -- **[agent_patterns](https://github.com/openai/openai-agents-python/tree/main/examples/agent_patterns):** - Examples in this category illustrate common agent design patterns, such as +- **[agent_patterns](https://github.com/openai/openai-agents-python/tree/main/examples/agent_patterns):** + Examples in this category illustrate common agent design patterns, such as + + - Deterministic workflows + - Agents as tools + - Parallel agent execution + - Conditional tool usage + - Input/output guardrails + - LLM as a judge + - Routing + - Streaming guardrails + +- **[basic](https://github.com/openai/openai-agents-python/tree/main/examples/basic):** + These examples showcase foundational capabilities of the SDK, such as + + - Hello world examples (Default model, GPT-5, open-weight model) + - Agent lifecycle management + - Dynamic system prompts + - Streaming outputs (text, items, function call args) + - Prompt templates + - File handling (local and remote, images and PDFs) + - Usage tracking + - Non-strict output types + - Previous response ID usage + +- **[customer_service](https://github.com/openai/openai-agents-python/tree/main/examples/customer_service):** + Example customer service system for an airline. + +- **[financial_research_agent](https://github.com/openai/openai-agents-python/tree/main/examples/financial_research_agent):** + A financial research agent that demonstrates structured research workflows with agents and tools for financial data analysis. + +- **[handoffs](https://github.com/openai/openai-agents-python/tree/main/examples/handoffs):** + See practical examples of agent handoffs with message filtering. + +- **[hosted_mcp](https://github.com/openai/openai-agents-python/tree/main/examples/hosted_mcp):** + Examples demonstrating how to use hosted MCP (Model Context Protocol) connectors and approvals. + +- **[mcp](https://github.com/openai/openai-agents-python/tree/main/examples/mcp):** + Learn how to build agents with MCP (Model Context Protocol), including: - - Deterministic workflows - - Agents as tools - - Parallel agent execution + - Filesystem examples + - Git examples + - MCP prompt server examples + - SSE (Server-Sent Events) examples + - Streamable HTTP examples -- **[basic](https://github.com/openai/openai-agents-python/tree/main/examples/basic):** - These examples showcase foundational capabilities of the SDK, such as +- **[memory](https://github.com/openai/openai-agents-python/tree/main/examples/memory):** + Examples of different memory implementations for agents, including: - - Dynamic system prompts - - Streaming outputs - - Lifecycle events + - SQLite session storage + - Advanced SQLite session storage + - Redis session storage + - SQLAlchemy session storage + - Encrypted session storage + - OpenAI session storage -- **[tool examples](https://github.com/openai/openai-agents-python/tree/main/examples/tools):** - Learn how to implement OAI hosted tools such as web search and file search, - and integrate them into your agents. +- **[model_providers](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers):** + Explore how to use non-OpenAI models with the SDK, including custom providers and LiteLLM integration. -- **[model providers](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers):** - Explore how to use non-OpenAI models with the SDK. +- **[realtime](https://github.com/openai/openai-agents-python/tree/main/examples/realtime):** + Examples showing how to build real-time experiences using the SDK, including: -- **[handoffs](https://github.com/openai/openai-agents-python/tree/main/examples/handoffs):** - See practical examples of agent handoffs. + - Web applications + - Command-line interfaces + - Twilio integration -- **[mcp](https://github.com/openai/openai-agents-python/tree/main/examples/mcp):** - Learn how to build agents with MCP. +- **[reasoning_content](https://github.com/openai/openai-agents-python/tree/main/examples/reasoning_content):** + Examples demonstrating how to work with reasoning content and structured outputs. -- **[customer_service](https://github.com/openai/openai-agents-python/tree/main/examples/customer_service)** and **[research_bot](https://github.com/openai/openai-agents-python/tree/main/examples/research_bot):** - Two more built-out examples that illustrate real-world applications +- **[research_bot](https://github.com/openai/openai-agents-python/tree/main/examples/research_bot):** + Simple deep research clone that demonstrates complex multi-agent research workflows. - - **customer_service**: Example customer service system for an airline. - - **research_bot**: Simple deep research clone. +- **[tools](https://github.com/openai/openai-agents-python/tree/main/examples/tools):** + Learn how to implement OAI hosted tools such as: -- **[voice](https://github.com/openai/openai-agents-python/tree/main/examples/voice):** - See examples of voice agents, using our TTS and STT models. + - Web search and web search with filters + - File search + - Code interpreter + - Computer use + - Image generation -- **[realtime](https://github.com/openai/openai-agents-python/tree/main/examples/realtime):** - Examples showing how to build realtime experiences using the SDK. +- **[voice](https://github.com/openai/openai-agents-python/tree/main/examples/voice):** + See examples of voice agents, using our TTS and STT models, including streamed voice examples. diff --git a/docs/guardrails.md b/docs/guardrails.md index 8df904a4c..3fee17df0 100644 --- a/docs/guardrails.md +++ b/docs/guardrails.md @@ -151,4 +151,4 @@ async def main(): 1. This is the actual agent's output type. 2. This is the guardrail's output type. 3. This is the guardrail function that receives the agent's output, and returns the result. -4. This is the actual agent that defines the workflow. +4. This is the actual agent that defines the workflow. \ No newline at end of file diff --git a/docs/handoffs.md b/docs/handoffs.md index 0b868c4af..85707c6b3 100644 --- a/docs/handoffs.md +++ b/docs/handoffs.md @@ -36,6 +36,7 @@ The [`handoff()`][agents.handoffs.handoff] function lets you customize things. - `on_handoff`: A callback function executed when the handoff is invoked. This is useful for things like kicking off some data fetching as soon as you know a handoff is being invoked. This function receives the agent context, and can optionally also receive LLM generated input. The input data is controlled by the `input_type` param. - `input_type`: The type of input expected by the handoff (optional). - `input_filter`: This lets you filter the input received by the next agent. See below for more. +- `is_enabled`: Whether the handoff is enabled. This can be a boolean or a function that returns a boolean, allowing you to dynamically enable or disable the handoff at runtime. ```python from agents import Agent, handoff, RunContextWrapper diff --git a/docs/index.md b/docs/index.md index 935c4be5b..f8eb7dfec 100644 --- a/docs/index.md +++ b/docs/index.md @@ -4,7 +4,7 @@ The [OpenAI Agents SDK](https://github.com/openai/openai-agents-python) enables - **Agents**, which are LLMs equipped with instructions and tools - **Handoffs**, which allow agents to delegate to other agents for specific tasks -- **Guardrails**, which enable the inputs to agents to be validated +- **Guardrails**, which enable validation of agent inputs and outputs - **Sessions**, which automatically maintains conversation history across agent runs In combination with Python, these primitives are powerful enough to express complex relationships between tools and agents, and allow you to build real-world applications without a steep learning curve. In addition, the SDK comes with built-in **tracing** that lets you visualize and debug your agentic flows, as well as evaluate them and even fine-tune models for your application. diff --git a/docs/ja/agents.md b/docs/ja/agents.md index 828b36355..4f8427d6d 100644 --- a/docs/ja/agents.md +++ b/docs/ja/agents.md @@ -4,38 +4,41 @@ search: --- # エージェント -エージェントはアプリの主要な構成ブロックです。エージェントは、大規模言語モデル ( LLM ) に instructions と tools を設定したものです。 +エージェントはアプリの中核となる基本コンポーネントです。エージェントは、instructions と tools で構成された大規模言語モデル( LLM )です。 -## 基本設定 +## 基本構成 -エージェントで最も一般的に設定するプロパティは次のとおりです。 +よく設定するエージェントのプロパティは以下のとおりです。 -- `instructions`: 開発者メッセージまたは system prompt とも呼ばれます。 -- `model`: 使用する LLM と、temperature や top_p などのモデル調整パラメーターを指定する任意の `model_settings`。 -- `tools`: エージェントがタスクを達成するために利用できるツール。 +- `name`: エージェントを識別する必須の文字列です。 +- `instructions`: developer message または システムプロンプト とも呼ばれます。 +- `model`: どの LLM を使用するか、また任意の `model_settings` で temperature、top_p などのモデル調整パラメーターを設定できます。 +- `tools`: エージェントがタスクを達成するために使用できるツールです。 ```python from agents import Agent, ModelSettings, function_tool @function_tool def get_weather(city: str) -> str: + """returns weather info for the specified city.""" return f"The weather in {city} is sunny" agent = Agent( name="Haiku agent", instructions="Always respond in haiku form", - model="o3-mini", + model="gpt-5-nano", tools=[get_weather], ) ``` ## コンテキスト -エージェントはその `context` 型について汎用的です。コンテキストは依存性注入の手段で、`Runner.run()` に渡すオブジェクトです。これはすべてのエージェント、ツール、ハンドオフなどに渡され、エージェント実行時の依存関係や状態をまとめて保持します。任意の Python オブジェクトをコンテキストとして渡せます。 +エージェントはその `context` 型についてジェネリックです。コンテキストは依存性注入のためのツールで、あなたが作成して `Runner.run()` に渡すオブジェクトです。これはすべてのエージェント、ツール、ハンドオフなどに渡され、実行時の依存関係や状態をまとめて保持します。コンテキストには任意の Python オブジェクトを渡せます。 ```python @dataclass class UserContext: + name: str uid: str is_pro_user: bool @@ -49,7 +52,7 @@ agent = Agent[UserContext]( ## 出力タイプ -デフォルトでは、エージェントはプレーンテキスト ( つまり `str` ) を出力します。特定の型で出力させたい場合は `output_type` パラメーターを使用します。一般的には [Pydantic](https://docs.pydantic.dev/) オブジェクトを利用しますが、Pydantic の [TypeAdapter](https://docs.pydantic.dev/latest/api/type_adapter/) でラップ可能な型であれば何でも対応します。たとえば dataclass、list、TypedDict などです。 +デフォルトでは、エージェントはプレーンテキスト(つまり `str`)の出力を生成します。特定の型の出力を生成させたい場合は、`output_type` パラメーターを使用します。一般的には [Pydantic](https://docs.pydantic.dev/) オブジェクトを使いますが、Pydantic の [TypeAdapter](https://docs.pydantic.dev/latest/api/type_adapter/) でラップできる任意の型(dataclasses、lists、TypedDict など)をサポートします。 ```python from pydantic import BaseModel @@ -70,11 +73,49 @@ agent = Agent( !!! note - `output_type` を渡すと、モデルは通常のプレーンテキスト応答の代わりに [structured outputs](https://platform.openai.com/docs/guides/structured-outputs) を使用するよう指示されます。 + `output_type` を渡すと、モデルは通常のプレーンテキスト応答ではなく、[structured outputs](https://platform.openai.com/docs/guides/structured-outputs) を使用するよう指示されます。 + +## 複数エージェントのシステム設計パターン + +マルチエージェントシステムの設計方法は多数ありますが、幅広く適用できるパターンとして次の 2 つがよく使われます。 + +1. マネージャー(ツールとしてのエージェント): 中央のマネージャー/オーケストレーターが、ツールとして公開された専門サブエージェントを呼び出し、会話の主導権を保持します。 +2. ハンドオフ: 対等なエージェント同士が、会話を引き継ぐ専門エージェントに主導権を渡します。これは分散型です。 + +詳細は、[エージェント構築の実践ガイド](https://cdn.openai.com/business-guides-and-resources/a-practical-guide-to-building-agents.pdf)をご覧ください。 + +### マネージャー(ツールとしてのエージェント) + +`customer_facing_agent` がすべてのユーザーとのやり取りを担当し、ツールとして公開された専門サブエージェントを呼び出します。詳しくは [ツール](tools.md#agents-as-tools) のドキュメントをご覧ください。 + +```python +from agents import Agent + +booking_agent = Agent(...) +refund_agent = Agent(...) + +customer_facing_agent = Agent( + name="Customer-facing agent", + instructions=( + "Handle all direct user communication. " + "Call the relevant tools when specialized expertise is needed." + ), + tools=[ + booking_agent.as_tool( + tool_name="booking_expert", + tool_description="Handles booking questions and requests.", + ), + refund_agent.as_tool( + tool_name="refund_expert", + tool_description="Handles refund questions and requests.", + ) + ], +) +``` -## ハンドオフ +### ハンドオフ -ハンドオフは、エージェントが委譲できるサブエージェントです。ハンドオフのリストを渡しておくと、エージェントは必要に応じてそれらに処理を委譲できます。これにより、単一のタスクに特化したモジュール式エージェントを編成できる強力なパターンが実現します。詳細は [handoffs](handoffs.md) ドキュメントをご覧ください。 +ハンドオフは、エージェントが委任できるサブエージェントです。ハンドオフが発生すると、委任先のエージェントが会話履歴を受け取り、会話を引き継ぎます。このパターンにより、単一タスクに長けたモジュール式・専門特化のエージェントを実現できます。詳しくは [ハンドオフ](handoffs.md) のドキュメントをご覧ください。 ```python from agents import Agent @@ -85,9 +126,9 @@ refund_agent = Agent(...) triage_agent = Agent( name="Triage agent", instructions=( - "Help the user with their questions." - "If they ask about booking, handoff to the booking agent." - "If they ask about refunds, handoff to the refund agent." + "Help the user with their questions. " + "If they ask about booking, hand off to the booking agent. " + "If they ask about refunds, hand off to the refund agent." ), handoffs=[booking_agent, refund_agent], ) @@ -95,7 +136,7 @@ triage_agent = Agent( ## 動的 instructions -通常はエージェント作成時に instructions を指定しますが、関数を介して動的に instructions を提供することもできます。その関数はエージェントとコンテキストを受け取り、プロンプトを返す必要があります。同期関数と `async` 関数の両方に対応しています。 +多くの場合、エージェントを作成するときに instructions を指定しますが、関数を通じて動的な instructions を提供することもできます。関数はエージェントとコンテキストを受け取り、プロンプトを返す必要があります。通常の関数と `async` 関数の両方が利用できます。 ```python def dynamic_instructions( @@ -110,23 +151,23 @@ agent = Agent[UserContext]( ) ``` -## ライフサイクルイベント (hooks) +## ライフサイクルイベント(フック) -場合によっては、エージェントのライフサイクルを観察したいことがあります。たとえば、イベントをログに記録したり、特定のイベント発生時にデータを事前取得したりする場合です。`hooks` プロパティを使ってエージェントのライフサイクルにフックできます。[`AgentHooks`][agents.lifecycle.AgentHooks] クラスをサブクラス化し、関心のあるメソッドをオーバーライドしてください。 +場合によっては、エージェントのライフサイクルを観察したいことがあります。たとえば、イベントをログ出力したり、特定のイベント発生時にデータを事前取得したりできます。`hooks` プロパティでエージェントのライフサイクルにフックできます。[`AgentHooks`][agents.lifecycle.AgentHooks] クラスを継承し、関心のあるメソッドをオーバーライドしてください。 ## ガードレール -ガードレールを使うと、エージェントの実行と並行してユーザー入力に対するチェックやバリデーションを実行できます。たとえば、ユーザーの入力内容が関連しているかをスクリーニングできます。詳細は [guardrails](guardrails.md) ドキュメントをご覧ください。 +ガードレールにより、エージェントの実行と並行して ユーザー入力 に対するチェック/検証を行い、また、エージェントが出力を生成した後にその出力に対してもチェックを実行できます。たとえば、ユーザー入力とエージェント出力を関連性でスクリーニングできます。詳しくは [ガードレール](guardrails.md) のドキュメントをご覧ください。 -## エージェントの複製 +## エージェントのクローン/コピー -`clone()` メソッドを使用すると、エージェントを複製し、必要に応じて任意のプロパティを変更できます。 +エージェントの `clone()` メソッドを使うと、エージェントを複製し、任意のプロパティを変更できます。 ```python pirate_agent = Agent( name="Pirate", instructions="Write like a pirate", - model="o3-mini", + model="gpt-4.1", ) robot_agent = pirate_agent.clone( @@ -137,15 +178,112 @@ robot_agent = pirate_agent.clone( ## ツール使用の強制 -ツールの一覧を渡しても、LLM が必ずツールを使用するとは限りません。[`ModelSettings.tool_choice`][agents.model_settings.ModelSettings.tool_choice] を設定することでツール使用を強制できます。有効な値は次のとおりです。 +ツールのリストを渡しても、常に LLM がツールを使用するとは限りません。[`ModelSettings.tool_choice`][agents.model_settings.ModelSettings.tool_choice] を設定するとツール使用を強制できます。有効な値は次のとおりです。 -1. `auto` — ツールを使用するかどうかを LLM が判断します。 -2. `required` — LLM にツール使用を必須化します ( ただし使用するツールは自動選択 )。 -3. `none` — LLM にツールを使用しないことを要求します。 -4. 特定の文字列 ( 例: `my_tool` ) — その特定のツールを LLM に使用させます。 +1. `auto`: ツールを使用するかどうかを LLM に任せます。 +2. `required`: LLM にツールの使用を必須にします(どのツールを使うかは知的に判断します)。 +3. `none`: LLM にツールを _使用しない_ ことを要求します。 +4. 特定の文字列(例: `my_tool`)を設定: LLM にその特定のツールの使用を要求します。 -!!! note +```python +from agents import Agent, Runner, function_tool, ModelSettings + +@function_tool +def get_weather(city: str) -> str: + """Returns weather info for the specified city.""" + return f"The weather in {city} is sunny" + +agent = Agent( + name="Weather Agent", + instructions="Retrieve weather details.", + tools=[get_weather], + model_settings=ModelSettings(tool_choice="get_weather") +) +``` + +## ツール使用の動作 + +`Agent` の設定パラメーター `tool_use_behavior` は、ツール出力の取り扱い方法を制御します。 + +- `"run_llm_again"`: デフォルト。ツールを実行し、その結果を LLM が処理して最終応答を生成します。 +- `"stop_on_first_tool"`: 最初のツール呼び出しの出力を、その後の LLM 処理なしで最終応答として使用します。 + +```python +from agents import Agent, Runner, function_tool, ModelSettings + +@function_tool +def get_weather(city: str) -> str: + """Returns weather info for the specified city.""" + return f"The weather in {city} is sunny" + +agent = Agent( + name="Weather Agent", + instructions="Retrieve weather details.", + tools=[get_weather], + tool_use_behavior="stop_on_first_tool" +) +``` + +- `StopAtTools(stop_at_tool_names=[...])`: 指定したいずれかのツールが呼び出されたら停止し、その出力を最終応答として使用します. - 無限ループを防ぐため、フレームワークはツール呼び出し後に `tool_choice` を自動的に "auto" にリセットします。この動作は [`agent.reset_tool_choice`][agents.agent.Agent.reset_tool_choice] で設定できます。無限ループが起こる理由は、ツールの結果が LLM に送られ、`tool_choice` により再びツール呼び出しが生成される、という流れが繰り返されるからです。 +```python +from agents import Agent, Runner, function_tool +from agents.agent import StopAtTools + +@function_tool +def get_weather(city: str) -> str: + """Returns weather info for the specified city.""" + return f"The weather in {city} is sunny" + +@function_tool +def sum_numbers(a: int, b: int) -> int: + """Adds two numbers.""" + return a + b + +agent = Agent( + name="Stop At Stock Agent", + instructions="Get weather or sum numbers.", + tools=[get_weather, sum_numbers], + tool_use_behavior=StopAtTools(stop_at_tool_names=["get_weather"]) +) +``` + +- `ToolsToFinalOutputFunction`: ツール結果を処理し、停止するか LLM を継続するかを判断するカスタム関数です。 + +```python +from agents import Agent, Runner, function_tool, FunctionToolResult, RunContextWrapper +from agents.agent import ToolsToFinalOutputResult +from typing import List, Any + +@function_tool +def get_weather(city: str) -> str: + """Returns weather info for the specified city.""" + return f"The weather in {city} is sunny" + +def custom_tool_handler( + context: RunContextWrapper[Any], + tool_results: List[FunctionToolResult] +) -> ToolsToFinalOutputResult: + """Processes tool results to decide final output.""" + for result in tool_results: + if result.output and "sunny" in result.output: + return ToolsToFinalOutputResult( + is_final_output=True, + final_output=f"Final weather: {result.output}" + ) + return ToolsToFinalOutputResult( + is_final_output=False, + final_output=None + ) + +agent = Agent( + name="Weather Agent", + instructions="Retrieve weather details.", + tools=[get_weather], + tool_use_behavior=custom_tool_handler +) +``` + +!!! note - ツール呼び出し後にエージェントを完全に停止させたい場合 ( auto モードで続行させたくない場合 ) は、[`Agent.tool_use_behavior="stop_on_first_tool"`] を設定してください。これにより、ツールの出力を LL M の追加処理なしにそのまま最終応答として返します。 \ No newline at end of file + 無限ループを防ぐため、フレームワークはツール呼び出し後に `tool_choice` を自動的に "auto" にリセットします。この動作は [`agent.reset_tool_choice`][agents.agent.Agent.reset_tool_choice] で設定できます。無限ループは、ツール結果が LLM に送られ、`tool_choice` により LLM が再度ツール呼び出しを生成し続けることによって発生します。 \ No newline at end of file diff --git a/docs/ja/config.md b/docs/ja/config.md index bf76b9fb6..9e4e2d80c 100644 --- a/docs/ja/config.md +++ b/docs/ja/config.md @@ -6,7 +6,7 @@ search: ## API キーとクライアント -デフォルトでは、 SDK はインポートされた時点で LLM リクエストとトレーシングに使用する `OPENAI_API_KEY` 環境変数を探します。アプリ起動前にこの環境変数を設定できない場合は、 [set_default_openai_key()][agents.set_default_openai_key] 関数を利用してキーを設定できます。 +デフォルトで、SDK は LLM リクエストとトレーシングのために、インポートされた時点で `OPENAI_API_KEY` 環境変数を探します。アプリ起動前にその環境変数を設定できない場合は、[set_default_openai_key()][agents.set_default_openai_key] 関数でキーを設定できます。 ```python from agents import set_default_openai_key @@ -14,7 +14,7 @@ from agents import set_default_openai_key set_default_openai_key("sk-...") ``` -また、使用する OpenAI クライアントを構成することも可能です。デフォルトでは、 SDK は環境変数または上記で設定したデフォルトキーを用いて `AsyncOpenAI` インスタンスを作成します。これを変更するには、 [set_default_openai_client()][agents.set_default_openai_client] 関数を使用します。 +また、使用する OpenAI クライアントを設定することもできます。デフォルトでは、SDK は環境変数または上記で設定したデフォルトキーを用いて `AsyncOpenAI` インスタンスを作成します。これを変更するには、[set_default_openai_client()][agents.set_default_openai_client] 関数を使用します。 ```python from openai import AsyncOpenAI @@ -24,7 +24,7 @@ custom_client = AsyncOpenAI(base_url="...", api_key="...") set_default_openai_client(custom_client) ``` -さらに、使用する OpenAI API をカスタマイズすることもできます。既定では OpenAI Responses API を利用します。これを Chat Completions API に変更するには、 [set_default_openai_api()][agents.set_default_openai_api] 関数を使用してください。 +最後に、使用する OpenAI API をカスタマイズすることもできます。デフォルトでは OpenAI Responses API を使用します。これを上書きして Chat Completions API を使うには、[set_default_openai_api()][agents.set_default_openai_api] 関数を使用します。 ```python from agents import set_default_openai_api @@ -34,7 +34,7 @@ set_default_openai_api("chat_completions") ## トレーシング -トレーシングはデフォルトで有効になっています。前述の OpenAI API キー(環境変数または設定したデフォルトキー)が自動的に使用されます。トレーシングで使用する API キーを個別に設定したい場合は、 [`set_tracing_export_api_key`][agents.set_tracing_export_api_key] 関数を利用してください。 +トレーシングはデフォルトで有効になっています。デフォルトでは、上記の OpenAI API キー(つまり、環境変数または設定したデフォルトキー)を使用します。トレーシングに使用する API キーを個別に設定するには、[`set_tracing_export_api_key`][agents.set_tracing_export_api_key] 関数を使用します。 ```python from agents import set_tracing_export_api_key @@ -42,7 +42,7 @@ from agents import set_tracing_export_api_key set_tracing_export_api_key("sk-...") ``` -トレーシングを完全に無効化するには、 [`set_tracing_disabled()`][agents.set_tracing_disabled] 関数を呼び出します。 +[`set_tracing_disabled()`][agents.set_tracing_disabled] 関数を使用すると、トレーシングを完全に無効化できます。 ```python from agents import set_tracing_disabled @@ -52,9 +52,9 @@ set_tracing_disabled(True) ## デバッグログ - SDK にはハンドラーが設定されていない Python ロガーが 2 つあります。デフォルトでは、警告とエラーは `stdout` に出力されますが、それ以外のログは抑制されます。 +SDK にはハンドラーが設定されていない Python ロガーが 2 つあります。デフォルトでは、これは警告とエラーが `stdout` に送られ、それ以外のログは抑制されることを意味します。 -詳細なログを有効にするには、 [`enable_verbose_stdout_logging()`][agents.enable_verbose_stdout_logging] 関数を使用します。 +詳細なログを有効にするには、[`enable_verbose_stdout_logging()`][agents.enable_verbose_stdout_logging] 関数を使用します。 ```python from agents import enable_verbose_stdout_logging @@ -62,7 +62,7 @@ from agents import enable_verbose_stdout_logging enable_verbose_stdout_logging() ``` -必要に応じて、ハンドラー、フィルター、フォーマッターなどを追加してログをカスタマイズすることも可能です。詳しくは [Python ロギングガイド](https://docs.python.org/3/howto/logging.html) を参照してください。 +また、ハンドラー、フィルター、フォーマッターなどを追加してログをカスタマイズすることもできます。詳しくは [Python logging guide](https://docs.python.org/3/howto/logging.html) を参照してください。 ```python import logging @@ -81,17 +81,17 @@ logger.setLevel(logging.WARNING) logger.addHandler(logging.StreamHandler()) ``` -### ログに含まれる機微情報 +### ログ内の機微なデータ -特定のログには機微情報(たとえば ユーザー データ)が含まれる場合があります。この情報が記録されるのを防ぎたい場合は、次の環境変数を設定してください。 +一部のログには機微なデータ(たとえば、ユーザーデータ)が含まれる場合があります。これらのデータの記録を無効にしたい場合は、次の環境変数を設定してください。 -LLM の入力および出力のログを無効にする: +LLM の入力と出力の記録を無効にするには: ```bash export OPENAI_AGENTS_DONT_LOG_MODEL_DATA=1 ``` -ツールの入力および出力のログを無効にする: +ツールの入力と出力の記録を無効にするには: ```bash export OPENAI_AGENTS_DONT_LOG_TOOL_DATA=1 diff --git a/docs/ja/context.md b/docs/ja/context.md index 72c0938cf..db74fd76e 100644 --- a/docs/ja/context.md +++ b/docs/ja/context.md @@ -4,30 +4,30 @@ search: --- # コンテキスト管理 -コンテキストという言葉には複数の意味があります。ここでは主に 2 つのコンテキストについて説明します。 +コンテキストは多義的な用語です。考慮すべき主なコンテキストは 2 つあります。 -1. コード内でローカルに利用できるコンテキスト: ツール関数の実行時や `on_handoff` などのコールバック、ライフサイクルフックで必要となるデータや依存関係です。 -2. LLM が参照できるコンテキスト: LLM がレスポンスを生成する際に見えるデータです。 +1. コードでローカルに利用できるコンテキスト: これはツール関数の実行時、`on_handoff` のようなコールバック、ライフサイクルフックなどで必要となるデータや依存関係です。 +2. LLM が利用できるコンテキスト: これは LLM が応答を生成するときに参照するデータです。 ## ローカルコンテキスト -ローカルコンテキストは [`RunContextWrapper`][agents.run_context.RunContextWrapper] クラスと、その中の [`context`][agents.run_context.RunContextWrapper.context] プロパティで表現されます。仕組みは次のとおりです。 +これは [`RunContextWrapper`][agents.run_context.RunContextWrapper] クラスと、その中の [`context`][agents.run_context.RunContextWrapper.context] プロパティで表現されます。仕組みは次のとおりです。 -1. 任意の Python オブジェクトを作成します。一般的なパターンとして dataclass や Pydantic オブジェクトを使用します。 -2. そのオブジェクトを各種 run メソッド(例: `Runner.run(..., **context=whatever** )`)に渡します。 -3. すべてのツール呼び出しやライフサイクルフックには、ラッパーオブジェクト `RunContextWrapper[T]` が渡されます。ここで `T` はコンテキストオブジェクトの型で、`wrapper.context` からアクセスできます。 +1. 任意の Python オブジェクトを作成します。一般的には dataclass や Pydantic オブジェクトを使います。 +2. そのオブジェクトを各種の実行メソッドに渡します(例: `Runner.run(..., **context=whatever**)`)。 +3. すべてのツール呼び出しやライフサイクルフックなどに、ラッパーオブジェクト `RunContextWrapper[T]` が渡されます。ここで `T` はあなたのコンテキストオブジェクトの型で、`wrapper.context` からアクセスできます。 -**最重要ポイント**: あるエージェントの実行において、エージェント・ツール関数・ライフサイクルフックなどはすべて同じ _型_ のコンテキストを使用しなければなりません。 +**最も重要** な注意点: 特定のエージェントの実行において、すべてのエージェント、ツール関数、ライフサイクルなどは同じ型のコンテキストを使用しなければなりません。 -コンテキストでは次のような用途が考えられます。 +コンテキストは次のような用途に使えます。 -- 実行に関するデータ(例: ユーザー名 / uid やその他のユーザー情報) -- 依存オブジェクト(例: ロガー、データフェッチャーなど) +- 実行時のコンテキストデータ(例: ユーザー名 / uid やその他の ユーザー 情報) +- 依存関係(例: ロガーオブジェクト、データフェッチャーなど) - ヘルパー関数 -!!! danger "Note" +!!! danger "注意" - コンテキストオブジェクトは LLM には送信されません。あくまでローカルのオブジェクトであり、読み書きやメソッド呼び出しが可能です。 + コンテキストオブジェクトは LLM に **送信されません**。これは純粋にローカルのオブジェクトで、読み書きやメソッド呼び出しができます。 ```python import asyncio @@ -42,7 +42,8 @@ class UserInfo: # (1)! @function_tool async def fetch_user_age(wrapper: RunContextWrapper[UserInfo]) -> str: # (2)! - return f"User {wrapper.context.name} is 47 years old" + """Fetch the age of the user. Call this function to get user's age information.""" + return f"The user {wrapper.context.name} is 47 years old" async def main(): user_info = UserInfo(name="John", uid=123) @@ -65,17 +66,62 @@ if __name__ == "__main__": asyncio.run(main()) ``` -1. これがコンテキストオブジェクトです。ここでは dataclass を使っていますが、任意の型を使用できます。 -2. これはツールです。`RunContextWrapper[UserInfo]` を受け取り、実装内でコンテキストを参照しています。 -3. エージェントにジェネリック `UserInfo` を付与することで、型チェッカーが誤りを検出できます(たとえば別のコンテキスト型を受け取るツールを渡した場合など)。 -4. `run` 関数にコンテキストを渡します。 -5. エージェントはツールを正しく呼び出し、年齢を取得します。 +1. これはコンテキストオブジェクトです。ここでは dataclass を使っていますが、任意の型を使用できます。 +2. これはツールです。`RunContextWrapper[UserInfo]` を受け取っていることがわかります。ツールの実装はコンテキストから読み取ります。 +3. エージェントにはジェネリクス `UserInfo` を付けます。これにより、型チェッカーがエラーを検出できます(たとえば、異なるコンテキスト型を受け取るツールを渡そうとした場合など)。 +4. `run` 関数にコンテキストを渡します。 +5. エージェントはツールを正しく呼び出し、年齢を取得します。 -## エージェント / LLM コンテキスト +--- + +### 応用: `ToolContext` + +場合によっては、実行中のツールに関する追加メタデータ(名前、呼び出し ID、raw の引数文字列など)にアクセスしたいことがあります。 +そのためには、`RunContextWrapper` を拡張した [`ToolContext`][agents.tool_context.ToolContext] クラスを使用できます。 + +```python +from typing import Annotated +from pydantic import BaseModel, Field +from agents import Agent, Runner, function_tool +from agents.tool_context import ToolContext + +class WeatherContext(BaseModel): + user_id: str + +class Weather(BaseModel): + city: str = Field(description="The city name") + temperature_range: str = Field(description="The temperature range in Celsius") + conditions: str = Field(description="The weather conditions") + +@function_tool +def get_weather(ctx: ToolContext[WeatherContext], city: Annotated[str, "The city to get the weather for"]) -> Weather: + print(f"[debug] Tool context: (name: {ctx.tool_name}, call_id: {ctx.tool_call_id}, args: {ctx.tool_arguments})") + return Weather(city=city, temperature_range="14-20C", conditions="Sunny with wind.") + +agent = Agent( + name="Weather Agent", + instructions="You are a helpful agent that can tell the weather of a given city.", + tools=[get_weather], +) +``` + +`ToolContext` は `RunContextWrapper` と同じ `.context` プロパティに加えて、 +現在のツール呼び出しに固有のフィールドを提供します。 + +- `tool_name` – 呼び出されているツールの名前 +- `tool_call_id` – このツール呼び出しの一意な識別子 +- `tool_arguments` – ツールに渡された raw の引数文字列 + +実行時にツールレベルのメタデータが必要な場合は `ToolContext` を使用してください。 +エージェントとツール間で一般的にコンテキストを共有するだけであれば、`RunContextWrapper` で十分です。 + +--- + +## エージェント / LLM のコンテキスト -LLM が呼び出されるとき、LLM が参照できるデータは会話履歴に含まれるものだけです。したがって、新しいデータを LLM に渡したい場合は、そのデータを履歴に含める形で提供する必要があります。方法はいくつかあります。 +LLM が呼び出されるとき、LLM が参照できるのは会話履歴のデータ **のみ** です。つまり、LLM に新しいデータを利用させたい場合は、その履歴に含める形で提供する必要があります。いくつかの方法があります。 -1. Agent の `instructions` に追加する。いわゆる「system prompt」や「developer message」と呼ばれるものです。システムプロンプトは静的な文字列でも、コンテキストを受け取って文字列を返す動的な関数でも構いません。ユーザー名や現在の日付など、常に有用な情報を渡す際によく使われます。 -2. `Runner.run` 呼び出し時の `input` に追加する。`instructions` と似ていますが、[chain of command](https://cdn.openai.com/spec/model-spec-2024-05-08.html#follow-the-chain-of-command) の下位レイヤーにメッセージを配置できます。 -3. 関数ツール経由で公開する。オンデマンドで取得するコンテキストに適しており、LLM が必要に応じてツールを呼び出してデータを取得します。 -4. retrieval や web search を使う。これらは特別なツールで、ファイルやデータベースから関連データを取得する(retrieval)、もしくは Web から取得する(web search)ことができます。レスポンスを関連コンテキストで「グラウンディング」するのに有効です。 \ No newline at end of file +1. エージェントの `instructions` に追加します。これは「システムプロンプト」または「開発者メッセージ」とも呼ばれます。システムプロンプトは静的な文字列でも、コンテキストを受け取って文字列を出力する動的な関数でもかまいません。常に有用な情報(例: ユーザー名や現在の日付)に適した手法です。 +2. `Runner.run` 関数を呼び出すときに `input` に追加します。これは `instructions` の手法に似ていますが、[指揮系統](https://cdn.openai.com/spec/model-spec-2024-05-08.html#follow-the-chain-of-command) の下位にメッセージを配置できます。 +3. 関数ツール 経由で公開します。これは _オンデマンド_ のコンテキストに有用です。LLM は必要なときにデータを要求し、ツールを呼び出してそのデータを取得できます。 +4. リトリーバルまたは Web 検索 を使用します。これらは、ファイルやデータベース(リトリーバル)や、Web(Web 検索)から関連データを取得できる特別なツールです。これは関連するコンテキストデータに基づいて応答を「グラウンディング」するのに有用です。 \ No newline at end of file diff --git a/docs/ja/examples.md b/docs/ja/examples.md index 00f634ec1..7087bd5c3 100644 --- a/docs/ja/examples.md +++ b/docs/ja/examples.md @@ -4,42 +4,90 @@ search: --- # コード例 -リポジトリの [examples セクション](https://github.com/openai/openai-agents-python/tree/main/examples) には、 SDK のさまざまなサンプル実装が用意されています。これらの例は、異なるパターンや機能を示す複数のカテゴリーに整理されています。 - +[リポジトリ](https://github.com/openai/openai-agents-python/tree/main/examples) の examples セクションで、SDK のさまざまなサンプル実装をご覧ください。これらのコード例は、異なるパターンや機能を示す複数のカテゴリーに整理されています。 ## カテゴリー -- **[agent_patterns](https://github.com/openai/openai-agents-python/tree/main/examples/agent_patterns):** - このカテゴリーの例では、一般的なエージェント設計パターンを紹介しています。 +- **[agent_patterns](https://github.com/openai/openai-agents-python/tree/main/examples/agent_patterns):** + このカテゴリーの例は、次のような一般的なエージェント設計パターンを示します + + - 決定論的ワークフロー + - ツールとしてのエージェント + - エージェントの並列実行 + - 条件付きツール使用 + - 入出力のガードレール + - LLM を判定者として使用 + - ルーティング + - ストリーミングのガードレール + +- **[basic](https://github.com/openai/openai-agents-python/tree/main/examples/basic):** + SDK の基礎的な機能を示すコード例です + + - Hello World のコード例(デフォルトモデル、GPT-5、オープンウェイトモデル) + - エージェントのライフサイクル管理 + - 動的な システムプロンプト + - ストリーミング出力(テキスト、アイテム、関数呼び出し引数) + - プロンプトテンプレート + - ファイル処理(ローカルとリモート、画像と PDF) + - 利用状況のトラッキング + - 厳格でない出力型 + - 前回のレスポンス ID の利用 + +- **[customer_service](https://github.com/openai/openai-agents-python/tree/main/examples/customer_service):** + 航空会社向けのカスタマーサービス システムの例。 + +- **[financial_research_agent](https://github.com/openai/openai-agents-python/tree/main/examples/financial_research_agent):** + エージェントとツールを用いた金融データ分析のための、構造化されたリサーチ ワークフローを示す金融リサーチ エージェント。 + +- **[handoffs](https://github.com/openai/openai-agents-python/tree/main/examples/handoffs):** + メッセージフィルタリング付きのエージェントのハンドオフの実用例。 + +- **[hosted_mcp](https://github.com/openai/openai-agents-python/tree/main/examples/hosted_mcp):** + hosted MCP (Model Context Protocol) コネクタと承認フローの使用方法を示す例。 + +- **[mcp](https://github.com/openai/openai-agents-python/tree/main/examples/mcp):** + MCP (Model Context Protocol) を使ってエージェントを構築する方法。以下を含みます: + + - ファイルシステムの例 + - Git の例 + - MCP プロンプト サーバーの例 + - SSE (Server-Sent Events) の例 + - ストリーミング可能な HTTP のコード例 - - 決定論的ワークフロー - - ツールとしてのエージェント - - エージェントの並列実行 +- **[memory](https://github.com/openai/openai-agents-python/tree/main/examples/memory):** + エージェント向けのさまざまなメモリ実装の例。以下を含みます: -- **[basic](https://github.com/openai/openai-agents-python/tree/main/examples/basic):** - SDK の基礎的な機能を示す例です。 + - SQLite セッションストレージ + - 高度な SQLite セッションストレージ + - Redis セッションストレージ + - SQLAlchemy セッションストレージ + - 暗号化されたセッションストレージ + - OpenAI セッションストレージ - - 動的なシステムプロンプト - - ストリーミング出力 - - ライフサイクルイベント +- **[model_providers](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers):** + OpenAI 以外のモデルを SDK で使う方法を紹介。カスタムプロバイダーや LiteLLM 連携を含みます。 -- **[tool examples](https://github.com/openai/openai-agents-python/tree/main/examples/tools):** - Web 検索やファイル検索など、 OpenAI がホストするツールの実装方法と、それらをエージェントに統合する方法を学べます。 +- **[realtime](https://github.com/openai/openai-agents-python/tree/main/examples/realtime):** + SDK を使ってリアルタイム体験を構築する方法を示す例。以下を含みます: -- **[model providers](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers):** - OpenAI 以外のモデルを SDK で利用する方法を探ります。 + - Web アプリケーション + - コマンドライン インターフェース + - Twilio 連携 -- **[handoffs](https://github.com/openai/openai-agents-python/tree/main/examples/handoffs):** - エージェントのハンドオフを実践的に示す例です。 +- **[reasoning_content](https://github.com/openai/openai-agents-python/tree/main/examples/reasoning_content):** + 推論コンテンツと structured outputs の扱い方を示すコード例。 -- **[mcp](https://github.com/openai/openai-agents-python/tree/main/examples/mcp):** - MCP を使ったエージェントの構築方法を学べます。 +- **[research_bot](https://github.com/openai/openai-agents-python/tree/main/examples/research_bot):** + 複雑なマルチエージェントのリサーチ ワークフローを示す、シンプルな ディープリサーチ クローン。 -- **[customer_service](https://github.com/openai/openai-agents-python/tree/main/examples/customer_service)** と **[research_bot](https://github.com/openai/openai-agents-python/tree/main/examples/research_bot):** - より実践的なユースケースを示す、拡張された 2 つの例です。 +- **[tools](https://github.com/openai/openai-agents-python/tree/main/examples/tools):** + 次のような OpenAI がホストするツールの実装方法: - - **customer_service**: 航空会社向けカスタマーサービスシステムの例 - - **research_bot**: シンプルなディープリサーチクローン + - Web 検索 と フィルター付きの Web 検索 + - ファイル検索 + - Code Interpreter + - コンピュータ操作 + - 画像生成 -- **[voice](https://github.com/openai/openai-agents-python/tree/main/examples/voice):** - TTS と STT モデルを用いた音声エージェントの例をご覧ください。 \ No newline at end of file +- **[voice](https://github.com/openai/openai-agents-python/tree/main/examples/voice):** + TTS と STT モデルを用いた音声エージェントの例。ストリーミング音声のコード例を含みます。 \ No newline at end of file diff --git a/docs/ja/guardrails.md b/docs/ja/guardrails.md index b67bb8bad..c2450a9b2 100644 --- a/docs/ja/guardrails.md +++ b/docs/ja/guardrails.md @@ -4,44 +4,44 @@ search: --- # ガードレール -ガードレールは エージェント と _並行して_ 実行され、ユーザー入力のチェックとバリデーションを行えます。例えば、とても賢い(つまり遅く/高価な)モデルを使用してカスタマーリクエストを処理するエージェントがあるとします。悪意のある ユーザー がモデルに数学の宿題を手伝わせようとするのは避けたいでしょう。そこで、速く/安価なモデルで動くガードレールを実行できます。ガードレールが悪意のある利用を検知すると、直ちにエラーを送出して高価なモデルの実行を停止し、時間とコストを節約できます。 +ガードレールはエージェントと _並行して_ 実行され、ユーザー入力のチェックと検証を行います。たとえば、顧客からのリクエスト対応に非常に賢い(そのぶん遅く/高価な)モデルを使うエージェントがあるとします。悪意のあるユーザーがそのモデルに数学の宿題を手伝わせるような指示を出すのは避けたいはずです。そこで、速く/安価なモデルでガードレールを実行できます。ガードレールが悪用を検出した場合、即座にエラーを発生させ、高価なモデルの実行を止め、時間とコストを節約します。 -ガードレールには 2 種類あります: +ガードレールには 2 つの種類があります。 -1. 入力ガードレール は初期 ユーザー 入力に対して実行されます -2. 出力ガードレール は最終的なエージェント出力に対して実行されます +1. 入力ガードレールは最初のユーザー入力に対して実行されます +2. 出力ガードレールは最終的なエージェント出力に対して実行されます ## 入力ガードレール -入力ガードレールは 3 ステップで実行されます: +入力ガードレールは 3 つのステップで動作します。 -1. まず、ガードレールはエージェントに渡されたものと同じ入力を受け取ります。 -2. 次に、ガードレール関数が実行され [`GuardrailFunctionOutput`][agents.guardrail.GuardrailFunctionOutput] を生成し、それが [`InputGuardrailResult`][agents.guardrail.InputGuardrailResult] にラップされます。 -3. 最後に [.tripwire_triggered][agents.guardrail.GuardrailFunctionOutput.tripwire_triggered] が true かどうかを確認します。true の場合、[`InputGuardrailTripwireTriggered`][agents.exceptions.InputGuardrailTripwireTriggered] 例外が送出されるので、適切に ユーザー に応答したり例外を処理できます。 +1. まず、ガードレールはエージェントに渡されたのと同じ入力を受け取ります。 +2. 次に、ガードレール関数が実行され、[`GuardrailFunctionOutput`][agents.guardrail.GuardrailFunctionOutput] を生成し、それを [`InputGuardrailResult`][agents.guardrail.InputGuardrailResult] でラップします +3. 最後に、[`.tripwire_triggered`][agents.guardrail.GuardrailFunctionOutput.tripwire_triggered] が true かどうかを確認します。true の場合、[`InputGuardrailTripwireTriggered`][agents.exceptions.InputGuardrailTripwireTriggered] 例外が送出され、ユーザーへの適切な応答や例外処理ができます。 !!! Note - 入力ガードレールは ユーザー 入力に対して実行されることを意図しているため、ガードレールは *最初* のエージェントでのみ実行されます。「なぜ `guardrails` プロパティがエージェントにあり、`Runner.run` に渡さないのか」と疑問に思うかもしれません。これは、ガードレールが実際の エージェント と密接に関連していることが多いからです。異なるエージェントには異なるガードレールを実行するため、コードを同じ場所に置くことで可読性が向上します。 + 入力ガードレールはユーザー入力に対して実行されることを意図しているため、エージェントのガードレールはそのエージェントが「最初の」エージェントである場合にのみ実行されます。なぜ `guardrails` プロパティがエージェント側にあり、`Runner.run` に渡さないのか不思議に思うかもしれません。これは、ガードレールが実際のエージェントに密接に関係する傾向があるためです。エージェントごとに異なるガードレールを実行するので、コードを同じ場所に置くことで可読性が向上します。 ## 出力ガードレール -出力ガードレールは 3 ステップで実行されます: +出力ガードレールは 3 つのステップで動作します。 -1. まず、ガードレールはエージェントが生成した出力を受け取ります。 -2. 次に、ガードレール関数が実行され [`GuardrailFunctionOutput`][agents.guardrail.GuardrailFunctionOutput] を生成し、それが [`OutputGuardrailResult`][agents.guardrail.OutputGuardrailResult] にラップされます。 -3. 最後に [.tripwire_triggered][agents.guardrail.GuardrailFunctionOutput.tripwire_triggered] が true かどうかを確認します。true の場合、[`OutputGuardrailTripwireTriggered`][agents.exceptions.OutputGuardrailTripwireTriggered] 例外が送出されるので、適切に ユーザー に応答したり例外を処理できます。 +1. まず、ガードレールはエージェントが生成した出力を受け取ります。 +2. 次に、ガードレール関数が実行され、[`GuardrailFunctionOutput`][agents.guardrail.GuardrailFunctionOutput] を生成し、それを [`OutputGuardrailResult`][agents.guardrail.OutputGuardrailResult] でラップします +3. 最後に、[`.tripwire_triggered`][agents.guardrail.GuardrailFunctionOutput.tripwire_triggered] が true かどうかを確認します。true の場合、[`OutputGuardrailTripwireTriggered`][agents.exceptions.OutputGuardrailTripwireTriggered] 例外が送出され、ユーザーへの適切な応答や例外処理ができます。 !!! Note - 出力ガードレールは最終的なエージェント出力に対して実行されることを意図しているため、ガードレールは *最後* のエージェントでのみ実行されます。入力ガードレールの場合と同様、ガードレールが実際の エージェント と密接に関連していることが多いため、コードを同じ場所に置くことで可読性が向上します。 + 出力ガードレールは最終的なエージェント出力に対して実行されることを意図しているため、エージェントのガードレールはそのエージェントが「最後の」エージェントである場合にのみ実行されます。入力ガードレールと同様に、ガードレールは実際のエージェントに密接に関連することが多いため、コードを同じ場所に置くことで可読性が向上します。 ## トリップワイヤー -入力または出力がガードレールを通過できなかった場合、ガードレールはトリップワイヤーでそれを示すことができます。トリップワイヤーがトリガーされたガードレールを検知した時点で、直ちに `{Input,Output}GuardrailTripwireTriggered` 例外を送出し、エージェントの実行を停止します。 +入力または出力がガードレールに失敗した場合、ガードレールはトリップワイヤーでそれを示せます。トリップワイヤーが作動したガードレールを検出するとすぐに、{Input,Output}GuardrailTripwireTriggered 例外を送出し、エージェントの実行を停止します。 ## ガードレールの実装 -入力を受け取り、[`GuardrailFunctionOutput`][agents.guardrail.GuardrailFunctionOutput] を返す関数を提供する必要があります。この例では、内部で エージェント を実行してこれを行います。 +入力を受け取り、[`GuardrailFunctionOutput`][agents.guardrail.GuardrailFunctionOutput] を返す関数を用意する必要があります。この例では、内部でエージェントを実行してこれを行います。 ```python from pydantic import BaseModel @@ -94,10 +94,10 @@ async def main(): print("Math homework guardrail tripped") ``` -1. このエージェントをガードレール関数内で使用します。 -2. これはエージェントの入力/コンテキストを受け取り、結果を返すガードレール関数です。 -3. ガードレール結果に追加情報を含めることができます。 -4. これはワークフローを定義する実際のエージェントです。 +1. このエージェントをガードレール関数内で使用します。 +2. これはエージェントの入力/コンテキストを受け取り、結果を返すガードレール関数です。 +3. ガードレール結果に追加情報を含めることができます。 +4. これはワークフローを定義する実際のエージェントです。 出力ガードレールも同様です。 @@ -152,7 +152,7 @@ async def main(): print("Math output guardrail tripped") ``` -1. これは実際のエージェントの出力型です。 -2. これはガードレールの出力型です。 -3. これはエージェントの出力を受け取り、結果を返すガードレール関数です。 -4. これはワークフローを定義する実際のエージェントです。 \ No newline at end of file +1. これは実際のエージェントの出力型です。 +2. これはガードレールの出力型です。 +3. これはエージェントの出力を受け取り、結果を返すガードレール関数です。 +4. これはワークフローを定義する実際のエージェントです。 \ No newline at end of file diff --git a/docs/ja/handoffs.md b/docs/ja/handoffs.md index c0e99556e..78835cdde 100644 --- a/docs/ja/handoffs.md +++ b/docs/ja/handoffs.md @@ -4,19 +4,19 @@ search: --- # ハンドオフ -ハンドオフを使用すると、エージェント がタスクを別の エージェント に委譲できます。これは、複数の エージェント がそれぞれ異なる分野を専門とするシナリオで特に便利です。たとえばカスタマーサポートアプリでは、注文状況、返金、 FAQ などのタスクを個別に担当する エージェント を用意できます。 +ハンドオフは、あるエージェントが別のエージェントにタスクを委任できるようにする仕組みです。これは、異なるエージェントがそれぞれ異なる分野に特化しているシナリオで特に有用です。たとえば、カスタマーサポートアプリでは、注文状況、返金、FAQ などのタスクをそれぞれ担当するエージェントがいるかもしれません。 -ハンドオフは LLM からはツールとして認識されます。そのため、`Refund Agent` という エージェント へのハンドオフであれば、ツール名は `transfer_to_refund_agent` になります。 +ハンドオフは LLM に対してツールとして表現されます。したがって、`Refund Agent` というエージェントへのハンドオフがある場合、ツール名は `transfer_to_refund_agent` となります。 ## ハンドオフの作成 -すべての エージェント には [`handoffs`][agents.agent.Agent.handoffs] パラメーターがあり、直接 `Agent` を渡すことも、ハンドオフをカスタマイズする `Handoff` オブジェクトを渡すこともできます。 +すべてのエージェントには [`handoffs`][agents.agent.Agent.handoffs] パラメーターがあり、`Agent` を直接渡すことも、ハンドオフをカスタマイズする `Handoff` オブジェクトを渡すこともできます。 -Agents SDK が提供する [`handoff()`][agents.handoffs.handoff] 関数を使ってハンドオフを作成できます。この関数では、引き継ぎ先の エージェント を指定し、オーバーライドや入力フィルターをオプションで設定できます。 +Agents SDK によって提供される [`handoff()`][agents.handoffs.handoff] 関数を使ってハンドオフを作成できます。この関数では、ハンドオフ先のエージェントに加えて、任意のオーバーライドや入力フィルターを指定できます。 ### 基本的な使い方 -シンプルなハンドオフを作成する例を示します。 +シンプルなハンドオフの作成方法は次のとおりです。 ```python from agents import Agent, handoff @@ -28,18 +28,19 @@ refund_agent = Agent(name="Refund agent") triage_agent = Agent(name="Triage agent", handoffs=[billing_agent, handoff(refund_agent)]) ``` -1. `billing_agent` のように エージェント を直接指定することも、`handoff()` 関数を使用することもできます。 +1. エージェントを直接使用する(`billing_agent` のように)ことも、`handoff()` 関数を使用することもできます。 ### `handoff()` 関数によるハンドオフのカスタマイズ -[`handoff()`][agents.handoffs.handoff] 関数を使うと、ハンドオフを細かくカスタマイズできます。 +[`handoff()`][agents.handoffs.handoff] 関数を使って、さまざまなカスタマイズができます。 -- `agent`: ここで指定した エージェント に処理が引き渡されます。 -- `tool_name_override`: デフォルトでは `Handoff.default_tool_name()` が使用され、`transfer_to_` という名前になります。これを上書きできます。 -- `tool_description_override`: `Handoff.default_tool_description()` が返すデフォルトのツール説明を上書きします。 -- `on_handoff`: ハンドオフ実行時に呼び出されるコールバック関数です。ハンドオフが呼ばれたタイミングでデータ取得を開始するなどに便利です。この関数は エージェント のコンテキストを受け取り、オプションで LLM が生成した入力も受け取れます。渡されるデータは `input_type` パラメーターで制御します。 -- `input_type`: ハンドオフが受け取る入力の型(任意)。 -- `input_filter`: 次の エージェント が受け取る入力をフィルタリングできます。詳細は後述します。 +- `agent`: ハンドオフ先のエージェントです。 +- `tool_name_override`: 既定では `Handoff.default_tool_name()` が使用され、`transfer_to_` に解決されます。これを上書きできます。 +- `tool_description_override`: `Handoff.default_tool_description()` の既定のツール説明を上書きします。 +- `on_handoff`: ハンドオフが呼び出されたときに実行されるコールバック関数です。ハンドオフが呼び出されることが分かった時点でデータ取得を開始するなどに有用です。この関数はエージェントコンテキストを受け取り、オプションで LLM が生成した入力も受け取れます。入力データは `input_type` パラメーターで制御します。 +- `input_type`: ハンドオフが想定する入力の型(任意)。 +- `input_filter`: 次のエージェントが受け取る入力をフィルタリングできます。詳細は以下を参照してください。 +- `is_enabled`: ハンドオフを有効にするかどうか。真偽値または真偽値を返す関数を指定でき、実行時に動的にハンドオフを有効化・無効化できます。 ```python from agents import Agent, handoff, RunContextWrapper @@ -59,7 +60,7 @@ handoff_obj = handoff( ## ハンドオフ入力 -場合によっては、 LLM がハンドオフを呼び出す際に追加のデータを渡してほしいことがあります。たとえば「Escalation エージェント」へのハンドオフでは、ログ用に理由を渡してもらいたいかもしれません。 +状況によっては、ハンドオフを呼び出す際に LLM にいくつかのデータを提供してほしい場合があります。たとえば、「Escalation エージェント」へのハンドオフを想定してください。ログに記録できるよう、理由を提供してほしいかもしれません。 ```python from pydantic import BaseModel @@ -83,9 +84,9 @@ handoff_obj = handoff( ## 入力フィルター -ハンドオフが発生すると、新しい エージェント が会話を引き継ぎ、これまでの会話履歴全体を閲覧できる状態になります。これを変更したい場合は [`input_filter`][agents.handoffs.Handoff.input_filter] を設定してください。入力フィルターは、[`HandoffInputData`][agents.handoffs.HandoffInputData] として渡される既存の入力を受け取り、新しい `HandoffInputData` を返す関数です。 +ハンドオフが発生すると、新しいエージェントが会話を引き継ぎ、これまでの会話履歴全体を閲覧できるかのように動作します。これを変更したい場合は、[`input_filter`][agents.handoffs.Handoff.input_filter] を設定できます。入力フィルターは、[`HandoffInputData`][agents.handoffs.HandoffInputData] を介して既存の入力を受け取り、新しい `HandoffInputData` を返す関数です。 -よくあるパターン(たとえば履歴からすべてのツール呼び出しを削除するなど)は [`agents.extensions.handoff_filters`][] に実装済みです。 +よくあるパターン(たとえば履歴からすべてのツール呼び出しを除去するなど)は、[`agents.extensions.handoff_filters`][] に実装されています。 ```python from agents import Agent, handoff @@ -99,11 +100,11 @@ handoff_obj = handoff( ) ``` -1. これにより `FAQ agent` が呼ばれた際に、履歴からすべてのツール呼び出しが自動で削除されます。 +1. これにより、`FAQ agent` が呼び出されたときに履歴から自動的にすべてのツールが削除されます。 ## 推奨プロンプト -LLM がハンドオフを正しく理解できるよう、エージェント にハンドオフに関する情報を含めることを推奨します。事前に用意したプレフィックス [`agents.extensions.handoff_prompt.RECOMMENDED_PROMPT_PREFIX`][] を利用するか、[`agents.extensions.handoff_prompt.prompt_with_handoff_instructions`][] を呼び出してプロンプトに推奨情報を自動で追加できます。 +LLM がハンドオフを正しく理解できるように、エージェントにハンドオフに関する情報を含めることを推奨します。[`agents.extensions.handoff_prompt.RECOMMENDED_PROMPT_PREFIX`][] に推奨のプレフィックスがあり、または [`agents.extensions.handoff_prompt.prompt_with_handoff_instructions`][] を呼び出して、プロンプトに推奨データを自動的に追加できます。 ```python from agents import Agent diff --git a/docs/ja/index.md b/docs/ja/index.md index 39692a166..f2f5fdd99 100644 --- a/docs/ja/index.md +++ b/docs/ja/index.md @@ -4,29 +4,31 @@ search: --- # OpenAI Agents SDK -[OpenAI Agents SDK](https://github.com/openai/openai-agents-python) は、抽象化をほとんど排した軽量で使いやすいパッケージにより、エージェントベースの AI アプリを構築できるようにします。これは、以前のエージェント向け実験プロジェクトである [Swarm](https://github.com/openai/swarm/tree/main) をプロダクションレベルへとアップグレードしたものです。Agents SDK にはごく少数の基本コンポーネントがあります。 +[OpenAI Agents SDK](https://github.com/openai/openai-agents-python) は、最小限の抽象化で軽量かつ使いやすいパッケージとして、エージェント型 AI アプリを構築できるようにします。これは、以前のエージェント実験である [Swarm](https://github.com/openai/swarm/tree/main) の本番運用向けアップグレードです。Agents SDK にはごく少数の基本コンポーネントがあります。 -- **エージェント**: instructions と tools を備えた LLM -- **ハンドオフ**: エージェントが特定タスクを他のエージェントへ委任するしくみ -- **ガードレール**: エージェントへの入力を検証する機能 +- **エージェント**、instructions と tools を備えた LLM +- **ハンドオフ**、特定のタスクを他のエージェントに委譲できる機能 +- **ガードレール**、エージェントの入力と出力を検証できる機能 +- **セッション**、エージェントの実行間で会話履歴を自動的に維持 -Python と組み合わせることで、これらのコンポーネントはツールとエージェント間の複雑な関係を表現でき、学習コストを抑えつつ実際のアプリケーションを構築できます。さらに SDK には、エージェントフローを可視化・デバッグできる **トレーシング** が標準搭載されており、評価やファインチューニングにも活用可能です。 +Python と組み合わせることで、これらの基本コンポーネントはツールとエージェント間の複雑な関係を表現でき、急な学習コストなしに実運用のアプリケーションを構築できます。さらに、SDK には内蔵の **トレーシング** があり、エージェントのフローを可視化・デバッグできるほか、評価したり、アプリケーション向けにモデルをファインチューニングすることもできます。 -## Agents SDK を使用する理由 +## Agents SDK を使う理由 -SDK には 2 つの設計原則があります。 +この SDK は次の 2 つの設計原則に基づいています。 -1. 使う価値のある十分な機能を備えつつ、学習が早いようコンポーネント数を絞る。 -2. すぐに使い始められる初期設定で動作しつつ、挙動を細かくカスタマイズできる。 +1. 使う価値があるだけの機能を備えつつ、学習が速いように基本コンポーネントは少なく。 +2. すぐに使えて高性能、かつ挙動を細部までカスタマイズ可能。 主な機能は次のとおりです。 -- エージェントループ: ツール呼び出し、結果を LLM に送信、LLM が完了するまでのループを自動で処理。 -- Python ファースト: 新しい抽象化を学ばずに、言語標準機能でエージェントをオーケストレーション。 -- ハンドオフ: 複数エージェント間の協調と委譲を実現する強力な機能。 -- ガードレール: エージェントと並列で入力バリデーションを実行し、失敗時に早期終了。 -- 関数ツール: 任意の Python 関数をツール化し、自動スキーマ生成と Pydantic での検証を提供。 -- トレーシング: フローの可視化・デバッグ・モニタリングに加え、OpenAI の評価・ファインチューニング・蒸留ツールを利用可能。 +- エージェントループ: ツールの呼び出し、結果の LLM への送信、LLM の完了までのループ処理を内蔵。 +- Python ファースト: 新しい抽象化を学ぶ必要はなく、言語の標準機能でエージェントのオーケストレーションや連鎖が可能。 +- ハンドオフ: 複数のエージェント間での調整と委譲を可能にする強力な機能。 +- ガードレール: エージェントと並行して入力の検証やチェックを実行し、失敗時は早期に中断。 +- セッション: エージェントの実行間で会話履歴を自動管理し、手動の状態管理を不要に。 +- 関数ツール: 任意の Python 関数をツール化し、自動スキーマ生成と Pydantic ベースの検証を提供。 +- トレーシング: ワークフローの可視化、デバッグ、監視に加え、OpenAI の評価、ファインチューニング、蒸留ツール群を活用可能。 ## インストール diff --git a/docs/ja/mcp.md b/docs/ja/mcp.md index 1e394a5e6..1a9947b6c 100644 --- a/docs/ja/mcp.md +++ b/docs/ja/mcp.md @@ -4,69 +4,319 @@ search: --- # Model context protocol (MCP) -[Model context protocol](https://modelcontextprotocol.io/introduction)(通称 MCP)は、 LLM にツールとコンテキストを提供するための仕組みです。MCP のドキュメントでは次のように説明されています。 +The [Model context protocol](https://modelcontextprotocol.io/introduction) (MCP) は、アプリケーションがツールやコンテキストを言語モデルに公開する方法を標準化します。公式ドキュメントより: -> MCP は、アプリケーションが LLM にコンテキストを提供する方法を標準化するオープンプロトコルです。MCP は AI アプリケーションにとっての USB‑C ポートのようなものと考えてください。USB‑C が各種デバイスを周辺機器と接続するための標準化された方法を提供するのと同様に、MCP は AI モデルをさまざまなデータソースやツールと接続するための標準化された方法を提供します。 +> MCP は、アプリケーションが LLM にコンテキストを提供する方法を標準化するオープンなプロトコルです。AI アプリケーションにおける USB‑C ポートのようなものと考えてください。USB‑C がデバイスをさまざまな周辺機器やアクセサリに接続する標準化された方法を提供するのと同様に、MCP は AI モデルをさまざまなデータソースやツールに接続する標準化された方法を提供します。 -Agents SDK は MCP をサポートしており、これにより幅広い MCP サーバーをエージェントにツールとして追加できます。 +Agents Python SDK は複数の MCP トランスポートを理解します。これにより、既存の MCP サーバーを再利用したり、独自に構築して、ファイルシステムや HTTP、コネクタに裏付けられたツールを エージェント に公開できます。 -## MCP サーバー +## Choosing an MCP integration -現在、MCP 仕様では使用するトランスポート方式に基づき 3 種類のサーバーが定義されています。 +MCP サーバーを エージェント に接続する前に、ツール呼び出しをどこで実行するか、および到達可能なトランスポートを決めます。以下のマトリクスは、Python SDK がサポートするオプションをまとめたものです。 -1. **stdio** サーバー: アプリケーションのサブプロセスとして実行されます。ローカルで動かすイメージです。 -2. **HTTP over SSE** サーバー: リモートで動作し、 URL 経由で接続します。 -3. **Streamable HTTP** サーバー: MCP 仕様に定義された Streamable HTTP トランスポートを使用してリモートで動作します。 +| What you need | Recommended option | +| ------------------------------------------------------------------------------------ | ----------------------------------------------------- | +| Let OpenAI's Responses API call a publicly reachable MCP server on the model's behalf| **Hosted MCP server tools** via [`HostedMCPTool`][agents.tool.HostedMCPTool] | +| Connect to Streamable HTTP servers that you run locally or remotely | **Streamable HTTP MCP servers** via [`MCPServerStreamableHttp`][agents.mcp.server.MCPServerStreamableHttp] | +| Talk to servers that implement HTTP with Server-Sent Events | **HTTP with SSE MCP servers** via [`MCPServerSse`][agents.mcp.server.MCPServerSse] | +| Launch a local process and communicate over stdin/stdout | **stdio MCP servers** via [`MCPServerStdio`][agents.mcp.server.MCPServerStdio] | -これらのサーバーへは [`MCPServerStdio`][agents.mcp.server.MCPServerStdio]、[`MCPServerSse`][agents.mcp.server.MCPServerSse]、[`MCPServerStreamableHttp`][agents.mcp.server.MCPServerStreamableHttp] クラスを使用して接続できます。 +以下のセクションでは、それぞれのオプションについて、設定方法や、どのトランスポートを選ぶべきかを説明します。 -たとえば、[公式 MCP filesystem サーバー](https://www.npmjs.com/package/@modelcontextprotocol/server-filesystem)を利用する場合は次のようになります。 +## 1. Hosted MCP server tools + +ホスト型ツールは、ツールの往復処理全体を OpenAI のインフラストラクチャに委ねます。あなたのコードがツールを列挙・呼び出す代わりに、[`HostedMCPTool`][agents.tool.HostedMCPTool] が サーバーラベル(および任意のコネクタメタデータ)を Responses API に転送します。モデルは、リモートサーバーのツールを列挙し、あなたの Python プロセスへの追加のコールバックなしに呼び出します。ホスト型ツールは現在、Responses API のホスト型 MCP 統合をサポートする OpenAI モデルで動作します。 + +### Basic hosted MCP tool + +エージェント の `tools` リストに [`HostedMCPTool`][agents.tool.HostedMCPTool] を追加してホスト型ツールを作成します。`tool_config` 辞書は、REST API に送信する JSON を反映します: + +```python +import asyncio + +from agents import Agent, HostedMCPTool, Runner + +async def main() -> None: + agent = Agent( + name="Assistant", + tools=[ + HostedMCPTool( + tool_config={ + "type": "mcp", + "server_label": "gitmcp", + "server_url": "https://gitmcp.io/openai/codex", + "require_approval": "never", + } + ) + ], + ) + + result = await Runner.run(agent, "Which language is this repository written in?") + print(result.final_output) + +asyncio.run(main()) +``` + +ホストされたサーバーは自動的にそのツールを公開します。`mcp_servers` に追加する必要はありません。 + +### Streaming hosted MCP results + +ホスト型ツールは、関数ツール とまったく同じ方法で ストリーミング をサポートします。`Runner.run_streamed` に `stream=True` を渡して、モデルが処理中でも増分の MCP 出力を消費します: + +```python +result = Runner.run_streamed(agent, "Summarise this repository's top languages") +async for event in result.stream_events(): + if event.type == "run_item_stream_event": + print(f"Received: {event.item}") +print(result.final_output) +``` + +### Optional approval flows + +サーバーが機微な操作を実行できる場合、各ツール実行の前に人間またはプログラムによる承認を必須にできます。`tool_config` の `require_approval` を、単一のポリシー(`"always"`、`"never"`)またはツール名からポリシーへの辞書で設定します。Python 内で判断するには、`on_approval_request` コールバックを指定します。 + +```python +from agents import MCPToolApprovalFunctionResult, MCPToolApprovalRequest + +SAFE_TOOLS = {"read_project_metadata"} + +def approve_tool(request: MCPToolApprovalRequest) -> MCPToolApprovalFunctionResult: + if request.data.name in SAFE_TOOLS: + return {"approve": True} + return {"approve": False, "reason": "Escalate to a human reviewer"} + +agent = Agent( + name="Assistant", + tools=[ + HostedMCPTool( + tool_config={ + "type": "mcp", + "server_label": "gitmcp", + "server_url": "https://gitmcp.io/openai/codex", + "require_approval": "always", + }, + on_approval_request=approve_tool, + ) + ], +) +``` + +コールバックは同期・非同期のどちらでもよく、モデルが継続実行のために承認データを必要とするたびに呼び出されます。 + +### Connector-backed hosted servers + +ホスト型 MCP は OpenAI コネクタにも対応しています。`server_url` を指定する代わりに、`connector_id` とアクセストークンを指定します。Responses API が認証を処理し、ホストされたサーバーがコネクタのツールを公開します。 + +```python +import os + +HostedMCPTool( + tool_config={ + "type": "mcp", + "server_label": "google_calendar", + "connector_id": "connector_googlecalendar", + "authorization": os.environ["GOOGLE_CALENDAR_AUTHORIZATION"], + "require_approval": "never", + } +) +``` + +ストリーミング、承認、コネクタを含む完全なホスト型ツールのサンプルは +[`examples/hosted_mcp`](https://github.com/openai/openai-agents-python/tree/main/examples/hosted_mcp) にあります。 + +## 2. Streamable HTTP MCP servers + +ネットワーク接続を自分で管理したい場合は、[`MCPServerStreamableHttp`][agents.mcp.server.MCPServerStreamableHttp] を使用します。Streamable HTTP サーバーは、トランスポートを自分で制御したい場合や、低レイテンシを維持しつつ自分のインフラ内で サーバー を実行したい場合に最適です。 + +```python +import asyncio +import os + +from agents import Agent, Runner +from agents.mcp import MCPServerStreamableHttp +from agents.model_settings import ModelSettings + +async def main() -> None: + token = os.environ["MCP_SERVER_TOKEN"] + async with MCPServerStreamableHttp( + name="Streamable HTTP Python Server", + params={ + "url": "http://localhost:8000/mcp", + "headers": {"Authorization": f"Bearer {token}"}, + "timeout": 10, + }, + cache_tools_list=True, + max_retry_attempts=3, + ) as server: + agent = Agent( + name="Assistant", + instructions="Use the MCP tools to answer the questions.", + mcp_servers=[server], + model_settings=ModelSettings(tool_choice="required"), + ) + + result = await Runner.run(agent, "Add 7 and 22.") + print(result.final_output) + +asyncio.run(main()) +``` + +コンストラクターは追加のオプションを受け取ります: + +- `client_session_timeout_seconds` は HTTP の読み取りタイムアウトを制御します。 +- `use_structured_content` は、テキスト出力よりも `tool_result.structured_content` を優先するかどうかを切り替えます。 +- `max_retry_attempts` と `retry_backoff_seconds_base` は、`list_tools()` と `call_tool()` に自動リトライを追加します。 +- `tool_filter` は、一部のツールのみを公開できます([ツールのフィルタリング](#tool-filtering) を参照)。 + +## 3. HTTP with SSE MCP servers + +MCP サーバーが HTTP with SSE トランスポートを実装している場合は、[`MCPServerSse`][agents.mcp.server.MCPServerSse] をインスタンス化します。トランスポート以外は、API は Streamable HTTP サーバーと同一です。 ```python -from agents.run_context import RunContextWrapper + +from agents import Agent, Runner +from agents.model_settings import ModelSettings +from agents.mcp import MCPServerSse + +workspace_id = "demo-workspace" + +async with MCPServerSse( + name="SSE Python Server", + params={ + "url": "http://localhost:8000/sse", + "headers": {"X-Workspace": workspace_id}, + }, + cache_tools_list=True, +) as server: + agent = Agent( + name="Assistant", + mcp_servers=[server], + model_settings=ModelSettings(tool_choice="required"), + ) + result = await Runner.run(agent, "What's the weather in Tokyo?") + print(result.final_output) +``` + +## 4. stdio MCP servers + +ローカルのサブプロセスとして実行される MCP サーバーには、[`MCPServerStdio`][agents.mcp.server.MCPServerStdio] を使用します。SDK はプロセスを起動し、パイプを開いたままにし、コンテキストマネージャーの終了時に自動でクローズします。これは、迅速なプロトタイプや、サーバーがコマンドラインのエントリポイントのみを公開している場合に役立ちます。 + +```python +from pathlib import Path +from agents import Agent, Runner +from agents.mcp import MCPServerStdio + +current_dir = Path(__file__).parent +samples_dir = current_dir / "sample_files" async with MCPServerStdio( + name="Filesystem Server via npx", params={ "command": "npx", - "args": ["-y", "@modelcontextprotocol/server-filesystem", samples_dir], - } + "args": ["-y", "@modelcontextprotocol/server-filesystem", str(samples_dir)], + }, ) as server: - # 注意:実際には通常は MCP サーバーをエージェントに追加し、 - # フレームワークがツール一覧の取得を自動的に処理するようにします。 - # list_tools() への直接呼び出しには run_context と agent パラメータが必要です。 - run_context = RunContextWrapper(context=None) - agent = Agent(name="test", instructions="test") - tools = await server.list_tools(run_context, agent) + agent = Agent( + name="Assistant", + instructions="Use the files in the sample directory to answer questions.", + mcp_servers=[server], + ) + result = await Runner.run(agent, "List the files available to you.") + print(result.final_output) ``` -## MCP サーバーの利用 +## Tool filtering -MCP サーバーはエージェントに追加できます。Agents SDK はエージェント実行時に毎回 MCP サーバーへ `list_tools()` を呼び出し、 LLM に MCP サーバーのツールを認識させます。LLM が MCP サーバーのツールを呼び出すと、SDK はそのサーバーへ `call_tool()` を実行します。 +各 MCP サーバーはツールフィルターをサポートしており、エージェント が必要とする機能だけを公開できます。フィルタリングは、構築時または実行ごとに動的に行えます。 + +### Static tool filtering + +[`create_static_tool_filter`][agents.mcp.create_static_tool_filter] を使用して、単純な許可/ブロックリストを設定します: ```python +from pathlib import Path -agent=Agent( - name="Assistant", - instructions="Use the tools to achieve the task", - mcp_servers=[mcp_server_1, mcp_server_2] +from agents.mcp import MCPServerStdio, create_static_tool_filter + +samples_dir = Path("/path/to/files") + +filesystem_server = MCPServerStdio( + params={ + "command": "npx", + "args": ["-y", "@modelcontextprotocol/server-filesystem", str(samples_dir)], + }, + tool_filter=create_static_tool_filter(allowed_tool_names=["read_file", "write_file"]), ) ``` -## キャッシュ +`allowed_tool_names` と `blocked_tool_names` の両方が指定された場合、SDK はまず許可リストを適用し、その後、残りの集合からブロックされたツールを取り除きます。 + +### Dynamic tool filtering + +より複雑なロジックには、[`ToolFilterContext`][agents.mcp.ToolFilterContext] を受け取る呼び出し可能オブジェクトを渡します。呼び出し可能オブジェクトは同期・非同期のどちらでもよく、ツールを公開すべき場合に `True` を返します。 + +```python +from pathlib import Path + +from agents.mcp import MCPServerStdio, ToolFilterContext + +samples_dir = Path("/path/to/files") + +async def context_aware_filter(context: ToolFilterContext, tool) -> bool: + if context.agent.name == "Code Reviewer" and tool.name.startswith("danger_"): + return False + return True + +async with MCPServerStdio( + params={ + "command": "npx", + "args": ["-y", "@modelcontextprotocol/server-filesystem", str(samples_dir)], + }, + tool_filter=context_aware_filter, +) as server: + ... +``` + +フィルターコンテキストは、アクティブな `run_context`、ツールを要求している `agent`、および `server_name` を公開します。 + +## Prompts + +MCP サーバーは、エージェントの instructions を動的に生成する プロンプト も提供できます。プロンプトをサポートする サーバー は、次の 2 つのメソッドを公開します: + +- `list_prompts()` は、利用可能なプロンプトテンプレートを列挙します。 +- `get_prompt(name, arguments)` は、必要に応じて パラメーター 付きの具体的なプロンプトを取得します。 + +```python +from agents import Agent + +prompt_result = await server.get_prompt( + "generate_code_review_instructions", + {"focus": "security vulnerabilities", "language": "python"}, +) +instructions = prompt_result.messages[0].content.text + +agent = Agent( + name="Code Reviewer", + instructions=instructions, + mcp_servers=[server], +) +``` -エージェントが実行されるたびに、MCP サーバーへ `list_tools()` が呼び出されます。サーバーがリモートの場合は特にレイテンシが発生します。ツール一覧を自動でキャッシュしたい場合は、[`MCPServerStdio`][agents.mcp.server.MCPServerStdio]、[`MCPServerSse`][agents.mcp.server.MCPServerSse]、[`MCPServerStreamableHttp`][agents.mcp.server.MCPServerStreamableHttp] の各クラスに `cache_tools_list=True` を渡してください。ツール一覧が変更されないと確信できる場合のみ使用してください。 +## Caching -キャッシュを無効化したい場合は、サーバーで `invalidate_tools_cache()` を呼び出します。 +すべての エージェント 実行は、各 MCP サーバーに対して `list_tools()` を呼び出します。リモートサーバーは目立つレイテンシをもたらす可能性があるため、すべての MCP サーバークラスは `cache_tools_list` オプションを公開します。ツール定義が頻繁に変わらないと自信がある場合にのみ、`True` に設定してください。あとから新しいリストを強制したい場合は、サーバーインスタンス上で `invalidate_tools_cache()` を呼び出します。 -## エンドツーエンドのコード例 +## Tracing -完全な動作例は [examples/mcp](https://github.com/openai/openai-agents-python/tree/main/examples/mcp) をご覧ください。 +[トレーシング](./tracing.md) は MCP のアクティビティを自動的に捕捉します。含まれるもの: -## トレーシング +1. ツールを列挙するための MCP サーバーへの呼び出し。 +2. ツール呼び出しに関する MCP 関連情報。 -[トレーシング](./tracing.md) は MCP の操作を自動的にキャプチャします。具体的には次の内容が含まれます。 +![MCP Tracing Screenshot](../assets/images/mcp-tracing.jpg) -1. ツール一覧取得のための MCP サーバー呼び出し -2. 関数呼び出しに関する MCP 情報 +## Further reading -![MCP Tracing Screenshot](../assets/images/mcp-tracing.jpg) \ No newline at end of file +- [Model Context Protocol](https://modelcontextprotocol.io/) – 仕様と設計ガイド。 +- [examples/mcp](https://github.com/openai/openai-agents-python/tree/main/examples/mcp) – 実行可能な stdio、SSE、Streamable HTTP のサンプル。 +- [examples/hosted_mcp](https://github.com/openai/openai-agents-python/tree/main/examples/hosted_mcp) – 承認やコネクタを含む、完全なホスト型 MCP デモ。 \ No newline at end of file diff --git a/docs/ja/models/index.md b/docs/ja/models/index.md index 410c01676..f1cf1a1e7 100644 --- a/docs/ja/models/index.md +++ b/docs/ja/models/index.md @@ -4,20 +4,61 @@ search: --- # モデル -Agents SDK は OpenAI モデルを 2 つの形態で即利用できます。 +Agents SDK には、OpenAI モデルに対する即時利用可能なサポートが 2 つの形で用意されています。 -- **推奨**: [`OpenAIResponsesModel`][agents.models.openai_responses.OpenAIResponsesModel] は、新しい [Responses API](https://platform.openai.com/docs/api-reference/responses) を使用して OpenAI API を呼び出します。 -- [`OpenAIChatCompletionsModel`][agents.models.openai_chatcompletions.OpenAIChatCompletionsModel] は、[Chat Completions API](https://platform.openai.com/docs/api-reference/chat) を使用して OpenAI API を呼び出します。 +- **推奨**: [`OpenAIResponsesModel`][agents.models.openai_responses.OpenAIResponsesModel]。新しい [Responses API](https://platform.openai.com/docs/api-reference/responses) を使って OpenAI API を呼び出します。 +- [`OpenAIChatCompletionsModel`][agents.models.openai_chatcompletions.OpenAIChatCompletionsModel]。 [Chat Completions API](https://platform.openai.com/docs/api-reference/chat) を使って OpenAI API を呼び出します。 + +## OpenAI モデル + +`Agent` を初期化する際にモデルを指定しない場合、デフォルトのモデルが使用されます。現在のデフォルトは [`gpt-4.1`](https://platform.openai.com/docs/models/gpt-4.1) で、エージェント的ワークフローにおける予測可能性と低レイテンシのバランスに優れています。 + +[`gpt-5`](https://platform.openai.com/docs/models/gpt-5) など他のモデルに切り替えたい場合は、次のセクションの手順に従ってください。 + +### デフォルトの OpenAI モデル + +カスタムモデルを設定していないすべてのエージェントで特定のモデルを一貫して使いたい場合は、エージェントを実行する前に環境変数 `OPENAI_DEFAULT_MODEL` を設定してください。 + +```bash +export OPENAI_DEFAULT_MODEL=gpt-5 +python3 my_awesome_agent.py +``` + +#### GPT-5 モデル + +この方法で GPT-5 の reasoning モデル([`gpt-5`](https://platform.openai.com/docs/models/gpt-5)、[`gpt-5-mini`](https://platform.openai.com/docs/models/gpt-5-mini)、[`gpt-5-nano`](https://platform.openai.com/docs/models/gpt-5-nano))を使用する場合、SDK は既定で妥当な `ModelSettings` を適用します。具体的には、`reasoning.effort` と `verbosity` の両方を `"low"` に設定します。これらの設定を自分で構成したい場合は、`agents.models.get_default_model_settings("gpt-5")` を呼び出してください。 + +より低レイテンシや特定の要件のために、別のモデルや設定を選択できます。デフォルトモデルの reasoning 努力度を調整するには、独自の `ModelSettings` を渡します。 + +```python +from openai.types.shared import Reasoning +from agents import Agent, ModelSettings + +my_agent = Agent( + name="My Agent", + instructions="You're a helpful agent.", + model_settings=ModelSettings(reasoning=Reasoning(effort="minimal"), verbosity="low") + # If OPENAI_DEFAULT_MODEL=gpt-5 is set, passing only model_settings works. + # It's also fine to pass a GPT-5 model name explicitly: + # model="gpt-5", +) +``` + +特にレイテンシを下げたい場合は、[`gpt-5-mini`](https://platform.openai.com/docs/models/gpt-5-mini) または [`gpt-5-nano`](https://platform.openai.com/docs/models/gpt-5-nano) に `reasoning.effort="minimal"` を指定すると、デフォルト設定より高速に応答が返ることがよくあります。ただし、Responses API の一部の組み込みツール(ファイル検索や画像生成など)は `"minimal"` の reasoning 努力度をサポートしていません。そのため、この Agents SDK ではデフォルトを `"low"` にしています。 + +#### 非 GPT-5 モデル + +カスタムの `model_settings` なしで GPT-5 以外のモデル名を渡した場合、SDK は任意のモデルと互換性のある汎用的な `ModelSettings` にフォールバックします。 ## 非 OpenAI モデル -ほとんどの非 OpenAI モデルは [LiteLLM インテグレーション](./litellm.md) 経由で利用できます。まず、litellm 依存グループをインストールします: +[LiteLLM 連携](./litellm.md)を通じて、ほとんどの他社製(非 OpenAI)モデルを使用できます。まず、litellm の依存関係グループをインストールします。 ```bash pip install "openai-agents[litellm]" ``` -次に、`litellm/` 接頭辞を付けて任意の [サポート対象モデル](https://docs.litellm.ai/docs/providers) を使用します: +次に、`litellm/` プレフィックスを付けて [サポート対象モデル](https://docs.litellm.ai/docs/providers) を使用します。 ```python claude_agent = Agent(model="litellm/anthropic/claude-3-5-sonnet-20240620", ...) @@ -26,30 +67,29 @@ gemini_agent = Agent(model="litellm/gemini/gemini-2.5-flash-preview-04-17", ...) ### 非 OpenAI モデルを利用するその他の方法 -他の LLM プロバイダーを統合する方法は、あと 3 つあります([こちら](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers/) に例があります)。 +他の LLM プロバイダーは、さらに 3 つの方法で統合できます(code examples は[こちら](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers/))。 -1. [`set_default_openai_client`][agents.set_default_openai_client] - `AsyncOpenAI` インスタンスを LLM クライアントとしてグローバルに使用したい場合に便利です。LLM プロバイダーが OpenAI 互換の API エンドポイントを持ち、`base_url` と `api_key` を設定できる場合に使用します。設定例は [examples/model_providers/custom_example_global.py](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers/custom_example_global.py) にあります。 -2. [`ModelProvider`][agents.models.interface.ModelProvider] - `Runner.run` レベルでカスタムモデルプロバイダーを指定できます。これにより「この run のすべてのエージェントでカスタムプロバイダーを使う」と宣言できます。設定例は [examples/model_providers/custom_example_provider.py](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers/custom_example_provider.py) にあります。 -3. [`Agent.model`][agents.agent.Agent.model] - 特定のエージェントインスタンスにモデルを指定できます。エージェントごとに異なるプロバイダーを組み合わせることが可能です。設定例は [examples/model_providers/custom_example_agent.py](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers/custom_example_agent.py) にあります。ほとんどのモデルを簡単に利用する方法として [LiteLLM インテグレーション](./litellm.md) を利用できます。 +1. [`set_default_openai_client`][agents.set_default_openai_client] は、LLM クライアントとして `AsyncOpenAI` のインスタンスをグローバルに使用したい場合に便利です。これは、LLM プロバイダーに OpenAI 互換の API エンドポイントがあり、`base_url` と `api_key` を設定できる場合に有効です。設定可能な例は [examples/model_providers/custom_example_global.py](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers/custom_example_global.py) を参照してください。 +2. [`ModelProvider`][agents.models.interface.ModelProvider] は `Runner.run` レベルにあります。これにより、「この実行でのすべてのエージェントにカスタムのモデルプロバイダーを使用する」と指定できます。設定可能な例は [examples/model_providers/custom_example_provider.py](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers/custom_example_provider.py) を参照してください。 +3. [`Agent.model`][agents.agent.Agent.model] を使うと、特定の Agent インスタンスに対してモデルを指定できます。これにより、エージェントごとに異なるプロバイダーを組み合わせて利用できます。設定可能な例は [examples/model_providers/custom_example_agent.py](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers/custom_example_agent.py) を参照してください。ほとんどの利用可能なモデルを簡単に使う方法として、[LiteLLM 連携](./litellm.md)を利用できます。 -`platform.openai.com` の API キーを持っていない場合は、`set_tracing_disabled()` でトレーシングを無効化するか、[別のトレーシングプロセッサー](../tracing.md) を設定することをお勧めします。 +`platform.openai.com` の API キーがない場合は、`set_tracing_disabled()` でトレーシングを無効化するか、[別のトレーシング プロセッサー](../tracing.md)を設定することをおすすめします。 !!! note - これらの例では、Responses API をまだサポートしていない LLM プロバイダーが多いため、Chat Completions API/モデルを使用しています。LLM プロバイダーが Responses API をサポートしている場合は、Responses を使用することを推奨します。 + + これらの例では Chat Completions API/モデルを使用しています。これは、多くの LLM プロバイダーがまだ Responses API をサポートしていないためです。LLM プロバイダーがサポートしている場合は、Responses の使用をおすすめします。 ## モデルの組み合わせ -1 つのワークフロー内でエージェントごとに異なるモデルを使用したい場合があります。たとえば、振り分けには小さく高速なモデルを、複雑なタスクには大きく高性能なモデルを使用するといったケースです。[`Agent`][agents.Agent] を設定する際、次のいずれかの方法でモデルを選択できます。 +単一のワークフロー内で、エージェントごとに異なるモデルを使いたい場合があります。例えば、トリアージには小型で高速なモデルを使い、複雑なタスクには大規模で高性能なモデルを使うといった具合です。[`Agent`][agents.Agent] を設定する際、次のいずれかの方法で特定のモデルを選べます。 -1. モデル名を直接指定する -2. 任意のモデル名と、その名前を Model インスタンスへマッピングできる [`ModelProvider`][agents.models.interface.ModelProvider] を指定する -3. [`Model`][agents.models.interface.Model] 実装を直接渡す +1. モデル名を渡す。 +2. 任意のモデル名と、それを Model インスタンスにマッピングできる [`ModelProvider`][agents.models.interface.ModelProvider] を渡す。 +3. [`Model`][agents.models.interface.Model] 実装を直接渡す。 !!!note - SDK は [`OpenAIResponsesModel`][agents.models.openai_responses.OpenAIResponsesModel] と [`OpenAIChatCompletionsModel`][agents.models.openai_chatcompletions.OpenAIChatCompletionsModel] の両形態をサポートしていますが、各ワークフローで 1 つのモデル形態に統一することを推奨します。2 つの形態はサポートする機能とツールが異なるためです。混在させる場合は、使用する機能が双方で利用可能かを必ず確認してください。 + + 当社の SDK は、[`OpenAIResponsesModel`][agents.models.openai_responses.OpenAIResponsesModel] と [`OpenAIChatCompletionsModel`][agents.models.openai_chatcompletions.OpenAIChatCompletionsModel] の両方の形に対応していますが、各ワークフローでは単一のモデル形を使用することをおすすめします。これは両者がサポートする機能やツールのセットが異なるためです。もしワークフローでモデル形の混在が必要な場合は、使用するすべての機能が両方で利用可能であることを確認してください。 ```python from agents import Agent, Runner, AsyncOpenAI, OpenAIChatCompletionsModel @@ -58,14 +98,14 @@ import asyncio spanish_agent = Agent( name="Spanish agent", instructions="You only speak Spanish.", - model="o3-mini", # (1)! + model="gpt-5-mini", # (1)! ) english_agent = Agent( name="English agent", instructions="You only speak English", model=OpenAIChatCompletionsModel( # (2)! - model="gpt-4o", + model="gpt-5-nano", openai_client=AsyncOpenAI() ), ) @@ -74,7 +114,7 @@ triage_agent = Agent( name="Triage agent", instructions="Handoff to the appropriate agent based on the language of the request.", handoffs=[spanish_agent, english_agent], - model="gpt-3.5-turbo", + model="gpt-5", ) async def main(): @@ -82,10 +122,10 @@ async def main(): print(result.final_output) ``` -1. OpenAI のモデル名を直接設定 -2. [`Model`][agents.models.interface.Model] 実装を提供 +1. OpenAI モデルの名前を直接設定します。 +2. [`Model`][agents.models.interface.Model] 実装を提供します。 -エージェントで使用するモデルをさらに構成したい場合は、`temperature` などのオプションパラメーターを指定できる [`ModelSettings`][agents.models.interface.ModelSettings] を渡せます。 +エージェントで使用するモデルをさらに構成したい場合は、[`ModelSettings`][agents.models.interface.ModelSettings] を渡すことで、temperature などのオプションのモデル構成パラメーターを指定できます。 ```python from agents import Agent, ModelSettings @@ -93,12 +133,12 @@ from agents import Agent, ModelSettings english_agent = Agent( name="English agent", instructions="You only speak English", - model="gpt-4o", + model="gpt-4.1", model_settings=ModelSettings(temperature=0.1), ) ``` -OpenAI の Responses API を使用する場合、`user` や `service_tier` など[その他のオプションパラメーター](https://platform.openai.com/docs/api-reference/responses/create) があります。トップレベルで指定できない場合は、`extra_args` で渡してください。 +また、OpenAI の Responses API を使用する場合、[他にもいくつかの任意パラメーター](https://platform.openai.com/docs/api-reference/responses/create)(例: `user`、`service_tier` など)があります。トップレベルで指定できない場合は、`extra_args` を使って渡すこともできます。 ```python from agents import Agent, ModelSettings @@ -106,7 +146,7 @@ from agents import Agent, ModelSettings english_agent = Agent( name="English agent", instructions="You only speak English", - model="gpt-4o", + model="gpt-4.1", model_settings=ModelSettings( temperature=0.1, extra_args={"service_tier": "flex", "user": "user_12345"}, @@ -116,27 +156,24 @@ english_agent = Agent( ## 他の LLM プロバイダー使用時の一般的な問題 -### Tracing クライアントの 401 エラー +### トレーシング クライアント エラー 401 -Tracing 関連のエラーが発生する場合、トレースは OpenAI サーバーへアップロードされるため、OpenAI API キーが必要です。対応方法は次の 3 つです。 +トレーシング関連のエラーが発生する場合、トレースは OpenAI のサーバーにアップロードされるためであり、OpenAI の API キーがないことが原因です。解決するには次の 3 つの選択肢があります。 -1. トレーシングを完全に無効化する: [`set_tracing_disabled(True)`][agents.set_tracing_disabled] -2. トレース用に OpenAI キーを設定する: [`set_tracing_export_api_key(...)`][agents.set_tracing_export_api_key] - この API キーはトレースのアップロードのみに使用され、[platform.openai.com](https://platform.openai.com/) で取得したものが必要です。 -3. OpenAI 以外のトレースプロセッサーを使用する。詳細は [tracing のドキュメント](../tracing.md#custom-tracing-processors) を参照してください。 +1. トレーシングを完全に無効化する: [`set_tracing_disabled(True)`][agents.set_tracing_disabled]。 +2. トレーシング用に OpenAI のキーを設定する: [`set_tracing_export_api_key(...)`][agents.set_tracing_export_api_key]。この API キーはトレースのアップロードのみに使用され、[platform.openai.com](https://platform.openai.com/) のものを使用する必要があります。 +3. OpenAI 以外のトレース プロセッサーを使用する。[トレーシング ドキュメント](../tracing.md#custom-tracing-processors)を参照してください。 ### Responses API のサポート -SDK はデフォルトで Responses API を使用しますが、ほとんどの LLM プロバイダーはまだ非対応です。その結果、404 などのエラーが発生することがあります。対処方法は次の 2 つです。 +SDK はデフォルトで Responses API を使用しますが、多くの他社 LLM プロバイダーはまだ非対応です。その結果、404 などの問題が発生することがあります。解決策は次の 2 つです。 -1. [`set_default_openai_api("chat_completions")`][agents.set_default_openai_api] を呼び出す - `OPENAI_API_KEY` と `OPENAI_BASE_URL` を環境変数で設定している場合に有効です。 -2. [`OpenAIChatCompletionsModel`][agents.models.openai_chatcompletions.OpenAIChatCompletionsModel] を使用する - 例は [こちら](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers/) にあります。 +1. [`set_default_openai_api("chat_completions")`][agents.set_default_openai_api] を呼び出します。これは環境変数で `OPENAI_API_KEY` と `OPENAI_BASE_URL` を設定している場合に機能します。 +2. [`OpenAIChatCompletionsModel`][agents.models.openai_chatcompletions.OpenAIChatCompletionsModel] を使用します。code examples は[こちら](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers/)にあります。 ### structured outputs のサポート -一部のモデルプロバイダーは [structured outputs](https://platform.openai.com/docs/guides/structured-outputs) をサポートしていません。その場合、次のようなエラーが発生することがあります。 +一部のモデルプロバイダーは [structured outputs](https://platform.openai.com/docs/guides/structured-outputs) をサポートしていません。このため、次のようなエラーが発生することがあります。 ``` @@ -144,12 +181,12 @@ BadRequestError: Error code: 400 - {'error': {'message': "'response_format.type' ``` -これは一部プロバイダーの制限で、JSON 出力自体はサポートしていても `json_schema` を指定できないことが原因です。修正に向けて取り組んでいますが、JSON スキーマ出力をサポートしているプロバイダーを使用することをお勧めします。そうでないと、不正な JSON が返されてアプリが頻繁に壊れる可能性があります。 +これは一部のモデルプロバイダーの制約で、JSON 出力はサポートしていても、出力に使用する `json_schema` を指定できません。現在この問題の修正に取り組んでいますが、JSON schema 出力をサポートするプロバイダーを利用することをおすすめします。そうでない場合、不正な JSON によりアプリが頻繁に壊れてしまいます。 -## プロバイダーを跨いだモデルの組み合わせ +## プロバイダー間でのモデルの組み合わせ -モデルプロバイダーごとの機能差に注意しないと、エラーが発生します。たとえば OpenAI は structured outputs、マルチモーダル入力、ホスト型の file search や web search をサポートしていますが、多くの他プロバイダーは非対応です。以下の制限に留意してください。 +モデルプロバイダー間の機能差に注意しないと、エラーが発生する可能性があります。例えば、OpenAI は structured outputs、マルチモーダル入力、ホスト型のファイル検索と Web 検索をサポートしますが、多くの他社プロバイダーはこれらの機能をサポートしていません。次の制限に注意してください。 -- 対応していないプロバイダーには未サポートの `tools` を送らない -- テキストのみのモデルを呼び出す前にマルチモーダル入力を除外する -- structured JSON 出力をサポートしていないプロバイダーでは、不正な JSON が返ることがある点に注意する \ No newline at end of file +- サポートされていない `tools` を理解しないプロバイダーに送らないでください +- テキスト専用のモデルを呼び出す前に、マルチモーダル入力を除外してください +- structured JSON 出力をサポートしないプロバイダーは、無効な JSON を出力することがあります \ No newline at end of file diff --git a/docs/ja/models/litellm.md b/docs/ja/models/litellm.md index 651d7a51b..cd6ac3f47 100644 --- a/docs/ja/models/litellm.md +++ b/docs/ja/models/litellm.md @@ -2,33 +2,33 @@ search: exclude: true --- -# LiteLLM 経由でのモデル利用 +# LiteLLM 経由での任意モデルの利用 !!! note - LiteLLM との統合は現在ベータ版です。特に小規模なモデルプロバイダーでは問題が発生する可能性があります。問題を見つけた場合は、[GitHub Issues](https://github.com/openai/openai-agents-python/issues) からご報告ください。迅速に対応いたします。 + LiteLLM 連携はベータ版です。特に小規模なモデルプロバイダーでは問題が発生する可能性があります。問題があれば [GitHub issues](https://github.com/openai/openai-agents-python/issues) からご報告ください。迅速に対応します。 -[LiteLLM](https://docs.litellm.ai/docs/) は、1 つのインターフェースで 100 以上のモデルを利用できるライブラリです。Agents SDK では LiteLLM との統合により、任意の AI モデルを使用できます。 +[LiteLLM](https://docs.litellm.ai/docs/) は、単一のインターフェースで 100+ のモデルを利用できるライブラリです。Agents SDK に LiteLLM 連携を追加し、任意の AI モデルを利用できるようにしました。 ## セットアップ -`litellm` がインストールされていることを確認してください。オプションの `litellm` 依存関係グループをインストールすることで対応できます。 +`litellm` を利用可能にする必要があります。オプションの `litellm` 依存関係グループをインストールしてください。 ```bash pip install "openai-agents[litellm]" ``` -インストール後、任意のエージェントで [`LitellmModel`][agents.extensions.models.litellm_model.LitellmModel] を利用できます。 +完了したら、任意の エージェント で [`LitellmModel`][agents.extensions.models.litellm_model.LitellmModel] を使用できます。 ## 例 -以下は動作する完全なサンプルです。実行するとモデル名と API キーの入力を求められます。例えば次のように入力できます。 +これは完全に動作する例です。実行すると、モデル名と API キーの入力を求められます。例えば次のように入力できます。 -- `openai/gpt-4.1` をモデル名に、OpenAI API キーを入力 -- `anthropic/claude-3-5-sonnet-20240620` をモデル名に、Anthropic API キーを入力 -- その他 +- モデルに `openai/gpt-4.1`、API キーにあなたの OpenAI API キー +- モデルに `anthropic/claude-3-5-sonnet-20240620`、API キーにあなたの Anthropic API キー +- など -LiteLLM でサポートされているモデルの全リストは、[litellm providers docs](https://docs.litellm.ai/docs/providers) を参照してください。 +LiteLLM でサポートされているモデルの一覧は、[litellm のプロバイダードキュメント](https://docs.litellm.ai/docs/providers) を参照してください。 ```python from __future__ import annotations @@ -74,4 +74,21 @@ if __name__ == "__main__": api_key = input("Enter an API key for Litellm: ") asyncio.run(main(model, api_key)) -``` \ No newline at end of file +``` + +## 使用状況データのトラッキング + +LiteLLM のレスポンスで Agents SDK の使用状況メトリクスを埋めたい場合は、エージェント作成時に `ModelSettings(include_usage=True)` を渡してください。 + +```python +from agents import Agent, ModelSettings +from agents.extensions.models.litellm_model import LitellmModel + +agent = Agent( + name="Assistant", + model=LitellmModel(model="your/model", api_key="..."), + model_settings=ModelSettings(include_usage=True), +) +``` + +`include_usage=True` の場合、LiteLLM のリクエストは、組み込みの OpenAI モデルと同様に、`result.context_wrapper.usage` を通じてトークン数とリクエスト数を報告します。 \ No newline at end of file diff --git a/docs/ja/multi_agent.md b/docs/ja/multi_agent.md index a179fed36..dc2c279af 100644 --- a/docs/ja/multi_agent.md +++ b/docs/ja/multi_agent.md @@ -2,40 +2,40 @@ search: exclude: true --- -# 複数エージェントのオーケストレーション +# 複数のエージェントのオーケストレーション -オーケストレーションとは、アプリ内でエージェントがどのように流れるかを指します。どのエージェントが、どの順序で実行され、その後どう決定するかを制御します。エージェントをオーケストレーションする主な方法は次の 2 つです。 +オーケストレーションとは、アプリ内でのエージェントの流れを指します。どのエージェントを、どの順番で実行し、次に何をするかをどのように決めるのか。エージェントをオーケストレーションする主な方法は 2 つあります。 -1. LLM に判断させる: LLM の知能を活用し、計画・推論を行い、その結果に基づいて次のステップを決定します。 -2. コードでオーケストレーションする: コード側でエージェントの流れを定義します。 +1. LLM に意思決定させる: LLM の知性を活用して計画・推論し、それに基づいて取るべきステップを決めます。 +2. コードでオーケストレーションする: コードでエージェントの流れを決定します。 -これらのパターンは組み合わせて使用できます。それぞれにトレードオフがあり、以下で説明します。 +これらのパターンは組み合わせ可能です。それぞれにトレードオフがあり、以下で説明します。 ## LLM によるオーケストレーション -エージェントとは、 instructions、ツール、ハンドオフを備えた LLM です。オープンエンドなタスクが与えられた場合、 LLM はタスクをどのように進めるかを自律的に計画し、ツールを使ってアクションやデータ取得を行い、ハンドオフでサブエージェントへタスクを委譲できます。たとえば、リサーチエージェントには次のようなツールを装備できます。 +エージェントとは、instructions、tools、ハンドオフを備えた LLM です。これは、オープンエンドなタスクが与えられたときに、LLM が自律的に計画を立て、ツールを使ってアクションやデータ取得を行い、ハンドオフでサブエージェントにタスクを委譲できることを意味します。例えば、リサーチエージェントには次のようなツールを備えられます。 -- Web 検索でオンライン情報を取得する -- ファイル検索で独自データや接続を調べる -- コンピュータ操作でコンピュータ上のアクションを実行する -- コード実行でデータ分析を行う -- 計画立案やレポート作成などに長けた専門エージェントへのハンドオフ +- Web 検索でオンラインの情報を見つける +- ファイル検索と取得でプロプライエタリなデータや接続を検索する +- コンピュータ操作でコンピュータ上のアクションを実行する +- コード実行でデータ分析を行う +- 計画立案やレポート作成などに優れた専門エージェントへのハンドオフ -このパターンはタスクがオープンエンドで、 LLM の知能に頼りたい場合に最適です。重要な戦術は次のとおりです。 +このパターンは、タスクがオープンエンドで、LLM の知性に依存したい場合に適しています。ここで重要な戦術は次のとおりです。 -1. 良いプロンプトに投資する。利用可能なツール、使い方、守るべきパラメーターを明確に示します。 -2. アプリを監視し、改善を繰り返す。問題が起きた箇所を特定し、プロンプトを改善します。 -3. エージェントに内省と改善を許可する。たとえばループで実行し自己批評させたり、エラーメッセージを渡して修正させたりします。 -4. 何でもこなす汎用エージェントより、特定タスクに特化したエージェントを用意します。 -5. [evals](https://platform.openai.com/docs/guides/evals) に投資する。これによりエージェントを訓練し、タスク性能を向上できます。 +1. 良いプロンプトに投資する。利用可能なツール、その使い方、そしてどのパラメーター内で動作しなければならないかを明確にします。 +2. アプリを監視し、反復改善する。問題が起きる箇所を特定し、プロンプトを改善します。 +3. エージェントに内省と改善を許可する。例えば、ループで実行して自己批評させる、またはエラーメッセージを提示して改善させます。 +4. 何でもこなす汎用エージェントではなく、1 つのタスクに長けた専門エージェントを用意します。 +5. [評価 (evals)](https://platform.openai.com/docs/guides/evals) に投資する。これにより、エージェントを訓練してタスク遂行能力を高められます。 ## コードによるオーケストレーション -LLM によるオーケストレーションは強力ですが、コードでオーケストレーションすると速度・コスト・性能の面でより決定的かつ予測可能になります。よく使われるパターンは次のとおりです。 +LLM によるオーケストレーションは強力ですが、コードによるオーケストレーションは、速度・コスト・性能の観点でより決定論的かつ予測可能になります。一般的なパターンは次のとおりです。 -- [structured outputs](https://platform.openai.com/docs/guides/structured-outputs) を使って、コード側で検査できる 適切な形式のデータ を生成する。たとえばエージェントにタスクをいくつかのカテゴリーに分類させ、そのカテゴリーに応じて次のエージェントを選択します。 -- あるエージェントの出力を次のエージェントの入力に変換して複数エージェントをチェーンする。ブログ記事執筆を「リサーチ → アウトライン作成 → 記事執筆 → 批評 → 改善」という一連のステップに分解できます。 -- タスクを実行するエージェントを `while` ループで回し、評価とフィードバックを行うエージェントと組み合わせ、評価者が基準を満たしたと判断するまで繰り返します。 -- `asyncio.gather` など Python の基本コンポーネントを用いて複数エージェントを並列実行する。互いに依存しない複数タスクがある場合に高速化できます。 +- [structured outputs](https://platform.openai.com/docs/guides/structured-outputs) を使って、コードで検査可能な 適切な形式のデータ を生成する。例えば、エージェントにタスクをいくつかのカテゴリーに分類させ、そのカテゴリーに基づいて次のエージェントを選ぶといった使い方ができます。 +- あるエージェントの出力を次のエージェントの入力に変換して、複数のエージェントを連結する。ブログ記事の作成タスクを、調査、アウトライン作成、本文執筆、批評、改善といった一連のステップに分解できます。 +- エージェントを `while` ループで実行し、もう一方のエージェントが評価とフィードバックを提供し、評価者が出力が特定の基準を満たしたと判断するまで繰り返す。 +- 複数のエージェントを並列に実行する(例: `asyncio.gather` のような Python の基本コンポーネントを利用)。互いに依存しない複数タスクがある場合に速度向上に有用です。 -[`examples/agent_patterns`](https://github.com/openai/openai-agents-python/tree/main/examples/agent_patterns) には多数のコード例があります。 \ No newline at end of file +[`examples/agent_patterns`](https://github.com/openai/openai-agents-python/tree/main/examples/agent_patterns) に多数の code examples があります。 \ No newline at end of file diff --git a/docs/ja/quickstart.md b/docs/ja/quickstart.md index 30c3219d7..1e06d8b1d 100644 --- a/docs/ja/quickstart.md +++ b/docs/ja/quickstart.md @@ -6,7 +6,7 @@ search: ## プロジェクトと仮想環境の作成 -これは一度だけ行えば十分です。 +これは一度だけ実行すれば十分です。 ```bash mkdir my_project @@ -16,7 +16,7 @@ python -m venv .venv ### 仮想環境の有効化 -新しいターミナルセッションを開始するたびに実行してください。 +新しいターミナル セッションを開始するたびに実行します。 ```bash source .venv/bin/activate @@ -30,7 +30,7 @@ pip install openai-agents # or `uv add openai-agents`, etc ### OpenAI API キーの設定 -まだお持ちでない場合は、[こちらの手順](https://platform.openai.com/docs/quickstart#create-and-export-an-api-key)に従って OpenAI API キーを作成してください。 +お持ちでない場合は、[こちらの手順](https://platform.openai.com/docs/quickstart#create-and-export-an-api-key)に従って OpenAI API キーを作成してください。 ```bash export OPENAI_API_KEY=sk-... @@ -38,7 +38,7 @@ export OPENAI_API_KEY=sk-... ## 最初のエージェントの作成 -エージェントは instructions 、名前、`model_config` などのオプション設定で定義します。 +エージェントは、instructions、名前、任意の設定(`model_config` など)で定義します。 ```python from agents import Agent @@ -49,9 +49,9 @@ agent = Agent( ) ``` -## さらにエージェントを追加 +## いくつかのエージェントの追加 -追加のエージェントも同様の方法で定義できます。`handoff_descriptions` はハンドオフのルーティングを判断するための追加コンテキストを提供します。 +追加のエージェントも同様に定義できます。`handoff_descriptions` は、ハンドオフのルーティングを判断するための追加コンテキストを提供します。 ```python from agents import Agent @@ -71,7 +71,7 @@ math_tutor_agent = Agent( ## ハンドオフの定義 -各エージェントに対して、タスクを進める際に選択できるハンドオフ先の一覧を定義できます。 +各エージェントごとに、タスクを進めるために選択できる送信先ハンドオフ オプションの一覧を定義できます。 ```python triage_agent = Agent( @@ -81,9 +81,9 @@ triage_agent = Agent( ) ``` -## エージェントオーケストレーションの実行 +## エージェントのオーケストレーションの実行 -ワークフローが実行され、トリアージエージェントが 2 つの専門エージェント間で正しくルーティングすることを確認しましょう。 +ワークフローが実行され、トリアージ エージェントが 2 つの専門エージェント間を正しくルーティングすることを確認しましょう。 ```python from agents import Runner @@ -95,12 +95,13 @@ async def main(): ## ガードレールの追加 -入力または出力に対して実行されるカスタムガードレールを定義できます。 +入力または出力に対して実行するカスタム ガードレールを定義できます。 ```python from agents import GuardrailFunctionOutput, Agent, Runner from pydantic import BaseModel + class HomeworkOutput(BaseModel): is_homework: bool reasoning: str @@ -120,12 +121,13 @@ async def homework_guardrail(ctx, agent, input_data): ) ``` -## すべてをまとめる +## すべてを組み合わせる -ハンドオフと入力ガードレールを組み合わせて、ワークフロー全体を実行してみましょう。 +ハンドオフと入力ガードレールを使って、すべてを組み合わせたワークフロー全体を実行しましょう。 ```python from agents import Agent, InputGuardrail, GuardrailFunctionOutput, Runner +from agents.exceptions import InputGuardrailTripwireTriggered from pydantic import BaseModel import asyncio @@ -170,11 +172,19 @@ triage_agent = Agent( ) async def main(): - result = await Runner.run(triage_agent, "who was the first president of the united states?") - print(result.final_output) - - result = await Runner.run(triage_agent, "what is life") - print(result.final_output) + # Example 1: History question + try: + result = await Runner.run(triage_agent, "who was the first president of the united states?") + print(result.final_output) + except InputGuardrailTripwireTriggered as e: + print("Guardrail blocked this input:", e) + + # Example 2: General/philosophical question + try: + result = await Runner.run(triage_agent, "What is the meaning of life?") + print(result.final_output) + except InputGuardrailTripwireTriggered as e: + print("Guardrail blocked this input:", e) if __name__ == "__main__": asyncio.run(main()) @@ -182,12 +192,12 @@ if __name__ == "__main__": ## トレースの表示 -エージェントの実行内容を確認するには、[OpenAI ダッシュボードの Trace viewer](https://platform.openai.com/traces) に移動してトレースを閲覧してください。 +エージェントの実行中に何が起きたかを確認するには、[OpenAI ダッシュボードの Trace viewer](https://platform.openai.com/traces) に移動し、エージェント実行のトレースを表示します。 ## 次のステップ -より複雑なエージェントフローの構築方法を学びましょう。 +さらに複雑なエージェント フローの構築方法を学びましょう: -- [エージェント](agents.md) の設定方法を学ぶ。 -- [エージェントの実行](running_agents.md) について学ぶ。 -- [ツール](tools.md)、[ガードレール](guardrails.md)、[モデル](models/index.md) について学ぶ。 \ No newline at end of file +- [エージェント](agents.md) の設定について学ぶ。 +- [エージェントの実行](running_agents.md) について学ぶ。 +- [ツール](tools.md)、[ガードレール](guardrails.md)、[モデル](models/index.md) について学ぶ。 \ No newline at end of file diff --git a/docs/ja/realtime/guide.md b/docs/ja/realtime/guide.md new file mode 100644 index 000000000..56ddc44ef --- /dev/null +++ b/docs/ja/realtime/guide.md @@ -0,0 +1,176 @@ +--- +search: + exclude: true +--- +# ガイド + +このガイドでは、OpenAI Agents SDK の realtime 機能を用いて音声対応の AI エージェントを構築する方法を詳しく説明します。 + +!!! warning "Beta feature" +Realtime エージェントはベータ版です。実装の改善に伴い破壊的変更が入る可能性があります。 + +## 概要 + +Realtime エージェントは会話のフローを実現し、音声およびテキスト入力をリアルタイムに処理して realtime 音声で応答します。OpenAI の Realtime API との永続接続を維持し、低レイテンシで自然な音声会話と、割り込みへの優雅な対応を可能にします。 + +## アーキテクチャ + +### コアコンポーネント + +realtime システムは次の主要コンポーネントで構成されます。 + +- **RealtimeAgent** : instructions、tools、handoffs を設定したエージェント +- **RealtimeRunner** : 構成を管理します。`runner.run()` を呼び出すとセッションを取得できます。 +- **RealtimeSession** : 単一の対話セッション。通常、ユーザーが会話を開始するたびに作成し、会話が終了するまで維持します。 +- **RealtimeModel** : 基盤となるモデルインターフェース(一般的には OpenAI の WebSocket 実装) + +### セッションフロー + +一般的な realtime セッションは次の流れで進みます。 + +1. **RealtimeAgent を作成** し、instructions、tools、handoffs を設定します。 +2. **RealtimeRunner をセットアップ** し、エージェントと構成オプションを渡します。 +3. `await runner.run()` を使って **セッションを開始** し、RealtimeSession を取得します。 +4. `send_audio()` または `send_message()` を使って **音声またはテキストメッセージを送信** します。 +5. セッションを反復処理して **イベントを受信** します。イベントには音声出力、書き起こし、ツール呼び出し、ハンドオフ、エラーが含まれます。 +6. ユーザーがエージェントの発話に被せたときに **割り込みを処理** します。これにより現在の音声生成が自動的に停止します。 + +セッションは会話履歴を保持し、realtime モデルとの永続接続を管理します。 + +## エージェントの設定 + +RealtimeAgent は通常の Agent クラスと同様に動作しますが、いくつか重要な違いがあります。完全な API の詳細は、[`RealtimeAgent`][agents.realtime.agent.RealtimeAgent] の API リファレンスをご覧ください。 + +通常のエージェントとの主な相違点: + +- モデルの選択はエージェントレベルではなくセッションレベルで構成します。 +- structured output のサポートはありません(`outputType` は非対応)。 +- 声質はエージェントごとに設定できますが、最初のエージェントが話し始めた後は変更できません。 +- tools、handoffs、instructions などのその他の機能は同様に動作します。 + +## セッションの設定 + +### モデル設定 + +セッション設定では基盤となる realtime モデルの動作を制御できます。モデル名(例: `gpt-realtime`)、声の選択(alloy、echo、fable、onyx、nova、shimmer)、サポートするモダリティ(テキストおよび/または音声)を構成できます。音声フォーマットは入力と出力の両方で設定でき、既定は PCM16 です。 + +### 音声設定 + +音声設定では、セッションが音声入力と出力をどのように処理するかを制御します。Whisper のようなモデルで入力音声の書き起こしを構成し、言語設定や、ドメイン固有用語の精度を高めるための書き起こしプロンプトを指定できます。ターン検出設定では、エージェントがいつ応答を開始・停止すべきかを制御し、音声活動検出のしきい値、無音の長さ、検出音声の前後パディングなどのオプションがあります。 + +## ツールと関数 + +### ツールの追加 + +通常のエージェントと同様に、realtime エージェントは会話中に実行される 関数ツール をサポートします。 + +```python +from agents import function_tool + +@function_tool +def get_weather(city: str) -> str: + """Get current weather for a city.""" + # Your weather API logic here + return f"The weather in {city} is sunny, 72°F" + +@function_tool +def book_appointment(date: str, time: str, service: str) -> str: + """Book an appointment.""" + # Your booking logic here + return f"Appointment booked for {service} on {date} at {time}" + +agent = RealtimeAgent( + name="Assistant", + instructions="You can help with weather and appointments.", + tools=[get_weather, book_appointment], +) +``` + +## ハンドオフ + +### ハンドオフの作成 + +ハンドオフにより、専門化されたエージェント間で会話を転送できます。 + +```python +from agents.realtime import realtime_handoff + +# Specialized agents +billing_agent = RealtimeAgent( + name="Billing Support", + instructions="You specialize in billing and payment issues.", +) + +technical_agent = RealtimeAgent( + name="Technical Support", + instructions="You handle technical troubleshooting.", +) + +# Main agent with handoffs +main_agent = RealtimeAgent( + name="Customer Service", + instructions="You are the main customer service agent. Hand off to specialists when needed.", + handoffs=[ + realtime_handoff(billing_agent, tool_description="Transfer to billing support"), + realtime_handoff(technical_agent, tool_description="Transfer to technical support"), + ] +) +``` + +## イベント処理 + +セッションはストリーミングでイベントを送出します。セッションオブジェクトを反復処理してリッスンできます。イベントには、音声出力チャンク、書き起こし結果、ツール実行の開始と終了、エージェントのハンドオフ、エラーなどが含まれます。主に処理すべきイベントは次のとおりです。 + +- **audio** : エージェントの応答からの raw 音声データ +- **audio_end** : エージェントの発話が完了 +- **audio_interrupted** : ユーザーがエージェントを割り込み +- **tool_start/tool_end** : ツール実行のライフサイクル +- **handoff** : エージェントのハンドオフが発生 +- **error** : 処理中にエラーが発生 + +完全なイベントの詳細は、[`RealtimeSessionEvent`][agents.realtime.events.RealtimeSessionEvent] を参照してください。 + +## ガードレール + +realtime エージェントでサポートされるのは出力ガードレールのみです。これらのガードレールはデバウンスされ、リアルタイム生成中のパフォーマンス問題を避けるために(毎語ではなく)定期的に実行されます。既定のデバウンス長は 100 文字ですが、構成可能です。 + +ガードレールは `RealtimeAgent` に直接アタッチするか、セッションの `run_config` を通じて提供できます。両方のソースからのガードレールは併用されます。 + +```python +from agents.guardrail import GuardrailFunctionOutput, OutputGuardrail + +def sensitive_data_check(context, agent, output): + return GuardrailFunctionOutput( + tripwire_triggered="password" in output, + output_info=None, + ) + +agent = RealtimeAgent( + name="Assistant", + instructions="...", + output_guardrails=[OutputGuardrail(guardrail_function=sensitive_data_check)], +) +``` + +ガードレールがトリガーされると、`guardrail_tripped` イベントが生成され、エージェントの現在の応答を割り込むことがあります。デバウンス動作により、安全性とリアルタイム性能要件のバランスを取ります。テキストエージェントと異なり、realtime エージェントはガードレールが作動しても Exception を **発生させません**。 + +## 音声処理 + +[`session.send_audio(audio_bytes)`][agents.realtime.session.RealtimeSession.send_audio] を使って音声を送信するか、[`session.send_message()`][agents.realtime.session.RealtimeSession.send_message] を使ってテキストを送信します。 + +音声出力については、`audio` イベントをリッスンして、任意の音声ライブラリで再生します。ユーザーがエージェントを割り込んだときに即座に再生を停止し、キューにある音声をクリアするために、`audio_interrupted` イベントを確実にリッスンしてください。 + +## 直接的なモデルアクセス + +基盤となるモデルにアクセスして、カスタムリスナーの追加や高度な操作を実行できます。 + +```python +# Add a custom listener to the model +session.model.add_listener(my_custom_listener) +``` + +これにより、接続を低レベルで制御する必要がある高度なユースケース向けに、[`RealtimeModel`][agents.realtime.model.RealtimeModel] インターフェースへ直接アクセスできます。 + +## 例 + +完全に動作するサンプルは、UI コンポーネントの有無それぞれのデモを含む [examples/realtime ディレクトリ](https://github.com/openai/openai-agents-python/tree/main/examples/realtime) をご覧ください。 \ No newline at end of file diff --git a/docs/ja/realtime/quickstart.md b/docs/ja/realtime/quickstart.md new file mode 100644 index 000000000..d759672c7 --- /dev/null +++ b/docs/ja/realtime/quickstart.md @@ -0,0 +1,232 @@ +--- +search: + exclude: true +--- +# クイックスタート + +リアルタイム エージェントは、OpenAI の Realtime API を使用して AI エージェントとの音声会話を可能にします。このガイドでは、最初のリアルタイム音声エージェントの作成手順を説明します。 + +!!! warning "ベータ機能" +リアルタイム エージェントはベータ版です。実装を改善する過程で破壊的変更が入る可能性があります。 + +## 前提条件 + +- Python 3.9 以上 +- OpenAI API キー +- OpenAI Agents SDK の基本的な知識 + +## インストール + +まだの場合は、OpenAI Agents SDK をインストールします: + +```bash +pip install openai-agents +``` + +## 最初のリアルタイム エージェントの作成 + +### 1. 必要なコンポーネントのインポート + +```python +import asyncio +from agents.realtime import RealtimeAgent, RealtimeRunner +``` + +### 2. リアルタイム エージェントの作成 + +```python +agent = RealtimeAgent( + name="Assistant", + instructions="You are a helpful voice assistant. Keep your responses conversational and friendly.", +) +``` + +### 3. ランナーのセットアップ + +```python +runner = RealtimeRunner( + starting_agent=agent, + config={ + "model_settings": { + "model_name": "gpt-realtime", + "voice": "ash", + "modalities": ["audio"], + "input_audio_format": "pcm16", + "output_audio_format": "pcm16", + "input_audio_transcription": {"model": "gpt-4o-mini-transcribe"}, + "turn_detection": {"type": "semantic_vad", "interrupt_response": True}, + } + } +) +``` + +### 4. セッションの開始 + +```python +# Start the session +session = await runner.run() + +async with session: + print("Session started! The agent will stream audio responses in real-time.") + # Process events + async for event in session: + try: + if event.type == "agent_start": + print(f"Agent started: {event.agent.name}") + elif event.type == "agent_end": + print(f"Agent ended: {event.agent.name}") + elif event.type == "handoff": + print(f"Handoff from {event.from_agent.name} to {event.to_agent.name}") + elif event.type == "tool_start": + print(f"Tool started: {event.tool.name}") + elif event.type == "tool_end": + print(f"Tool ended: {event.tool.name}; output: {event.output}") + elif event.type == "audio_end": + print("Audio ended") + elif event.type == "audio": + # Enqueue audio for callback-based playback with metadata + # Non-blocking put; queue is unbounded, so drops won’t occur. + pass + elif event.type == "audio_interrupted": + print("Audio interrupted") + # Begin graceful fade + flush in the audio callback and rebuild jitter buffer. + elif event.type == "error": + print(f"Error: {event.error}") + elif event.type == "history_updated": + pass # Skip these frequent events + elif event.type == "history_added": + pass # Skip these frequent events + elif event.type == "raw_model_event": + print(f"Raw model event: {_truncate_str(str(event.data), 200)}") + else: + print(f"Unknown event type: {event.type}") + except Exception as e: + print(f"Error processing event: {_truncate_str(str(e), 200)}") + +def _truncate_str(s: str, max_length: int) -> str: + if len(s) > max_length: + return s[:max_length] + "..." + return s +``` + +## 完全な例 + +以下は動作する完全な例です: + +```python +import asyncio +from agents.realtime import RealtimeAgent, RealtimeRunner + +async def main(): + # Create the agent + agent = RealtimeAgent( + name="Assistant", + instructions="You are a helpful voice assistant. Keep responses brief and conversational.", + ) + # Set up the runner with configuration + runner = RealtimeRunner( + starting_agent=agent, + config={ + "model_settings": { + "model_name": "gpt-realtime", + "voice": "ash", + "modalities": ["audio"], + "input_audio_format": "pcm16", + "output_audio_format": "pcm16", + "input_audio_transcription": {"model": "gpt-4o-mini-transcribe"}, + "turn_detection": {"type": "semantic_vad", "interrupt_response": True}, + } + }, + ) + # Start the session + session = await runner.run() + + async with session: + print("Session started! The agent will stream audio responses in real-time.") + # Process events + async for event in session: + try: + if event.type == "agent_start": + print(f"Agent started: {event.agent.name}") + elif event.type == "agent_end": + print(f"Agent ended: {event.agent.name}") + elif event.type == "handoff": + print(f"Handoff from {event.from_agent.name} to {event.to_agent.name}") + elif event.type == "tool_start": + print(f"Tool started: {event.tool.name}") + elif event.type == "tool_end": + print(f"Tool ended: {event.tool.name}; output: {event.output}") + elif event.type == "audio_end": + print("Audio ended") + elif event.type == "audio": + # Enqueue audio for callback-based playback with metadata + # Non-blocking put; queue is unbounded, so drops won’t occur. + pass + elif event.type == "audio_interrupted": + print("Audio interrupted") + # Begin graceful fade + flush in the audio callback and rebuild jitter buffer. + elif event.type == "error": + print(f"Error: {event.error}") + elif event.type == "history_updated": + pass # Skip these frequent events + elif event.type == "history_added": + pass # Skip these frequent events + elif event.type == "raw_model_event": + print(f"Raw model event: {_truncate_str(str(event.data), 200)}") + else: + print(f"Unknown event type: {event.type}") + except Exception as e: + print(f"Error processing event: {_truncate_str(str(e), 200)}") + +def _truncate_str(s: str, max_length: int) -> str: + if len(s) > max_length: + return s[:max_length] + "..." + return s + +if __name__ == "__main__": + # Run the session + asyncio.run(main()) +``` + +## 構成オプション + +### モデル設定 + +- `model_name`: 使用可能なリアルタイムモデルを選択 (例: `gpt-realtime`) +- `voice`: 音声の選択 (`alloy`, `echo`, `fable`, `onyx`, `nova`, `shimmer`) +- `modalities`: テキストまたは音声を有効化 (`["text"]` または `["audio"]`) + +### 音声設定 + +- `input_audio_format`: 入力音声の形式 (`pcm16`, `g711_ulaw`, `g711_alaw`) +- `output_audio_format`: 出力音声の形式 +- `input_audio_transcription`: 音声書き起こしの設定 + +### ターン検出 + +- `type`: 検出方式 (`server_vad`, `semantic_vad`) +- `threshold`: 音声活動のしきい値 (0.0-1.0) +- `silence_duration_ms`: ターン終了を検出する無音時間 +- `prefix_padding_ms`: 発話前の音声パディング + +## 次のステップ + +- [リアルタイム エージェントの詳細を見る](guide.md) +- 実動する例は [examples/realtime](https://github.com/openai/openai-agents-python/tree/main/examples/realtime) フォルダーを参照してください +- エージェントにツールを追加する +- エージェント間のハンドオフを実装する +- 安全性のためのガードレールを設定する + +## 認証 + +OpenAI API キーが環境に設定されていることを確認してください: + +```bash +export OPENAI_API_KEY="your-api-key-here" +``` + +または、セッション作成時に直接渡します: + +```python +session = await runner.run(model_config={"api_key": "your-api-key"}) +``` \ No newline at end of file diff --git a/docs/ja/release.md b/docs/ja/release.md new file mode 100644 index 000000000..27a32511d --- /dev/null +++ b/docs/ja/release.md @@ -0,0 +1,40 @@ +--- +search: + exclude: true +--- +# リリースプロセス/変更履歴 + +本プロジェクトは、形式 `0.Y.Z` を用いたセマンティック バージョニングの軽微に変更したバージョンに従います。先頭の `0` は、 SDK が依然として急速に進化していることを示します。各コンポーネントの増分は次のとおりです: + +## マイナー (`Y`) バージョン + +ベータとしてマークされていない公開インターフェースに対する **破壊的変更** がある場合、マイナー バージョン `Y` を上げます。たとえば、`0.0.x` から `0.1.x` への変更には破壊的変更が含まれる可能性があります。 + +破壊的変更を避けたい場合は、プロジェクトで `0.0.x` バージョンにピン留めすることをお勧めします。 + +## パッチ (`Z`) バージョン + +破壊的でない変更では `Z` を増やします: + +- バグ修正 +- 新機能 +- 非公開インターフェースへの変更 +- ベータ機能の更新 + +## 破壊的変更の変更履歴 + +### 0.4.0 + +このバージョンでは、[openai](https://pypi.org/project/openai/) パッケージ v1.x はサポート対象外になりました。 この SDK と併せて openai v2.x を使用してください。 + +### 0.3.0 + +このバージョンでは、 Realtime API のサポートが gpt-realtime モデルおよびその API インターフェース( GA バージョン)に移行します。 + +### 0.2.0 + +このバージョンでは、これまで `Agent` を引数として受け取っていた一部の箇所が、代わりに `AgentBase` を引数として受け取るようになりました。たとえば、 MCP サーバーの `list_tools()` 呼び出しです。これは型に関する変更のみで、引き続き `Agent` オブジェクトを受け取ります。更新するには、`Agent` を `AgentBase` に置き換えて型エラーを修正するだけです。 + +### 0.1.0 + +このバージョンでは、[`MCPServer.list_tools()`][agents.mcp.server.MCPServer] に新しいパラメーターが 2 つ追加されました: `run_context` と `agent`。`MCPServer` をサブクラス化するすべてのクラスに、これらのパラメーターを追加する必要があります。 \ No newline at end of file diff --git a/docs/ja/repl.md b/docs/ja/repl.md index 108c12b90..799ed5f0e 100644 --- a/docs/ja/repl.md +++ b/docs/ja/repl.md @@ -4,19 +4,20 @@ search: --- # REPL ユーティリティ -`run_demo_loop` を使うと、ターミナルから手軽にエージェントを試せます。 +この SDK は、ターミナル上でエージェントの挙動をすばやく対話的にテストできる `run_demo_loop` を提供します。 ```python import asyncio from agents import Agent, run_demo_loop async def main() -> None: - agent = Agent(name="Assistant", instructions="あなたは親切なアシスタントです") + agent = Agent(name="Assistant", instructions="You are a helpful assistant.") await run_demo_loop(agent) if __name__ == "__main__": asyncio.run(main()) ``` -`run_demo_loop` は入力を繰り返し受け取り、会話履歴を保持したままエージェントを実行します。既定ではストリーミング出力を表示します。 -`quit` または `exit` と入力するか `Ctrl-D` を押すと終了します。 +`run_demo_loop` は、ループでユーザー入力を求め、ターン間の会話履歴を保持します。デフォルトでは、生成されたモデル出力をそのままストリーミングします。上記の例を実行すると、run_demo_loop は対話型のチャットセッションを開始します。入力を継続的に求め、ターン間で会話全体の履歴を記憶するため(エージェントが何を議論したかを把握できます)、エージェントの応答を生成と同時にリアルタイムで自動的にストリーミングします。 + +このチャットセッションを終了するには、`quit` または `exit` と入力して(Enter を押す)か、Ctrl-D キーボードショートカットを使用します。 \ No newline at end of file diff --git a/docs/ja/results.md b/docs/ja/results.md index cedd92402..34d4633a2 100644 --- a/docs/ja/results.md +++ b/docs/ja/results.md @@ -4,53 +4,53 @@ search: --- # 結果 -`Runner.run` メソッドを呼び出すと、以下のいずれかが返されます。 +`Runner.run` メソッドを呼び出すと、次のいずれかが返ります。 -- `run` または `run_sync` を呼び出した場合は [`RunResult`][agents.result.RunResult] -- `run_streamed` を呼び出した場合は [`RunResultStreaming`][agents.result.RunResultStreaming] +- [`RunResult`][agents.result.RunResult](`run` または `run_sync` を呼び出した場合) +- [`RunResultStreaming`][agents.result.RunResultStreaming](`run_streamed` を呼び出した場合) -これらはどちらも [`RunResultBase`][agents.result.RunResultBase] を継承しており、ほとんどの有用な情報はここに格納されています。 +どちらも [`RunResultBase`][agents.result.RunResultBase] を継承しており、ここに最も有用な情報が含まれます。 ## 最終出力 -[`final_output`][agents.result.RunResultBase.final_output] プロパティには、最後に実行されたエージェントの最終出力が格納されます。内容は以下のいずれかです。 +[`final_output`][agents.result.RunResultBase.final_output] プロパティには、最後に実行されたエージェントの最終出力が含まれます。これは次のいずれかです。 -- `output_type` が定義されていない場合は `str` -- `output_type` が定義されている場合は `last_agent.output_type` 型のオブジェクト +- 最後のエージェントに `output_type` が定義されていない場合は `str` +- エージェントに出力タイプが定義されている場合は `last_agent.output_type` 型のオブジェクト !!! note - `final_output` の型は `Any` です。ハンドオフが発生する可能性があるため、静的に型付けできません。ハンドオフが発生すると、どのエージェントでも最後になり得るため、可能性のある出力型を静的に特定できないのです。 + `final_output` の型は `Any` です。handoffs のため、これを静的に型付けすることはできません。handoffs が発生すると、どのエージェントが最後になるか分からないため、可能な出力タイプの集合を静的に把握できないためです。 -## 次のターンへの入力 +## 次ターンの入力 -[`result.to_input_list()`][agents.result.RunResultBase.to_input_list] を使用すると、エージェント実行中に生成されたアイテムを元の入力に連結した入力リストへ変換できます。これにより、あるエージェント実行の出力を別の実行へ渡したり、ループで実行して毎回新しいユーザー入力を追加したりすることが容易になります。 +[`result.to_input_list()`][agents.result.RunResultBase.to_input_list] を使用すると、あなたが提供した元の入力に、エージェントの実行中に生成されたアイテムを連結した入力リストに変換できます。これにより、あるエージェント実行の出力を別の実行に渡したり、ループで実行して毎回新しいユーザー入力を追加したりするのが容易になります。 ## 最後のエージェント -[`last_agent`][agents.result.RunResultBase.last_agent] プロパティには、最後に実行されたエージェントが格納されています。アプリケーションによっては、次回ユーザーが入力する際にこれが役立つことがよくあります。例えば、フロントラインのトリアージ エージェントが言語専用のエージェントにハンドオフする場合、最後のエージェントを保存しておき、ユーザーが次にメッセージを送ったときに再利用できます。 +[`last_agent`][agents.result.RunResultBase.last_agent] プロパティには、最後に実行されたエージェントが含まれます。アプリケーションによっては、次回ユーザーが入力する際に有用です。例えば、フロントラインのトリアージ用エージェントが言語別のエージェントへ handoff する場合、最後のエージェントを保存しておき、次回ユーザーがエージェントにメッセージを送る際に再利用できます。 -## 新しいアイテム +## 新規アイテム -[`new_items`][agents.result.RunResultBase.new_items] プロパティには、実行中に生成された新しいアイテムが含まれます。これらのアイテムは [`RunItem`][agents.items.RunItem] です。RunItem は、 LLM が生成した raw アイテムをラップします。 +[`new_items`][agents.result.RunResultBase.new_items] プロパティには、実行中に生成された新しいアイテムが含まれます。アイテムは [`RunItem`][agents.items.RunItem] です。実行アイテムは、LLM が生成した raw アイテムをラップします。 -- [`MessageOutputItem`][agents.items.MessageOutputItem] — LLM からのメッセージを示します。 raw アイテムは生成されたメッセージです。 -- [`HandoffCallItem`][agents.items.HandoffCallItem] — LLM がハンドオフ ツールを呼び出したことを示します。 raw アイテムは LLM からのツール呼び出しアイテムです。 -- [`HandoffOutputItem`][agents.items.HandoffOutputItem] — ハンドオフが発生したことを示します。 raw アイテムはハンドオフ ツール呼び出しに対するツール応答です。また、アイテムから送信元 / 送信先エージェントにもアクセスできます。 -- [`ToolCallItem`][agents.items.ToolCallItem] — LLM がツールを呼び出したことを示します。 -- [`ToolCallOutputItem`][agents.items.ToolCallOutputItem] — ツールが呼び出されたことを示します。 raw アイテムはツール応答です。また、アイテムからツール出力にもアクセスできます。 -- [`ReasoningItem`][agents.items.ReasoningItem] — LLM からの推論アイテムを示します。 raw アイテムは生成された推論内容です。 +- [`MessageOutputItem`][agents.items.MessageOutputItem] は LLM からのメッセージを示します。raw アイテムは生成されたメッセージです。 +- [`HandoffCallItem`][agents.items.HandoffCallItem] は、LLM が handoff ツールを呼び出したことを示します。raw アイテムは LLM からのツール呼び出しアイテムです。 +- [`HandoffOutputItem`][agents.items.HandoffOutputItem] は、handoff が発生したことを示します。raw アイテムは handoff ツール呼び出しに対するツールのレスポンスです。アイテムから送信元/送信先のエージェントにもアクセスできます。 +- [`ToolCallItem`][agents.items.ToolCallItem] は、LLM がツールを呼び出したことを示します。 +- [`ToolCallOutputItem`][agents.items.ToolCallOutputItem] は、ツールが呼び出されたことを示します。raw アイテムはツールのレスポンスです。アイテムからツール出力にもアクセスできます。 +- [`ReasoningItem`][agents.items.ReasoningItem] は LLM からの推論アイテムを示します。raw アイテムは生成された推論です。 ## その他の情報 ### ガードレール結果 -[`input_guardrail_results`][agents.result.RunResultBase.input_guardrail_results] と [`output_guardrail_results`][agents.result.RunResultBase.output_guardrail_results] プロパティには、ガードレールの結果が存在する場合に格納されます。ガードレール結果には、ログや保存を行いたい有用な情報が含まれることがあるため、これらを参照できるようにしています。 +[`input_guardrail_results`][agents.result.RunResultBase.input_guardrail_results] と [`output_guardrail_results`][agents.result.RunResultBase.output_guardrail_results] プロパティには、存在する場合はガードレールの結果が含まれます。ガードレール結果には、ログ記録や保存に有用な情報が含まれる場合があるため、利用できるようにしています。 ### raw レスポンス -[`raw_responses`][agents.result.RunResultBase.raw_responses] プロパティには、 LLM が生成した [`ModelResponse`][agents.items.ModelResponse] が格納されます。 +[`raw_responses`][agents.result.RunResultBase.raw_responses] プロパティには、LLM によって生成された [`ModelResponse`][agents.items.ModelResponse] が含まれます。 ### 元の入力 -[`input`][agents.result.RunResultBase.input] プロパティには、`run` メソッドに渡した元の入力が格納されます。ほとんどの場合は必要ありませんが、必要に応じて参照できるように用意されています。 \ No newline at end of file +[`input`][agents.result.RunResultBase.input] プロパティには、`run` メソッドに渡した元の入力が含まれます。ほとんどの場合これは不要ですが、必要な場合のために参照できるようになっています。 \ No newline at end of file diff --git a/docs/ja/running_agents.md b/docs/ja/running_agents.md index 83d5bec64..fee97378d 100644 --- a/docs/ja/running_agents.md +++ b/docs/ja/running_agents.md @@ -4,12 +4,11 @@ search: --- # エージェントの実行 -`Runner` クラス [`Runner`][agents.run.Runner] を使用して エージェント を実行できます。方法は 3 つあります。 +エージェントは [`Runner`][agents.run.Runner] クラスで実行できます。方法は 3 つあります: -1. 非同期で実行し、[`RunResult`][agents.result.RunResult] を返す [`Runner.run()`][agents.run.Runner.run] -2. 同期メソッドで、内部的には `.run()` を呼び出す [`Runner.run_sync()`][agents.run.Runner.run_sync] -3. 非同期で実行し、[`RunResultStreaming`][agents.result.RunResultStreaming] を返す [`Runner.run_streamed()`][agents.run.Runner.run_streamed] - LLM をストリーミングモードで呼び出し、受信したイベントを逐次 ストリーミング します。 +1. [`Runner.run()`][agents.run.Runner.run]: 非同期で実行し、[`RunResult`][agents.result.RunResult] を返します。 +2. [`Runner.run_sync()`][agents.run.Runner.run_sync]: 同期メソッドで、内部的には `.run()` を実行します。 +3. [`Runner.run_streamed()`][agents.run.Runner.run_streamed]: 非同期で実行し、[`RunResultStreaming`][agents.result.RunResultStreaming] を返します。LLM を ストリーミング モードで呼び出し、受信したイベントを逐次ストリーミングします。 ```python from agents import Agent, Runner @@ -21,60 +20,64 @@ async def main(): print(result.final_output) # Code within the code, # Functions calling themselves, - # Infinite loop's dance. + # Infinite loop's dance ``` -詳細は [結果ガイド](results.md) を参照してください。 +詳しくは[結果ガイド](results.md)をご覧ください。 ## エージェントループ -`Runner` の run メソッドを使用する際は、開始 エージェント と入力を渡します。入力は文字列(ユーザー メッセージと見なされます)または入力項目のリスト(OpenAI Responses API の項目)です。 +`Runner` の run メソッドでは、開始するエージェントと入力を渡します。入力は文字列(ユーザーメッセージとみなされます)または入力アイテムのリスト(OpenAI Responses API のアイテム)を指定できます。 -Runner は以下のループを実行します。 +Runner は次のループを実行します: -1. 現在の エージェント と現在の入力で LLM を呼び出します。 -2. LLM が出力を生成します。 - 1. `final_output` が返された場合、ループを終了して結果を返します。 - 2. ハンドオフ が発生した場合、現在の エージェント と入力を更新し、ループを再実行します。 - 3. ツール呼び出し がある場合、それらを実行し、結果を追加してループを再実行します。 -3. 指定した `max_turns` を超えた場合、[`MaxTurnsExceeded`][agents.exceptions.MaxTurnsExceeded] 例外を送出します。 +1. 現在のエージェントに対して、現在の入力で LLM を呼び出します。 +2. LLM が出力を生成します。 + 1. LLM が `final_output` を返した場合、ループを終了し結果を返します。 + 2. LLM が ハンドオフ を行った場合、現在のエージェントと入力を更新し、ループを再実行します。 + 3. LLM が ツール呼び出し を生成した場合、それらを実行し、結果を追加して、ループを再実行します。 +3. 渡された `max_turns` を超えた場合、[`MaxTurnsExceeded`][agents.exceptions.MaxTurnsExceeded] 例外を送出します。 !!! note - LLM の出力が「最終出力」と見なされる条件は、望ましい型のテキスト出力であり、ツール呼び出しがないことです。 + + LLM の出力が「最終出力」と見なされるルールは、目的の型でテキスト出力を生成し、ツール呼び出しが 1 つもないことです。 ## ストリーミング -ストリーミング を使用すると、LLM の実行中に ストリーミング イベントを受け取れます。ストリーム完了後、[`RunResultStreaming`][agents.result.RunResultStreaming] には実行に関する完全な情報(新しく生成されたすべての出力を含む)が格納されます。`.stream_events()` を呼び出して ストリーミング イベントを取得できます。詳しくは [ストリーミングガイド](streaming.md) をご覧ください。 +ストリーミングを使うと、LLM 実行中のストリーミング イベントも受け取れます。ストリーム完了後、[`RunResultStreaming`][agents.result.RunResultStreaming] には実行に関する完全な情報(生成されたすべての新しい出力を含む)が含まれます。ストリーミング イベントは `.stream_events()` を呼び出して取得できます。詳しくは[ストリーミング ガイド](streaming.md)をご覧ください。 + +## 実行設定 -## Run 設定 +`run_config` パラメーターでは、エージェント実行のグローバル設定を構成できます: -`run_config` パラメーターにより、エージェント実行のグローバル設定を行えます。 +- [`model`][agents.run.RunConfig.model]: 各 Agent の `model` 設定に関係なく、使用するグローバルな LLM モデルを設定できます。 +- [`model_provider`][agents.run.RunConfig.model_provider]: モデル名を解決するためのモデルプロバイダーで、デフォルトは OpenAI です。 +- [`model_settings`][agents.run.RunConfig.model_settings]: エージェント固有の設定を上書きします。例えば、グローバルな `temperature` や `top_p` を設定できます。 +- [`input_guardrails`][agents.run.RunConfig.input_guardrails], [`output_guardrails`][agents.run.RunConfig.output_guardrails]: すべての実行に含める入力または出力の ガードレール のリストです。 +- [`handoff_input_filter`][agents.run.RunConfig.handoff_input_filter]: ハンドオフに対して、既に個別設定がない場合に適用されるグローバルな入力フィルターです。入力フィルターにより、新しいエージェントへ送る入力を編集できます。詳細は [`Handoff.input_filter`][agents.handoffs.Handoff.input_filter] のドキュメントをご覧ください。 +- [`tracing_disabled`][agents.run.RunConfig.tracing_disabled]: 実行全体の[トレーシング](tracing.md)を無効化できます。 +- [`trace_include_sensitive_data`][agents.run.RunConfig.trace_include_sensitive_data]: LLM やツール呼び出しの入出力など、潜在的に機微なデータをトレースに含めるかどうかを設定します。 +- [`workflow_name`][agents.run.RunConfig.workflow_name], [`trace_id`][agents.run.RunConfig.trace_id], [`group_id`][agents.run.RunConfig.group_id]: 実行のトレーシング ワークフロー名、トレース ID、トレース グループ ID を設定します。最低でも `workflow_name` の設定を推奨します。グループ ID は任意で、複数の実行にわたるトレースを関連付けるのに役立ちます。 +- [`trace_metadata`][agents.run.RunConfig.trace_metadata]: すべてのトレースに含めるメタデータです。 -- [`model`][agents.run.RunConfig.model]: 各 Agent の `model` 設定に関わらず使用するグローバル LLM モデルを指定します。 -- [`model_provider`][agents.run.RunConfig.model_provider]: モデル名を解決する モデルプロバイダー。デフォルトは OpenAI です。 -- [`model_settings`][agents.run.RunConfig.model_settings]: エージェント固有設定を上書きします。例としてグローバル `temperature` や `top_p` の設定など。 -- [`input_guardrails`][agents.run.RunConfig.input_guardrails], [`output_guardrails`][agents.run.RunConfig.output_guardrails]: すべての実行に適用する入力 / 出力 ガードレール のリスト。 -- [`handoff_input_filter`][agents.run.RunConfig.handoff_input_filter]: ハンドオフ に入力フィルターが設定されていない場合に適用されるグローバル入力フィルター。新しい エージェント へ送信される入力を編集できます。詳細は [`Handoff.input_filter`][agents.handoffs.Handoff.input_filter] を参照してください。 -- [`tracing_disabled`][agents.run.RunConfig.tracing_disabled]: 実行全体の [トレーシング](tracing.md) を無効化します。 -- [`trace_include_sensitive_data`][agents.run.RunConfig.trace_include_sensitive_data]: トレースに LLM やツール呼び出しの入出力など、機微なデータを含めるかどうかを設定します。 -- [`workflow_name`][agents.run.RunConfig.workflow_name], [`trace_id`][agents.run.RunConfig.trace_id], [`group_id`][agents.run.RunConfig.group_id]: 実行のトレーシング ワークフロー名、トレース ID、トレース グループ ID を設定します。少なくとも `workflow_name` の設定を推奨します。`group_id` を設定すると、複数の実行にまたがるトレースをリンクできます。 -- [`trace_metadata`][agents.run.RunConfig.trace_metadata]: すべてのトレースに付与するメタデータ。 +## 会話/チャットスレッド -## 会話 / チャットスレッド +いずれかの run メソッドを呼び出すと、1 つ以上のエージェント(したがって 1 回以上の LLM 呼び出し)が実行される可能性がありますが、チャット会話における 1 回の論理的なターンを表します。例: -いずれかの run メソッドを呼び出すと、1 つ以上の エージェント が実行され(つまり 1 つ以上の LLM 呼び出しが行われ)、チャット会話の 1 つの論理ターンを表します。例: +1. ユーザーのターン: ユーザーがテキストを入力 +2. Runner の実行: 最初のエージェントが LLM を呼び出し、ツールを実行し、2 番目のエージェントにハンドオフ、2 番目のエージェントが更にツールを実行し、その後出力を生成。 -1. ユーザーターン: ユーザー がテキストを入力 -2. Runner 実行: 最初の エージェント が LLM を呼び出し、ツールを実行し、2 番目の エージェント へハンドオフ。2 番目の エージェント がさらにツールを実行し、最終出力を生成。 +エージェント実行の最後に、ユーザーへ何を表示するかを選べます。例えば、エージェントが生成したすべての新しいアイテムを表示するか、最終出力のみを表示します。いずれの場合も、ユーザーが追質問をするかもしれず、その場合は再度 run メソッドを呼び出します。 -エージェント実行の終了時に、ユーザー に何を表示するかは自由です。たとえば、エージェント が生成したすべての新しい項目を表示する、または最終出力のみを表示する等です。いずれの場合でも、ユーザー がフォローアップ質問をしたら、再度 run メソッドを呼び出せます。 +### 手動の会話管理 -次ターンの入力は、基底クラス [`RunResultBase.to_input_list()`][agents.result.RunResultBase.to_input_list] を使用して取得できます。 +次のターン用の入力を取得するために、[`RunResultBase.to_input_list()`][agents.result.RunResultBase.to_input_list] メソッドを使って会話履歴を手動で管理できます: ```python async def main(): agent = Agent(name="Assistant", instructions="Reply very concisely.") + thread_id = "thread_123" # Example thread ID with trace(workflow_name="Conversation", group_id=thread_id): # First turn result = await Runner.run(agent, "What city is the Golden Gate Bridge in?") @@ -88,12 +91,117 @@ async def main(): # California ``` +### Sessions による自動会話管理 + +より簡単な方法として、[Sessions](sessions/index.md) を使用すれば、`.to_input_list()` を手動で呼び出さずに会話履歴を自動で扱えます: + +```python +from agents import Agent, Runner, SQLiteSession + +async def main(): + agent = Agent(name="Assistant", instructions="Reply very concisely.") + + # Create session instance + session = SQLiteSession("conversation_123") + + thread_id = "thread_123" # Example thread ID + with trace(workflow_name="Conversation", group_id=thread_id): + # First turn + result = await Runner.run(agent, "What city is the Golden Gate Bridge in?", session=session) + print(result.final_output) + # San Francisco + + # Second turn - agent automatically remembers previous context + result = await Runner.run(agent, "What state is it in?", session=session) + print(result.final_output) + # California +``` + +Sessions は自動的に次を行います: + +- 各実行の前に会話履歴を取得 +- 各実行の後に新しいメッセージを保存 +- セッション ID ごとに別々の会話を維持 + +詳しくは [Sessions のドキュメント](sessions/index.md)をご覧ください。 + + +### サーバー管理の会話 + +`to_input_list()` や `Sessions` を使ってローカルで管理する代わりに、OpenAI の conversation state 機能に サーバー 側で会話状態を管理させることもできます。これにより、過去のすべてのメッセージを手動で再送せずに会話履歴を保持できます。詳しくは [OpenAI Conversation state ガイド](https://platform.openai.com/docs/guides/conversation-state?api-mode=responses)をご覧ください。 + +OpenAI はターン間の状態を追跡する 2 つの方法を提供します: + +#### 1. `conversation_id` の使用 + +まず OpenAI Conversations API を使用して会話を作成し、その ID を後続のすべての呼び出しで再利用します: + +```python +from agents import Agent, Runner +from openai import AsyncOpenAI + +client = AsyncOpenAI() + +async def main(): + # Create a server-managed conversation + conversation = await client.conversations.create() + conv_id = conversation.id + + agent = Agent(name="Assistant", instructions="Reply very concisely.") + + # First turn + result1 = await Runner.run(agent, "What city is the Golden Gate Bridge in?", conversation_id=conv_id) + print(result1.final_output) + # San Francisco + + # Second turn reuses the same conversation_id + result2 = await Runner.run( + agent, + "What state is it in?", + conversation_id=conv_id, + ) + print(result2.final_output) + # California +``` + +#### 2. `previous_response_id` の使用 + +もう 1 つの方法は、各ターンを直前のターンのレスポンス ID に明示的にリンクする **レスポンス チェイニング(response chaining)** です。 + +```python +from agents import Agent, Runner + +async def main(): + agent = Agent(name="Assistant", instructions="Reply very concisely.") + + # First turn + result1 = await Runner.run(agent, "What city is the Golden Gate Bridge in?") + print(result1.final_output) + # San Francisco + + # Second turn, chained to the previous response + result2 = await Runner.run( + agent, + "What state is it in?", + previous_response_id=result1.last_response_id, + ) + print(result2.final_output) + # California +``` + + +## 長時間実行エージェントとヒューマン・イン・ザ・ループ + +Agents SDK の [Temporal](https://temporal.io/) 統合を使用すると、ヒューマン・イン・ザ・ループのタスクを含む永続的で長時間実行のワークフローを実行できます。長時間タスクを完了するために Temporal と Agents SDK が連携するデモは[この動画](https://www.youtube.com/watch?v=fFBZqzT4DD8)で、ドキュメントは[こちら](https://github.com/temporalio/sdk-python/tree/main/temporalio/contrib/openai_agents)をご覧ください。 + ## 例外 -特定の状況で SDK は例外を送出します。完全な一覧は [`agents.exceptions`][] にあります。概要は以下のとおりです。 +SDK は特定の場合に例外を送出します。完全な一覧は [`agents.exceptions`][] にあります。概要は次のとおりです: -- [`AgentsException`][agents.exceptions.AgentsException]: SDK が送出するすべての例外の基底クラス -- [`MaxTurnsExceeded`][agents.exceptions.MaxTurnsExceeded]: 実行が `max_turns` を超えた場合に送出 -- [`ModelBehaviorError`][agents.exceptions.ModelBehaviorError]: モデルが不正な出力(例: JSON 形式違反、存在しないツールの呼び出しなど)を生成した場合に送出 -- [`UserError`][agents.exceptions.UserError]: SDK の使用方法に誤りがある場合に送出 -- [`InputGuardrailTripwireTriggered`][agents.exceptions.InputGuardrailTripwireTriggered], [`OutputGuardrailTripwireTriggered`][agents.exceptions.OutputGuardrailTripwireTriggered]: [ガードレール](guardrails.md) が発火した場合に送出 \ No newline at end of file +- [`AgentsException`][agents.exceptions.AgentsException]: SDK 内で送出されるすべての例外の基底クラスです。他の特定の例外はすべてこの汎用タイプから派生します。 +- [`MaxTurnsExceeded`][agents.exceptions.MaxTurnsExceeded]: エージェントの実行が `Runner.run`、`Runner.run_sync`、または `Runner.run_streamed` メソッドに渡された `max_turns` 制限を超えた場合に送出されます。指定された対話ターン数内にタスクを完了できなかったことを示します。 +- [`ModelBehaviorError`][agents.exceptions.ModelBehaviorError]: 基盤となるモデル(LLM)が予期しないまたは無効な出力を生成した際に発生します。これには次が含まれます: + - 不正な JSON: 特定の `output_type` が定義されている場合に特に、ツール呼び出しや直接出力で不正な JSON 構造を返す。 + - 予期しないツール関連の失敗: モデルが想定どおりの方法でツールを使用できない場合。 +- [`UserError`][agents.exceptions.UserError]: SDK を使用する(SDK を使ってコードを書く)あなたが誤りを行った場合に送出されます。これは一般に、誤ったコード実装、無効な設定、または SDK の API の誤用に起因します。 +- [`InputGuardrailTripwireTriggered`][agents.exceptions.InputGuardrailTripwireTriggered], [`OutputGuardrailTripwireTriggered`][agents.exceptions.OutputGuardrailTripwireTriggered]: それぞれ、入力ガードレールまたは出力ガードレールの条件が満たされた場合に送出されます。入力ガードレールは処理前に受信メッセージをチェックし、出力ガードレールは配信前にエージェントの最終応答をチェックします。 \ No newline at end of file diff --git a/docs/ja/sessions.md b/docs/ja/sessions.md new file mode 100644 index 000000000..b722a867d --- /dev/null +++ b/docs/ja/sessions.md @@ -0,0 +1,459 @@ +--- +search: + exclude: true +--- +# セッション + +Agents SDK は、複数のエージェント実行にわたって会話履歴を自動で維持する組み込みのセッションメモリを提供し、ターン間で手動で `.to_input_list()` を扱う必要をなくします。 + +セッションは特定のセッションに対する会話履歴を保存し、明示的な手動メモリ管理なしでエージェントがコンテキストを維持できるようにします。これは、エージェントに過去のやり取りを記憶させたいチャットアプリケーションやマルチターンの会話を構築する際に特に有用です。 + +## クイックスタート + +```python +from agents import Agent, Runner, SQLiteSession + +# Create agent +agent = Agent( + name="Assistant", + instructions="Reply very concisely.", +) + +# Create a session instance with a session ID +session = SQLiteSession("conversation_123") + +# First turn +result = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session +) +print(result.final_output) # "San Francisco" + +# Second turn - agent automatically remembers previous context +result = await Runner.run( + agent, + "What state is it in?", + session=session +) +print(result.final_output) # "California" + +# Also works with synchronous runner +result = Runner.run_sync( + agent, + "What's the population?", + session=session +) +print(result.final_output) # "Approximately 39 million" +``` + +## 仕組み + +セッションメモリが有効な場合: + +1. **各実行の前**: ランナーはセッションの会話履歴を自動的に取得し、入力アイテムの前に付加します。 +2. **各実行の後**: 実行中に生成されたすべての新しいアイテム (ユーザー入力、アシスタントの応答、ツール呼び出しなど) は自動的にセッションに保存されます。 +3. **コンテキスト保持**: 同一セッションでの後続の実行には完全な会話履歴が含まれ、エージェントはコンテキストを維持できます。 + +これにより、ターン間で `.to_input_list()` を手動で呼び出して会話状態を管理する必要がなくなります。 + +## メモリ操作 + +### 基本操作 + +セッションは会話履歴を管理するためにいくつかの操作をサポートします: + +```python +from agents import SQLiteSession + +session = SQLiteSession("user_123", "conversations.db") + +# Get all items in a session +items = await session.get_items() + +# Add new items to a session +new_items = [ + {"role": "user", "content": "Hello"}, + {"role": "assistant", "content": "Hi there!"} +] +await session.add_items(new_items) + +# Remove and return the most recent item +last_item = await session.pop_item() +print(last_item) # {"role": "assistant", "content": "Hi there!"} + +# Clear all items from a session +await session.clear_session() +``` + +### 修正のための pop_item の使用 + +会話内の最後のアイテムを取り消したり修正したい場合、`pop_item` メソッドが特に便利です: + +```python +from agents import Agent, Runner, SQLiteSession + +agent = Agent(name="Assistant") +session = SQLiteSession("correction_example") + +# Initial conversation +result = await Runner.run( + agent, + "What's 2 + 2?", + session=session +) +print(f"Agent: {result.final_output}") + +# User wants to correct their question +assistant_item = await session.pop_item() # Remove agent's response +user_item = await session.pop_item() # Remove user's question + +# Ask a corrected question +result = await Runner.run( + agent, + "What's 2 + 3?", + session=session +) +print(f"Agent: {result.final_output}") +``` + +## メモリオプション + +### メモリなし (デフォルト) + +```python +# Default behavior - no session memory +result = await Runner.run(agent, "Hello") +``` + +### OpenAI Conversations API メモリ + +自前のデータベースを管理せずに [会話状態](https://platform.openai.com/docs/guides/conversation-state?api-mode=responses#using-the-conversations-api) を永続化するには、[OpenAI Conversations API](https://platform.openai.com/docs/api-reference/conversations/create) を使用します。これは、会話履歴の保存に OpenAI がホストするインフラストラクチャに既に依存している場合に役立ちます。 + +```python +from agents import OpenAIConversationsSession + +session = OpenAIConversationsSession() + +# Optionally resume a previous conversation by passing a conversation ID +# session = OpenAIConversationsSession(conversation_id="conv_123") + +result = await Runner.run( + agent, + "Hello", + session=session, +) +``` + +### SQLite メモリ + +```python +from agents import SQLiteSession + +# In-memory database (lost when process ends) +session = SQLiteSession("user_123") + +# Persistent file-based database +session = SQLiteSession("user_123", "conversations.db") + +# Use the session +result = await Runner.run( + agent, + "Hello", + session=session +) +``` + +### 複数セッション + +```python +from agents import Agent, Runner, SQLiteSession + +agent = Agent(name="Assistant") + +# Different sessions maintain separate conversation histories +session_1 = SQLiteSession("user_123", "conversations.db") +session_2 = SQLiteSession("user_456", "conversations.db") + +result1 = await Runner.run( + agent, + "Hello", + session=session_1 +) +result2 = await Runner.run( + agent, + "Hello", + session=session_2 +) +``` + +### SQLAlchemy ベースのセッション + +より高度なユースケースでは、SQLAlchemy ベースのセッションバックエンドを使用できます。これにより、セッションストレージに SQLAlchemy がサポートする任意のデータベース (PostgreSQL、MySQL、SQLite など) を使用できます。 + +**例 1: `from_url` を使ったインメモリ SQLite** + +これは最も簡単な開始方法で、開発やテストに最適です。 + +```python +import asyncio +from agents import Agent, Runner +from agents.extensions.memory.sqlalchemy_session import SQLAlchemySession + +async def main(): + agent = Agent("Assistant") + session = SQLAlchemySession.from_url( + "user-123", + url="sqlite+aiosqlite:///:memory:", + create_tables=True, # Auto-create tables for the demo + ) + + result = await Runner.run(agent, "Hello", session=session) + +if __name__ == "__main__": + asyncio.run(main()) +``` + +**例 2: 既存の SQLAlchemy エンジンを使用** + +本番アプリケーションでは、すでに SQLAlchemy の `AsyncEngine` インスタンスを持っている可能性が高いです。これをそのままセッションに渡せます。 + +```python +import asyncio +from agents import Agent, Runner +from agents.extensions.memory.sqlalchemy_session import SQLAlchemySession +from sqlalchemy.ext.asyncio import create_async_engine + +async def main(): + # In your application, you would use your existing engine + engine = create_async_engine("sqlite+aiosqlite:///conversations.db") + + agent = Agent("Assistant") + session = SQLAlchemySession( + "user-456", + engine=engine, + create_tables=True, # Auto-create tables for the demo + ) + + result = await Runner.run(agent, "Hello", session=session) + print(result.final_output) + + await engine.dispose() + +if __name__ == "__main__": + asyncio.run(main()) +``` + +### 暗号化セッション + +保存時に会話データの暗号化が必要なアプリケーションでは、`EncryptedSession` を使用して任意のセッションバックエンドを透過的な暗号化と自動 TTL ベースの有効期限でラップできます。これには `encrypt` エクストラが必要です: `pip install openai-agents[encrypt]`。 + +`EncryptedSession` は、セッションごとのキー導出 (HKDF) を用いた Fernet 暗号化を使用し、古いメッセージの自動期限切れをサポートします。アイテムが TTL を超えると、取得時に静かにスキップされます。 + +**例: SQLAlchemy セッションデータの暗号化** + +```python +import asyncio +from agents import Agent, Runner +from agents.extensions.memory import EncryptedSession, SQLAlchemySession + +async def main(): + # Create underlying session (works with any SessionABC implementation) + underlying_session = SQLAlchemySession.from_url( + session_id="user-123", + url="postgresql+asyncpg://app:secret@db.example.com/agents", + create_tables=True, + ) + + # Wrap with encryption and TTL-based expiration + session = EncryptedSession( + session_id="user-123", + underlying_session=underlying_session, + encryption_key="your-encryption-key", # Use a secure key from your secrets management + ttl=600, # 10 minutes - items older than this are silently skipped + ) + + agent = Agent("Assistant") + result = await Runner.run(agent, "Hello", session=session) + print(result.final_output) + +if __name__ == "__main__": + asyncio.run(main()) +``` + +**主な特長:** + +- **透過的な暗号化**: 保存前にすべてのセッションアイテムを自動的に暗号化し、取得時に復号化します +- **セッションごとのキー導出**: セッション ID をソルトとした HKDF で一意の暗号鍵を導出します +- **TTL ベースの有効期限**: 設定可能な有効期間に基づいて古いメッセージを自動的に期限切れにします (デフォルト: 10 分) +- **柔軟な鍵入力**: Fernet キーまたは生の文字列のいずれも暗号鍵として受け付けます +- **任意のセッションをラップ**: SQLite、SQLAlchemy、またはカスタムセッション実装で動作します + +!!! warning "重要なセキュリティに関する注意" + + - 暗号鍵は安全に保管してください (例: 環境変数、シークレットマネージャー) + - 期限切れトークンの拒否はアプリケーション サーバーのシステムクロックに基づきます。正当なトークンがクロックずれにより拒否されないよう、すべてのサーバーが NTP で時刻同期されていることを確認してください + - 基盤となるセッションは暗号化済みデータを保存し続けるため、データベース インフラストラクチャの管理権限は保持されます + + +## カスタムメモリ実装 + +[`Session`][agents.memory.session.Session] プロトコルに従うクラスを作成することで、独自のセッションメモリを実装できます: + +```python +from agents.memory.session import SessionABC +from agents.items import TResponseInputItem +from typing import List + +class MyCustomSession(SessionABC): + """Custom session implementation following the Session protocol.""" + + def __init__(self, session_id: str): + self.session_id = session_id + # Your initialization here + + async def get_items(self, limit: int | None = None) -> List[TResponseInputItem]: + """Retrieve conversation history for this session.""" + # Your implementation here + pass + + async def add_items(self, items: List[TResponseInputItem]) -> None: + """Store new items for this session.""" + # Your implementation here + pass + + async def pop_item(self) -> TResponseInputItem | None: + """Remove and return the most recent item from this session.""" + # Your implementation here + pass + + async def clear_session(self) -> None: + """Clear all items for this session.""" + # Your implementation here + pass + +# Use your custom session +agent = Agent(name="Assistant") +result = await Runner.run( + agent, + "Hello", + session=MyCustomSession("my_session") +) +``` + +## セッション管理 + +### セッション ID の命名 + +会話の整理に役立つわかりやすいセッション ID を使用します: + +- ユーザー基準: `"user_12345"` +- スレッド基準: `"thread_abc123"` +- コンテキスト基準: `"support_ticket_456"` + +### メモリ永続化 + +- 一時的な会話にはインメモリ SQLite (`SQLiteSession("session_id")`) を使用 +- 永続的な会話にはファイルベース SQLite (`SQLiteSession("session_id", "path/to/db.sqlite")`) を使用 +- 既存のデータベースを持つ本番システムには SQLAlchemy ベースのセッション (`SQLAlchemySession("session_id", engine=engine, create_tables=True)`) を使用 +- 履歴を OpenAI Conversations API に保存したい場合は OpenAI がホストするストレージ (`OpenAIConversationsSession()`) を使用 +- 透過的な暗号化と TTL ベースの有効期限で任意のセッションをラップするには暗号化セッション (`EncryptedSession(session_id, underlying_session, encryption_key)`) を使用 +- さらに高度なユースケース向けに、他の本番システム (Redis、Django など) 用のカスタムセッションバックエンドの実装を検討 + +### セッション管理 + +```python +# Clear a session when conversation should start fresh +await session.clear_session() + +# Different agents can share the same session +support_agent = Agent(name="Support") +billing_agent = Agent(name="Billing") +session = SQLiteSession("user_123") + +# Both agents will see the same conversation history +result1 = await Runner.run( + support_agent, + "Help me with my account", + session=session +) +result2 = await Runner.run( + billing_agent, + "What are my charges?", + session=session +) +``` + +## 完全な例 + +セッションメモリの動作を示す完全な例です: + +```python +import asyncio +from agents import Agent, Runner, SQLiteSession + + +async def main(): + # Create an agent + agent = Agent( + name="Assistant", + instructions="Reply very concisely.", + ) + + # Create a session instance that will persist across runs + session = SQLiteSession("conversation_123", "conversation_history.db") + + print("=== Sessions Example ===") + print("The agent will remember previous messages automatically.\n") + + # First turn + print("First turn:") + print("User: What city is the Golden Gate Bridge in?") + result = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session + ) + print(f"Assistant: {result.final_output}") + print() + + # Second turn - the agent will remember the previous conversation + print("Second turn:") + print("User: What state is it in?") + result = await Runner.run( + agent, + "What state is it in?", + session=session + ) + print(f"Assistant: {result.final_output}") + print() + + # Third turn - continuing the conversation + print("Third turn:") + print("User: What's the population of that state?") + result = await Runner.run( + agent, + "What's the population of that state?", + session=session + ) + print(f"Assistant: {result.final_output}") + print() + + print("=== Conversation Complete ===") + print("Notice how the agent remembered the context from previous turns!") + print("Sessions automatically handles conversation history.") + + +if __name__ == "__main__": + asyncio.run(main()) +``` + +## API リファレンス + +詳細な API ドキュメントは以下をご覧ください: + +- [`Session`][agents.memory.Session] - プロトコルインターフェース +- [`SQLiteSession`][agents.memory.SQLiteSession] - SQLite 実装 +- [`OpenAIConversationsSession`](ref/memory/openai_conversations_session.md) - OpenAI Conversations API 実装 +- [`SQLAlchemySession`][agents.extensions.memory.sqlalchemy_session.SQLAlchemySession] - SQLAlchemy ベースの実装 +- [`EncryptedSession`][agents.extensions.memory.encrypt_session.EncryptedSession] - TTL 付き暗号化セッションラッパー \ No newline at end of file diff --git a/docs/ja/sessions/advanced_sqlite_session.md b/docs/ja/sessions/advanced_sqlite_session.md new file mode 100644 index 000000000..3a39da9f8 --- /dev/null +++ b/docs/ja/sessions/advanced_sqlite_session.md @@ -0,0 +1,307 @@ +--- +search: + exclude: true +--- +# 高度な SQLite セッション + +`AdvancedSQLiteSession` は、会話の分岐、詳細な使用状況の分析、構造化された会話クエリなどの高度な会話管理機能を提供する、基本の `SQLiteSession` を強化したバージョンです。 + +## 機能 + +- **会話の分岐**: 任意の ユーザー メッセージから代替の会話パスを作成 +- **使用状況の追跡**: 各ターンごとのトークン使用量を詳細に分析し、完全な JSON 内訳を提供 +- **構造化クエリ**: ターン単位の会話取得、ツール使用統計など +- **ブランチ管理**: 独立したブランチの切り替えと管理 +- **メッセージ構造のメタデータ**: メッセージタイプ、ツール使用状況、会話の流れを追跡 + +## クイックスタート + +```python +from agents import Agent, Runner +from agents.extensions.memory import AdvancedSQLiteSession + +# Create agent +agent = Agent( + name="Assistant", + instructions="Reply very concisely.", +) + +# Create an advanced session +session = AdvancedSQLiteSession( + session_id="conversation_123", + db_path="conversations.db", + create_tables=True +) + +# First conversation turn +result = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session +) +print(result.final_output) # "San Francisco" + +# IMPORTANT: Store usage data +await session.store_run_usage(result) + +# Continue conversation +result = await Runner.run( + agent, + "What state is it in?", + session=session +) +print(result.final_output) # "California" +await session.store_run_usage(result) +``` + +## 初期化 + +```python +from agents.extensions.memory import AdvancedSQLiteSession + +# Basic initialization +session = AdvancedSQLiteSession( + session_id="my_conversation", + create_tables=True # Auto-create advanced tables +) + +# With persistent storage +session = AdvancedSQLiteSession( + session_id="user_123", + db_path="path/to/conversations.db", + create_tables=True +) + +# With custom logger +import logging +logger = logging.getLogger("my_app") +session = AdvancedSQLiteSession( + session_id="session_456", + create_tables=True, + logger=logger +) +``` + +### パラメーター + +- `session_id` (str): 会話セッションの一意の識別子 +- `db_path` (str | Path): SQLite データベースファイルへのパス。メモリ内ストレージの場合はデフォルトで `:memory:` を使用 +- `create_tables` (bool): 高度なテーブルを自動作成するかどうか。デフォルトは `False` +- `logger` (logging.Logger | None): セッション用のカスタムロガー。デフォルトはモジュールのロガー + +## 使用状況の追跡 + +AdvancedSQLiteSession は、会話の各ターンごとにトークン使用データを保存することで、詳細な使用状況分析を提供します。 **これは各エージェントの実行後に `store_run_usage` メソッドが呼び出されることに完全に依存します。** + +### 使用データの保存 + +```python +# After each agent run, store the usage data +result = await Runner.run(agent, "Hello", session=session) +await session.store_run_usage(result) + +# This stores: +# - Total tokens used +# - Input/output token breakdown +# - Request count +# - Detailed JSON token information (if available) +``` + +### 使用統計の取得 + +```python +# Get session-level usage (all branches) +session_usage = await session.get_session_usage() +if session_usage: + print(f"Total requests: {session_usage['requests']}") + print(f"Total tokens: {session_usage['total_tokens']}") + print(f"Input tokens: {session_usage['input_tokens']}") + print(f"Output tokens: {session_usage['output_tokens']}") + print(f"Total turns: {session_usage['total_turns']}") + +# Get usage for specific branch +branch_usage = await session.get_session_usage(branch_id="main") + +# Get usage by turn +turn_usage = await session.get_turn_usage() +for turn_data in turn_usage: + print(f"Turn {turn_data['user_turn_number']}: {turn_data['total_tokens']} tokens") + if turn_data['input_tokens_details']: + print(f" Input details: {turn_data['input_tokens_details']}") + if turn_data['output_tokens_details']: + print(f" Output details: {turn_data['output_tokens_details']}") + +# Get usage for specific turn +turn_2_usage = await session.get_turn_usage(user_turn_number=2) +``` + +## 会話の分岐 + +AdvancedSQLiteSession の主な機能の 1 つは、任意の ユーザー メッセージから会話のブランチを作成でき、代替の会話パスを探索できる点です。 + +### ブランチの作成 + +```python +# Get available turns for branching +turns = await session.get_conversation_turns() +for turn in turns: + print(f"Turn {turn['turn']}: {turn['content']}") + print(f"Can branch: {turn['can_branch']}") + +# Create a branch from turn 2 +branch_id = await session.create_branch_from_turn(2) +print(f"Created branch: {branch_id}") + +# Create a branch with custom name +branch_id = await session.create_branch_from_turn( + 2, + branch_name="alternative_path" +) + +# Create branch by searching for content +branch_id = await session.create_branch_from_content( + "weather", + branch_name="weather_focus" +) +``` + +### ブランチ管理 + +```python +# List all branches +branches = await session.list_branches() +for branch in branches: + current = " (current)" if branch["is_current"] else "" + print(f"{branch['branch_id']}: {branch['user_turns']} turns, {branch['message_count']} messages{current}") + +# Switch between branches +await session.switch_to_branch("main") +await session.switch_to_branch(branch_id) + +# Delete a branch +await session.delete_branch(branch_id, force=True) # force=True allows deleting current branch +``` + +### ブランチのワークフロー例 + +```python +# Original conversation +result = await Runner.run(agent, "What's the capital of France?", session=session) +await session.store_run_usage(result) + +result = await Runner.run(agent, "What's the weather like there?", session=session) +await session.store_run_usage(result) + +# Create branch from turn 2 (weather question) +branch_id = await session.create_branch_from_turn(2, "weather_focus") + +# Continue in new branch with different question +result = await Runner.run( + agent, + "What are the main tourist attractions in Paris?", + session=session +) +await session.store_run_usage(result) + +# Switch back to main branch +await session.switch_to_branch("main") + +# Continue original conversation +result = await Runner.run( + agent, + "How expensive is it to visit?", + session=session +) +await session.store_run_usage(result) +``` + +## 構造化クエリ + +AdvancedSQLiteSession は、会話の構造と内容を分析するための複数のメソッドを提供します。 + +### 会話分析 + +```python +# Get conversation organized by turns +conversation_by_turns = await session.get_conversation_by_turns() +for turn_num, items in conversation_by_turns.items(): + print(f"Turn {turn_num}: {len(items)} items") + for item in items: + if item["tool_name"]: + print(f" - {item['type']} (tool: {item['tool_name']})") + else: + print(f" - {item['type']}") + +# Get tool usage statistics +tool_usage = await session.get_tool_usage() +for tool_name, count, turn in tool_usage: + print(f"{tool_name}: used {count} times in turn {turn}") + +# Find turns by content +matching_turns = await session.find_turns_by_content("weather") +for turn in matching_turns: + print(f"Turn {turn['turn']}: {turn['content']}") +``` + +### メッセージ構造 + +セッションはメッセージ構造を自動的に追跡します。内容は次のとおりです。 + +- メッセージタイプ(user、assistant、tool_call など) +- ツール呼び出しのツール名 +- ターン番号とシーケンス番号 +- ブランチとの関連付け +- タイムスタンプ + +## データベーススキーマ + +AdvancedSQLiteSession は、基本の SQLite スキーマを拡張し、次の 2 つの追加テーブルを含みます。 + +### message_structure テーブル + +```sql +CREATE TABLE message_structure ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + session_id TEXT NOT NULL, + message_id INTEGER NOT NULL, + branch_id TEXT NOT NULL DEFAULT 'main', + message_type TEXT NOT NULL, + sequence_number INTEGER NOT NULL, + user_turn_number INTEGER, + branch_turn_number INTEGER, + tool_name TEXT, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (session_id) REFERENCES agent_sessions(session_id) ON DELETE CASCADE, + FOREIGN KEY (message_id) REFERENCES agent_messages(id) ON DELETE CASCADE +); +``` + +### turn_usage テーブル + +```sql +CREATE TABLE turn_usage ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + session_id TEXT NOT NULL, + branch_id TEXT NOT NULL DEFAULT 'main', + user_turn_number INTEGER NOT NULL, + requests INTEGER DEFAULT 0, + input_tokens INTEGER DEFAULT 0, + output_tokens INTEGER DEFAULT 0, + total_tokens INTEGER DEFAULT 0, + input_tokens_details JSON, + output_tokens_details JSON, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (session_id) REFERENCES agent_sessions(session_id) ON DELETE CASCADE, + UNIQUE(session_id, branch_id, user_turn_number) +); +``` + +## 完全な例 + +すべての機能を網羅する [完全な例](https://github.com/openai/openai-agents-python/tree/main/examples/memory/advanced_sqlite_session_example.py) をご覧ください。 + + +## API リファレンス + +- [`AdvancedSQLiteSession`][agents.extensions.memory.advanced_sqlite_session.AdvancedSQLiteSession] - メインクラス +- [`Session`][agents.memory.session.Session] - ベースセッションプロトコル \ No newline at end of file diff --git a/docs/ja/sessions/encrypted_session.md b/docs/ja/sessions/encrypted_session.md new file mode 100644 index 000000000..c6fb51e86 --- /dev/null +++ b/docs/ja/sessions/encrypted_session.md @@ -0,0 +1,179 @@ +--- +search: + exclude: true +--- +# 暗号化セッション + +`EncryptedSession` は、あらゆるセッション実装に対して透過的な暗号化を提供し、古い項目の自動有効期限切れにより会話データを保護します。 + +## 機能 + +- **透過的な暗号化**: どのセッションでも Fernet 暗号化でラップします +- **セッションごとのキー**: 一意の暗号化を行うために HKDF キー導出を使用します +- **自動有効期限**: TTL が切れた古い項目は静かにスキップされます +- **差し替え可能**: 既存の任意のセッション実装で動作します + +## インストール + +暗号化セッションには `encrypt` エクストラが必要です: + +```bash +pip install openai-agents[encrypt] +``` + +## クイックスタート + +```python +import asyncio +from agents import Agent, Runner +from agents.extensions.memory import EncryptedSession, SQLAlchemySession + +async def main(): + agent = Agent("Assistant") + + # Create underlying session + underlying_session = SQLAlchemySession.from_url( + "user-123", + url="sqlite+aiosqlite:///:memory:", + create_tables=True + ) + + # Wrap with encryption + session = EncryptedSession( + session_id="user-123", + underlying_session=underlying_session, + encryption_key="your-secret-key-here", + ttl=600 # 10 minutes + ) + + result = await Runner.run(agent, "Hello", session=session) + print(result.final_output) + +if __name__ == "__main__": + asyncio.run(main()) +``` + +## 設定 + +### 暗号化キー + +暗号化キーは Fernet キーまたは任意の文字列を使用できます: + +```python +from agents.extensions.memory import EncryptedSession + +# Using a Fernet key (base64-encoded) +session = EncryptedSession( + session_id="user-123", + underlying_session=underlying_session, + encryption_key="your-fernet-key-here", + ttl=600 +) + +# Using a raw string (will be derived to a key) +session = EncryptedSession( + session_id="user-123", + underlying_session=underlying_session, + encryption_key="my-secret-password", + ttl=600 +) +``` + +### TTL (Time To Live) + +暗号化された項目が有効である期間を設定します: + +```python +# Items expire after 1 hour +session = EncryptedSession( + session_id="user-123", + underlying_session=underlying_session, + encryption_key="secret", + ttl=3600 # 1 hour in seconds +) + +# Items expire after 1 day +session = EncryptedSession( + session_id="user-123", + underlying_session=underlying_session, + encryption_key="secret", + ttl=86400 # 24 hours in seconds +) +``` + +## さまざまなセッションタイプでの使用 + +### SQLite セッションでの使用 + +```python +from agents import SQLiteSession +from agents.extensions.memory import EncryptedSession + +# Create encrypted SQLite session +underlying = SQLiteSession("user-123", "conversations.db") + +session = EncryptedSession( + session_id="user-123", + underlying_session=underlying, + encryption_key="secret-key" +) +``` + +### SQLAlchemy セッションでの使用 + +```python +from agents.extensions.memory import EncryptedSession, SQLAlchemySession + +# Create encrypted SQLAlchemy session +underlying = SQLAlchemySession.from_url( + "user-123", + url="postgresql+asyncpg://user:pass@localhost/db", + create_tables=True +) + +session = EncryptedSession( + session_id="user-123", + underlying_session=underlying, + encryption_key="secret-key" +) +``` + +!!! warning "高度なセッション機能" + + `EncryptedSession` を `AdvancedSQLiteSession` のような高度なセッション実装と併用する場合、次の点に注意してください: + + - メッセージ内容が暗号化されるため、`find_turns_by_content()` のようなメソッドは効果的に動作しません + - コンテンツベースの検索は暗号化データに対して行われるため、その有効性が制限されます + + + +## キー導出 + +EncryptedSession は HKDF (HMAC-based Key Derivation Function) を使用して、セッションごとに一意の暗号化キーを導出します: + +- **マスターキー**: 提供された暗号化キー +- **セッションソルト**: セッション ID +- **Info string**: `"agents.session-store.hkdf.v1"` +- **出力**: 32 バイト Fernet キー + +これにより次のことが保証されます: +- 各セッションには一意の暗号化キーがあります +- マスターキーがなければキーを導出できません +- 異なるセッション間でセッションデータを復号できません + +## 自動有効期限 + +項目が TTL を超えた場合、取得時に自動的にスキップされます: + +```python +# Items older than TTL are silently ignored +items = await session.get_items() # Only returns non-expired items + +# Expired items don't affect session behavior +result = await Runner.run(agent, "Continue conversation", session=session) +``` + +## API リファレンス + +- [`EncryptedSession`][agents.extensions.memory.encrypt_session.EncryptedSession] - メインクラス +- [`Session`][agents.memory.session.Session] - ベースセッションプロトコル \ No newline at end of file diff --git a/docs/ja/sessions/index.md b/docs/ja/sessions/index.md new file mode 100644 index 000000000..7708cf52f --- /dev/null +++ b/docs/ja/sessions/index.md @@ -0,0 +1,435 @@ +--- +search: + exclude: true +--- +# セッション + +Agents SDK は、複数のエージェント実行にわたって会話履歴を自動的に維持する組み込みのセッションメモリを提供し、ターン間で手動で `.to_input_list()` を扱う必要をなくします。 + +セッションは特定のセッションの会話履歴を保存し、明示的な手動メモリ管理なしでエージェントがコンテキストを維持できるようにします。これは、エージェントに以前のやり取りを記憶させたいチャットアプリケーションやマルチターンの会話を構築する際に特に有用です。 + +## クイックスタート + +```python +from agents import Agent, Runner, SQLiteSession + +# Create agent +agent = Agent( + name="Assistant", + instructions="Reply very concisely.", +) + +# Create a session instance with a session ID +session = SQLiteSession("conversation_123") + +# First turn +result = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session +) +print(result.final_output) # "San Francisco" + +# Second turn - agent automatically remembers previous context +result = await Runner.run( + agent, + "What state is it in?", + session=session +) +print(result.final_output) # "California" + +# Also works with synchronous runner +result = Runner.run_sync( + agent, + "What's the population?", + session=session +) +print(result.final_output) # "Approximately 39 million" +``` + +## 仕組み + +セッションメモリが有効な場合: + +1. **各実行前**: ランナーはセッションの会話履歴を自動的に取得し、入力アイテムの先頭に付加します。 +2. **各実行後**: 実行中に生成されたすべての新しいアイテム(ユーザー入力、アシスタントの応答、ツール呼び出しなど)が自動的にセッションに保存されます。 +3. **コンテキスト保持**: 同じセッションでの後続の各実行には完全な会話履歴が含まれ、エージェントはコンテキストを維持できます。 + +これにより、実行間で手動で `.to_input_list()` を呼び出して会話状態を管理する必要がなくなります。 + +## メモリ操作 + +### 基本操作 + +セッションは会話履歴を管理するためのいくつかの操作をサポートします: + +```python +from agents import SQLiteSession + +session = SQLiteSession("user_123", "conversations.db") + +# Get all items in a session +items = await session.get_items() + +# Add new items to a session +new_items = [ + {"role": "user", "content": "Hello"}, + {"role": "assistant", "content": "Hi there!"} +] +await session.add_items(new_items) + +# Remove and return the most recent item +last_item = await session.pop_item() +print(last_item) # {"role": "assistant", "content": "Hi there!"} + +# Clear all items from a session +await session.clear_session() +``` + +### 修正のための pop_item の使用 + +`pop_item` メソッドは、会話の最後のアイテムを取り消したり変更したりしたい場合に特に便利です: + +```python +from agents import Agent, Runner, SQLiteSession + +agent = Agent(name="Assistant") +session = SQLiteSession("correction_example") + +# Initial conversation +result = await Runner.run( + agent, + "What's 2 + 2?", + session=session +) +print(f"Agent: {result.final_output}") + +# User wants to correct their question +assistant_item = await session.pop_item() # Remove agent's response +user_item = await session.pop_item() # Remove user's question + +# Ask a corrected question +result = await Runner.run( + agent, + "What's 2 + 3?", + session=session +) +print(f"Agent: {result.final_output}") +``` + +## セッションタイプ + +SDK は、さまざまなユースケース向けにいくつかのセッション実装を提供します: + +### OpenAI Conversations API セッション + +`OpenAIConversationsSession` を介して [OpenAI の Conversations API](https://platform.openai.com/docs/api-reference/conversations) を使用します。 + +```python +from agents import Agent, Runner, OpenAIConversationsSession + +# Create agent +agent = Agent( + name="Assistant", + instructions="Reply very concisely.", +) + +# Create a new conversation +session = OpenAIConversationsSession() + +# Optionally resume a previous conversation by passing a conversation ID +# session = OpenAIConversationsSession(conversation_id="conv_123") + +# Start conversation +result = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session +) +print(result.final_output) # "San Francisco" + +# Continue the conversation +result = await Runner.run( + agent, + "What state is it in?", + session=session +) +print(result.final_output) # "California" +``` + +### SQLite セッション + +SQLite を使用したデフォルトの軽量セッション実装: + +```python +from agents import SQLiteSession + +# In-memory database (lost when process ends) +session = SQLiteSession("user_123") + +# Persistent file-based database +session = SQLiteSession("user_123", "conversations.db") + +# Use the session +result = await Runner.run( + agent, + "Hello", + session=session +) +``` + +### SQLAlchemy セッション + +あらゆる SQLAlchemy 対応データベースを使用する本番対応のセッション: + +```python +from agents.extensions.memory import SQLAlchemySession + +# Using database URL +session = SQLAlchemySession.from_url( + "user_123", + url="postgresql+asyncpg://user:pass@localhost/db", + create_tables=True +) + +# Using existing engine +from sqlalchemy.ext.asyncio import create_async_engine +engine = create_async_engine("postgresql+asyncpg://user:pass@localhost/db") +session = SQLAlchemySession("user_123", engine=engine, create_tables=True) +``` + +詳細なドキュメントは [SQLAlchemy セッション](sqlalchemy_session.md) を参照してください。 + +### 高度な SQLite セッション + +会話の分岐、利用分析、構造化クエリを備えた強化版 SQLite セッション: + +```python +from agents.extensions.memory import AdvancedSQLiteSession + +# Create with advanced features +session = AdvancedSQLiteSession( + session_id="user_123", + db_path="conversations.db", + create_tables=True +) + +# Automatic usage tracking +result = await Runner.run(agent, "Hello", session=session) +await session.store_run_usage(result) # Track token usage + +# Conversation branching +await session.create_branch_from_turn(2) # Branch from turn 2 +``` + +詳細なドキュメントは [高度な SQLite セッション](advanced_sqlite_session.md) を参照してください。 + +### 暗号化セッション + +あらゆるセッション実装向けの透過的な暗号化ラッパー: + +```python +from agents.extensions.memory import EncryptedSession, SQLAlchemySession + +# Create underlying session +underlying_session = SQLAlchemySession.from_url( + "user_123", + url="sqlite+aiosqlite:///conversations.db", + create_tables=True +) + +# Wrap with encryption and TTL +session = EncryptedSession( + session_id="user_123", + underlying_session=underlying_session, + encryption_key="your-secret-key", + ttl=600 # 10 minutes +) + +result = await Runner.run(agent, "Hello", session=session) +``` + +詳細なドキュメントは [暗号化セッション](encrypted_session.md) を参照してください。 + +## セッション管理 + +### セッション ID の命名 + +会話を整理しやすい意味のあるセッション ID を使用します: + +- ユーザー単位: `"user_12345"` +- スレッド単位: `"thread_abc123"` +- コンテキスト単位: `"support_ticket_456"` + +### メモリ永続化 + +- 一時的な会話にはインメモリ SQLite(`SQLiteSession("session_id")`)を使用します +- 永続的な会話にはファイルベースの SQLite(`SQLiteSession("session_id", "path/to/db.sqlite")`)を使用します +- 既存のデータベースを SQLAlchemy がサポートする本番システムには SQLAlchemy 対応のセッション(`SQLAlchemySession("session_id", engine=engine, create_tables=True)`)を使用します +- 履歴を OpenAI Conversations API に保存したい場合は OpenAI ホストのストレージ(`OpenAIConversationsSession()`)を使用します +- あらゆるセッションを透過的な暗号化と TTL ベースの有効期限でラップするには暗号化セッション(`EncryptedSession(session_id, underlying_session, encryption_key)`)を使用します +- より高度なユースケースには、他の本番システム(Redis、Django など)向けのカスタムセッションバックエンドの実装を検討してください + +### 複数セッション + +```python +from agents import Agent, Runner, SQLiteSession + +agent = Agent(name="Assistant") + +# Different sessions maintain separate conversation histories +session_1 = SQLiteSession("user_123", "conversations.db") +session_2 = SQLiteSession("user_456", "conversations.db") + +result1 = await Runner.run( + agent, + "Help me with my account", + session=session_1 +) +result2 = await Runner.run( + agent, + "What are my charges?", + session=session_2 +) +``` + +### セッション共有 + +```python +# Different agents can share the same session +support_agent = Agent(name="Support") +billing_agent = Agent(name="Billing") +session = SQLiteSession("user_123") + +# Both agents will see the same conversation history +result1 = await Runner.run( + support_agent, + "Help me with my account", + session=session +) +result2 = await Runner.run( + billing_agent, + "What are my charges?", + session=session +) +``` + +## 完全な例 + +セッションメモリがどのように機能するかを示す完全な例です: + +```python +import asyncio +from agents import Agent, Runner, SQLiteSession + + +async def main(): + # Create an agent + agent = Agent( + name="Assistant", + instructions="Reply very concisely.", + ) + + # Create a session instance that will persist across runs + session = SQLiteSession("conversation_123", "conversation_history.db") + + print("=== Sessions Example ===") + print("The agent will remember previous messages automatically.\n") + + # First turn + print("First turn:") + print("User: What city is the Golden Gate Bridge in?") + result = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session + ) + print(f"Assistant: {result.final_output}") + print() + + # Second turn - the agent will remember the previous conversation + print("Second turn:") + print("User: What state is it in?") + result = await Runner.run( + agent, + "What state is it in?", + session=session + ) + print(f"Assistant: {result.final_output}") + print() + + # Third turn - continuing the conversation + print("Third turn:") + print("User: What's the population of that state?") + result = await Runner.run( + agent, + "What's the population of that state?", + session=session + ) + print(f"Assistant: {result.final_output}") + print() + + print("=== Conversation Complete ===") + print("Notice how the agent remembered the context from previous turns!") + print("Sessions automatically handles conversation history.") + + +if __name__ == "__main__": + asyncio.run(main()) +``` + +## カスタムセッション実装 + +[`Session`][agents.memory.session.Session] プロトコルに従うクラスを作成することで、独自のセッションメモリを実装できます: + +```python +from agents.memory.session import SessionABC +from agents.items import TResponseInputItem +from typing import List + +class MyCustomSession(SessionABC): + """Custom session implementation following the Session protocol.""" + + def __init__(self, session_id: str): + self.session_id = session_id + # Your initialization here + + async def get_items(self, limit: int | None = None) -> List[TResponseInputItem]: + """Retrieve conversation history for this session.""" + # Your implementation here + pass + + async def add_items(self, items: List[TResponseInputItem]) -> None: + """Store new items for this session.""" + # Your implementation here + pass + + async def pop_item(self) -> TResponseInputItem | None: + """Remove and return the most recent item from this session.""" + # Your implementation here + pass + + async def clear_session(self) -> None: + """Clear all items for this session.""" + # Your implementation here + pass + +# Use your custom session +agent = Agent(name="Assistant") +result = await Runner.run( + agent, + "Hello", + session=MyCustomSession("my_session") +) +``` + +## API リファレンス + +詳細な API ドキュメントは以下を参照してください: + +- [`Session`][agents.memory.session.Session] - プロトコルインターフェース +- [`OpenAIConversationsSession`][agents.memory.OpenAIConversationsSession] - OpenAI Conversations API 実装 +- [`SQLiteSession`][agents.memory.sqlite_session.SQLiteSession] - 基本的な SQLite 実装 +- [`SQLAlchemySession`][agents.extensions.memory.sqlalchemy_session.SQLAlchemySession] - SQLAlchemy 対応実装 +- [`AdvancedSQLiteSession`][agents.extensions.memory.advanced_sqlite_session.AdvancedSQLiteSession] - 分岐と分析を備えた強化版 SQLite +- [`EncryptedSession`][agents.extensions.memory.encrypt_session.EncryptedSession] - 任意のセッション向けの暗号化ラッパー \ No newline at end of file diff --git a/docs/ja/sessions/sqlalchemy_session.md b/docs/ja/sessions/sqlalchemy_session.md new file mode 100644 index 000000000..1844a2452 --- /dev/null +++ b/docs/ja/sessions/sqlalchemy_session.md @@ -0,0 +1,80 @@ +--- +search: + exclude: true +--- +# SQLAlchemy セッション + +`SQLAlchemySession` は SQLAlchemy を使用して本番運用に適したセッション実装を提供し、セッションの保存先として SQLAlchemy がサポートする任意のデータベース(PostgreSQL、MySQL、SQLite など)を使用できます。 + +## インストール + +SQLAlchemy セッションには `sqlalchemy` の extra が必要です: + +```bash +pip install openai-agents[sqlalchemy] +``` + +## クイックスタート + +### データベース URL の使用 + +最も簡単な始め方です: + +```python +import asyncio +from agents import Agent, Runner +from agents.extensions.memory import SQLAlchemySession + +async def main(): + agent = Agent("Assistant") + + # Create session using database URL + session = SQLAlchemySession.from_url( + "user-123", + url="sqlite+aiosqlite:///:memory:", + create_tables=True + ) + + result = await Runner.run(agent, "Hello", session=session) + print(result.final_output) + +if __name__ == "__main__": + asyncio.run(main()) +``` + +### 既存のエンジンの使用 + +既存の SQLAlchemy エンジンを使用するアプリケーション向け: + +```python +import asyncio +from agents import Agent, Runner +from agents.extensions.memory import SQLAlchemySession +from sqlalchemy.ext.asyncio import create_async_engine + +async def main(): + # Create your database engine + engine = create_async_engine("postgresql+asyncpg://user:pass@localhost/db") + + agent = Agent("Assistant") + session = SQLAlchemySession( + "user-456", + engine=engine, + create_tables=True + ) + + result = await Runner.run(agent, "Hello", session=session) + print(result.final_output) + + # Clean up + await engine.dispose() + +if __name__ == "__main__": + asyncio.run(main()) +``` + + +## API リファレンス + +- [`SQLAlchemySession`][agents.extensions.memory.sqlalchemy_session.SQLAlchemySession] - メインクラス +- [`Session`][agents.memory.session.Session] - ベースセッションプロトコル \ No newline at end of file diff --git a/docs/ja/streaming.md b/docs/ja/streaming.md index a8a46cca8..72cb5482c 100644 --- a/docs/ja/streaming.md +++ b/docs/ja/streaming.md @@ -4,15 +4,15 @@ search: --- # ストリーミング -ストリーミングを使用すると、 エージェント の実行が進行するにつれて発生する更新を購読できます。これにより、エンド ユーザーに進捗状況や部分的な応答を表示するのに役立ちます。 +ストリーミングを使うと、エージェントの実行が進むにつれて更新を購読できます。これは、エンドユーザーに進行状況の更新や部分的な応答を表示するのに役立ちます。 -ストリーミングを行うには、 [`Runner.run_streamed()`][agents.run.Runner.run_streamed] を呼び出します。これにより [`RunResultStreaming`][agents.result.RunResultStreaming] が返されます。続いて `result.stream_events()` を呼び出すと、後述する [`StreamEvent`][agents.stream_events.StreamEvent] オブジェクトの非同期ストリームを取得できます。 +ストリーミングするには、[`Runner.run_streamed()`][agents.run.Runner.run_streamed] を呼び出します。これにより、[`RunResultStreaming`][agents.result.RunResultStreaming] が得られます。`result.stream_events()` を呼び出すと、以下で説明する [`StreamEvent`][agents.stream_events.StreamEvent] オブジェクトの非同期ストリームを受け取れます。 -## raw response イベント +## raw レスポンスイベント -[`RawResponsesStreamEvent`][agents.stream_events.RawResponsesStreamEvent] は、 LLM から直接渡される raw なイベントです。これらは OpenAI Responses API 形式であり、各イベントには `response.created` や `response.output_text.delta` などの type とデータが含まれます。生成されたメッセージを即座にユーザーへストリーミングしたい場合に便利です。 +[`RawResponsesStreamEvent`][agents.stream_events.RawResponsesStreamEvent] は、LLM から直接渡される raw なイベントです。OpenAI Responses API フォーマットであり、各イベントには `response.created` や `response.output_text.delta` などのタイプとデータがあります。これらのイベントは、生成され次第、応答メッセージをユーザーにストリーミングしたい場合に有用です。 -たとえば、以下のコードは LLM が生成したテキストをトークンごとに出力します。 +例えば、次のコードは LLM が生成するテキストをトークンごとに出力します。 ```python import asyncio @@ -35,11 +35,11 @@ if __name__ == "__main__": asyncio.run(main()) ``` -## Run item イベントと エージェント イベント +## Run アイテムイベントと エージェントイベント -[`RunItemStreamEvent`][agents.stream_events.RunItemStreamEvent] は、より高レベルなイベントです。アイテムが完全に生成されたタイミングを通知するため、トークン単位ではなく「メッセージが生成された」「ツールが実行された」といったレベルで進捗をプッシュできます。同様に、 [`AgentUpdatedStreamEvent`][agents.stream_events.AgentUpdatedStreamEvent] はハンドオフなどで現在の エージェント が変わった際に更新を提供します。 +[`RunItemStreamEvent`][agents.stream_events.RunItemStreamEvent] は、より高レベルなイベントです。アイテムが完全に生成されたタイミングを通知します。これにより、各トークンではなく、「メッセージが生成された」「ツールが実行された」などのレベルで進捗をプッシュできます。同様に、[`AgentUpdatedStreamEvent`][agents.stream_events.AgentUpdatedStreamEvent] は、現在のエージェントが変更されたとき(例: ハンドオフの結果として)に更新を提供します。 -たとえば、以下のコードは raw イベントを無視し、ユーザーへ更新のみをストリーミングします。 +例えば、次のコードは raw イベントを無視し、ユーザーに更新をストリーミングします。 ```python import asyncio diff --git a/docs/ja/tools.md b/docs/ja/tools.md index cd80092d5..548600aef 100644 --- a/docs/ja/tools.md +++ b/docs/ja/tools.md @@ -4,23 +4,23 @@ search: --- # ツール -ツールはエージェントがアクションを実行できるようにします。たとえばデータの取得、コードの実行、外部 API の呼び出し、さらにはコンピュータ操作などです。Agents SDK には次の 3 種類のツールがあります。 +ツールは エージェント にアクションを実行させます。たとえば、データの取得、コードの実行、外部 API の呼び出し、さらにはコンピュータの使用などです。Agent SDK には次の 3 種類のツールがあります。 -- ホストツール: これらは LLM サーバー上で AI モデルと一緒に実行されます。OpenAI は retrieval、Web 検索、コンピュータ操作をホストツールとして提供しています。 -- 関数呼び出し: 任意の Python 関数をツールとして利用できます。 -- ツールとしてのエージェント: ハンドオフせずに、エージェントから他のエージェントを呼び出すことができます。 +- ホスト型ツール: これらは AI モデルと同じ LLM サーバー上で動作します。OpenAI は retrieval、Web 検索、コンピュータ操作 をホスト型ツールとして提供しています。 +- Function calling: 任意の Python 関数をツールとして使用できます。 +- エージェントをツールとして使用: エージェントをツールとして利用でき、ハンドオフ せずに他の エージェント を呼び出せます。 -## ホストツール +## ホスト型ツール -OpenAI は [`OpenAIResponsesModel`][agents.models.openai_responses.OpenAIResponsesModel] を使用する際に、いくつかの組み込みツールを提供しています。 +OpenAI は、[`OpenAIResponsesModel`][agents.models.openai_responses.OpenAIResponsesModel] を使用する際にいくつかの組み込みツールを提供しています。 -- [`WebSearchTool`][agents.tool.WebSearchTool] はエージェントに Web 検索を行わせます。 -- [`FileSearchTool`][agents.tool.FileSearchTool] は OpenAI ベクトルストアから情報を取得します。 -- [`ComputerTool`][agents.tool.ComputerTool] はコンピュータ操作タスクを自動化します。 -- [`CodeInterpreterTool`][agents.tool.CodeInterpreterTool] はサンドボックス環境でコードを実行します。 -- [`HostedMCPTool`][agents.tool.HostedMCPTool] はリモート MCP サーバーのツールをモデルから直接利用できるようにします。 +- [`WebSearchTool`][agents.tool.WebSearchTool] は エージェント に Web を検索させます。 +- [`FileSearchTool`][agents.tool.FileSearchTool] は OpenAI の ベクトルストア から情報を取得できます。 +- [`ComputerTool`][agents.tool.ComputerTool] は コンピュータ操作 の自動化を可能にします。 +- [`CodeInterpreterTool`][agents.tool.CodeInterpreterTool] は LLM がサンドボックス環境でコードを実行できるようにします。 +- [`HostedMCPTool`][agents.tool.HostedMCPTool] はリモートの MCP サーバー のツールをモデルに公開します。 - [`ImageGenerationTool`][agents.tool.ImageGenerationTool] はプロンプトから画像を生成します。 -- [`LocalShellTool`][agents.tool.LocalShellTool] はローカルマシンでシェルコマンドを実行します。 +- [`LocalShellTool`][agents.tool.LocalShellTool] はローカルマシン上でシェルコマンドを実行します。 ```python from agents import Agent, FileSearchTool, Runner, WebSearchTool @@ -43,14 +43,14 @@ async def main(): ## 関数ツール -任意の Python 関数をツールとして使用できます。Agents SDK が自動的に設定を行います。 +任意の Python 関数をツールとして使用できます。Agents SDK がツールの設定を自動で行います。 -- ツールの名前は Python 関数の名前になります(任意で名前を指定することも可能です) -- ツールの説明は関数の docstring から取得されます(任意で説明を指定することも可能です) -- 関数の引数から自動的に入力スキーマを生成します -- 各入力の説明は、無効化しない限り docstring から取得されます +- ツール名は Python 関数名になります(任意で名前を指定可能) +- ツールの説明は関数の docstring から取得します(任意で説明を指定可能) +- 関数入力のスキーマは、関数の引数から自動生成されます +- 各入力の説明は、無効化しない限り関数の docstring から取得します -Python の `inspect` モジュールを使用して関数シグネチャを抽出し、[`griffe`](https://mkdocstrings.github.io/griffe/) で docstring を解析し、`pydantic` でスキーマを作成します。 +Python の `inspect` モジュールで関数シグネチャを抽出し、[`griffe`](https://mkdocstrings.github.io/griffe/) で docstring を解析、スキーマ作成には `pydantic` を使用します。 ```python import json @@ -102,12 +102,12 @@ for tool in agent.tools: ``` -1. 関数の引数には任意の Python 型を使用でき、同期・非同期どちらの関数も利用できます。 -2. docstring が存在する場合、ツールと引数の説明を取得します。 -3. 関数はオプションで `context` を受け取れます(最初の引数である必要があります)。ツール名、説明、docstring のスタイルなどを上書き設定することも可能です。 -4. デコレートされた関数をツールのリストに渡してください。 +1. 関数の引数には任意の Python 型を使用でき、関数は同期/非同期どちらでも構いません。 +2. docstring があれば、ツールと引数の説明の取得に使用します。 +3. 関数は任意で `context` を受け取れます(最初の引数である必要があります)。ツール名や説明、docstring のスタイルなどのオーバーライドも設定できます。 +4. デコレートした関数をツールのリストに渡せます。 -??? note "展開して出力を確認" +??? note "Expand to see output" ``` fetch_weather @@ -177,14 +177,22 @@ for tool in agent.tools: } ``` +### 関数ツールからの画像やファイルの返却 + +テキスト出力に加えて、関数ツールの出力として 1 つまたは複数の画像やファイルを返すこともできます。次のいずれかを返せます。 + +- 画像: [`ToolOutputImage`][agents.tool.ToolOutputImage](または TypedDict 版の [`ToolOutputImageDict`][agents.tool.ToolOutputImageDict]) +- ファイル: [`ToolOutputFileContent`][agents.tool.ToolOutputFileContent](または TypedDict 版の [`ToolOutputFileContentDict`][agents.tool.ToolOutputFileContentDict]) +- テキスト: 文字列または文字列化可能オブジェクト、または [`ToolOutputText`][agents.tool.ToolOutputText](または TypedDict 版の [`ToolOutputTextDict`][agents.tool.ToolOutputTextDict]) + ### カスタム関数ツール -Python 関数をそのままツールにしたくない場合は、[`FunctionTool`][agents.tool.FunctionTool] を直接作成できます。次を指定する必要があります。 +Python 関数をツールとして使いたくない場合もあります。必要であれば直接 [`FunctionTool`][agents.tool.FunctionTool] を作成できます。以下を提供する必要があります。 - `name` - `description` - `params_json_schema`(引数の JSON スキーマ) -- `on_invoke_tool`(context と引数の JSON 文字列を受け取り、ツールの出力を文字列で返す async 関数) +- `on_invoke_tool`([`ToolContext`][agents.tool_context.ToolContext] と引数の JSON 文字列を受け取り、ツールの出力を文字列で返す非同期関数) ```python from typing import Any @@ -219,16 +227,16 @@ tool = FunctionTool( ### 引数と docstring の自動解析 -前述のとおり、関数シグネチャを自動解析してツールのスキーマを生成し、docstring を解析してツールおよび個別引数の説明を抽出します。主な注意点は次のとおりです。 +前述のとおり、ツールのスキーマを抽出するために関数シグネチャを自動解析し、ツール本体と各引数の説明を抽出するために docstring を解析します。ポイントは次のとおりです。 -1. シグネチャ解析は `inspect` モジュールで行います。型アノテーションを用いて引数の型を認識し、Pydantic モデルを動的に構築して全体のスキーマを表現します。Python の基本型、Pydantic モデル、TypedDict などほとんどの型をサポートします。 -2. `griffe` を使用して docstring を解析します。対応する docstring 形式は `google`、`sphinx`、`numpy` です。形式は自動検出を試みますが、`function_tool` 呼び出し時に明示的に指定することもできます。`use_docstring_info` を `False` に設定すると docstring 解析を無効化できます。 +1. シグネチャ解析は `inspect` モジュールで行います。型アノテーションから引数の型を把握し、全体スキーマを表す Pydantic モデルを動的に構築します。Python の基本型、Pydantic モデル、TypedDict など、ほとんどの型をサポートします。 +2. docstring の解析には `griffe` を使用します。サポートする docstring 形式は `google`、`sphinx`、`numpy` です。docstring 形式は自動検出を試みますがベストエフォートのため、`function_tool` 呼び出し時に明示的に指定できます。`use_docstring_info` を `False` に設定すると docstring 解析を無効化できます。 スキーマ抽出のコードは [`agents.function_schema`][] にあります。 -## ツールとしてのエージェント +## エージェントをツールとして使用 -一部のワークフローでは、ハンドオフせずに中央のエージェントが複数の専門エージェントをオーケストレーションしたい場合があります。そのような場合、エージェントをツールとしてモデル化できます。 +一部のワークフローでは、ハンドオフ せずに中央の エージェント が専門特化した エージェント 群をオーケストレーションしたい場合があります。これは エージェント をツールとしてモデリングすることで実現できます。 ```python from agents import Agent, Runner @@ -267,14 +275,14 @@ async def main(): print(result.final_output) ``` -### ツールエージェントのカスタマイズ +### ツール化したエージェントのカスタマイズ -`agent.as_tool` 関数はエージェントを簡単にツール化するためのヘルパーです。ただし、すべての設定に対応しているわけではありません(例: `max_turns` は設定不可)。高度なユースケースでは、ツール実装内で `Runner.run` を直接使用してください。 +`agent.as_tool` 関数は エージェント をツールに変換しやすくするための簡便メソッドです。ただし、すべての設定をサポートしているわけではありません。例えば `max_turns` は設定できません。高度なユースケースでは、ツール実装内で直接 `Runner.run` を使用してください。 ```python @function_tool async def run_my_agent() -> str: - """A tool that runs the agent with custom configs". + """A tool that runs the agent with custom configs""" agent = Agent(name="My agent", instructions="...") @@ -288,12 +296,130 @@ async def run_my_agent() -> str: return str(result.final_output) ``` +### カスタム出力抽出 + +状況によっては、中央の エージェント に返す前にツール化した エージェント の出力を加工したいことがあります。例えば次のような場合に有用です。 + +- サブエージェントのチャット履歴から特定情報(例: JSON ペイロード)を抽出する。 +- エージェント の最終回答を変換・再整形する(例: Markdown をプレーンテキストや CSV に変換)。 +- 出力を検証し、 エージェント の応答が欠落または不正な場合にフォールバック値を用意する。 + +これは `as_tool` メソッドに `custom_output_extractor` 引数を指定することで実現できます。 + +```python +async def extract_json_payload(run_result: RunResult) -> str: + # Scan the agent’s outputs in reverse order until we find a JSON-like message from a tool call. + for item in reversed(run_result.new_items): + if isinstance(item, ToolCallOutputItem) and item.output.strip().startswith("{"): + return item.output.strip() + # Fallback to an empty JSON object if nothing was found + return "{}" + + +json_tool = data_agent.as_tool( + tool_name="get_data_json", + tool_description="Run the data agent and return only its JSON payload", + custom_output_extractor=extract_json_payload, +) +``` + +### 条件付きツール有効化 + +実行時に `is_enabled` パラメーター を使って エージェント ツールを条件付きで有効化/無効化できます。これにより、コンテキスト、ユーザー の嗜好、実行時条件に基づいて、LLM が利用可能なツールを動的にフィルタリングできます。 + +```python +import asyncio +from agents import Agent, AgentBase, Runner, RunContextWrapper +from pydantic import BaseModel + +class LanguageContext(BaseModel): + language_preference: str = "french_spanish" + +def french_enabled(ctx: RunContextWrapper[LanguageContext], agent: AgentBase) -> bool: + """Enable French for French+Spanish preference.""" + return ctx.context.language_preference == "french_spanish" + +# Create specialized agents +spanish_agent = Agent( + name="spanish_agent", + instructions="You respond in Spanish. Always reply to the user's question in Spanish.", +) + +french_agent = Agent( + name="french_agent", + instructions="You respond in French. Always reply to the user's question in French.", +) + +# Create orchestrator with conditional tools +orchestrator = Agent( + name="orchestrator", + instructions=( + "You are a multilingual assistant. You use the tools given to you to respond to users. " + "You must call ALL available tools to provide responses in different languages. " + "You never respond in languages yourself, you always use the provided tools." + ), + tools=[ + spanish_agent.as_tool( + tool_name="respond_spanish", + tool_description="Respond to the user's question in Spanish", + is_enabled=True, # Always enabled + ), + french_agent.as_tool( + tool_name="respond_french", + tool_description="Respond to the user's question in French", + is_enabled=french_enabled, + ), + ], +) + +async def main(): + context = RunContextWrapper(LanguageContext(language_preference="french_spanish")) + result = await Runner.run(orchestrator, "How are you?", context=context.context) + print(result.final_output) + +asyncio.run(main()) +``` + +`is_enabled` パラメーター は次を受け付けます。 + +- **Boolean values**: `True`(常に有効)または `False`(常に無効) +- **Callable functions**: `(context, agent)` を受け取り boolean を返す関数 +- **Async functions**: 複雑な条件ロジック向けの非同期関数 + +無効化されたツールは実行時に LLM から完全に隠されるため、次の用途に役立ちます。 + +- ユーザー 権限に基づく機能ゲーティング +- 環境別のツール可用性(dev と prod) +- ツール構成の A/B テスト +- 実行時状態に基づく動的ツールフィルタリング + ## 関数ツールでのエラー処理 -`@function_tool` で関数ツールを作成する際、`failure_error_function` を渡せます。これはツール呼び出しが失敗した場合に LLM へ返すエラーレスポンスを生成する関数です。 +`@function_tool` で関数ツールを作成する際、`failure_error_function` を渡せます。これは、ツール呼び出しがクラッシュした場合に LLM にエラーレスポンスを提供する関数です。 + +- 既定(何も渡さない場合)は、エラーが発生したことを LLM に伝える `default_tool_error_function` が実行されます。 +- 独自のエラー関数を渡した場合はそれが実行され、そのレスポンスが LLM に送信されます。 +- 明示的に `None` を渡した場合、ツール呼び出しエラーは再スローされ、呼び出し側で処理することになります。これは、モデルが不正な JSON を生成した場合の `ModelBehaviorError`、あなたのコードがクラッシュした場合の `UserError` などになり得ます。 -- 何も指定しない場合、`default_tool_error_function` が実行され、LLM にエラー発生を伝えます。 -- 独自のエラー関数を渡した場合はそちらが実行され、そのレスポンスが LLM へ送信されます。 -- 明示的に `None` を渡すと、ツール呼び出し時のエラーは再送出されます。モデルが無効な JSON を生成した場合は `ModelBehaviorError`、コードがクラッシュした場合は `UserError` などになります。 +```python +from agents import function_tool, RunContextWrapper +from typing import Any + +def my_custom_error_function(context: RunContextWrapper[Any], error: Exception) -> str: + """A custom function to provide a user-friendly error message.""" + print(f"A tool call failed with the following error: {error}") + return "An internal server error occurred. Please try again later." + +@function_tool(failure_error_function=my_custom_error_function) +def get_user_profile(user_id: str) -> str: + """Fetches a user profile from a mock API. + This function demonstrates a 'flaky' or failing API call. + """ + if user_id == "user_123": + return "User profile for user_123 successfully retrieved." + else: + raise ValueError(f"Could not retrieve profile for user_id: {user_id}. API returned an error.") + +``` `FunctionTool` オブジェクトを手動で作成する場合は、`on_invoke_tool` 関数内でエラーを処理する必要があります。 \ No newline at end of file diff --git a/docs/ja/tracing.md b/docs/ja/tracing.md index d67200ce4..f3efe8609 100644 --- a/docs/ja/tracing.md +++ b/docs/ja/tracing.md @@ -4,52 +4,52 @@ search: --- # トレーシング -Agents SDK にはビルトインのトレーシング機能があり、エージェントの実行中に発生するイベント―― LLM 生成、ツール呼び出し、ハンドオフ、ガードレール、さらにカスタムイベントまで――を網羅的に記録します。開発時と本番環境の両方で [Traces dashboard](https://platform.openai.com/traces) を使用すると、ワークフローをデバッグ・可視化・モニタリングできます。 +Agents SDK には組み込みのトレーシングが含まれており、エージェントの実行中に発生するイベントの包括的な記録を収集します。LLM 生成、ツール呼び出し、ハンドオフ、ガードレール、さらにはカスタムイベントまで記録します。[Traces ダッシュボード](https://platform.openai.com/traces)を使用すると、開発中および本番環境でワークフローをデバッグ、可視化、監視できます。 !!!note - トレーシングはデフォルトで有効です。無効化する方法は次の 2 つです: + トレーシングはデフォルトで有効です。トレーシングを無効化する方法は 2 つあります: - 1. 環境変数 `OPENAI_AGENTS_DISABLE_TRACING=1` を設定してグローバルに無効化する - 2. 単一の実行に対しては [`agents.run.RunConfig.tracing_disabled`][] を `True` に設定する + 1. 環境変数 `OPENAI_AGENTS_DISABLE_TRACING=1` を設定して、トレーシングをグローバルに無効化できます + 2. 1 回の実行についてのみ、[`agents.run.RunConfig.tracing_disabled`][] を `True` に設定して無効化できます -***OpenAI の API を Zero Data Retention (ZDR) ポリシーで利用している組織では、トレーシングを利用できません。*** +***OpenAI の API を使用し Zero Data Retention (ZDR) ポリシーの下で運用している組織では、トレーシングは使用できません。*** ## トレースとスパン -- **トレース** は 1 度のワークフロー全体を表します。複数のスパンで構成され、次のプロパティを持ちます: - - `workflow_name`: 論理的なワークフローまたはアプリ名。例: 「Code generation」や「Customer service」 - - `trace_id`: トレースを一意に識別する ID。指定しない場合は自動生成されます。形式は `trace_<32_alphanumeric>` である必要があります。 - - `group_id`: オプションのグループ ID。会話内の複数トレースを関連付けます。たとえばチャットスレッド ID など。 - - `disabled`: `True` の場合、このトレースは記録されません。 - - `metadata`: トレースに付随する任意のメタデータ。 -- **スパン** は開始時刻と終了時刻を持つ個々の処理を表します。スパンは以下を保持します: - - `started_at` と `ended_at` タイムスタンプ - - 所属トレースを示す `trace_id` - - 親スパンを指す `parent_id` (存在する場合) - - スパンに関する情報を格納する `span_data`。たとえば `AgentSpanData` にはエージェント情報が、`GenerationSpanData` には LLM 生成情報が含まれます。 +- **トレース** は「ワークフロー」の単一のエンドツーエンド処理を表します。スパンで構成されます。トレースには次のプロパティがあります: + - `workflow_name`: 論理的なワークフローまたはアプリ名です。例: "Code generation" や "Customer service" + - `trace_id`: トレースの一意の ID。渡さない場合は自動生成されます。`trace_<32_alphanumeric>` の形式である必要があります + - `group_id`: 同じ会話からの複数のトレースを紐づけるための任意のグループ ID。たとえばチャットスレッド ID など + - `disabled`: True の場合、そのトレースは記録されません + - `metadata`: トレース用の任意のメタデータ +- **スパン** は開始時刻と終了時刻を持つ操作を表します。スパンには次の情報があります: + - `started_at` と `ended_at` のタイムスタンプ + - 所属するトレースを示す `trace_id` + - 親スパンを指す `parent_id`(ある場合) + - スパンに関する情報である `span_data`。たとえば、`AgentSpanData` はエージェントに関する情報、`GenerationSpanData` は LLM 生成に関する情報を含みます ## デフォルトのトレーシング -デフォルトで SDK は以下をトレースします: +デフォルトで、SDK は次をトレースします: -- `Runner.{run, run_sync, run_streamed}()` 全体を `trace()` でラップ -- エージェントが実行されるたびに `agent_span()` でラップ -- LLM 生成を `generation_span()` でラップ -- 関数ツール呼び出しを `function_span()` でラップ -- ガードレールを `guardrail_span()` でラップ -- ハンドオフを `handoff_span()` でラップ -- 音声入力 (speech‑to‑text) を `transcription_span()` でラップ -- 音声出力 (text‑to‑speech) を `speech_span()` でラップ -- 関連する音声スパンは `speech_group_span()` の下にネストされる場合があります +- 全体の `Runner.{run, run_sync, run_streamed}()` は `trace()` でラップされます +- エージェントが実行されるたびに、`agent_span()` でラップされます +- LLM 生成は `generation_span()` でラップされます +- 関数ツールの呼び出しはそれぞれ `function_span()` でラップされます +- ガードレールは `guardrail_span()` でラップされます +- ハンドオフは `handoff_span()` でラップされます +- 音声入力(音声認識)は `transcription_span()` でラップされます +- 音声出力(テキスト読み上げ)は `speech_span()` でラップされます +- 関連する音声スパンは `speech_group_span()` の下に親子付けされる場合があります -トレース名はデフォルトで「Agent trace」です。`trace` を使用して指定したり、[`RunConfig`][agents.run.RunConfig] で名前やその他のプロパティを設定できます。 +デフォルトでは、トレース名は "Agent workflow" です。`trace` を使用してこの名前を設定できますし、[`RunConfig`][agents.run.RunConfig] を使って名前やその他のプロパティを設定することもできます。 -さらに [カスタムトレーシングプロセッサー](#custom-tracing-processors) を設定して、トレースを別の送信先に出力(置き換えまたは追加)することも可能です。 +さらに、[カスタム トレース プロセッサー](#custom-tracing-processors) を設定して、別の宛先へ(置き換え、または副次的な宛先として)トレースを送信できます。 ## 上位レベルのトレース -複数回の `run()` 呼び出しを 1 つのトレースにまとめたい場合があります。その場合、コード全体を `trace()` でラップします。 +ときどき、複数回の `run()` 呼び出しを単一のトレースに含めたいことがあります。これはコード全体を `trace()` でラップすることで実現できます。 ```python from agents import Agent, Runner, trace @@ -64,60 +64,88 @@ async def main(): print(f"Rating: {second_result.final_output}") ``` -1. `with trace()` で 2 つの `Runner.run` 呼び出しをラップしているため、それぞれが個別のトレースを作成せず、全体で 1 つのトレースになります。 +1. `Runner.run` への 2 回の呼び出しが `with trace()` でラップされているため、個々の実行は 2 つのトレースを作成するのではなく、全体のトレースの一部になります。 ## トレースの作成 -[`trace()`][agents.tracing.trace] 関数を使ってトレースを作成できます。開始と終了が必要で、方法は 2 つあります。 +[`trace()`][agents.tracing.trace] 関数を使ってトレースを作成できます。トレースは開始と終了が必要です。方法は 2 つあります: -1. **推奨**: `with trace(...) as my_trace` のようにコンテキストマネージャーとして使用する。開始と終了が自動で行われます。 -2. [`trace.start()`][agents.tracing.Trace.start] と [`trace.finish()`][agents.tracing.Trace.finish] を手動で呼び出す。 +1. 推奨: トレースをコンテキストマネージャとして使用します(例: `with trace(...) as my_trace`)。これにより適切なタイミングでトレースの開始と終了が自動化されます。 +2. [`trace.start()`][agents.tracing.Trace.start] と [`trace.finish()`][agents.tracing.Trace.finish] を手動で呼び出すこともできます。 -現在のトレースは Python の [`contextvar`](https://docs.python.org/3/library/contextvars.html) で管理されているため、並行処理でも自動で機能します。手動で開始/終了する場合は `start()`/`finish()` に `mark_as_current` と `reset_current` を渡して現在のトレースを更新してください。 +現在のトレースは Python の [`contextvar`](https://docs.python.org/3/library/contextvars.html) を通じて追跡されます。これにより自動的に並行処理で機能します。トレースを手動で開始/終了する場合、現在のトレースを更新するために `start()`/`finish()` に `mark_as_current` と `reset_current` を渡す必要があります。 ## スパンの作成 -各種 [`*_span()`][agents.tracing.create] メソッドでスパンを作成できます。一般的には手動で作成する必要はありません。カスタム情報を追跡するための [`custom_span()`][agents.tracing.custom_span] も利用できます。 +さまざまな [`*_span()`][agents.tracing.create] メソッドを使ってスパンを作成できます。一般に、スパンを手動で作成する必要はありません。カスタムのスパン情報を追跡するために [`custom_span()`][agents.tracing.custom_span] 関数を使用できます。 -スパンは自動的に現在のトレースの一部となり、最も近い現在のスパンの下にネストされます。これも Python の [`contextvar`](https://docs.python.org/3/library/contextvars.html) で管理されています。 +スパンは自動的に現在のトレースの一部となり、Python の [`contextvar`](https://docs.python.org/3/library/contextvars.html) によって追跡される、最も近い現在のスパンの下にネストされます。 -## 機密データ +## 機微なデータ -一部のスパンでは機密データが収集される可能性があります。 +一部のスパンは機微なデータを取得する可能性があります。 -`generation_span()` には LLM の入力と出力、`function_span()` には関数呼び出しの入力と出力が保存されます。これらに機密データが含まれる場合、[`RunConfig.trace_include_sensitive_data`][agents.run.RunConfig.trace_include_sensitive_data] を使用して記録を無効化できます。 +`generation_span()` は LLM 生成の入力/出力を保存し、`function_span()` は関数呼び出しの入力/出力を保存します。これらには機微なデータが含まれる場合があるため、[`RunConfig.trace_include_sensitive_data`][agents.run.RunConfig.trace_include_sensitive_data] を使用してそのデータの取得を無効化できます。 -同様に、音声スパンにはデフォルトで base64 エンコードされた PCM 音声データが含まれます。[`VoicePipelineConfig.trace_include_sensitive_audio_data`][agents.voice.pipeline_config.VoicePipelineConfig.trace_include_sensitive_audio_data] を設定して音声データの記録を無効化できます。 +同様に、音声スパンにはデフォルトで入出力音声の base64 エンコードされた PCM データが含まれます。[`VoicePipelineConfig.trace_include_sensitive_audio_data`][agents.voice.pipeline_config.VoicePipelineConfig.trace_include_sensitive_audio_data] を設定して、この音声データの取得を無効化できます。 -## カスタムトレーシングプロセッサー +## カスタム トレーシング プロセッサー -トレーシングの高レベル構成は次のとおりです。 +トレーシングの高レベルなアーキテクチャは次のとおりです: -- 初期化時にグローバルな [`TraceProvider`][agents.tracing.setup.TraceProvider] を作成し、トレースを生成。 -- `TraceProvider` は [`BatchTraceProcessor`][agents.tracing.processors.BatchTraceProcessor] を用いてスパン/トレースをバッチ送信し、[`BackendSpanExporter`][agents.tracing.processors.BackendSpanExporter] が OpenAI バックエンドへバッチでエクスポートします。 +- 初期化時に、トレースを作成する役割を持つグローバルな [`TraceProvider`][agents.tracing.setup.TraceProvider] を作成します。 +- `TraceProvider` に [`BatchTraceProcessor`][agents.tracing.processors.BatchTraceProcessor] を設定し、トレース/スパンをバッチで [`BackendSpanExporter`][agents.tracing.processors.BackendSpanExporter] に送信します。Exporter はスパンとトレースをバッチで OpenAI のバックエンドにエクスポートします。 -デフォルト設定を変更して別のバックエンドへ送信したり、エクスポーターの挙動を修正するには次の 2 通りがあります。 +このデフォルト設定をカスタマイズし、別のバックエンドへの送信や追加のバックエンドへの送信、あるいは Exporter の動作を変更するには、次の 2 つの方法があります: -1. [`add_trace_processor()`][agents.tracing.add_trace_processor] - 既定の送信に加え、**追加** のトレースプロセッサーを登録できます。これにより OpenAI バックエンドへの送信に加えて独自処理が可能です。 -2. [`set_trace_processors()`][agents.tracing.set_trace_processors] - 既定のプロセッサーを置き換え、**独自** のトレースプロセッサーだけを使用します。OpenAI バックエンドへ送信する場合は、その機能を持つ `TracingProcessor` を含める必要があります。 +1. [`add_trace_processor()`][agents.tracing.add_trace_processor] は、トレースやスパンが準備でき次第受け取る、追加のトレース プロセッサーを追加できます。これにより、OpenAI のバックエンドへの送信に加えて独自の処理を実施できます。 +2. [`set_trace_processors()`][agents.tracing.set_trace_processors] は、デフォルトのプロセッサーを独自のトレース プロセッサーに置き換えることができます。つまり、OpenAI のバックエンドにトレースが送信されるのは、送信を行う `TracingProcessor` を含めた場合に限られます。 -## 外部トレーシングプロセッサー一覧 +## OpenAI 以外のモデルでのトレーシング -- [Weights & Biases](https://weave-docs.wandb.ai/guides/integrations/openai_agents) -- [Arize‑Phoenix](https://docs.arize.com/phoenix/tracing/integrations-tracing/openai-agents-sdk) -- [MLflow (self‑hosted/OSS](https://mlflow.org/docs/latest/tracing/integrations/openai-agent) -- [MLflow (Databricks hosted](https://docs.databricks.com/aws/en/mlflow/mlflow-tracing#-automatic-tracing) -- [Braintrust](https://braintrust.dev/docs/guides/traces/integrations#openai-agents-sdk) -- [Pydantic Logfire](https://logfire.pydantic.dev/docs/integrations/llms/openai/#openai-agents) -- [AgentOps](https://docs.agentops.ai/v1/integrations/agentssdk) -- [Scorecard](https://docs.scorecard.io/docs/documentation/features/tracing#openai-agents-sdk-integration) -- [Keywords AI](https://docs.keywordsai.co/integration/development-frameworks/openai-agent) -- [LangSmith](https://docs.smith.langchain.com/observability/how_to_guides/trace_with_openai_agents_sdk) -- [Maxim AI](https://www.getmaxim.ai/docs/observe/integrations/openai-agents-sdk) -- [Comet Opik](https://www.comet.com/docs/opik/tracing/integrations/openai_agents) -- [Langfuse](https://langfuse.com/docs/integrations/openaiagentssdk/openai-agents) -- [Langtrace](https://docs.langtrace.ai/supported-integrations/llm-frameworks/openai-agents-sdk) -- [Okahu‑Monocle](https://github.com/monocle2ai/monocle) -- [Portkey AI](https://portkey.ai/docs/integrations/agents/openai-agents) +OpenAI の API キーを、OpenAI 以外のモデルとともに使用して、トレーシングを無効化することなく OpenAI Traces ダッシュボードで無料のトレーシングを有効にできます。 + +```python +import os +from agents import set_tracing_export_api_key, Agent, Runner +from agents.extensions.models.litellm_model import LitellmModel + +tracing_api_key = os.environ["OPENAI_API_KEY"] +set_tracing_export_api_key(tracing_api_key) + +model = LitellmModel( + model="your-model-name", + api_key="your-api-key", +) + +agent = Agent( + name="Assistant", + model=model, +) +``` + +## 注意 +- 無料のトレースは OpenAI Traces ダッシュボードで表示できます。 + +## 外部トレーシング プロセッサー一覧 + +- [Weights & Biases](https://weave-docs.wandb.ai/guides/integrations/openai_agents) +- [Arize-Phoenix](https://docs.arize.com/phoenix/tracing/integrations-tracing/openai-agents-sdk) +- [Future AGI](https://docs.futureagi.com/future-agi/products/observability/auto-instrumentation/openai_agents) +- [MLflow (self-hosted/OSS)](https://mlflow.org/docs/latest/tracing/integrations/openai-agent) +- [MLflow (Databricks hosted)](https://docs.databricks.com/aws/en/mlflow/mlflow-tracing#-automatic-tracing) +- [Braintrust](https://braintrust.dev/docs/guides/traces/integrations#openai-agents-sdk) +- [Pydantic Logfire](https://logfire.pydantic.dev/docs/integrations/llms/openai/#openai-agents) +- [AgentOps](https://docs.agentops.ai/v1/integrations/agentssdk) +- [Scorecard](https://docs.scorecard.io/docs/documentation/features/tracing#openai-agents-sdk-integration) +- [Keywords AI](https://docs.keywordsai.co/integration/development-frameworks/openai-agent) +- [LangSmith](https://docs.smith.langchain.com/observability/how_to_guides/trace_with_openai_agents_sdk) +- [Maxim AI](https://www.getmaxim.ai/docs/observe/integrations/openai-agents-sdk) +- [Comet Opik](https://www.comet.com/docs/opik/tracing/integrations/openai_agents) +- [Langfuse](https://langfuse.com/docs/integrations/openaiagentssdk/openai-agents) +- [Langtrace](https://docs.langtrace.ai/supported-integrations/llm-frameworks/openai-agents-sdk) +- [Okahu-Monocle](https://github.com/monocle2ai/monocle) +- [Galileo](https://v2docs.galileo.ai/integrations/openai-agent-integration#openai-agent-integration) +- [Portkey AI](https://portkey.ai/docs/integrations/agents/openai-agents) +- [LangDB AI](https://docs.langdb.ai/getting-started/working-with-agent-frameworks/working-with-openai-agents-sdk) +- [Agenta](https://docs.agenta.ai/observability/integrations/openai-agents) \ No newline at end of file diff --git a/docs/ja/usage.md b/docs/ja/usage.md new file mode 100644 index 000000000..fc36165e0 --- /dev/null +++ b/docs/ja/usage.md @@ -0,0 +1,86 @@ +--- +search: + exclude: true +--- +# 使用状況 + +Agents SDK は、すべての run の token 使用状況を自動的に追跡します。run コンテキストからアクセスでき、コストの監視、制限の適用、分析の記録に利用できます。 + +## 追跡対象 + +- **requests**: 実行された LLM API 呼び出し数 +- **input_tokens**: 送信された入力 token の合計 +- **output_tokens**: 受信した出力 token の合計 +- **total_tokens**: 入力 + 出力 +- **details**: + - `input_tokens_details.cached_tokens` + - `output_tokens_details.reasoning_tokens` + +## 実行からの使用状況の取得 + +`Runner.run(...)` の後、`result.context_wrapper.usage` から使用状況にアクセスします。 + +```python +result = await Runner.run(agent, "What's the weather in Tokyo?") +usage = result.context_wrapper.usage + +print("Requests:", usage.requests) +print("Input tokens:", usage.input_tokens) +print("Output tokens:", usage.output_tokens) +print("Total tokens:", usage.total_tokens) +``` + +使用状況は、実行中のすべてのモデル呼び出し(ツール呼び出しや handoffs を含む)にわたって集計されます。 + +### LiteLLM モデルでの使用状況の有効化 + +LiteLLM プロバイダーは、デフォルトでは使用状況メトリクスを報告しません。[`LitellmModel`](models/litellm.md) を使用する場合は、`ModelSettings(include_usage=True)` をエージェントに渡して、LiteLLM のレスポンスが `result.context_wrapper.usage` を埋めるようにします。 + +```python +from agents import Agent, ModelSettings, Runner +from agents.extensions.models.litellm_model import LitellmModel + +agent = Agent( + name="Assistant", + model=LitellmModel(model="your/model", api_key="..."), + model_settings=ModelSettings(include_usage=True), +) + +result = await Runner.run(agent, "What's the weather in Tokyo?") +print(result.context_wrapper.usage.total_tokens) +``` + +## セッションでの使用状況の取得 + +`Session`(例: `SQLiteSession`)を使用する場合、`Runner.run(...)` の各呼び出しは、その実行に固有の使用状況を返します。セッションはコンテキスト用に会話履歴を保持しますが、各実行の使用状況は独立しています。 + +```python +session = SQLiteSession("my_conversation") + +first = await Runner.run(agent, "Hi!", session=session) +print(first.context_wrapper.usage.total_tokens) # Usage for first run + +second = await Runner.run(agent, "Can you elaborate?", session=session) +print(second.context_wrapper.usage.total_tokens) # Usage for second run +``` + +セッションは実行間で会話コンテキストを保持しますが、各 `Runner.run()` 呼び出しで返される使用状況メトリクスは、その実行のみを表します。セッションでは、前のメッセージが各実行に入力として再供給される場合があり、その結果、次のターンの入力 token 数に影響します。 + +## フックでの使用状況の利用 + +`RunHooks` を使用している場合、各フックに渡される `context` オブジェクトには `usage` が含まれます。これにより、重要なライフサイクルのタイミングで使用状況を記録できます。 + +```python +class MyHooks(RunHooks): + async def on_agent_end(self, context: RunContextWrapper, agent: Agent, output: Any) -> None: + u = context.usage + print(f"{agent.name} → {u.requests} requests, {u.total_tokens} total tokens") +``` + +## API リファレンス + +詳細な API ドキュメントは次を参照してください: + +- [`Usage`][agents.usage.Usage] - 使用状況の追跡データ構造 +- [`RunContextWrapper`][agents.run.RunContextWrapper] - 実行コンテキストから使用状況にアクセス +- [`RunHooks`][agents.run.RunHooks] - 使用状況トラッキングのライフサイクルにフック \ No newline at end of file diff --git a/docs/ja/visualization.md b/docs/ja/visualization.md index 9093bb659..cc466b47f 100644 --- a/docs/ja/visualization.md +++ b/docs/ja/visualization.md @@ -4,7 +4,7 @@ search: --- # エージェントの可視化 -エージェントの可視化を使用すると、 ** Graphviz ** を用いてエージェントとその関係を構造化されたグラフィカル表現として生成できます。これは、アプリケーション内でエージェント、ツール、handoffs がどのように相互作用するかを理解するのに役立ちます。 +エージェントの可視化では、 **Graphviz** を使用してエージェントとその関係の構造化されたグラフィカル表現を生成できます。これは、アプリケーション内でエージェント、ツール、ハンドオフがどのように相互作用するかを理解するのに役立ちます。 ## インストール @@ -16,16 +16,20 @@ pip install "openai-agents[viz]" ## グラフの生成 -`draw_graph` 関数を使用してエージェントの可視化を生成できます。この関数は有向グラフを作成し、以下のように表現します。 +`draw_graph` 関数を使用してエージェントの可視化を生成できます。この関数は次のような有向グラフを作成します: - **エージェント** は黄色のボックスで表されます。 +- **MCP サーバー** は灰色のボックスで表されます。 - **ツール** は緑色の楕円で表されます。 -- **handoffs** はエージェント間の有向エッジで示されます。 +- **ハンドオフ** はあるエージェントから別のエージェントへの有向エッジで表されます。 ### 使用例 ```python +import os + from agents import Agent, function_tool +from agents.mcp.server import MCPServerStdio from agents.extensions.visualization import draw_graph @function_tool @@ -42,46 +46,63 @@ english_agent = Agent( instructions="You only speak English", ) +current_dir = os.path.dirname(os.path.abspath(__file__)) +samples_dir = os.path.join(current_dir, "sample_files") +mcp_server = MCPServerStdio( + name="Filesystem Server, via npx", + params={ + "command": "npx", + "args": ["-y", "@modelcontextprotocol/server-filesystem", samples_dir], + }, +) + triage_agent = Agent( name="Triage agent", instructions="Handoff to the appropriate agent based on the language of the request.", handoffs=[spanish_agent, english_agent], tools=[get_weather], + mcp_servers=[mcp_server], ) draw_graph(triage_agent) ``` -![Agent Graph](../assets/images/graph.png) +![エージェントのグラフ](../assets/images/graph.png) + +これは、 **triage agent** の構造と、サブエージェントやツールへの接続を視覚的に表すグラフを生成します。 -これにより、 **triage agent** の構造と、それがサブエージェントやツールとどのようにつながっているかを視覚的に表すグラフが生成されます。 ## 可視化の理解 -生成されたグラフには次の要素が含まれます。 +生成されたグラフには以下が含まれます: + +- エントリーポイントを示す **開始ノード** (`__start__`)。 +- 黄色で塗りつぶされた **長方形** で表されるエージェント。 +- 緑で塗りつぶされた **楕円** で表されるツール。 +- 灰色で塗りつぶされた **長方形** で表される MCP サーバー。 +- 相互作用を示す有向エッジ: + - エージェント間のハンドオフには **実線矢印**。 + - ツール呼び出しには **点線矢印**。 + - MCP サーバー呼び出しには **破線矢印**。 +- 実行の終了地点を示す **終了ノード** (`__end__`)。 -- エントリーポイントを示す **start node** (`__start__`) -- 黄色の塗りつぶしを持つ **矩形** のエージェント -- 緑色の塗りつぶしを持つ **楕円** のツール -- 相互作用を示す有向エッジ - - エージェント間の handoffs には **実線の矢印** - - ツール呼び出しには **破線の矢印** -- 実行が終了する位置を示す **end node** (`__end__`) +**注:** MCP サーバーは最近のバージョンの +`agents` パッケージ( **v0.2.8** で確認済み)でレンダリングされます。可視化に MCP のボックスが表示されない場合は、最新リリースにアップグレードしてください。 ## グラフのカスタマイズ ### グラフの表示 -デフォルトでは、`draw_graph` はグラフをインラインで表示します。別ウィンドウでグラフを表示するには、次のように記述します。 +デフォルトでは、`draw_graph` はグラフをインライン表示します。別ウィンドウで表示するには次のようにします: ```python draw_graph(triage_agent).view() ``` ### グラフの保存 -デフォルトでは、`draw_graph` はグラフをインラインで表示します。ファイルとして保存するには、ファイル名を指定します: +デフォルトでは、`draw_graph` はグラフをインライン表示します。ファイルとして保存するには、ファイル名を指定します: ```python draw_graph(triage_agent, filename="agent_graph") ``` -これにより、作業ディレクトリに `agent_graph.png` が生成されます。 +これにより、作業ディレクトリに `agent_graph.png` が生成されます。 \ No newline at end of file diff --git a/docs/ja/voice/pipeline.md b/docs/ja/voice/pipeline.md index d52fb77f7..dc71d8ae9 100644 --- a/docs/ja/voice/pipeline.md +++ b/docs/ja/voice/pipeline.md @@ -2,9 +2,9 @@ search: exclude: true --- -# パイプラインと ワークフロー +# パイプラインとワークフロー -[`VoicePipeline`][agents.voice.pipeline.VoicePipeline] は、エージェント的なワークフローを音声アプリに簡単に変換できるクラスです。ワークフローを渡すと、パイプラインが入力音声の文字起こし、音声終了の検知、適切なタイミングでのワークフロー呼び出し、そしてワークフロー出力を音声へ変換する処理を担当します。 +[`VoicePipeline`][agents.voice.pipeline.VoicePipeline] は、エージェントのワークフローを音声アプリに簡単に変換できるクラスです。実行するワークフローを渡すと、パイプラインが入力音声の文字起こし、音声の終了検出、適切なタイミングでのワークフロー呼び出し、そしてワークフローの出力を再び音声に変換する処理を行います。 ```mermaid graph LR @@ -34,31 +34,29 @@ graph LR ## パイプラインの設定 -パイプラインを作成する際に、以下を設定できます。 +パイプライン作成時には、次の項目を設定できます。 -1. [`workflow`][agents.voice.workflow.VoiceWorkflowBase] ‐ 新しい音声が文字起こしされるたびに実行されるコード -2. 使用する [`speech-to-text`][agents.voice.model.STTModel] および [`text-to-speech`][agents.voice.model.TTSModel] モデル -3. [`config`][agents.voice.pipeline_config.VoicePipelineConfig] ‐ 以下のような内容を設定可能 - - モデルプロバイダー。モデル名をモデルにマッピングします - - トレーシング。トレーシングの無効化、音声ファイルのアップロード可否、ワークフロー名、トレース ID など - - TTS と STT モデルの設定。プロンプト、言語、使用するデータ型など +1. 新しい音声が文字起こしされるたびに実行されるコードである [`workflow`][agents.voice.workflow.VoiceWorkflowBase] +2. 使用する [`speech-to-text`][agents.voice.model.STTModel] と [`text-to-speech`][agents.voice.model.TTSModel] のモデル +3. 次のような設定を可能にする [`config`][agents.voice.pipeline_config.VoicePipelineConfig] + - モデル名をモデルにマッピングできるモデルプロバイダー + - トレーシング(トレーシングの無効化可否、音声ファイルのアップロード可否、ワークフロー名、trace ID など) + - プロンプト、言語、使用するデータ型など、 TTS と STT モデルの設定 ## パイプラインの実行 -パイプラインは [`run()`][agents.voice.pipeline.VoicePipeline.run] メソッドで実行できます。音声入力は次の 2 形式で渡せます。 +[`run()`][agents.voice.pipeline.VoicePipeline.run] メソッドでパイプラインを実行できます。音声入力は次の 2 つの形式で渡せます。 -1. [`AudioInput`][agents.voice.input.AudioInput] - 完全な音声トランスクリプトがある場合に使用し、その結果だけを生成したいときに便利です。話者の発話終了を検知する必要がないケース、たとえば録音済み音声やプッシュトゥートーク型アプリのようにユーザーが話し終えたタイミングが明確な場合に向いています。 -2. [`StreamedAudioInput`][agents.voice.input.StreamedAudioInput] - ユーザーの発話終了検知が必要な場合に使用します。検出された音声チャンクを順次プッシュでき、音声パイプラインが「アクティビティ検知」と呼ばれるプロセスを通じて適切なタイミングでエージェント ワークフローを自動的に実行します。 +1. [`AudioInput`][agents.voice.input.AudioInput] は、完全な音声トランスクリプトがあり、その結果だけを生成したい場合に使用します。これは、話者の発話終了を検出する必要がないケース、たとえば事前録音の音声や、ユーザーが話し終えるタイミングが明確なプッシュトゥトークのアプリで便利です。 +2. [`StreamedAudioInput`][agents.voice.input.StreamedAudioInput] は、ユーザーの発話終了を検出する必要がある場合に使用します。検出された音声チャンクをプッシュでき、音声パイプラインは「アクティビティ検出」と呼ばれる処理によって、適切なタイミングで自動的にエージェントのワークフローを実行します。 ## 結果 -音声パイプライン実行の結果は [`StreamedAudioResult`][agents.voice.result.StreamedAudioResult] です。これは発生したイベントをストリーミングで受け取れるオブジェクトです。いくつかの [`VoiceStreamEvent`][agents.voice.events.VoiceStreamEvent] があり、主なものは次のとおりです。 +音声パイプライン実行の結果は [`StreamedAudioResult`][agents.voice.result.StreamedAudioResult] です。これは、発生したイベントをストリーミングできるオブジェクトです。いくつかの種類の [`VoiceStreamEvent`][agents.voice.events.VoiceStreamEvent] があり、次を含みます。 -1. [`VoiceStreamEventAudio`][agents.voice.events.VoiceStreamEventAudio] ‐ 音声チャンクを含みます -2. [`VoiceStreamEventLifecycle`][agents.voice.events.VoiceStreamEventLifecycle] ‐ ターンの開始や終了などのライフサイクルイベントを通知します -3. [`VoiceStreamEventError`][agents.voice.events.VoiceStreamEventError] ‐ エラーイベントです +1. 音声チャンクを含む [`VoiceStreamEventAudio`][agents.voice.events.VoiceStreamEventAudio] +2. ターンの開始や終了といったライフサイクルイベントを通知する [`VoiceStreamEventLifecycle`][agents.voice.events.VoiceStreamEventLifecycle] +3. エラーイベントである [`VoiceStreamEventError`][agents.voice.events.VoiceStreamEventError] ```python @@ -78,4 +76,4 @@ async for event in result.stream(): ### 割り込み -Agents SDK は現在 [`StreamedAudioInput`][agents.voice.input.StreamedAudioInput] に対して、組み込みの割り込み処理をサポートしていません。そのため、検出された各ターンごとにワークフローが個別に実行されます。アプリケーション内で割り込みを処理したい場合は、[`VoiceStreamEventLifecycle`][agents.voice.events.VoiceStreamEventLifecycle] イベントを監視できます。`turn_started` は新しいターンが文字起こしされ、処理が開始されたことを示します。`turn_ended` は該当ターンのすべての音声が送信された後にトリガーされます。たとえば、モデルがターンを開始した際にスピーカーのマイクをミュートし、そのターンに関連する音声をすべて送信し終えた後にアンミュートするといった制御に、これらのイベントを利用できます。 \ No newline at end of file +Agents SDK は現在、[`StreamedAudioInput`][agents.voice.input.StreamedAudioInput] に対する組み込みの割り込みサポートを提供していません。代わりに、検出された各ターンごとにワークフローの個別の実行をトリガーします。アプリケーション内で割り込みに対応したい場合は、[`VoiceStreamEventLifecycle`][agents.voice.events.VoiceStreamEventLifecycle] イベントを監視できます。`turn_started` は新しいターンが文字起こしされ、処理が開始されたことを示します。`turn_ended` は対応するターンの音声がすべて送出された後にトリガーされます。これらのイベントを使用して、モデルがターンを開始したときに話者のマイクをミュートし、ターンに関連する音声をすべて送出し終えた後にミュート解除することができます。 \ No newline at end of file diff --git a/docs/ja/voice/quickstart.md b/docs/ja/voice/quickstart.md index 291b9882a..44d6bd42a 100644 --- a/docs/ja/voice/quickstart.md +++ b/docs/ja/voice/quickstart.md @@ -6,19 +6,19 @@ search: ## 前提条件 -まずは [クイックスタート手順](../quickstart.md) に従って Agents SDK をセットアップし、仮想環境を作成してください。その後、SDK の音声関連のオプション依存関係をインストールします: +ベースの [クイックスタート手順](../quickstart.md)( Agents SDK 用)に従い、仮想環境をセットアップしてください。次に、 SDK から音声のオプション依存関係をインストールします: ```bash pip install 'openai-agents[voice]' ``` -## コンセプト +## 概念 -押さえておくべき主な概念は [`VoicePipeline`][agents.voice.pipeline.VoicePipeline] です。これは次の 3 ステップから成るプロセスです。 +主に知っておくべき概念は [`VoicePipeline`][agents.voice.pipeline.VoicePipeline] で、これは 3 段階のプロセスです: -1. speech-to-text モデルを実行して音声をテキストに変換します。 -2. 通常はエージェント的ワークフローであるあなたのコードを実行し、結果を生成します。 -3. text-to-speech モデルを実行して結果のテキストを再び音声に変換します。 +1. 音声をテキストに変換するために、音声認識(speech‑to‑text)モデルを実行します。 +2. 通常はエージェント的ワークフローであるあなたのコードを実行して、結果を生成します。 +3. テキストを音声に戻すために、音声合成(text‑to‑speech)モデルを実行します。 ```mermaid graph LR @@ -48,7 +48,7 @@ graph LR ## エージェント -まず、いくつかの エージェント をセットアップしましょう。この SDK でエージェントを構築したことがあれば、見覚えがあるはずです。ここでは複数の エージェント、ハンドオフ、そしてツールを用意します。 +まず、いくつかのエージェントをセットアップします。これは、この SDK でエージェントを作成したことがある場合は馴染みがあるはずです。今回は複数のエージェント、ハンドオフ、そして 1 つのツールを用意します。 ```python import asyncio @@ -76,7 +76,7 @@ spanish_agent = Agent( instructions=prompt_with_handoff_instructions( "You're speaking to a human, so be polite and concise. Speak in Spanish.", ), - model="gpt-4o-mini", + model="gpt-4.1", ) agent = Agent( @@ -84,7 +84,7 @@ agent = Agent( instructions=prompt_with_handoff_instructions( "You're speaking to a human, so be polite and concise. If the user speaks in Spanish, handoff to the spanish agent.", ), - model="gpt-4o-mini", + model="gpt-4.1", handoffs=[spanish_agent], tools=[get_weather], ) @@ -92,7 +92,7 @@ agent = Agent( ## 音声パイプライン -[`SingleAgentVoiceWorkflow`][agents.voice.workflow.SingleAgentVoiceWorkflow] をワークフローとして、シンプルな音声パイプラインを構築します。 +[`SingleAgentVoiceWorkflow`][agents.voice.workflow.SingleAgentVoiceWorkflow] をワークフローとして使用し、シンプルな音声パイプラインをセットアップします。 ```python from agents.voice import SingleAgentVoiceWorkflow, VoicePipeline @@ -160,7 +160,7 @@ spanish_agent = Agent( instructions=prompt_with_handoff_instructions( "You're speaking to a human, so be polite and concise. Speak in Spanish.", ), - model="gpt-4o-mini", + model="gpt-4.1", ) agent = Agent( @@ -168,7 +168,7 @@ agent = Agent( instructions=prompt_with_handoff_instructions( "You're speaking to a human, so be polite and concise. If the user speaks in Spanish, handoff to the spanish agent.", ), - model="gpt-4o-mini", + model="gpt-4.1", handoffs=[spanish_agent], tools=[get_weather], ) @@ -195,4 +195,4 @@ if __name__ == "__main__": asyncio.run(main()) ``` -この例を実行すると、エージェントがあなたに話しかけます。実際にエージェントと会話できるデモは、[examples/voice/static](https://github.com/openai/openai-agents-python/tree/main/examples/voice/static) をご覧ください。 \ No newline at end of file +このサンプルを実行すると、エージェントがあなたに話しかけます。自分でエージェントと会話できるデモは [examples/voice/static](https://github.com/openai/openai-agents-python/tree/main/examples/voice/static) をご覧ください。 \ No newline at end of file diff --git a/docs/ja/voice/tracing.md b/docs/ja/voice/tracing.md index 21f4788f9..9d74081f3 100644 --- a/docs/ja/voice/tracing.md +++ b/docs/ja/voice/tracing.md @@ -6,13 +6,13 @@ search: [エージェントのトレーシング](../tracing.md) と同様に、音声パイプラインも自動的にトレーシングされます。 -基本的なトレーシング情報については上記のドキュメントを参照してください。さらに、[`VoicePipelineConfig`][agents.voice.pipeline_config.VoicePipelineConfig] でパイプラインのトレーシング設定を行えます。 +基本的なトレーシング情報については上記のドキュメントをご確認ください。加えて、[`VoicePipelineConfig`][agents.voice.pipeline_config.VoicePipelineConfig] を使ってパイプラインのトレーシングを設定できます。 -主なトレーシング関連フィールドは次のとおりです。 +トレーシングに関係する主なフィールドは次のとおりです。 -- [`tracing_disabled`][agents.voice.pipeline_config.VoicePipelineConfig.tracing_disabled]:トレーシングを無効にするかどうかを制御します。デフォルトではトレーシングは有効です。 -- [`trace_include_sensitive_data`][agents.voice.pipeline_config.VoicePipelineConfig.trace_include_sensitive_data]:トレースに音声テキストなどの機微なデータを含めるかどうかを制御します。これは音声パイプライン専用であり、Workflow 内部で発生する処理には影響しません。 -- [`trace_include_sensitive_audio_data`][agents.voice.pipeline_config.VoicePipelineConfig.trace_include_sensitive_audio_data]:トレースに音声データを含めるかどうかを制御します。 -- [`workflow_name`][agents.voice.pipeline_config.VoicePipelineConfig.workflow_name]:トレース Workflow の名前です。 -- [`group_id`][agents.voice.pipeline_config.VoicePipelineConfig.group_id]:複数のトレースを関連付けるための `group_id` です。 -- [`trace_metadata`][agents.voice.pipeline_config.VoicePipelineConfig.tracing_disabled]:トレースに追加するメタデータです。 \ No newline at end of file +- [`tracing_disabled`][agents.voice.pipeline_config.VoicePipelineConfig.tracing_disabled]: トレーシングを無効化するかを制御します。デフォルトではトレーシングは有効です。 +- [`trace_include_sensitive_data`][agents.voice.pipeline_config.VoicePipelineConfig.trace_include_sensitive_data]: 音声書き起こしなど、機密となり得るデータをトレースに含めるかを制御します。これは音声パイプライン専用で、ワークフロー内部で行われることには適用されません。 +- [`trace_include_sensitive_audio_data`][agents.voice.pipeline_config.VoicePipelineConfig.trace_include_sensitive_audio_data]: 音声データをトレースに含めるかを制御します。 +- [`workflow_name`][agents.voice.pipeline_config.VoicePipelineConfig.workflow_name]: トレースのワークフロー名です。 +- [`group_id`][agents.voice.pipeline_config.VoicePipelineConfig.group_id]: 複数のトレースをリンクできる、トレースの `group_id` です。 +- [`trace_metadata`][agents.voice.pipeline_config.VoicePipelineConfig.tracing_disabled]: トレースに含める追加のメタデータです。 \ No newline at end of file diff --git a/docs/ko/agents.md b/docs/ko/agents.md new file mode 100644 index 000000000..6f5f124d3 --- /dev/null +++ b/docs/ko/agents.md @@ -0,0 +1,289 @@ +--- +search: + exclude: true +--- +# 에이전트 + +에이전트는 앱의 핵심 구성 요소입니다. 에이전트는 instructions와 tools로 구성된 대규모 언어 모델(LLM)입니다. + +## 기본 구성 + +에이전트에서 가장 자주 설정하는 속성은 다음과 같습니다: + +- `name`: 에이전트를 식별하는 필수 문자열 +- `instructions`: developer message 또는 시스템 프롬프트로도 알려져 있음 +- `model`: 사용할 LLM과 temperature, top_p 등 모델 튜닝 매개변수를 설정하는 선택적 `model_settings` +- `tools`: 에이전트가 작업을 수행할 때 사용할 도구 + +```python +from agents import Agent, ModelSettings, function_tool + +@function_tool +def get_weather(city: str) -> str: + """returns weather info for the specified city.""" + return f"The weather in {city} is sunny" + +agent = Agent( + name="Haiku agent", + instructions="Always respond in haiku form", + model="gpt-5-nano", + tools=[get_weather], +) +``` + +## 컨텍스트 + +에이전트는 `context` 타입에 대해 제네릭입니다. 컨텍스트는 의존성 주입 도구로, `Runner.run()`에 전달하는 객체이며 모든 에이전트, 도구, 핸드오프 등에 전달되어 에이전트 실행을 위한 의존성과 상태의 컨테이너 역할을 합니다. 컨텍스트로는 어떤 Python 객체든 제공할 수 있습니다. + +```python +@dataclass +class UserContext: + name: str + uid: str + is_pro_user: bool + + async def fetch_purchases() -> list[Purchase]: + return ... + +agent = Agent[UserContext]( + ..., +) +``` + +## 출력 타입 + +기본적으로 에이전트는 일반 텍스트(예: `str`) 출력을 생성합니다. 특정 타입의 출력을 원한다면 `output_type` 매개변수를 사용할 수 있습니다. 일반적인 선택은 [Pydantic](https://docs.pydantic.dev/) 객체이지만, Pydantic [TypeAdapter](https://docs.pydantic.dev/latest/api/type_adapter/)로 래핑할 수 있는 모든 타입을 지원합니다. 예: dataclasses, lists, TypedDict 등 + +```python +from pydantic import BaseModel +from agents import Agent + + +class CalendarEvent(BaseModel): + name: str + date: str + participants: list[str] + +agent = Agent( + name="Calendar extractor", + instructions="Extract calendar events from text", + output_type=CalendarEvent, +) +``` + +!!! note + + `output_type`을 전달하면, 모델이 일반 텍스트 응답 대신 [structured outputs](https://platform.openai.com/docs/guides/structured-outputs)을 사용하도록 지시합니다. + +## 멀티 에이전트 시스템 디자인 패턴 + +멀티 에이전트 시스템을 설계하는 방법은 다양하지만, 일반적으로 다음 두 가지 패턴이 널리 적용됩니다: + +1. 매니저(도구로서의 에이전트): 중앙 매니저/오케스트레이터가 특화된 하위 에이전트를 도구처럼 호출하며 대화의 주도권을 유지 +2. 핸드오프: 동등한 에이전트 간에 대화를 특화된 에이전트로 넘겨, 해당 에이전트가 대화를 이어받는 분산형 패턴 + +자세한 내용은 [에이전트 구축 실용 가이드](https://cdn.openai.com/business-guides-and-resources/a-practical-guide-to-building-agents.pdf)를 참고하세요. + +### 매니저(도구로서의 에이전트) + +`customer_facing_agent`가 모든 사용자 상호작용을 처리하고, 도구로 노출된 특화 하위 에이전트를 호출합니다. 자세한 내용은 [도구](tools.md#agents-as-tools) 문서를 참고하세요. + +```python +from agents import Agent + +booking_agent = Agent(...) +refund_agent = Agent(...) + +customer_facing_agent = Agent( + name="Customer-facing agent", + instructions=( + "Handle all direct user communication. " + "Call the relevant tools when specialized expertise is needed." + ), + tools=[ + booking_agent.as_tool( + tool_name="booking_expert", + tool_description="Handles booking questions and requests.", + ), + refund_agent.as_tool( + tool_name="refund_expert", + tool_description="Handles refund questions and requests.", + ) + ], +) +``` + +### 핸드오프 + +핸드오프는 에이전트가 위임할 수 있는 하위 에이전트입니다. 핸드오프가 발생하면 위임받은 에이전트가 대화 기록을 넘겨받아 대화를 이어받습니다. 이 패턴은 단일 작업에 뛰어난 모듈식 특화 에이전트를 가능하게 합니다. 자세한 내용은 [핸드오프](handoffs.md) 문서를 참고하세요. + +```python +from agents import Agent + +booking_agent = Agent(...) +refund_agent = Agent(...) + +triage_agent = Agent( + name="Triage agent", + instructions=( + "Help the user with their questions. " + "If they ask about booking, hand off to the booking agent. " + "If they ask about refunds, hand off to the refund agent." + ), + handoffs=[booking_agent, refund_agent], +) +``` + +## 동적 instructions + +대부분의 경우 에이전트를 생성할 때 instructions를 제공할 수 있습니다. 하지만 함수로 동적 instructions를 제공할 수도 있습니다. 이 함수는 에이전트와 컨텍스트를 인자로 받고 프롬프트를 반환해야 합니다. 일반 함수와 `async` 함수 모두 허용됩니다. + +```python +def dynamic_instructions( + context: RunContextWrapper[UserContext], agent: Agent[UserContext] +) -> str: + return f"The user's name is {context.context.name}. Help them with their questions." + + +agent = Agent[UserContext]( + name="Triage agent", + instructions=dynamic_instructions, +) +``` + +## 라이프사이클 이벤트(훅) + +때로는 에이전트의 라이프사이클을 관찰하고 싶을 수 있습니다. 예를 들어, 이벤트를 로깅하거나 특정 이벤트 발생 시 데이터를 미리 가져오고 싶을 수 있습니다. `hooks` 속성으로 에이전트 라이프사이클에 훅을 연결할 수 있습니다. [`AgentHooks`][agents.lifecycle.AgentHooks] 클래스를 서브클래싱하고, 관심 있는 메서드를 오버라이드하세요. + +## 가드레일 + +가드레일은 에이전트가 실행되는 동안 사용자 입력에 대한 검사/검증을 병렬로 수행하고, 에이전트 출력이 생성된 후 해당 출력에 대해서도 검사/검증을 수행할 수 있게 합니다. 예를 들어, 사용자 입력과 에이전트 출력을 관련성 기준으로 스크리닝할 수 있습니다. 자세한 내용은 [가드레일](guardrails.md) 문서를 참고하세요. + +## 에이전트 복제/복사 + +에이전트에서 `clone()` 메서드를 사용하면 에이전트를 복제하고, 필요한 속성을 선택적으로 변경할 수 있습니다. + +```python +pirate_agent = Agent( + name="Pirate", + instructions="Write like a pirate", + model="gpt-4.1", +) + +robot_agent = pirate_agent.clone( + name="Robot", + instructions="Write like a robot", +) +``` + +## 도구 사용 강제 + +도구 목록을 제공해도 LLM이 항상 도구를 사용하는 것은 아닙니다. [`ModelSettings.tool_choice`][agents.model_settings.ModelSettings.tool_choice]를 설정하여 도구 사용을 강제할 수 있습니다. 유효한 값은 다음과 같습니다: + +1. `auto`: LLM이 도구 사용 여부를 결정 +2. `required`: LLM이 반드시 도구를 사용해야 함(단, 어떤 도구를 사용할지는 지능적으로 선택) +3. `none`: LLM이 도구를 사용하지 않도록 요구 +4. 특정 문자열 설정(예: `my_tool`): 해당 특정 도구 사용을 요구 + +```python +from agents import Agent, Runner, function_tool, ModelSettings + +@function_tool +def get_weather(city: str) -> str: + """Returns weather info for the specified city.""" + return f"The weather in {city} is sunny" + +agent = Agent( + name="Weather Agent", + instructions="Retrieve weather details.", + tools=[get_weather], + model_settings=ModelSettings(tool_choice="get_weather") +) +``` + +## 도구 사용 동작 + +`Agent` 구성의 `tool_use_behavior` 매개변수는 도구 출력 처리 방식을 제어합니다: + +- "run_llm_again": 기본값. 도구를 실행한 뒤, LLM이 결과를 처리해 최종 응답을 생성 +- "stop_on_first_tool": 첫 번째 도구 호출의 출력을 추가 LLM 처리 없이 최종 응답으로 사용 + +```python +from agents import Agent, Runner, function_tool, ModelSettings + +@function_tool +def get_weather(city: str) -> str: + """Returns weather info for the specified city.""" + return f"The weather in {city} is sunny" + +agent = Agent( + name="Weather Agent", + instructions="Retrieve weather details.", + tools=[get_weather], + tool_use_behavior="stop_on_first_tool" +) +``` + +- `StopAtTools(stop_at_tool_names=[...])`: 지정된 도구가 호출되면 중지하고, 해당 출력을 최종 응답으로 사용 + +```python +from agents import Agent, Runner, function_tool +from agents.agent import StopAtTools + +@function_tool +def get_weather(city: str) -> str: + """Returns weather info for the specified city.""" + return f"The weather in {city} is sunny" + +@function_tool +def sum_numbers(a: int, b: int) -> int: + """Adds two numbers.""" + return a + b + +agent = Agent( + name="Stop At Stock Agent", + instructions="Get weather or sum numbers.", + tools=[get_weather, sum_numbers], + tool_use_behavior=StopAtTools(stop_at_tool_names=["get_weather"]) +) +``` + +- `ToolsToFinalOutputFunction`: 도구 결과를 처리하고 중지 또는 LLM 계속 진행 여부를 결정하는 커스텀 함수 + +```python +from agents import Agent, Runner, function_tool, FunctionToolResult, RunContextWrapper +from agents.agent import ToolsToFinalOutputResult +from typing import List, Any + +@function_tool +def get_weather(city: str) -> str: + """Returns weather info for the specified city.""" + return f"The weather in {city} is sunny" + +def custom_tool_handler( + context: RunContextWrapper[Any], + tool_results: List[FunctionToolResult] +) -> ToolsToFinalOutputResult: + """Processes tool results to decide final output.""" + for result in tool_results: + if result.output and "sunny" in result.output: + return ToolsToFinalOutputResult( + is_final_output=True, + final_output=f"Final weather: {result.output}" + ) + return ToolsToFinalOutputResult( + is_final_output=False, + final_output=None + ) + +agent = Agent( + name="Weather Agent", + instructions="Retrieve weather details.", + tools=[get_weather], + tool_use_behavior=custom_tool_handler +) +``` + +!!! note + + 무한 루프를 방지하기 위해 프레임워크는 도구 호출 후 `tool_choice`를 자동으로 "auto"로 재설정합니다. 이 동작은 [`agent.reset_tool_choice`][agents.agent.Agent.reset_tool_choice]로 구성할 수 있습니다. 무한 루프의 원인은 도구 결과가 LLM으로 전달되고, `tool_choice` 때문에 LLM이 다시 도구 호출을 생성하는 과정이 반복되기 때문입니다. \ No newline at end of file diff --git a/docs/ko/config.md b/docs/ko/config.md new file mode 100644 index 000000000..a02e3e155 --- /dev/null +++ b/docs/ko/config.md @@ -0,0 +1,98 @@ +--- +search: + exclude: true +--- +# SDK 구성 + +## API 키와 클라이언트 + +기본적으로 SDK는 가져오는 즉시 LLM 요청과 트레이싱을 위해 `OPENAI_API_KEY` 환경 변수를 찾습니다. 앱 시작 전에 해당 환경 변수를 설정할 수 없다면, [set_default_openai_key()][agents.set_default_openai_key] 함수를 사용해 키를 설정할 수 있습니다. + +```python +from agents import set_default_openai_key + +set_default_openai_key("sk-...") +``` + +또는 사용할 OpenAI 클라이언트를 구성할 수도 있습니다. 기본적으로 SDK는 환경 변수의 API 키나 위에서 설정한 기본 키를 사용하여 `AsyncOpenAI` 인스턴스를 생성합니다. [set_default_openai_client()][agents.set_default_openai_client] 함수를 사용해 이를 변경할 수 있습니다. + +```python +from openai import AsyncOpenAI +from agents import set_default_openai_client + +custom_client = AsyncOpenAI(base_url="...", api_key="...") +set_default_openai_client(custom_client) +``` + +마지막으로, 사용하는 OpenAI API를 커스터마이즈할 수도 있습니다. 기본값은 OpenAI Responses API입니다. [set_default_openai_api()][agents.set_default_openai_api] 함수를 사용하여 Chat Completions API로 오버라이드할 수 있습니다. + +```python +from agents import set_default_openai_api + +set_default_openai_api("chat_completions") +``` + +## 트레이싱 + +트레이싱은 기본적으로 활성화되어 있습니다. 기본적으로 위 섹션의 OpenAI API 키(즉, 환경 변수 또는 설정한 기본 키)를 사용합니다. 트레이싱에 사용할 API 키를 별도로 지정하려면 [`set_tracing_export_api_key`][agents.set_tracing_export_api_key] 함수를 사용하세요. + +```python +from agents import set_tracing_export_api_key + +set_tracing_export_api_key("sk-...") +``` + +[`set_tracing_disabled()`][agents.set_tracing_disabled] 함수를 사용해 트레이싱을 완전히 비활성화할 수도 있습니다. + +```python +from agents import set_tracing_disabled + +set_tracing_disabled(True) +``` + +## 디버그 로깅 + +SDK에는 핸들러가 설정되지 않은 두 개의 Python 로거가 있습니다. 기본적으로 이는 경고와 오류가 `stdout`으로 전송되고, 다른 로그는 억제됨을 의미합니다. + +자세한 로깅을 활성화하려면 [`enable_verbose_stdout_logging()`][agents.enable_verbose_stdout_logging] 함수를 사용하세요. + +```python +from agents import enable_verbose_stdout_logging + +enable_verbose_stdout_logging() +``` + +또는 핸들러, 필터, 포매터 등을 추가하여 로그를 커스터마이즈할 수 있습니다. 자세한 내용은 [Python 로깅 가이드](https://docs.python.org/3/howto/logging.html)를 참조하세요. + +```python +import logging + +logger = logging.getLogger("openai.agents") # or openai.agents.tracing for the Tracing logger + +# To make all logs show up +logger.setLevel(logging.DEBUG) +# To make info and above show up +logger.setLevel(logging.INFO) +# To make warning and above show up +logger.setLevel(logging.WARNING) +# etc + +# You can customize this as needed, but this will output to `stderr` by default +logger.addHandler(logging.StreamHandler()) +``` + +### 로그의 민감한 데이터 + +일부 로그에는 민감한 데이터(예: 사용자 데이터)가 포함될 수 있습니다. 이러한 데이터의 로깅을 비활성화하려면 다음 환경 변수를 설정하세요. + +LLM 입력 및 출력을 로깅하지 않으려면: + +```bash +export OPENAI_AGENTS_DONT_LOG_MODEL_DATA=1 +``` + +도구 입력 및 출력을 로깅하지 않으려면: + +```bash +export OPENAI_AGENTS_DONT_LOG_TOOL_DATA=1 +``` \ No newline at end of file diff --git a/docs/ko/context.md b/docs/ko/context.md new file mode 100644 index 000000000..3e9a9fd7a --- /dev/null +++ b/docs/ko/context.md @@ -0,0 +1,127 @@ +--- +search: + exclude: true +--- +# 컨텍스트 관리 + +컨텍스트는 과부하된 용어입니다. 관심을 가질 수 있는 컨텍스트는 크게 두 가지 범주가 있습니다: + +1. 코드에서 로컬로 사용할 수 있는 컨텍스트: 도구 함수가 실행될 때, `on_handoff` 같은 콜백, 라이프사이클 훅 등에서 필요할 수 있는 데이터와 의존성 +2. LLM이 사용할 수 있는 컨텍스트: LLM이 응답을 생성할 때 볼 수 있는 데이터 + +## 로컬 컨텍스트 + +이는 [`RunContextWrapper`][agents.run_context.RunContextWrapper] 클래스와 그 안의 [`context`][agents.run_context.RunContextWrapper.context] 속성을 통해 표현됩니다. 동작 방식은 다음과 같습니다: + +1. 원하는 어떤 Python 객체든 생성합니다. 일반적으로 dataclass 또는 Pydantic 객체를 사용합니다 +2. 해당 객체를 다양한 실행 메서드에 전달합니다(예: `Runner.run(..., **context=whatever**)`) +3. 모든 도구 호출, 라이프사이클 훅 등에는 래퍼 객체 `RunContextWrapper[T]`가 전달되며, 여기서 `T`는 컨텍스트 객체 타입을 나타내며 `wrapper.context`로 접근할 수 있습니다 + +가장 중요한 점: 특정 에이전트 실행에 참여하는 모든 에이전트, 도구 함수, 라이프사이클 등은 동일한 컨텍스트의 _타입_ 을 사용해야 합니다. + +컨텍스트는 다음과 같은 용도로 사용할 수 있습니다: + +- 실행을 위한 컨텍스트 데이터(예: 사용자 이름/uid 같은 정보 또는 그 외 사용자와 관련된 정보) +- 의존성(예: 로거 객체, 데이터 페처 등) +- 헬퍼 함수 + +!!! danger "주의" + + 컨텍스트 객체는 LLM에 **전송되지 않습니다**. 로컬 객체일 뿐이며, 이를 읽고 쓰거나 메서드를 호출할 수 있습니다. + +```python +import asyncio +from dataclasses import dataclass + +from agents import Agent, RunContextWrapper, Runner, function_tool + +@dataclass +class UserInfo: # (1)! + name: str + uid: int + +@function_tool +async def fetch_user_age(wrapper: RunContextWrapper[UserInfo]) -> str: # (2)! + """Fetch the age of the user. Call this function to get user's age information.""" + return f"The user {wrapper.context.name} is 47 years old" + +async def main(): + user_info = UserInfo(name="John", uid=123) + + agent = Agent[UserInfo]( # (3)! + name="Assistant", + tools=[fetch_user_age], + ) + + result = await Runner.run( # (4)! + starting_agent=agent, + input="What is the age of the user?", + context=user_info, + ) + + print(result.final_output) # (5)! + # The user John is 47 years old. + +if __name__ == "__main__": + asyncio.run(main()) +``` + +1. 이것이 컨텍스트 객체입니다. 여기서는 dataclass를 사용했지만, 어떤 타입이든 사용할 수 있습니다 +2. 이것은 도구입니다. `RunContextWrapper[UserInfo]`를 받는 것을 볼 수 있습니다. 도구 구현은 컨텍스트에서 읽습니다 +3. 에이전트에 제네릭 `UserInfo`를 표시하여, 타입 체커가 오류를 잡을 수 있도록 합니다(예를 들어, 다른 컨텍스트 타입을 받는 도구를 전달하려고 하면 오류를 잡습니다) +4. 컨텍스트가 `run` 함수로 전달됩니다 +5. 에이전트는 도구를 올바르게 호출하고 나이를 가져옵니다 + +--- + +### 고급: `ToolContext` + +일부 경우에는 실행 중인 도구에 대한 추가 메타데이터(예: 이름, 호출 ID, 원문 인수 문자열)에 접근하고 싶을 수 있습니다. +이를 위해 `RunContextWrapper`를 확장한 [`ToolContext`][agents.tool_context.ToolContext] 클래스를 사용할 수 있습니다. + +```python +from typing import Annotated +from pydantic import BaseModel, Field +from agents import Agent, Runner, function_tool +from agents.tool_context import ToolContext + +class WeatherContext(BaseModel): + user_id: str + +class Weather(BaseModel): + city: str = Field(description="The city name") + temperature_range: str = Field(description="The temperature range in Celsius") + conditions: str = Field(description="The weather conditions") + +@function_tool +def get_weather(ctx: ToolContext[WeatherContext], city: Annotated[str, "The city to get the weather for"]) -> Weather: + print(f"[debug] Tool context: (name: {ctx.tool_name}, call_id: {ctx.tool_call_id}, args: {ctx.tool_arguments})") + return Weather(city=city, temperature_range="14-20C", conditions="Sunny with wind.") + +agent = Agent( + name="Weather Agent", + instructions="You are a helpful agent that can tell the weather of a given city.", + tools=[get_weather], +) +``` + +`ToolContext`는 `RunContextWrapper`와 동일한 `.context` 속성을 제공하며, +현재 도구 호출에 특화된 추가 필드를 제공합니다: + +- `tool_name` – 호출 중인 도구의 이름 +- `tool_call_id` – 이 도구 호출의 고유 식별자 +- `tool_arguments` – 도구에 전달된 원문 인수 문자열 + +실행 중 도구 수준 메타데이터가 필요할 때 `ToolContext`를 사용하세요. +에이전트와 도구 간 일반적인 컨텍스트 공유에는 `RunContextWrapper`만으로 충분합니다. + +--- + +## 에이전트/LLM 컨텍스트 + +LLM이 호출될 때 볼 수 있는 데이터는 대화 기록뿐입니다. 즉, LLM이 새로운 데이터를 볼 수 있게 하려면 해당 데이터가 그 기록에 포함되도록 해야 합니다. 이를 위한 방법은 다음과 같습니다: + +1. 에이전트의 `instructions`에 추가합니다. 이는 "시스템 프롬프트" 또는 "developer message"로도 알려져 있습니다. 시스템 프롬프트는 정적인 문자열일 수도 있고, 컨텍스트를 받아 문자열을 출력하는 동적 함수일 수도 있습니다. 항상 유용한 정보(예: 사용자 이름이나 현재 날짜)에는 일반적인 방식입니다 +2. `Runner.run` 함수를 호출할 때 `input`에 추가합니다. 이는 `instructions` 전략과 유사하지만, [chain of command](https://cdn.openai.com/spec/model-spec-2024-05-08.html#follow-the-chain-of-command) 상에서 더 낮은 메시지를 가질 수 있습니다 +3. 함수 도구를 통해 노출합니다. 이는 온디맨드 컨텍스트에 유용합니다. LLM이 데이터가 필요할 때 판단하여, 해당 데이터를 가져오기 위해 도구를 호출할 수 있습니다 +4. 리트리벌 또는 웹 검색을 사용합니다. 이는 파일이나 데이터베이스(리트리벌) 또는 웹(웹 검색)에서 관련 데이터를 가져올 수 있는 특수한 도구입니다. 이는 응답을 관련 컨텍스트 데이터에 기반하도록 하는 데 유용합니다 \ No newline at end of file diff --git a/docs/ko/examples.md b/docs/ko/examples.md new file mode 100644 index 000000000..25f8d9b8f --- /dev/null +++ b/docs/ko/examples.md @@ -0,0 +1,93 @@ +--- +search: + exclude: true +--- +# 코드 예제 + +[repo](https://github.com/openai/openai-agents-python/tree/main/examples)의 examples 섹션에서 SDK의 다양한 샘플 구현을 확인하세요. 예제는 다양한 패턴과 기능을 보여 주는 여러 카테고리로 구성되어 있습니다. + +## 카테고리 + +- **[agent_patterns](https://github.com/openai/openai-agents-python/tree/main/examples/agent_patterns):** + 이 카테고리의 코드 예제는 다음과 같은 일반적인 에이전트 설계 패턴을 보여 줍니다 + + - 결정적 워크플로 + - 도구로서의 에이전트 + - 에이전트 병렬 실행 + - 조건부 도구 사용 + - 입력/출력 가드레일 + - 판정자로서의 LLM + - 라우팅 + - 스트리밍 가드레일 + +- **[basic](https://github.com/openai/openai-agents-python/tree/main/examples/basic):** + 이 코드 예제들은 SDK의 기본 기능을 보여 줍니다 + + - Hello World 예제 (기본 모델, GPT-5, open-weight 모델) + - 에이전트 라이프사이클 관리 + - 동적 시스템 프롬프트 + - 스트리밍 출력 (텍스트, 항목, 함수 호출 인자) + - 프롬프트 템플릿 + - 파일 처리 (로컬 및 원격, 이미지 및 PDF) + - 사용량 추적 + - 비엄격 출력 타입 + - 이전 응답 ID 사용 + +- **[customer_service](https://github.com/openai/openai-agents-python/tree/main/examples/customer_service):** + 항공사를 위한 고객 서비스 시스템 예제 + +- **[financial_research_agent](https://github.com/openai/openai-agents-python/tree/main/examples/financial_research_agent):** + 금융 데이터 분석을 위해 에이전트와 도구로 구조화된 리서치 워크플로를 시연하는 금융 리서치 에이전트 + +- **[handoffs](https://github.com/openai/openai-agents-python/tree/main/examples/handoffs):** + 메시지 필터링과 함께 에이전트 핸드오프의 실용적 코드 예제를 확인하세요 + +- **[hosted_mcp](https://github.com/openai/openai-agents-python/tree/main/examples/hosted_mcp):** + 호스티드 MCP (Model Context Protocol) 커넥터와 승인 사용 방법을 보여 주는 코드 예제 + +- **[mcp](https://github.com/openai/openai-agents-python/tree/main/examples/mcp):** + MCP (Model Context Protocol)로 에이전트를 만드는 방법을 배워 보세요. 다음을 포함합니다 + + - 파일시스템 예제 + - Git 예제 + - MCP 프롬프트 서버 예제 + - SSE (Server-Sent Events) 예제 + - 스트리밍 가능한 HTTP 예제 + +- **[memory](https://github.com/openai/openai-agents-python/tree/main/examples/memory):** + 에이전트를 위한 다양한 메모리 구현 코드 예제, 다음을 포함 + + - SQLite 세션 스토리지 + - 고급 SQLite 세션 스토리지 + - Redis 세션 스토리지 + - SQLAlchemy 세션 스토리지 + - 암호화된 세션 스토리지 + - OpenAI 세션 스토리지 + +- **[model_providers](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers):** + 사용자 지정 프로바이더와 LiteLLM 통합을 포함하여 SDK로 OpenAI 외 모델을 사용하는 방법 알아보기 + +- **[realtime](https://github.com/openai/openai-agents-python/tree/main/examples/realtime):** + SDK를 사용하여 실시간 경험을 구축하는 방법을 보여 주는 코드 예제, 다음을 포함 + + - 웹 애플리케이션 + - 커맨드라인 인터페이스 + - Twilio 통합 + +- **[reasoning_content](https://github.com/openai/openai-agents-python/tree/main/examples/reasoning_content):** + 추론 콘텐츠 및 structured outputs를 다루는 방법을 보여 주는 코드 예제 + +- **[research_bot](https://github.com/openai/openai-agents-python/tree/main/examples/research_bot):** + 복잡한 멀티 에이전트 리서치 워크플로를 시연하는 간단한 딥 리서치 클론 + +- **[tools](https://github.com/openai/openai-agents-python/tree/main/examples/tools):** + 다음과 같은 OpenAI 호스트하는 도구를 구현하는 방법을 배워 보세요 + + - 웹 검색 및 필터가 있는 웹 검색 + - 파일 검색 + - Code Interpreter + - 컴퓨터 사용 + - 이미지 생성 + +- **[voice](https://github.com/openai/openai-agents-python/tree/main/examples/voice):** + TTS 및 STT 모델을 사용하는 음성 에이전트 코드 예제를 확인하세요. 스트리밍 음성 예제 포함 \ No newline at end of file diff --git a/docs/ko/guardrails.md b/docs/ko/guardrails.md new file mode 100644 index 000000000..8e5b6d4bc --- /dev/null +++ b/docs/ko/guardrails.md @@ -0,0 +1,158 @@ +--- +search: + exclude: true +--- +# 가드레일 + +가드레일은 에이전트와 _병렬로_ 실행되며, 사용자 입력에 대한 점검과 검증을 수행할 수 있게 합니다. 예를 들어, 고객 요청을 돕기 위해 매우 똑똑한(따라서 느리고 비싼) 모델을 사용하는 에이전트를 상상해 보세요. 악의적인 사용자가 수학 숙제를 도와달라고 모델에 요청하는 것은 원치 않을 것입니다. 이때 빠르고 저렴한 모델로 가드레일을 실행할 수 있습니다. 가드레일이 악의적 사용을 감지하면 즉시 오류를 발생시켜, 비용이 많이 드는 모델 실행을 중단하고 시간과 비용을 절약할 수 있습니다. + +가드레일에는 두 가지 종류가 있습니다: + +1. 입력 가드레일은 초기 사용자 입력에서 실행됨 +2. 출력 가드레일은 최종 에이전트 출력에서 실행됨 + +## 입력 가드레일 + +입력 가드레일은 다음 3단계로 실행됩니다: + +1. 먼저, 가드레일은 에이전트에 전달된 것과 동일한 입력을 받습니다 +2. 다음으로, 가드레일 함수가 실행되어 [`GuardrailFunctionOutput`][agents.guardrail.GuardrailFunctionOutput]을 생성하고, 이는 [`InputGuardrailResult`][agents.guardrail.InputGuardrailResult]로 래핑됩니다 +3. 마지막으로 [`.tripwire_triggered`][agents.guardrail.GuardrailFunctionOutput.tripwire_triggered]가 true인지 확인합니다. true이면 [`InputGuardrailTripwireTriggered`][agents.exceptions.InputGuardrailTripwireTriggered] 예외가 발생하며, 이에 적절히 사용자에게 응답하거나 예외를 처리할 수 있습니다 + +!!! Note + + 입력 가드레일은 사용자 입력에서 실행되도록 설계되었으므로, 에이전트의 가드레일은 해당 에이전트가 *첫 번째* 에이전트일 때만 실행됩니다. 왜 `guardrails` 속성이 에이전트에 있고 `Runner.run`에 전달되지 않는지 궁금할 수 있습니다. 이는 가드레일이 실제 에이전트와 밀접하게 연관되는 경향이 있기 때문입니다. 에이전트마다 서로 다른 가드레일을 실행하므로, 코드를 함께 배치하는 것이 가독성에 유리합니다. + +## 출력 가드레일 + +출력 가드레일은 다음 3단계로 실행됩니다: + +1. 먼저, 가드레일은 에이전트가 생성한 출력을 받습니다 +2. 다음으로, 가드레일 함수가 실행되어 [`GuardrailFunctionOutput`][agents.guardrail.GuardrailFunctionOutput]을 생성하고, 이는 [`OutputGuardrailResult`][agents.guardrail.OutputGuardrailResult]로 래핑됩니다 +3. 마지막으로 [`.tripwire_triggered`][agents.guardrail.GuardrailFunctionOutput.tripwire_triggered]가 true인지 확인합니다. true이면 [`OutputGuardrailTripwireTriggered`][agents.exceptions.OutputGuardrailTripwireTriggered] 예외가 발생하며, 이에 적절히 사용자에게 응답하거나 예외를 처리할 수 있습니다 + +!!! Note + + 출력 가드레일은 최종 에이전트 출력에서 실행되도록 설계되었으므로, 에이전트의 가드레일은 해당 에이전트가 *마지막* 에이전트일 때만 실행됩니다. 입력 가드레일과 마찬가지로, 가드레일은 실제 에이전트와 밀접하게 연관되므로 코드를 함께 배치하는 것이 가독성에 유리합니다. + +## 트립와이어 + +입력 또는 출력이 가드레일을 통과하지 못하면, 가드레일은 트립와이어로 이를 신호할 수 있습니다. 트립와이어가 트리거된 가드레일을 발견하는 즉시 `{Input,Output}GuardrailTripwireTriggered` 예외를 발생시키고 에이전트 실행을 중단합니다. + +## 가드레일 구현 + +입력을 받아 [`GuardrailFunctionOutput`][agents.guardrail.GuardrailFunctionOutput]을 반환하는 함수를 제공해야 합니다. 이 예제에서는 내부적으로 에이전트를 실행하여 이를 수행합니다. + +```python +from pydantic import BaseModel +from agents import ( + Agent, + GuardrailFunctionOutput, + InputGuardrailTripwireTriggered, + RunContextWrapper, + Runner, + TResponseInputItem, + input_guardrail, +) + +class MathHomeworkOutput(BaseModel): + is_math_homework: bool + reasoning: str + +guardrail_agent = Agent( # (1)! + name="Guardrail check", + instructions="Check if the user is asking you to do their math homework.", + output_type=MathHomeworkOutput, +) + + +@input_guardrail +async def math_guardrail( # (2)! + ctx: RunContextWrapper[None], agent: Agent, input: str | list[TResponseInputItem] +) -> GuardrailFunctionOutput: + result = await Runner.run(guardrail_agent, input, context=ctx.context) + + return GuardrailFunctionOutput( + output_info=result.final_output, # (3)! + tripwire_triggered=result.final_output.is_math_homework, + ) + + +agent = Agent( # (4)! + name="Customer support agent", + instructions="You are a customer support agent. You help customers with their questions.", + input_guardrails=[math_guardrail], +) + +async def main(): + # This should trip the guardrail + try: + await Runner.run(agent, "Hello, can you help me solve for x: 2x + 3 = 11?") + print("Guardrail didn't trip - this is unexpected") + + except InputGuardrailTripwireTriggered: + print("Math homework guardrail tripped") +``` + +1. 이 에이전트를 가드레일 함수에서 사용합니다 +2. 이는 에이전트의 입력/컨텍스트를 받아 결과를 반환하는 가드레일 함수입니다 +3. 가드레일 결과에 추가 정보를 포함할 수 있습니다 +4. 워크플로를 정의하는 실제 에이전트입니다 + +출력 가드레일도 유사합니다. + +```python +from pydantic import BaseModel +from agents import ( + Agent, + GuardrailFunctionOutput, + OutputGuardrailTripwireTriggered, + RunContextWrapper, + Runner, + output_guardrail, +) +class MessageOutput(BaseModel): # (1)! + response: str + +class MathOutput(BaseModel): # (2)! + reasoning: str + is_math: bool + +guardrail_agent = Agent( + name="Guardrail check", + instructions="Check if the output includes any math.", + output_type=MathOutput, +) + +@output_guardrail +async def math_guardrail( # (3)! + ctx: RunContextWrapper, agent: Agent, output: MessageOutput +) -> GuardrailFunctionOutput: + result = await Runner.run(guardrail_agent, output.response, context=ctx.context) + + return GuardrailFunctionOutput( + output_info=result.final_output, + tripwire_triggered=result.final_output.is_math, + ) + +agent = Agent( # (4)! + name="Customer support agent", + instructions="You are a customer support agent. You help customers with their questions.", + output_guardrails=[math_guardrail], + output_type=MessageOutput, +) + +async def main(): + # This should trip the guardrail + try: + await Runner.run(agent, "Hello, can you help me solve for x: 2x + 3 = 11?") + print("Guardrail didn't trip - this is unexpected") + + except OutputGuardrailTripwireTriggered: + print("Math output guardrail tripped") +``` + +1. 실제 에이전트의 출력 타입입니다 +2. 가드레일의 출력 타입입니다 +3. 에이전트의 출력을 받아 결과를 반환하는 가드레일 함수입니다 +4. 워크플로를 정의하는 실제 에이전트입니다 \ No newline at end of file diff --git a/docs/ko/handoffs.md b/docs/ko/handoffs.md new file mode 100644 index 000000000..e1d87737c --- /dev/null +++ b/docs/ko/handoffs.md @@ -0,0 +1,118 @@ +--- +search: + exclude: true +--- +# 핸드오프 + +핸드오프는 한 에이전트가 다른 에이전트에게 작업을 위임하도록 합니다. 이는 서로 다른 영역에 특화된 에이전트가 있는 시나리오에서 특히 유용합니다. 예를 들어, 고객 지원 앱에는 주문 상태, 환불, FAQ 등과 같은 작업을 각각 전담하는 에이전트가 있을 수 있습니다. + +핸드오프는 LLM 에게 도구로 표현됩니다. 따라서 `Refund Agent`라는 에이전트로의 핸드오프가 있다면, 도구 이름은 `transfer_to_refund_agent`가 됩니다. + +## 핸드오프 생성 + +모든 에이전트에는 [`handoffs`][agents.agent.Agent.handoffs] 매개변수가 있으며, 이는 `Agent` 자체 또는 핸드오프를 사용자 지정하는 `Handoff` 객체를 받을 수 있습니다. + +Agents SDK 에서 제공하는 [`handoff()`][agents.handoffs.handoff] 함수를 사용하여 핸드오프를 생성할 수 있습니다. 이 함수는 핸드오프 대상 에이전트와 함께 선택적 오버라이드와 입력 필터를 지정할 수 있습니다. + +### 기본 사용법 + +간단한 핸드오프를 만드는 방법은 다음과 같습니다: + +```python +from agents import Agent, handoff + +billing_agent = Agent(name="Billing agent") +refund_agent = Agent(name="Refund agent") + +# (1)! +triage_agent = Agent(name="Triage agent", handoffs=[billing_agent, handoff(refund_agent)]) +``` + +1. 에이전트를 직접 사용할 수 있으며(예: `billing_agent`), 또는 `handoff()` 함수를 사용할 수 있습니다 + +### `handoff()` 함수로 핸드오프 사용자 지정 + +[`handoff()`][agents.handoffs.handoff] 함수는 다양한 사용자 지정을 지원합니다. + +- `agent`: 작업을 넘길 대상 에이전트 +- `tool_name_override`: 기본적으로 `Handoff.default_tool_name()` 함수가 사용되며, 이는 `transfer_to_`로 결정됨. 이를 오버라이드할 수 있음 +- `tool_description_override`: `Handoff.default_tool_description()`의 기본 도구 설명을 오버라이드 +- `on_handoff`: 핸드오프가 호출될 때 실행되는 콜백 함수. 핸드오프가 호출됨을 알게 되는 즉시 데이터 페칭을 시작하는 등의 용도에 유용함. 이 함수는 에이전트 컨텍스트를 받고, 선택적으로 LLM 이 생성한 입력도 받을 수 있음. 입력 데이터는 `input_type` 매개변수로 제어됨 +- `input_type`: 핸드오프가 기대하는 입력의 타입(선택 사항) +- `input_filter`: 다음 에이전트가 받는 입력을 필터링할 수 있음. 아래 참고 +- `is_enabled`: 핸드오프 활성화 여부. 불리언 또는 불리언을 반환하는 함수가 될 수 있어, 런타임에 동적으로 활성화/비활성화 가능 + +```python +from agents import Agent, handoff, RunContextWrapper + +def on_handoff(ctx: RunContextWrapper[None]): + print("Handoff called") + +agent = Agent(name="My agent") + +handoff_obj = handoff( + agent=agent, + on_handoff=on_handoff, + tool_name_override="custom_handoff_tool", + tool_description_override="Custom description", +) +``` + +## 핸드오프 입력 + +특정 상황에서는, 핸드오프를 호출할 때 LLM 이 일부 데이터를 제공하길 원할 수 있습니다. 예를 들어, "에스컬레이션 에이전트"로의 핸드오프를 상상해 보세요. 기록을 위해 사유를 제공받고자 할 수 있습니다. + +```python +from pydantic import BaseModel + +from agents import Agent, handoff, RunContextWrapper + +class EscalationData(BaseModel): + reason: str + +async def on_handoff(ctx: RunContextWrapper[None], input_data: EscalationData): + print(f"Escalation agent called with reason: {input_data.reason}") + +agent = Agent(name="Escalation agent") + +handoff_obj = handoff( + agent=agent, + on_handoff=on_handoff, + input_type=EscalationData, +) +``` + +## 입력 필터 + +핸드오프가 발생하면, 마치 새 에이전트가 대화를 인수하여 이전 전체 대화 기록을 볼 수 있는 것과 같습니다. 이를 변경하고 싶다면 [`input_filter`][agents.handoffs.Handoff.input_filter]를 설정할 수 있습니다. 입력 필터는 [`HandoffInputData`][agents.handoffs.HandoffInputData]를 통해 기존 입력을 받고, 새로운 `HandoffInputData`를 반환해야 하는 함수입니다. + +일부 일반적인 패턴(예: 히스토리에서 모든 도구 호출 제거)은 [`agents.extensions.handoff_filters`][]에 이미 구현되어 있습니다 + +```python +from agents import Agent, handoff +from agents.extensions import handoff_filters + +agent = Agent(name="FAQ agent") + +handoff_obj = handoff( + agent=agent, + input_filter=handoff_filters.remove_all_tools, # (1)! +) +``` + +1. 이것은 `FAQ agent`가 호출될 때 자동으로 히스토리에서 모든 도구를 제거합니다 + +## 권장 프롬프트 + +LLM 이 핸드오프를 올바르게 이해하도록 하려면, 에이전트에 핸드오프 관련 정보를 포함하는 것을 권장합니다. [`agents.extensions.handoff_prompt.RECOMMENDED_PROMPT_PREFIX`][]의 권장 프리픽스를 사용하거나, [`agents.extensions.handoff_prompt.prompt_with_handoff_instructions`][]를 호출하여 프롬프트에 권장 데이터를 자동으로 추가할 수 있습니다. + +```python +from agents import Agent +from agents.extensions.handoff_prompt import RECOMMENDED_PROMPT_PREFIX + +billing_agent = Agent( + name="Billing agent", + instructions=f"""{RECOMMENDED_PROMPT_PREFIX} + .""", +) +``` \ No newline at end of file diff --git a/docs/ko/index.md b/docs/ko/index.md new file mode 100644 index 000000000..fb6c1fad8 --- /dev/null +++ b/docs/ko/index.md @@ -0,0 +1,58 @@ +--- +search: + exclude: true +--- +# OpenAI Agents SDK + +[OpenAI Agents SDK](https://github.com/openai/openai-agents-python)는 최소한의 추상화로 가볍고 사용하기 쉬운 패키지에서 에이전트형 AI 앱을 만들 수 있게 해 줍니다. 이는 에이전트를 위한 이전 실험 프로젝트인 [Swarm](https://github.com/openai/swarm/tree/main)의 프로덕션급 업그레이드입니다. Agents SDK에는 매우 적은 수의 기본 컴포넌트가 있습니다: + +- **에이전트**: instructions와 tools를 갖춘 LLM +- **핸드오프**: 에이전트가 특정 작업을 다른 에이전트에 위임할 수 있게 함 +- **가드레일**: 에이전트의 입력과 출력을 검증 가능하게 함 +- **세션**: 에이전트 실행 전반에 걸쳐 대화 이력을 자동으로 유지함 + +Python과 결합하면, 이러한 기본 컴포넌트만으로도 도구와 에이전트 간의 복잡한 관계를 표현하고, 가파른 학습 곡선 없이 실제 애플리케이션을 구축할 수 있습니다. 또한 SDK에는 에이전트 플로우를 시각화하고 디버깅하며, 평가하고 심지어 애플리케이션용 모델을 파인튜닝할 수 있게 해 주는 기본 제공 **트레이싱**이 포함되어 있습니다. + +## Agents SDK 사용 이유 + +SDK는 두 가지 설계 원칙을 따릅니다: + +1. 사용할 가치가 있을 만큼 충분한 기능을 제공하되, 빠르게 배울 수 있도록 기본 컴포넌트 수는 최소화합니다. +2. 기본 설정만으로도 잘 동작하지만, 원하는 동작을 정확히 커스터마이즈할 수 있습니다. + +SDK의 주요 기능은 다음과 같습니다: + +- 에이전트 루프: 도구 호출, 결과를 LLM에 전달, LLM이 완료될 때까지 반복을 처리하는 기본 제공 에이전트 루프 +- 파이썬 우선: 새로운 추상화를 배우지 않고도, 언어의 기본 기능만으로 에이전트를 오케스트레이션하고 체인 구성 +- 핸드오프: 여러 에이전트 간 조정과 위임을 가능하게 하는 강력한 기능 +- 가드레일: 에이전트와 병렬로 입력 검증과 체크를 수행하고, 실패 시 빠르게 중단 +- 세션: 에이전트 실행 전체에서 대화 이력을 자동으로 관리하여 수동 상태 관리를 제거 +- 함수 도구: 어떤 Python 함수든 자동 스키마 생성과 Pydantic 기반 검증으로 도구로 전환 +- 트레이싱: 워크플로를 시각화, 디버그, 모니터링할 수 있게 해 주는 기본 제공 트레이싱과 함께, OpenAI의 평가, 파인튜닝, 지식 증류 도구도 활용 가능 + +## 설치 + +```bash +pip install openai-agents +``` + +## Hello World 예시 + +```python +from agents import Agent, Runner + +agent = Agent(name="Assistant", instructions="You are a helpful assistant") + +result = Runner.run_sync(agent, "Write a haiku about recursion in programming.") +print(result.final_output) + +# Code within the code, +# Functions calling themselves, +# Infinite loop's dance. +``` + +(_실행할 경우 `OPENAI_API_KEY` 환경 변수를 설정하세요_) + +```bash +export OPENAI_API_KEY=sk-... +``` \ No newline at end of file diff --git a/docs/ko/mcp.md b/docs/ko/mcp.md new file mode 100644 index 000000000..7cbf88ec2 --- /dev/null +++ b/docs/ko/mcp.md @@ -0,0 +1,322 @@ +--- +search: + exclude: true +--- +# Model context protocol (MCP) + +[Model context protocol](https://modelcontextprotocol.io/introduction) (MCP)은 애플리케이션이 도구와 컨텍스트를 언어 모델에 노출하는 방식을 표준화합니다. 공식 문서에서 발췌: + +> MCP는 애플리케이션이 LLM에 컨텍스트를 제공하는 방식을 표준화하는 오픈 프로토콜입니다. MCP를 AI 애플리케이션을 위한 USB-C 포트로 생각해 보세요. USB-C가 다양한 주변기기와 액세서리에 기기를 연결하는 표준화된 방식을 제공하듯, MCP는 AI 모델을 다양한 데이터 소스와 도구에 연결하는 표준화된 방식을 제공합니다. + +Agents Python SDK는 여러 MCP 트랜스포트를 이해합니다. 이를 통해 기존 MCP 서버를 재사용하거나 직접 구축하여 파일 시스템, HTTP, 또는 커넥터를 기반으로 한 도구를 에이전트에 노출할 수 있습니다. + +## MCP 통합 선택 + +MCP 서버를 에이전트에 연결하기 전에 도구 호출을 어디에서 실행할지와 도달 가능한 트랜스포트를 결정하세요. 아래 매트릭스는 Python SDK가 지원하는 옵션을 요약합니다. + +| 필요한 사항 | 권장 옵션 | +| ------------------------------------------------------------------------------------ | ----------------------------------------------------- | +| OpenAI의 Responses API가 모델을 대신하여 공용으로 접근 가능한 MCP 서버를 호출하도록 함 | **호스티드 MCP 서버 도구** via [`HostedMCPTool`][agents.tool.HostedMCPTool] | +| 로컬 또는 원격에서 실행 중인 Streamable HTTP 서버에 연결 | **Streamable HTTP MCP 서버** via [`MCPServerStreamableHttp`][agents.mcp.server.MCPServerStreamableHttp] | +| Server-Sent Events를 사용하는 HTTP를 구현한 서버와 통신 | **HTTP with SSE MCP 서버** via [`MCPServerSse`][agents.mcp.server.MCPServerSse] | +| 로컬 프로세스를 실행하고 stdin/stdout을 통해 통신 | **stdio MCP 서버** via [`MCPServerStdio`][agents.mcp.server.MCPServerStdio] | + +아래 섹션에서는 각 옵션을 설정하는 방법과, 어떤 상황에서 특정 트랜스포트를 선호해야 하는지 안내합니다. + +## 1. Hosted MCP server tools + +호스티드 툴은 전체 도구 왕복을 OpenAI 인프라로 넘깁니다. 코드에서 도구를 나열하고 호출하는 대신 [`HostedMCPTool`][agents.tool.HostedMCPTool]이 서버 레이블(및 선택적 커넥터 메타데이터)을 Responses API로 전달합니다. 모델은 원격 서버의 도구를 나열하고, Python 프로세스로의 추가 콜백 없이 이를 호출합니다. 호스티드 툴은 현재 Responses API의 호스티드 MCP 통합을 지원하는 OpenAI 모델에서 동작합니다. + +### 기본 호스티드 MCP 도구 + +에이전트의 `tools` 목록에 [`HostedMCPTool`][agents.tool.HostedMCPTool]을 추가하여 호스티드 도구를 생성하세요. `tool_config` 딕셔너리는 REST API에 전송할 JSON을 반영합니다: + +```python +import asyncio + +from agents import Agent, HostedMCPTool, Runner + +async def main() -> None: + agent = Agent( + name="Assistant", + tools=[ + HostedMCPTool( + tool_config={ + "type": "mcp", + "server_label": "gitmcp", + "server_url": "https://gitmcp.io/openai/codex", + "require_approval": "never", + } + ) + ], + ) + + result = await Runner.run(agent, "Which language is this repository written in?") + print(result.final_output) + +asyncio.run(main()) +``` + +호스티드 서버는 도구를 자동으로 노출합니다. `mcp_servers`에 추가할 필요가 없습니다. + +### 호스티드 MCP 결과 스트리밍 + +호스티드 툴은 함수 도구와 정확히 동일한 방식으로 스트리밍을 지원합니다. `Runner.run_streamed`에 `stream=True`를 전달하여 모델이 실행 중일 때도 증분 MCP 출력을 소비하세요: + +```python +result = Runner.run_streamed(agent, "Summarise this repository's top languages") +async for event in result.stream_events(): + if event.type == "run_item_stream_event": + print(f"Received: {event.item}") +print(result.final_output) +``` + +### 선택적 승인 플로우 + +서버가 민감한 작업을 수행할 수 있는 경우, 각 도구 실행 전에 사람 또는 프로그램의 승인을 요구할 수 있습니다. `tool_config`의 `require_approval`을 단일 정책(`"always"`, `"never"`) 또는 도구 이름별 정책 매핑 딕셔너리로 설정하세요. 파이썬 내부에서 결정을 내리려면 `on_approval_request` 콜백을 제공하세요. + +```python +from agents import MCPToolApprovalFunctionResult, MCPToolApprovalRequest + +SAFE_TOOLS = {"read_project_metadata"} + +def approve_tool(request: MCPToolApprovalRequest) -> MCPToolApprovalFunctionResult: + if request.data.name in SAFE_TOOLS: + return {"approve": True} + return {"approve": False, "reason": "Escalate to a human reviewer"} + +agent = Agent( + name="Assistant", + tools=[ + HostedMCPTool( + tool_config={ + "type": "mcp", + "server_label": "gitmcp", + "server_url": "https://gitmcp.io/openai/codex", + "require_approval": "always", + }, + on_approval_request=approve_tool, + ) + ], +) +``` + +콜백은 동기 또는 비동기로 작성할 수 있으며, 모델이 계속 실행하는 데 필요한 승인 데이터가 필요할 때마다 호출됩니다. + +### 커넥터 기반 호스티드 서버 + +호스티드 MCP는 OpenAI 커넥터도 지원합니다. `server_url` 대신 `connector_id`와 액세스 토큰을 제공하세요. Responses API가 인증을 처리하며, 호스티드 서버가 커넥터의 도구를 노출합니다. + +```python +import os + +HostedMCPTool( + tool_config={ + "type": "mcp", + "server_label": "google_calendar", + "connector_id": "connector_googlecalendar", + "authorization": os.environ["GOOGLE_CALENDAR_AUTHORIZATION"], + "require_approval": "never", + } +) +``` + +스트리밍, 승인, 커넥터를 포함한 완전한 호스티드 툴 샘플은 +[`examples/hosted_mcp`](https://github.com/openai/openai-agents-python/tree/main/examples/hosted_mcp)에 있습니다. + +## 2. Streamable HTTP MCP 서버 + +네트워크 연결을 직접 관리하려면 [`MCPServerStreamableHttp`][agents.mcp.server.MCPServerStreamableHttp]를 사용하세요. Streamable HTTP 서버는 트랜스포트를 직접 제어하거나, 지연 시간을 낮게 유지하면서 서버를 자체 인프라 내에서 실행하고자 할 때 이상적입니다. + +```python +import asyncio +import os + +from agents import Agent, Runner +from agents.mcp import MCPServerStreamableHttp +from agents.model_settings import ModelSettings + +async def main() -> None: + token = os.environ["MCP_SERVER_TOKEN"] + async with MCPServerStreamableHttp( + name="Streamable HTTP Python Server", + params={ + "url": "http://localhost:8000/mcp", + "headers": {"Authorization": f"Bearer {token}"}, + "timeout": 10, + }, + cache_tools_list=True, + max_retry_attempts=3, + ) as server: + agent = Agent( + name="Assistant", + instructions="Use the MCP tools to answer the questions.", + mcp_servers=[server], + model_settings=ModelSettings(tool_choice="required"), + ) + + result = await Runner.run(agent, "Add 7 and 22.") + print(result.final_output) + +asyncio.run(main()) +``` + +생성자는 다음 추가 옵션을 받습니다: + +- `client_session_timeout_seconds`는 HTTP 읽기 타임아웃을 제어합니다 +- `use_structured_content`는 `tool_result.structured_content`를 텍스트 출력보다 우선할지 여부를 전환합니다 +- `max_retry_attempts` 및 `retry_backoff_seconds_base`는 `list_tools()`와 `call_tool()`에 대한 자동 재시도를 추가합니다 +- `tool_filter`를 사용하면 도구의 부분집합만 노출할 수 있습니다([도구 필터링](#tool-filtering) 참고) + +## 3. HTTP with SSE MCP 서버 + +MCP 서버가 HTTP with SSE 트랜스포트를 구현하는 경우, [`MCPServerSse`][agents.mcp.server.MCPServerSse]를 인스턴스화하세요. 트랜스포트를 제외하면 API는 Streamable HTTP 서버와 동일합니다. + +```python + +from agents import Agent, Runner +from agents.model_settings import ModelSettings +from agents.mcp import MCPServerSse + +workspace_id = "demo-workspace" + +async with MCPServerSse( + name="SSE Python Server", + params={ + "url": "http://localhost:8000/sse", + "headers": {"X-Workspace": workspace_id}, + }, + cache_tools_list=True, +) as server: + agent = Agent( + name="Assistant", + mcp_servers=[server], + model_settings=ModelSettings(tool_choice="required"), + ) + result = await Runner.run(agent, "What's the weather in Tokyo?") + print(result.final_output) +``` + +## 4. stdio MCP 서버 + +로컬 하위 프로세스로 실행되는 MCP 서버에는 [`MCPServerStdio`][agents.mcp.server.MCPServerStdio]를 사용하세요. SDK가 프로세스를 생성하고, 파이프를 열어두며, 컨텍스트 매니저가 종료될 때 자동으로 닫습니다. 이 옵션은 빠른 개념 증명이나 서버가 커맨드라인 엔트리 포인트만 노출하는 경우에 유용합니다. + +```python +from pathlib import Path +from agents import Agent, Runner +from agents.mcp import MCPServerStdio + +current_dir = Path(__file__).parent +samples_dir = current_dir / "sample_files" + +async with MCPServerStdio( + name="Filesystem Server via npx", + params={ + "command": "npx", + "args": ["-y", "@modelcontextprotocol/server-filesystem", str(samples_dir)], + }, +) as server: + agent = Agent( + name="Assistant", + instructions="Use the files in the sample directory to answer questions.", + mcp_servers=[server], + ) + result = await Runner.run(agent, "List the files available to you.") + print(result.final_output) +``` + +## 도구 필터링 + +각 MCP 서버는 에이전트에 필요한 함수만 노출할 수 있도록 도구 필터를 지원합니다. 필터링은 생성 시점 또는 실행별로 동적으로 수행할 수 있습니다. + +### 정적 도구 필터링 + +[`create_static_tool_filter`][agents.mcp.create_static_tool_filter]를 사용하여 간단한 허용/차단 리스트를 구성하세요: + +```python +from pathlib import Path + +from agents.mcp import MCPServerStdio, create_static_tool_filter + +samples_dir = Path("/path/to/files") + +filesystem_server = MCPServerStdio( + params={ + "command": "npx", + "args": ["-y", "@modelcontextprotocol/server-filesystem", str(samples_dir)], + }, + tool_filter=create_static_tool_filter(allowed_tool_names=["read_file", "write_file"]), +) +``` + +`allowed_tool_names`와 `blocked_tool_names`가 모두 제공되는 경우, SDK는 허용 리스트를 먼저 적용한 뒤 남은 집합에서 차단된 도구를 제거합니다. + +### 동적 도구 필터링 + +더 정교한 로직이 필요하다면 [`ToolFilterContext`][agents.mcp.ToolFilterContext]를 받는 호출 가능 객체를 전달하세요. 이 호출 가능 객체는 동기 또는 비동기로 작성할 수 있으며, 도구를 노출해야 할 때 `True`를 반환합니다. + +```python +from pathlib import Path + +from agents.mcp import MCPServerStdio, ToolFilterContext + +samples_dir = Path("/path/to/files") + +async def context_aware_filter(context: ToolFilterContext, tool) -> bool: + if context.agent.name == "Code Reviewer" and tool.name.startswith("danger_"): + return False + return True + +async with MCPServerStdio( + params={ + "command": "npx", + "args": ["-y", "@modelcontextprotocol/server-filesystem", str(samples_dir)], + }, + tool_filter=context_aware_filter, +) as server: + ... +``` + +필터 컨텍스트는 활성 `run_context`, 도구를 요청하는 `agent`, 그리고 `server_name`을 제공합니다. + +## 프롬프트 + +MCP 서버는 에이전트 instructions를 동적으로 생성하는 프롬프트도 제공할 수 있습니다. 프롬프트를 지원하는 서버는 두 가지 메서드를 노출합니다: + +- `list_prompts()`는 사용 가능한 프롬프트 템플릿을 나열합니다 +- `get_prompt(name, arguments)`는 선택적 매개변수와 함께 구체적인 프롬프트를 가져옵니다 + +```python +from agents import Agent + +prompt_result = await server.get_prompt( + "generate_code_review_instructions", + {"focus": "security vulnerabilities", "language": "python"}, +) +instructions = prompt_result.messages[0].content.text + +agent = Agent( + name="Code Reviewer", + instructions=instructions, + mcp_servers=[server], +) +``` + +## 캐싱 + +모든 에이전트 실행은 각 MCP 서버에 대해 `list_tools()`를 호출합니다. 원격 서버는 눈에 띄는 지연을 유발할 수 있으므로, 모든 MCP 서버 클래스는 `cache_tools_list` 옵션을 노출합니다. 도구 정의가 자주 변경되지 않는다고 확신하는 경우에만 `True`로 설정하세요. 이후 새 목록을 강제로 가져오려면 서버 인스턴스에서 `invalidate_tools_cache()`를 호출하세요. + +## 트레이싱 + +[트레이싱](./tracing.md)은 MCP 활동을 자동으로 캡처합니다. 포함되는 항목: + +1. 도구를 나열하기 위한 MCP 서버 호출 +2. 도구 호출과 관련된 MCP 정보 + +![MCP 트레이싱 스크린샷](../assets/images/mcp-tracing.jpg) + +## 추가 자료 + +- [Model Context Protocol](https://modelcontextprotocol.io/) – 명세와 설계 가이드 +- [examples/mcp](https://github.com/openai/openai-agents-python/tree/main/examples/mcp) – 실행 가능한 stdio, SSE, Streamable HTTP 샘플 +- [examples/hosted_mcp](https://github.com/openai/openai-agents-python/tree/main/examples/hosted_mcp) – 승인 및 커넥터를 포함한 완전한 호스티드 MCP 데모 \ No newline at end of file diff --git a/docs/ko/models/index.md b/docs/ko/models/index.md new file mode 100644 index 000000000..a47d10a9f --- /dev/null +++ b/docs/ko/models/index.md @@ -0,0 +1,192 @@ +--- +search: + exclude: true +--- +# 모델 + +Agents SDK 는 OpenAI 모델을 다음 두 가지 방식으로 기본 지원합니다: + +- **권장**: 새로운 [Responses API](https://platform.openai.com/docs/api-reference/responses)를 사용해 OpenAI API 를 호출하는 [`OpenAIResponsesModel`][agents.models.openai_responses.OpenAIResponsesModel] +- [Chat Completions API](https://platform.openai.com/docs/api-reference/chat)를 사용해 OpenAI API 를 호출하는 [`OpenAIChatCompletionsModel`][agents.models.openai_chatcompletions.OpenAIChatCompletionsModel] + +## OpenAI 모델 + +`Agent` 초기화 시 모델을 지정하지 않으면 기본 모델이 사용됩니다. 현재 기본값은 [`gpt-4.1`](https://platform.openai.com/docs/models/gpt-4.1)로, 에이전트형 워크플로에 대한 예측 가능성과 낮은 지연 시간의 균형이 뛰어납니다. + +[`gpt-5`](https://platform.openai.com/docs/models/gpt-5) 같은 다른 모델로 전환하려면 다음 섹션의 단계를 따르세요. + +### 기본 OpenAI 모델 + +사용자 지정 모델을 설정하지 않은 모든 에이전트에서 일관되게 특정 모델을 사용하려면, 에이전트를 실행하기 전에 `OPENAI_DEFAULT_MODEL` 환경 변수를 설정하세요. + +```bash +export OPENAI_DEFAULT_MODEL=gpt-5 +python3 my_awesome_agent.py +``` + +#### GPT-5 모델 + +GPT-5 의 reasoning 모델들([`gpt-5`](https://platform.openai.com/docs/models/gpt-5), [`gpt-5-mini`](https://platform.openai.com/docs/models/gpt-5-mini), [`gpt-5-nano`](https://platform.openai.com/docs/models/gpt-5-nano))을 이렇게 사용할 경우, SDK 는 기본적으로 합리적인 `ModelSettings` 를 적용합니다. 구체적으로, `reasoning.effort` 와 `verbosity` 를 모두 `"low"` 로 설정합니다. 이러한 설정을 직접 만들고 싶다면 `agents.models.get_default_model_settings("gpt-5")` 를 호출하세요. + +더 낮은 지연 시간이나 특정 요구사항이 있다면 다른 모델과 설정을 선택할 수 있습니다. 기본 모델의 reasoning effort 를 조정하려면 사용자 정의 `ModelSettings` 를 전달하세요: + +```python +from openai.types.shared import Reasoning +from agents import Agent, ModelSettings + +my_agent = Agent( + name="My Agent", + instructions="You're a helpful agent.", + model_settings=ModelSettings(reasoning=Reasoning(effort="minimal"), verbosity="low") + # If OPENAI_DEFAULT_MODEL=gpt-5 is set, passing only model_settings works. + # It's also fine to pass a GPT-5 model name explicitly: + # model="gpt-5", +) +``` + +특히 낮은 지연 시간이 필요하다면, [`gpt-5-mini`](https://platform.openai.com/docs/models/gpt-5-mini) 또는 [`gpt-5-nano`](https://platform.openai.com/docs/models/gpt-5-nano) 모델을 `reasoning.effort="minimal"` 로 사용하는 것이 기본 설정보다 더 빠르게 응답하는 경우가 많습니다. 다만 Responses API 의 일부 내장 도구(예: 파일 검색과 이미지 생성)는 `"minimal"` reasoning effort 를 지원하지 않으므로, 본 Agents SDK 는 기본값을 `"low"` 로 설정합니다. + +#### 비 GPT-5 모델 + +사용자 지정 `model_settings` 없이 비 GPT-5 모델 이름을 전달하면, SDK 는 어떤 모델과도 호환되는 일반적인 `ModelSettings` 로 되돌립니다. + +## 비 OpenAI 모델 + +대부분의 다른 비 OpenAI 모델은 [LiteLLM 통합](./litellm.md)을 통해 사용할 수 있습니다. 먼저 litellm 의 의존성 그룹을 설치하세요: + +```bash +pip install "openai-agents[litellm]" +``` + +그런 다음, `litellm/` 접두사를 사용하여 [지원되는 모델](https://docs.litellm.ai/docs/providers) 중 아무거나 사용하세요: + +```python +claude_agent = Agent(model="litellm/anthropic/claude-3-5-sonnet-20240620", ...) +gemini_agent = Agent(model="litellm/gemini/gemini-2.5-flash-preview-04-17", ...) +``` + +### 비 OpenAI 모델을 사용하는 다른 방법 + +다른 LLM 제공업체를 통합하는 방법은 3가지가 더 있습니다(예시는 [여기](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers/)): + +1. [`set_default_openai_client`][agents.set_default_openai_client] 는 LLM 클라이언트로 `AsyncOpenAI` 인스턴스를 전역적으로 사용하려는 경우에 유용합니다. 이는 LLM 제공업체가 OpenAI 호환 API 엔드포인트를 제공하고, `base_url` 과 `api_key` 를 설정할 수 있는 경우에 해당합니다. 설정 가능한 예시는 [examples/model_providers/custom_example_global.py](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers/custom_example_global.py) 를 참고하세요. +2. [`ModelProvider`][agents.models.interface.ModelProvider] 는 `Runner.run` 수준에서 사용합니다. 이를 통해 "이 실행 내 모든 에이전트에 사용자 정의 모델 제공업체를 사용"하도록 설정할 수 있습니다. 설정 가능한 예시는 [examples/model_providers/custom_example_provider.py](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers/custom_example_provider.py) 를 참고하세요. +3. [`Agent.model`][agents.agent.Agent.model] 을 사용하면 특정 Agent 인스턴스에 모델을 지정할 수 있습니다. 이를 통해 에이전트마다 다른 제공업체를 혼합해 사용할 수 있습니다. 설정 가능한 예시는 [examples/model_providers/custom_example_agent.py](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers/custom_example_agent.py) 를 참고하세요. 대부분의 사용 가능한 모델을 간편하게 사용하려면 [LiteLLM 통합](./litellm.md) 을 활용하세요. + +`platform.openai.com` 의 API 키가 없는 경우, `set_tracing_disabled()` 로 트레이싱을 비활성화하거나, [다른 트레이싱 프로세서](../tracing.md) 를 설정하는 것을 권장합니다. + +!!! note + + 이 예제들에서는 대부분의 LLM 제공업체가 아직 Responses API 를 지원하지 않기 때문에 Chat Completions API/모델을 사용합니다. LLM 제공업체가 Responses API 를 지원한다면 Responses 사용을 권장합니다. + +## 모델 혼합 사용 + +단일 워크플로 내에서 에이전트마다 다른 모델을 사용하고 싶을 수 있습니다. 예를 들어, 분류(트리아지)에는 더 작고 빠른 모델을, 복잡한 작업에는 더 크고 강력한 모델을 사용할 수 있습니다. [`Agent`][agents.Agent] 를 구성할 때 다음 중 하나로 특정 모델을 선택할 수 있습니다: + +1. 모델 이름을 전달 +2. 임의의 모델 이름 + 해당 이름을 Model 인스턴스로 매핑할 수 있는 [`ModelProvider`][agents.models.interface.ModelProvider] 를 전달 +3. [`Model`][agents.models.interface.Model] 구현체를 직접 제공 + +!!!note + + SDK 는 [`OpenAIResponsesModel`][agents.models.openai_responses.OpenAIResponsesModel] 과 [`OpenAIChatCompletionsModel`][agents.models.openai_chatcompletions.OpenAIChatCompletionsModel] 두 가지 형태를 모두 지원하지만, 두 형태가 지원하는 기능과 도구가 서로 다르므로 각 워크플로에는 하나의 모델 형태만 사용할 것을 권장합니다. 워크플로가 모델 형태의 혼합을 요구한다면, 사용하는 모든 기능이 두 형태 모두에서 제공되는지 확인하세요. + +```python +from agents import Agent, Runner, AsyncOpenAI, OpenAIChatCompletionsModel +import asyncio + +spanish_agent = Agent( + name="Spanish agent", + instructions="You only speak Spanish.", + model="gpt-5-mini", # (1)! +) + +english_agent = Agent( + name="English agent", + instructions="You only speak English", + model=OpenAIChatCompletionsModel( # (2)! + model="gpt-5-nano", + openai_client=AsyncOpenAI() + ), +) + +triage_agent = Agent( + name="Triage agent", + instructions="Handoff to the appropriate agent based on the language of the request.", + handoffs=[spanish_agent, english_agent], + model="gpt-5", +) + +async def main(): + result = await Runner.run(triage_agent, input="Hola, ¿cómo estás?") + print(result.final_output) +``` + +1. OpenAI 모델 이름을 직접 설정 +2. [`Model`][agents.models.interface.Model] 구현체를 제공 + +에이전트에 사용되는 모델을 추가로 구성하려면, `temperature` 같은 선택적 모델 구성 매개변수를 제공하는 [`ModelSettings`][agents.models.interface.ModelSettings] 를 전달할 수 있습니다. + +```python +from agents import Agent, ModelSettings + +english_agent = Agent( + name="English agent", + instructions="You only speak English", + model="gpt-4.1", + model_settings=ModelSettings(temperature=0.1), +) +``` + +또한 OpenAI 의 Responses API 를 사용할 때 [몇 가지 다른 선택적 매개변수](https://platform.openai.com/docs/api-reference/responses/create) (예: `user`, `service_tier` 등)가 있습니다. 이들이 최상위에 없으면 `extra_args` 를 사용해 함께 전달할 수 있습니다. + +```python +from agents import Agent, ModelSettings + +english_agent = Agent( + name="English agent", + instructions="You only speak English", + model="gpt-4.1", + model_settings=ModelSettings( + temperature=0.1, + extra_args={"service_tier": "flex", "user": "user_12345"}, + ), +) +``` + +## 다른 LLM 제공업체 사용 시 일반적인 문제 + +### Tracing 클라이언트 오류 401 + +트레이싱 관련 오류가 발생한다면, 이는 트레이스가 OpenAI 서버로 업로드되는데 OpenAI API 키가 없기 때문입니다. 해결 방법은 다음 세 가지 중 하나입니다: + +1. 트레이싱 완전 비활성화: [`set_tracing_disabled(True)`][agents.set_tracing_disabled] +2. 트레이싱용 OpenAI 키 설정: [`set_tracing_export_api_key(...)`][agents.set_tracing_export_api_key]. 이 API 키는 트레이스 업로드에만 사용되며, 반드시 [platform.openai.com](https://platform.openai.com/) 의 키여야 합니다. +3. 비 OpenAI 트레이스 프로세서 사용. [tracing 문서](../tracing.md#custom-tracing-processors) 를 참고하세요. + +### Responses API 지원 + +SDK 는 기본적으로 Responses API 를 사용하지만, 대부분의 다른 LLM 제공업체는 아직 이를 지원하지 않습니다. 그 결과 404 같은 문제가 발생할 수 있습니다. 해결 방법은 두 가지입니다: + +1. [`set_default_openai_api("chat_completions")`][agents.set_default_openai_api] 를 호출하세요. 환경 변수로 `OPENAI_API_KEY` 와 `OPENAI_BASE_URL` 을 설정하는 경우에 동작합니다. +2. [`OpenAIChatCompletionsModel`][agents.models.openai_chatcompletions.OpenAIChatCompletionsModel] 을 사용하세요. 예시는 [여기](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers/) 에 있습니다. + +### Structured outputs 지원 + +일부 모델 제공업체는 [structured outputs](https://platform.openai.com/docs/guides/structured-outputs) 를 지원하지 않습니다. 이로 인해 다음과 같은 오류가 발생할 수 있습니다: + +``` + +BadRequestError: Error code: 400 - {'error': {'message': "'response_format.type' : value is not one of the allowed values ['text','json_object']", 'type': 'invalid_request_error'}} + +``` + +이는 일부 모델 제공업체의 한계로, JSON 출력을 지원하지만 출력에 사용할 `json_schema` 를 지정할 수 없습니다. 이에 대한 해결책을 마련 중이지만, JSON schema 출력을 지원하는 제공업체를 사용하는 것을 권장합니다. 그렇지 않으면 잘못된 JSON 때문에 앱이 자주 실패할 수 있습니다. + +## 제공업체 간 모델 혼합 + +모델 제공업체 간 기능 차이를 인지하지 못하면 오류가 발생할 수 있습니다. 예를 들어, OpenAI 는 structured outputs, 멀티모달 입력, 호스티드 파일 검색 및 웹 검색을 지원하지만, 다른 많은 제공업체는 이러한 기능을 지원하지 않습니다. 다음 제약을 유의하세요: + +- 지원하지 않는 `tools` 를 이해하지 못하는 제공업체로 보내지 않기 +- 텍스트 전용 모델을 호출하기 전에 멀티모달 입력을 필터링 +- structured JSON outputs 를 지원하지 않는 제공업체는 때때로 잘못된 JSON 을 생성할 수 있음 \ No newline at end of file diff --git a/docs/ko/models/litellm.md b/docs/ko/models/litellm.md new file mode 100644 index 000000000..3836f16b7 --- /dev/null +++ b/docs/ko/models/litellm.md @@ -0,0 +1,94 @@ +--- +search: + exclude: true +--- +# LiteLLM 를 통한 임의 모델 사용 + +!!! note + + LiteLLM 통합은 베타 상태입니다. 특히 규모가 작은 일부 모델 제공자에서 문제가 발생할 수 있습니다. [Github issues](https://github.com/openai/openai-agents-python/issues)를 통해 이슈를 보고해 주세요. 신속히 수정하겠습니다. + +[LiteLLM](https://docs.litellm.ai/docs/) 은 단일 인터페이스로 100개 이상의 모델을 사용할 수 있게 해주는 라이브러리입니다. Agents SDK 에 LiteLLM 통합을 추가하여 어떤 AI 모델이든 사용할 수 있도록 했습니다. + +## 설정 + +`litellm` 이 사용 가능해야 합니다. 선택적 `litellm` 의존성 그룹을 설치하면 됩니다: + +```bash +pip install "openai-agents[litellm]" +``` + +설치가 완료되면, 어떤 에이전트에서든 [`LitellmModel`][agents.extensions.models.litellm_model.LitellmModel] 을 사용할 수 있습니다. + +## 예제 + +완전히 동작하는 예제입니다. 실행하면 모델 이름과 API 키를 입력하라는 프롬프트가 표시됩니다. 예를 들어 다음과 같이 입력할 수 있습니다: + +- `openai/gpt-4.1` 를 모델로, OpenAI API 키 +- `anthropic/claude-3-5-sonnet-20240620` 를 모델로, Anthropic API 키 +- 등 + +LiteLLM 이 지원하는 전체 모델 목록은 [litellm providers docs](https://docs.litellm.ai/docs/providers) 를 참고하세요. + +```python +from __future__ import annotations + +import asyncio + +from agents import Agent, Runner, function_tool, set_tracing_disabled +from agents.extensions.models.litellm_model import LitellmModel + +@function_tool +def get_weather(city: str): + print(f"[debug] getting weather for {city}") + return f"The weather in {city} is sunny." + + +async def main(model: str, api_key: str): + agent = Agent( + name="Assistant", + instructions="You only respond in haikus.", + model=LitellmModel(model=model, api_key=api_key), + tools=[get_weather], + ) + + result = await Runner.run(agent, "What's the weather in Tokyo?") + print(result.final_output) + + +if __name__ == "__main__": + # First try to get model/api key from args + import argparse + + parser = argparse.ArgumentParser() + parser.add_argument("--model", type=str, required=False) + parser.add_argument("--api-key", type=str, required=False) + args = parser.parse_args() + + model = args.model + if not model: + model = input("Enter a model name for Litellm: ") + + api_key = args.api_key + if not api_key: + api_key = input("Enter an API key for Litellm: ") + + asyncio.run(main(model, api_key)) +``` + +## 사용량 데이터 추적 + +LiteLLM 응답으로 Agents SDK 사용량 메트릭을 채우고 싶다면, 에이전트를 생성할 때 `ModelSettings(include_usage=True)` 를 전달하세요. + +```python +from agents import Agent, ModelSettings +from agents.extensions.models.litellm_model import LitellmModel + +agent = Agent( + name="Assistant", + model=LitellmModel(model="your/model", api_key="..."), + model_settings=ModelSettings(include_usage=True), +) +``` + +`include_usage=True` 를 사용하면, LiteLLM 요청은 기본 제공 OpenAI 모델과 마찬가지로 `result.context_wrapper.usage` 를 통해 토큰 및 요청 수를 보고합니다. \ No newline at end of file diff --git a/docs/ko/multi_agent.md b/docs/ko/multi_agent.md new file mode 100644 index 000000000..f00a80c3b --- /dev/null +++ b/docs/ko/multi_agent.md @@ -0,0 +1,41 @@ +--- +search: + exclude: true +--- +# 멀티 에이전트 오케스트레이션 + +오케스트레이션은 앱에서 에이전트가 흐르는 방식, 즉 어떤 에이전트가 어떤 순서로 실행되고 다음에 무엇을 할지 어떻게 결정하는지를 의미합니다. 에이전트를 오케스트레이션하는 방법은 두 가지가 있습니다: + +1. LLM이 결정을 내리도록 허용: LLM의 지능을 활용해 계획하고 추론하며 그에 따라 수행할 단계를 결정합니다. +2. 코드로 오케스트레이션: 코드로 에이전트의 흐름을 결정합니다. + +이 패턴들은 혼합해서 사용할 수 있습니다. 각 방식에는 아래에 설명된 트레이드오프가 있습니다. + +## LLM 기반 오케스트레이션 + +에이전트는 instructions, tools, 핸드오프를 갖춘 LLM입니다. 즉, 개방형 과제가 주어지면 LLM이 도구를 사용해 행동을 취하고 데이터를 획득하며, 핸드오프를 통해 하위 에이전트에 작업을 위임하는 방식으로 과제를 수행할 계획을 자율적으로 세울 수 있습니다. 예를 들어, 리서치 에이전트는 다음과 같은 도구를 갖출 수 있습니다: + +- 웹 검색을 통한 온라인 정보 탐색 +- 파일 검색 및 검색을 통한 사내 데이터와 연결 탐색 +- 컴퓨터 사용을 통한 컴퓨터 상의 행동 수행 +- 코드 실행을 통한 데이터 분석 +- 계획 수립, 보고서 작성 등에 특화된 에이전트로의 핸드오프 + +이 패턴은 과제가 개방형이고 LLM의 지능에 의존하고 싶을 때 적합합니다. 여기서 가장 중요한 전술은 다음과 같습니다: + +1. 좋은 프롬프트에 투자하세요. 사용 가능한 도구, 사용 방법, 그리고 운영해야 할 매개변수를 명확히 하세요. +2. 앱을 모니터링하고 개선을 반복하세요. 문제가 생기는 지점을 확인하고 프롬프트를 반복적으로 개선하세요. +3. 에이전트가 자기 성찰을 통해 개선하도록 하세요. 예를 들어, 루프에서 실행하며 스스로를 비판하게 하거나, 오류 메시지를 제공해 개선하도록 하세요. +4. 모든 일을 잘하는 범용 에이전트 대신 하나의 작업에 특화된 에이전트를 두세요. +5. [evals](https://platform.openai.com/docs/guides/evals)에 투자하세요. 이를 통해 에이전트가 학습하고 과제 수행 능력을 향상시킬 수 있습니다. + +## 코드 기반 오케스트레이션 + +LLM 기반 오케스트레이션은 강력하지만, 코드 기반 오케스트레이션은 속도, 비용, 성능 측면에서 작업을 더 결정론적이고 예측 가능하게 만듭니다. 일반적인 패턴은 다음과 같습니다: + +- [structured outputs](https://platform.openai.com/docs/guides/structured-outputs)를 사용해 코드로 검사할 수 있는 적절한 형식의 데이터를 생성. 예: 에이전트에게 작업을 몇 개의 카테고리로 분류하도록 요청한 뒤, 해당 카테고리에 따라 다음 에이전트를 선택 +- 한 에이전트의 출력을 다음 에이전트의 입력으로 변환하여 여러 에이전트를 체이닝. 예: 블로그 글 작성을 리서치 → 개요 작성 → 본문 작성 → 비평 → 개선의 일련의 단계로 분해 +- 평가와 피드백을 제공하는 에이전트와 실제 작업을 수행하는 에이전트를 `while` 루프로 함께 실행하고, 평가자가 출력이 특정 기준을 통과했다고 판단할 때까지 반복 +- `asyncio.gather` 같은 파이썬 기본 구성 요소를 사용하여 여러 에이전트를 병렬 실행. 서로 의존하지 않는 여러 작업을 더 빨리 처리할 때 유용 + +[`examples/agent_patterns`](https://github.com/openai/openai-agents-python/tree/main/examples/agent_patterns)에 다양한 code examples가 있습니다. \ No newline at end of file diff --git a/docs/ko/quickstart.md b/docs/ko/quickstart.md new file mode 100644 index 000000000..83422d08e --- /dev/null +++ b/docs/ko/quickstart.md @@ -0,0 +1,203 @@ +--- +search: + exclude: true +--- +# 빠른 시작 + +## 프로젝트와 가상 환경 생성 + +한 번만 하면 됩니다. + +```bash +mkdir my_project +cd my_project +python -m venv .venv +``` + +### 가상 환경 활성화 + +새 터미널 세션을 시작할 때마다 실행하세요. + +```bash +source .venv/bin/activate +``` + +### Agents SDK 설치 + +```bash +pip install openai-agents # or `uv add openai-agents`, etc +``` + +### OpenAI API 키 설정 + +없다면 OpenAI API 키를 만들기 위해 [이 지침](https://platform.openai.com/docs/quickstart#create-and-export-an-api-key)을 따르세요. + +```bash +export OPENAI_API_KEY=sk-... +``` + +## 첫 에이전트 생성 + +에이전트는 instructions, 이름, 그리고 선택적 구성(예: `model_config`)으로 정의됩니다 + +```python +from agents import Agent + +agent = Agent( + name="Math Tutor", + instructions="You provide help with math problems. Explain your reasoning at each step and include examples", +) +``` + +## 에이전트 몇 개 더 추가 + +추가 에이전트도 동일한 방식으로 정의할 수 있습니다. `handoff_descriptions`는 핸드오프 라우팅을 결정하는 데 필요한 추가 컨텍스트를 제공합니다 + +```python +from agents import Agent + +history_tutor_agent = Agent( + name="History Tutor", + handoff_description="Specialist agent for historical questions", + instructions="You provide assistance with historical queries. Explain important events and context clearly.", +) + +math_tutor_agent = Agent( + name="Math Tutor", + handoff_description="Specialist agent for math questions", + instructions="You provide help with math problems. Explain your reasoning at each step and include examples", +) +``` + +## 핸드오프 정의 + +각 에이전트에서, 작업을 진행하는 방법을 결정할 때 선택할 수 있는 아웃바운드 핸드오프 옵션 목록을 정의할 수 있습니다. + +```python +triage_agent = Agent( + name="Triage Agent", + instructions="You determine which agent to use based on the user's homework question", + handoffs=[history_tutor_agent, math_tutor_agent] +) +``` + +## 에이전트 오케스트레이션 실행 + +워크플로가 실행되고 트리아지 에이전트가 두 전문 에이전트 간에 올바르게 라우팅하는지 확인해 봅시다. + +```python +from agents import Runner + +async def main(): + result = await Runner.run(triage_agent, "What is the capital of France?") + print(result.final_output) +``` + +## 가드레일 추가 + +입력 또는 출력에 대해 실행할 사용자 지정 가드레일을 정의할 수 있습니다. + +```python +from agents import GuardrailFunctionOutput, Agent, Runner +from pydantic import BaseModel + + +class HomeworkOutput(BaseModel): + is_homework: bool + reasoning: str + +guardrail_agent = Agent( + name="Guardrail check", + instructions="Check if the user is asking about homework.", + output_type=HomeworkOutput, +) + +async def homework_guardrail(ctx, agent, input_data): + result = await Runner.run(guardrail_agent, input_data, context=ctx.context) + final_output = result.final_output_as(HomeworkOutput) + return GuardrailFunctionOutput( + output_info=final_output, + tripwire_triggered=not final_output.is_homework, + ) +``` + +## 전체 통합 + +핸드오프와 입력 가드레일을 사용해 전체 워크플로를 통합해 실행해 봅시다. + +```python +from agents import Agent, InputGuardrail, GuardrailFunctionOutput, Runner +from agents.exceptions import InputGuardrailTripwireTriggered +from pydantic import BaseModel +import asyncio + +class HomeworkOutput(BaseModel): + is_homework: bool + reasoning: str + +guardrail_agent = Agent( + name="Guardrail check", + instructions="Check if the user is asking about homework.", + output_type=HomeworkOutput, +) + +math_tutor_agent = Agent( + name="Math Tutor", + handoff_description="Specialist agent for math questions", + instructions="You provide help with math problems. Explain your reasoning at each step and include examples", +) + +history_tutor_agent = Agent( + name="History Tutor", + handoff_description="Specialist agent for historical questions", + instructions="You provide assistance with historical queries. Explain important events and context clearly.", +) + + +async def homework_guardrail(ctx, agent, input_data): + result = await Runner.run(guardrail_agent, input_data, context=ctx.context) + final_output = result.final_output_as(HomeworkOutput) + return GuardrailFunctionOutput( + output_info=final_output, + tripwire_triggered=not final_output.is_homework, + ) + +triage_agent = Agent( + name="Triage Agent", + instructions="You determine which agent to use based on the user's homework question", + handoffs=[history_tutor_agent, math_tutor_agent], + input_guardrails=[ + InputGuardrail(guardrail_function=homework_guardrail), + ], +) + +async def main(): + # Example 1: History question + try: + result = await Runner.run(triage_agent, "who was the first president of the united states?") + print(result.final_output) + except InputGuardrailTripwireTriggered as e: + print("Guardrail blocked this input:", e) + + # Example 2: General/philosophical question + try: + result = await Runner.run(triage_agent, "What is the meaning of life?") + print(result.final_output) + except InputGuardrailTripwireTriggered as e: + print("Guardrail blocked this input:", e) + +if __name__ == "__main__": + asyncio.run(main()) +``` + +## 트레이스 보기 + +에이전트 실행 중에 어떤 일이 있었는지 검토하려면 [OpenAI 대시보드의 Trace 뷰어](https://platform.openai.com/traces)에서 실행 트레이스를 확인하세요. + +## 다음 단계 + +더 복잡한 에이전트 플로우를 만드는 방법을 알아보세요: + +- [Agents](agents.md) 구성 방법 알아보기 +- [에이전트 실행](running_agents.md) 알아보기 +- [tools](tools.md), [guardrails](guardrails.md), [models](models/index.md) 알아보기 \ No newline at end of file diff --git a/docs/ko/realtime/guide.md b/docs/ko/realtime/guide.md new file mode 100644 index 000000000..08ba4bab8 --- /dev/null +++ b/docs/ko/realtime/guide.md @@ -0,0 +1,176 @@ +--- +search: + exclude: true +--- +# 가이드 + +이 가이드는 OpenAI Agents SDK의 실시간 기능을 활용해 음성 지원 AI 에이전트를 구축하는 방법을 자세히 설명합니다. + +!!! warning "베타 기능" +실시간 에이전트는 베타 단계입니다. 구현을 개선하는 과정에서 호환성 깨짐이 발생할 수 있습니다. + +## 개요 + +실시간 에이전트는 오디오와 텍스트 입력을 실시간으로 처리하고 실시간 오디오로 응답하는 대화 흐름을 제공합니다. OpenAI의 Realtime API와 지속적으로 연결되어 낮은 지연으로 자연스러운 음성 대화를 지원하며 인터럽션(중단 처리)을 우아하게 처리합니다. + +## 아키텍처 + +### 핵심 구성 요소 + +실시간 시스템은 다음과 같은 주요 구성 요소로 이루어집니다: + +- **RealtimeAgent**: instructions, tools, 핸드오프로 구성된 에이전트 +- **RealtimeRunner**: 구성을 관리합니다. `runner.run()`을 호출해 세션을 얻을 수 있습니다 +- **RealtimeSession**: 단일 상호작용 세션입니다. 보통 사용자가 대화를 시작할 때 하나를 만들고 대화가 끝날 때까지 유지합니다 +- **RealtimeModel**: 기본 모델 인터페이스(일반적으로 OpenAI의 WebSocket 구현) + +### 세션 흐름 + +일반적인 실시간 세션은 다음 흐름을 따릅니다: + +1. instructions, tools, 핸드오프로 **RealtimeAgent를 생성**합니다 +2. 에이전트와 구성 옵션으로 **RealtimeRunner를 설정**합니다 +3. `await runner.run()`으로 **세션을 시작**하고 RealtimeSession을 받습니다 +4. `send_audio()` 또는 `send_message()`를 사용해 **오디오 또는 텍스트 메시지를 전송**합니다 +5. 세션을 순회(iterate)하며 **이벤트를 수신**합니다 - 오디오 출력, 전사, 도구 호출, 핸드오프, 오류 등이 포함됩니다 +6. 사용자가 에이전트 말 위로 말할 때 **인터럽션(중단 처리)**을 처리합니다. 현재 오디오 생성을 자동으로 중지합니다 + +세션은 대화 기록을 유지하고 실시간 모델과의 지속 연결을 관리합니다. + +## 에이전트 구성 + +RealtimeAgent는 일반 Agent 클래스와 유사하지만 몇 가지 중요한 차이가 있습니다. 전체 API 세부 정보는 [`RealtimeAgent`][agents.realtime.agent.RealtimeAgent] API 레퍼런스를 참조하세요. + +일반 에이전트와의 주요 차이점: + +- 모델 선택은 에이전트 수준이 아닌 세션 수준에서 구성합니다 +- structured output 지원이 없습니다(`outputType` 미지원) +- 보이스는 에이전트별로 구성할 수 있으나 첫 번째 에이전트가 말한 후에는 변경할 수 없습니다 +- tools, 핸드오프, instructions 등 다른 기능은 동일하게 동작합니다 + +## 세션 구성 + +### 모델 설정 + +세션 구성으로 기본 실시간 모델의 동작을 제어할 수 있습니다. 모델 이름(예: `gpt-realtime`), 보이스 선택(alloy, echo, fable, onyx, nova, shimmer), 지원 모달리티(텍스트 및/또는 오디오)를 설정할 수 있습니다. 오디오 형식은 입력과 출력 모두에 대해 설정할 수 있으며 기본값은 PCM16입니다. + +### 오디오 구성 + +오디오 설정은 세션이 음성 입력과 출력을 처리하는 방식을 제어합니다. Whisper 같은 모델을 사용해 입력 오디오 전사를 구성하고, 언어 설정을 지정하며, 도메인 특화 용어의 정확도를 높이기 위한 전사 프롬프트를 제공할 수 있습니다. 턴 감지 설정으로 에이전트가 언제 응답을 시작하고 멈춰야 하는지 제어하며, 음성 활동 감지 임계값, 무음 지속 시간, 감지된 음성 주변 패딩 옵션을 제공합니다. + +## 도구와 함수 + +### 도구 추가 + +일반 에이전트와 마찬가지로, 실시간 에이전트는 대화 중에 실행되는 함수 도구를 지원합니다: + +```python +from agents import function_tool + +@function_tool +def get_weather(city: str) -> str: + """Get current weather for a city.""" + # Your weather API logic here + return f"The weather in {city} is sunny, 72°F" + +@function_tool +def book_appointment(date: str, time: str, service: str) -> str: + """Book an appointment.""" + # Your booking logic here + return f"Appointment booked for {service} on {date} at {time}" + +agent = RealtimeAgent( + name="Assistant", + instructions="You can help with weather and appointments.", + tools=[get_weather, book_appointment], +) +``` + +## 핸드오프 + +### 핸드오프 생성 + +핸드오프를 통해 특화된 에이전트 간에 대화를 전환할 수 있습니다. + +```python +from agents.realtime import realtime_handoff + +# Specialized agents +billing_agent = RealtimeAgent( + name="Billing Support", + instructions="You specialize in billing and payment issues.", +) + +technical_agent = RealtimeAgent( + name="Technical Support", + instructions="You handle technical troubleshooting.", +) + +# Main agent with handoffs +main_agent = RealtimeAgent( + name="Customer Service", + instructions="You are the main customer service agent. Hand off to specialists when needed.", + handoffs=[ + realtime_handoff(billing_agent, tool_description="Transfer to billing support"), + realtime_handoff(technical_agent, tool_description="Transfer to technical support"), + ] +) +``` + +## 이벤트 처리 + +세션은 세션 객체를 순회하며 수신할 수 있는 이벤트를 스트리밍합니다. 이벤트에는 오디오 출력 청크, 전사 결과, 도구 실행 시작/종료, 에이전트 핸드오프, 오류가 포함됩니다. 처리해야 할 주요 이벤트는 다음과 같습니다: + +- **audio**: 에이전트 응답의 원시 오디오 데이터 +- **audio_end**: 에이전트가 말하기를 완료함 +- **audio_interrupted**: 사용자가 에이전트를 가로막음 +- **tool_start/tool_end**: 도구 실행 라이프사이클 +- **handoff**: 에이전트 핸드오프 발생 +- **error**: 처리 중 오류 발생 + +완전한 이벤트 세부 정보는 [`RealtimeSessionEvent`][agents.realtime.events.RealtimeSessionEvent]를 참고하세요. + +## 가드레일 + +실시간 에이전트에는 출력 가드레일만 지원됩니다. 성능 문제를 피하기 위해 모든 단어마다가 아니라 디바운스되어 주기적으로 실행됩니다. 기본 디바운스 길이는 100자이며 구성 가능합니다. + +가드레일은 `RealtimeAgent`에 직접 연결하거나 세션의 `run_config`를 통해 제공할 수 있습니다. 두 소스의 가드레일은 함께 실행됩니다. + +```python +from agents.guardrail import GuardrailFunctionOutput, OutputGuardrail + +def sensitive_data_check(context, agent, output): + return GuardrailFunctionOutput( + tripwire_triggered="password" in output, + output_info=None, + ) + +agent = RealtimeAgent( + name="Assistant", + instructions="...", + output_guardrails=[OutputGuardrail(guardrail_function=sensitive_data_check)], +) +``` + +가드레일이 트리거되면 `guardrail_tripped` 이벤트를 생성하고 에이전트의 현재 응답을 인터럽트할 수 있습니다. 디바운스 동작은 안전성과 실시간 성능 요구 사항 간의 균형을 맞추는 데 도움이 됩니다. 텍스트 에이전트와 달리, 실시간 에이전트는 가드레일이 작동해도 Exception을 발생시키지 **않습니다**. + +## 오디오 처리 + +[`session.send_audio(audio_bytes)`][agents.realtime.session.RealtimeSession.send_audio]를 사용해 오디오를 세션에 보내거나 [`session.send_message()`][agents.realtime.session.RealtimeSession.send_message]를 사용해 텍스트를 보낼 수 있습니다. + +오디오 출력을 위해서는 `audio` 이벤트를 수신하고 선호하는 오디오 라이브러리로 오디오 데이터를 재생하세요. 사용자가 에이전트를 중단할 때 즉시 재생을 멈추고 대기 중인 오디오를 모두 비우기 위해 `audio_interrupted` 이벤트를 반드시 수신하세요. + +## 모델 직접 액세스 + +기본 모델에 접근해 커스텀 리스너를 추가하거나 고급 작업을 수행할 수 있습니다: + +```python +# Add a custom listener to the model +session.model.add_listener(my_custom_listener) +``` + +이를 통해 연결에 대한 더 낮은 수준의 제어가 필요한 고급 사용 사례를 위해 [`RealtimeModel`][agents.realtime.model.RealtimeModel] 인터페이스에 직접 액세스할 수 있습니다. + +## code examples + +완전한 동작 code examples는 [examples/realtime 디렉터리](https://github.com/openai/openai-agents-python/tree/main/examples/realtime)에서 확인할 수 있습니다. UI 구성 요소가 있는 데모와 없는 데모가 포함되어 있습니다. \ No newline at end of file diff --git a/docs/ko/realtime/quickstart.md b/docs/ko/realtime/quickstart.md new file mode 100644 index 000000000..1d24a0bc1 --- /dev/null +++ b/docs/ko/realtime/quickstart.md @@ -0,0 +1,232 @@ +--- +search: + exclude: true +--- +# 빠른 시작 + +실시간 에이전트는 OpenAI의 Realtime API를 사용하여 AI 에이전트와의 음성 대화를 가능하게 합니다. 이 가이드는 첫 실시간 음성 에이전트를 만드는 방법을 안내합니다. + +!!! warning "베타 기능" +실시간 에이전트는 베타 단계입니다. 구현을 개선하는 동안 호환성 깨짐이 있을 수 있습니다. + +## 사전 준비 사항 + +- Python 3.9 이상 +- OpenAI API 키 +- OpenAI Agents SDK에 대한 기본적인 이해 + +## 설치 + +아직 설치하지 않았다면 OpenAI Agents SDK를 설치하세요: + +```bash +pip install openai-agents +``` + +## 첫 실시간 에이전트 만들기 + +### 1. 필요한 구성 요소 임포트 + +```python +import asyncio +from agents.realtime import RealtimeAgent, RealtimeRunner +``` + +### 2. 실시간 에이전트 생성 + +```python +agent = RealtimeAgent( + name="Assistant", + instructions="You are a helpful voice assistant. Keep your responses conversational and friendly.", +) +``` + +### 3. 러너 설정 + +```python +runner = RealtimeRunner( + starting_agent=agent, + config={ + "model_settings": { + "model_name": "gpt-realtime", + "voice": "ash", + "modalities": ["audio"], + "input_audio_format": "pcm16", + "output_audio_format": "pcm16", + "input_audio_transcription": {"model": "gpt-4o-mini-transcribe"}, + "turn_detection": {"type": "semantic_vad", "interrupt_response": True}, + } + } +) +``` + +### 4. 세션 시작 + +```python +# Start the session +session = await runner.run() + +async with session: + print("Session started! The agent will stream audio responses in real-time.") + # Process events + async for event in session: + try: + if event.type == "agent_start": + print(f"Agent started: {event.agent.name}") + elif event.type == "agent_end": + print(f"Agent ended: {event.agent.name}") + elif event.type == "handoff": + print(f"Handoff from {event.from_agent.name} to {event.to_agent.name}") + elif event.type == "tool_start": + print(f"Tool started: {event.tool.name}") + elif event.type == "tool_end": + print(f"Tool ended: {event.tool.name}; output: {event.output}") + elif event.type == "audio_end": + print("Audio ended") + elif event.type == "audio": + # Enqueue audio for callback-based playback with metadata + # Non-blocking put; queue is unbounded, so drops won’t occur. + pass + elif event.type == "audio_interrupted": + print("Audio interrupted") + # Begin graceful fade + flush in the audio callback and rebuild jitter buffer. + elif event.type == "error": + print(f"Error: {event.error}") + elif event.type == "history_updated": + pass # Skip these frequent events + elif event.type == "history_added": + pass # Skip these frequent events + elif event.type == "raw_model_event": + print(f"Raw model event: {_truncate_str(str(event.data), 200)}") + else: + print(f"Unknown event type: {event.type}") + except Exception as e: + print(f"Error processing event: {_truncate_str(str(e), 200)}") + +def _truncate_str(s: str, max_length: int) -> str: + if len(s) > max_length: + return s[:max_length] + "..." + return s +``` + +## 전체 예제 + +다음은 완전한 동작 예제입니다: + +```python +import asyncio +from agents.realtime import RealtimeAgent, RealtimeRunner + +async def main(): + # Create the agent + agent = RealtimeAgent( + name="Assistant", + instructions="You are a helpful voice assistant. Keep responses brief and conversational.", + ) + # Set up the runner with configuration + runner = RealtimeRunner( + starting_agent=agent, + config={ + "model_settings": { + "model_name": "gpt-realtime", + "voice": "ash", + "modalities": ["audio"], + "input_audio_format": "pcm16", + "output_audio_format": "pcm16", + "input_audio_transcription": {"model": "gpt-4o-mini-transcribe"}, + "turn_detection": {"type": "semantic_vad", "interrupt_response": True}, + } + }, + ) + # Start the session + session = await runner.run() + + async with session: + print("Session started! The agent will stream audio responses in real-time.") + # Process events + async for event in session: + try: + if event.type == "agent_start": + print(f"Agent started: {event.agent.name}") + elif event.type == "agent_end": + print(f"Agent ended: {event.agent.name}") + elif event.type == "handoff": + print(f"Handoff from {event.from_agent.name} to {event.to_agent.name}") + elif event.type == "tool_start": + print(f"Tool started: {event.tool.name}") + elif event.type == "tool_end": + print(f"Tool ended: {event.tool.name}; output: {event.output}") + elif event.type == "audio_end": + print("Audio ended") + elif event.type == "audio": + # Enqueue audio for callback-based playback with metadata + # Non-blocking put; queue is unbounded, so drops won’t occur. + pass + elif event.type == "audio_interrupted": + print("Audio interrupted") + # Begin graceful fade + flush in the audio callback and rebuild jitter buffer. + elif event.type == "error": + print(f"Error: {event.error}") + elif event.type == "history_updated": + pass # Skip these frequent events + elif event.type == "history_added": + pass # Skip these frequent events + elif event.type == "raw_model_event": + print(f"Raw model event: {_truncate_str(str(event.data), 200)}") + else: + print(f"Unknown event type: {event.type}") + except Exception as e: + print(f"Error processing event: {_truncate_str(str(e), 200)}") + +def _truncate_str(s: str, max_length: int) -> str: + if len(s) > max_length: + return s[:max_length] + "..." + return s + +if __name__ == "__main__": + # Run the session + asyncio.run(main()) +``` + +## 구성 옵션 + +### 모델 설정 + +- `model_name`: 사용 가능한 실시간 모델에서 선택 (예: `gpt-realtime`) +- `voice`: 음성 선택 (`alloy`, `echo`, `fable`, `onyx`, `nova`, `shimmer`) +- `modalities`: 텍스트 또는 오디오 활성화 (`["text"]` 또는 `["audio"]`) + +### 오디오 설정 + +- `input_audio_format`: 입력 오디오 형식 (`pcm16`, `g711_ulaw`, `g711_alaw`) +- `output_audio_format`: 출력 오디오 형식 +- `input_audio_transcription`: 음성 인식 구성 + +### 턴 감지 + +- `type`: 감지 방식 (`server_vad`, `semantic_vad`) +- `threshold`: 음성 활동 임계값 (0.0-1.0) +- `silence_duration_ms`: 턴 종료를 감지할 무음 지속시간 +- `prefix_padding_ms`: 발화 전 오디오 패딩 + +## 다음 단계 + +- [실시간 에이전트 자세히 알아보기](guide.md) +- [examples/realtime](https://github.com/openai/openai-agents-python/tree/main/examples/realtime) 폴더의 동작하는 code examples 확인 +- 에이전트에 도구 추가 +- 에이전트 간 핸드오프 구현 +- 안전을 위한 가드레일 설정 + +## 인증 + +환경 변수에 OpenAI API 키가 설정되어 있는지 확인하세요: + +```bash +export OPENAI_API_KEY="your-api-key-here" +``` + +또는 세션을 생성할 때 직접 전달하세요: + +```python +session = await runner.run(model_config={"api_key": "your-api-key"}) +``` \ No newline at end of file diff --git a/docs/ko/release.md b/docs/ko/release.md new file mode 100644 index 000000000..26d583508 --- /dev/null +++ b/docs/ko/release.md @@ -0,0 +1,40 @@ +--- +search: + exclude: true +--- +# 릴리스 프로세스/변경 로그 + +이 프로젝트는 `0.Y.Z` 형식의 약간 수정된 시맨틱 버전 관리를 따릅니다. 선행 `0`은 SDK가 여전히 빠르게 발전 중임을 의미합니다. 각 구성 요소는 다음과 같이 증가시킵니다: + +## 마이너(`Y`) 버전 + +베타로 표시되지 않은 모든 퍼블릭 인터페이스에 대한 **호환성 파괴 변경**이 있을 때 마이너 버전 `Y`를 올립니다. 예를 들어 `0.0.x`에서 `0.1.x`로 올라갈 때 호환성 파괴 변경이 포함될 수 있습니다. + +호환성 파괴 변경을 원하지 않으시면, 프로젝트에서 `0.0.x` 버전으로 고정할 것을 권장합니다. + +## 패치(`Z`) 버전 + +호환성 파괴가 없는 변경에 대해 `Z`를 증가시킵니다: + +- 버그 수정 +- 새 기능 +- 비공개 인터페이스 변경 +- 베타 기능 업데이트 + +## 호환성 파괴 변경 로그 + +### 0.4.0 + +이 버전에서는 [openai](https://pypi.org/project/openai/) 패키지 v1.x 버전이 더 이상 지원되지 않습니다. 이 SDK와 함께 openai v2.x를 사용하세요. + +### 0.3.0 + +이 버전에서는 Realtime API 지원이 gpt-realtime 모델 및 해당 API 인터페이스(GA 버전)로 마이그레이션됩니다. + +### 0.2.0 + +이 버전에서는 기존에 `Agent`를 인수로 받던 일부 위치가 이제 `AgentBase`를 인수로 받습니다. 예: MCP 서버의 `list_tools()` 호출. 이는 순수하게 타입과 관련된 변경이며, 여전히 `Agent` 객체를 받게 됩니다. 업데이트하려면 `Agent`를 `AgentBase`로 바꿔 타입 오류를 해결하면 됩니다. + +### 0.1.0 + +이 버전에서는 [`MCPServer.list_tools()`][agents.mcp.server.MCPServer]에 `run_context`와 `agent`라는 새 매개변수가 두 개 추가되었습니다. `MCPServer`를 서브클래싱하는 모든 클래스에 이 매개변수들을 추가해야 합니다. \ No newline at end of file diff --git a/docs/ko/repl.md b/docs/ko/repl.md new file mode 100644 index 000000000..097c10369 --- /dev/null +++ b/docs/ko/repl.md @@ -0,0 +1,23 @@ +--- +search: + exclude: true +--- +# REPL 유틸리티 + +SDK는 터미널에서 에이전트의 동작을 빠르고 대화형으로 테스트할 수 있도록 `run_demo_loop`를 제공합니다. + +```python +import asyncio +from agents import Agent, run_demo_loop + +async def main() -> None: + agent = Agent(name="Assistant", instructions="You are a helpful assistant.") + await run_demo_loop(agent) + +if __name__ == "__main__": + asyncio.run(main()) +``` + +`run_demo_loop`는 반복 루프에서 사용자 입력을 요청하고, 턴 사이의 대화 기록을 유지합니다. 기본적으로 생성되는 대로 모델 출력을 스트리밍합니다. 위 예제를 실행하면, run_demo_loop가 대화형 채팅 세션을 시작합니다. 계속해서 사용자 입력을 요청하고, 턴 사이의 전체 대화 기록을 기억하여(에이전트가 어떤 내용이 논의되었는지 알 수 있도록) 응답을 생성하는 즉시 실시간으로 에이전트의 응답을 자동 스트리밍합니다. + +이 채팅 세션을 종료하려면 `quit` 또는 `exit`를 입력하고 Enter 키를 누르거나 `Ctrl-D` 키보드 단축키를 사용하세요. \ No newline at end of file diff --git a/docs/ko/results.md b/docs/ko/results.md new file mode 100644 index 000000000..6cb8c0189 --- /dev/null +++ b/docs/ko/results.md @@ -0,0 +1,56 @@ +--- +search: + exclude: true +--- +# 결과 + +`Runner.run` 메서드를 호출하면 다음 중 하나를 받습니다: + +- [`RunResult`][agents.result.RunResult] (`run` 또는 `run_sync` 호출 시) +- [`RunResultStreaming`][agents.result.RunResultStreaming] (`run_streamed` 호출 시) + +둘 다 [`RunResultBase`][agents.result.RunResultBase]를 상속하며, 대부분의 유용한 정보가 여기에 있습니다. + +## 최종 출력 + +[`final_output`][agents.result.RunResultBase.final_output] 속성에는 마지막으로 실행된 에이전트의 최종 출력이 들어 있습니다. 이는 다음 중 하나입니다: + +- 마지막 에이전트에 `output_type`이 정의되지 않은 경우 `str` +- 에이전트에 출력 타입이 정의된 경우 `last_agent.output_type` 타입의 객체 + +!!! note + + `final_output`의 타입은 `Any`입니다. 핸드오프 때문에 이를 정적으로 타이핑할 수 없습니다. 핸드오프가 발생하면 어떤 에이전트든 마지막 에이전트가 될 수 있으므로, 가능한 출력 타입 집합을 정적으로 알 수 없습니다. + +## 다음 턴 입력 + +[`result.to_input_list()`][agents.result.RunResultBase.to_input_list]를 사용하면 결과를 입력 리스트로 변환하여, 제공한 원래 입력과 에이전트 실행 중 생성된 항목들을 연결할 수 있습니다. 이를 통해 한 번의 에이전트 실행 출력을 다른 실행에 전달하거나, 루프에서 실행하며 매번 새로운 사용자 입력을 이어 붙이기 편리합니다. + +## 마지막 에이전트 + +[`last_agent`][agents.result.RunResultBase.last_agent] 속성에는 마지막으로 실행된 에이전트가 들어 있습니다. 애플리케이션에 따라, 이는 사용자가 다음 번에 입력할 때 자주 유용합니다. 예를 들어, 프런트라인 분류 에이전트가 언어별 에이전트로 핸드오프하는 경우, 마지막 에이전트를 저장해 두었다가 사용자가 에이전트에 메시지를 보낼 때 재사용할 수 있습니다. + +## 새 항목 + +[`new_items`][agents.result.RunResultBase.new_items] 속성에는 실행 중 생성된 새 항목들이 들어 있습니다. 항목은 [`RunItem`][agents.items.RunItem]입니다. 실행 항목은 LLM 이 생성한 원문 항목을 래핑합니다. + +- [`MessageOutputItem`][agents.items.MessageOutputItem]: LLM 의 메시지를 나타냄. 원문 항목은 생성된 메시지 +- [`HandoffCallItem`][agents.items.HandoffCallItem]: LLM 이 핸드오프 도구를 호출했음을 나타냄. 원문 항목은 LLM 의 도구 호출 항목 +- [`HandoffOutputItem`][agents.items.HandoffOutputItem]: 핸드오프가 발생했음을 나타냄. 원문 항목은 핸드오프 도구 호출에 대한 도구 응답. 항목에서 소스/타깃 에이전트에도 접근 가능 +- [`ToolCallItem`][agents.items.ToolCallItem]: LLM 이 도구를 호출했음을 나타냄 +- [`ToolCallOutputItem`][agents.items.ToolCallOutputItem]: 도구가 호출되었음을 나타냄. 원문 항목은 도구 응답. 항목에서 도구 출력에도 접근 가능 +- [`ReasoningItem`][agents.items.ReasoningItem]: LLM 의 추론 항목을 나타냄. 원문 항목은 생성된 추론 + +## 기타 정보 + +### 가드레일 결과 + +[`input_guardrail_results`][agents.result.RunResultBase.input_guardrail_results] 및 [`output_guardrail_results`][agents.result.RunResultBase.output_guardrail_results] 속성에는 (있다면) 가드레일의 결과가 들어 있습니다. 가드레일 결과에는 로깅하거나 저장하고 싶은 유용한 정보가 포함될 수 있어, 이를 제공해 드립니다. + +### 원문 응답 + +[`raw_responses`][agents.result.RunResultBase.raw_responses] 속성에는 LLM 이 생성한 [`ModelResponse`][agents.items.ModelResponse]가 들어 있습니다. + +### 원본 입력 + +[`input`][agents.result.RunResultBase.input] 속성에는 `run` 메서드에 제공한 원본 입력이 들어 있습니다. 대부분의 경우 필요하지 않지만, 필요한 경우를 대비해 제공됩니다. \ No newline at end of file diff --git a/docs/ko/running_agents.md b/docs/ko/running_agents.md new file mode 100644 index 000000000..2c28c37ee --- /dev/null +++ b/docs/ko/running_agents.md @@ -0,0 +1,207 @@ +--- +search: + exclude: true +--- +# 에이전트 실행 + +에이전트는 [`Runner`][agents.run.Runner] 클래스를 통해 실행할 수 있습니다. 선택지는 3가지입니다: + +1. [`Runner.run()`][agents.run.Runner.run]: 비동기로 실행되며 [`RunResult`][agents.result.RunResult] 를 반환 +2. [`Runner.run_sync()`][agents.run.Runner.run_sync]: 동기 메서드로, 내부적으로 `.run()` 을 실행 +3. [`Runner.run_streamed()`][agents.run.Runner.run_streamed]: 비동기로 실행되며 [`RunResultStreaming`][agents.result.RunResultStreaming] 를 반환. LLM 을 스트리밍 모드로 호출하며, 수신되는 대로 이벤트를 스트리밍 + +```python +from agents import Agent, Runner + +async def main(): + agent = Agent(name="Assistant", instructions="You are a helpful assistant") + + result = await Runner.run(agent, "Write a haiku about recursion in programming.") + print(result.final_output) + # Code within the code, + # Functions calling themselves, + # Infinite loop's dance +``` + +자세한 내용은 [결과 가이드](results.md)에서 확인하세요. + +## 에이전트 루프 + +`Runner` 의 run 메서드를 사용할 때 시작 에이전트와 입력을 전달합니다. 입력은 문자열(사용자 메시지로 간주) 또는 OpenAI Responses API 의 입력 항목 리스트일 수 있습니다. + +그 후 러너는 다음 루프를 실행합니다: + +1. 현재 에이전트와 현재 입력으로 LLM 을 호출 +2. LLM 이 출력을 생성 + 1. LLM 이 `final_output` 을 반환하면 루프가 종료되고 결과를 반환 + 2. LLM 이 핸드오프를 수행하면 현재 에이전트와 입력을 업데이트하고 루프를 재실행 + 3. LLM 이 도구 호출을 생성하면 해당 도구 호출을 실행하고 결과를 덧붙인 뒤 루프를 재실행 +3. 전달된 `max_turns` 를 초과하면 [`MaxTurnsExceeded`][agents.exceptions.MaxTurnsExceeded] 예외를 발생 + +!!! note + + LLM 출력이 "최종 출력" 으로 간주되는 규칙은, 원하는 타입의 텍스트 출력을 생성하고 도구 호출이 없는 경우입니다. + +## 스트리밍 + +스트리밍을 사용하면 LLM 이 실행되는 동안 추가로 스트리밍 이벤트를 수신할 수 있습니다. 스트림이 완료되면 [`RunResultStreaming`][agents.result.RunResultStreaming] 에는 실행에 대한 전체 정보와 새로 생성된 모든 출력이 포함됩니다. 스트리밍 이벤트는 `.stream_events()` 를 호출해 받을 수 있습니다. 자세한 내용은 [스트리밍 가이드](streaming.md)에서 확인하세요. + +## 실행 구성 + +`run_config` 매개변수는 에이전트 실행에 대한 전역 설정을 구성합니다: + +- [`model`][agents.run.RunConfig.model]: 각 Agent 의 `model` 설정과 무관하게 사용할 전역 LLM 모델을 지정 +- [`model_provider`][agents.run.RunConfig.model_provider]: 모델 이름 조회용 모델 제공자, 기본값은 OpenAI +- [`model_settings`][agents.run.RunConfig.model_settings]: 에이전트별 설정을 재정의. 예를 들어 전역 `temperature` 또는 `top_p` 를 설정 가능 +- [`input_guardrails`][agents.run.RunConfig.input_guardrails], [`output_guardrails`][agents.run.RunConfig.output_guardrails]: 모든 실행에 포함할 입력/출력 가드레일 목록 +- [`handoff_input_filter`][agents.run.RunConfig.handoff_input_filter]: 핸드오프에 적용할 전역 입력 필터(해당 핸드오프에 이미 없을 경우). 입력 필터를 통해 새 에이전트로 전송되는 입력을 편집할 수 있음. 자세한 내용은 [`Handoff.input_filter`][agents.handoffs.Handoff.input_filter] 문서를 참조 +- [`tracing_disabled`][agents.run.RunConfig.tracing_disabled]: 전체 실행에 대해 [트레이싱](tracing.md) 비활성화 여부 설정 +- [`trace_include_sensitive_data`][agents.run.RunConfig.trace_include_sensitive_data]: 트레이스에 LLM 및 도구 호출의 입출력 등 민감할 수 있는 데이터를 포함할지 설정 +- [`workflow_name`][agents.run.RunConfig.workflow_name], [`trace_id`][agents.run.RunConfig.trace_id], [`group_id`][agents.run.RunConfig.group_id]: 실행에 대한 트레이싱 워크플로 이름, 트레이스 ID, 트레이스 그룹 ID 설정. 최소한 `workflow_name` 설정을 권장. 그룹 ID 는 여러 실행에 걸쳐 트레이스를 연결할 수 있는 선택 필드 +- [`trace_metadata`][agents.run.RunConfig.trace_metadata]: 모든 트레이스에 포함할 메타데이터 + +## 대화/채팅 스레드 + +어느 run 메서드를 호출하든 하나 이상의 에이전트 실행(따라서 하나 이상의 LLM 호출)로 이어질 수 있지만, 이는 채팅 대화의 단일 논리 턴을 나타냅니다. 예: + +1. 사용자 턴: 사용자가 텍스트 입력 +2. 러너 실행: 첫 번째 에이전트가 LLM 을 호출하고 도구를 실행하고 두 번째 에이전트로 핸드오프, 두 번째 에이전트가 추가 도구를 실행한 뒤 출력을 생성 + +에이전트 실행이 끝나면 사용자에게 무엇을 보여줄지 선택할 수 있습니다. 예를 들어, 에이전트가 생성한 모든 새 항목을 보여주거나 최종 출력만 보여줄 수 있습니다. 어느 쪽이든 사용자가 후속 질문을 할 수 있으며, 이때 run 메서드를 다시 호출하면 됩니다. + +### 수동 대화 관리 + +[`RunResultBase.to_input_list()`][agents.result.RunResultBase.to_input_list] 메서드를 사용해 다음 턴의 입력을 받아 대화 기록을 수동으로 관리할 수 있습니다: + +```python +async def main(): + agent = Agent(name="Assistant", instructions="Reply very concisely.") + + thread_id = "thread_123" # Example thread ID + with trace(workflow_name="Conversation", group_id=thread_id): + # First turn + result = await Runner.run(agent, "What city is the Golden Gate Bridge in?") + print(result.final_output) + # San Francisco + + # Second turn + new_input = result.to_input_list() + [{"role": "user", "content": "What state is it in?"}] + result = await Runner.run(agent, new_input) + print(result.final_output) + # California +``` + +### Sessions 를 통한 자동 대화 관리 + +더 간단한 접근 방식으로, [Sessions](sessions/index.md) 를 사용하면 `.to_input_list()` 를 수동으로 호출하지 않고도 대화 기록을 자동으로 처리할 수 있습니다: + +```python +from agents import Agent, Runner, SQLiteSession + +async def main(): + agent = Agent(name="Assistant", instructions="Reply very concisely.") + + # Create session instance + session = SQLiteSession("conversation_123") + + thread_id = "thread_123" # Example thread ID + with trace(workflow_name="Conversation", group_id=thread_id): + # First turn + result = await Runner.run(agent, "What city is the Golden Gate Bridge in?", session=session) + print(result.final_output) + # San Francisco + + # Second turn - agent automatically remembers previous context + result = await Runner.run(agent, "What state is it in?", session=session) + print(result.final_output) + # California +``` + +Sessions 는 자동으로 다음을 수행합니다: + +- 각 실행 전 대화 기록을 가져옴 +- 각 실행 후 새 메시지를 저장 +- 서로 다른 세션 ID 별로 대화를 분리 관리 + +자세한 내용은 [Sessions 문서](sessions/index.md)를 참조하세요. + + +### 서버 관리 대화 + +`to_input_list()` 또는 `Sessions` 로 로컬에서 처리하는 대신, OpenAI conversation state 기능에 서버 측 대화 상태 관리를 맡길 수도 있습니다. 이를 통해 과거 메시지를 모두 수동으로 재전송하지 않고도 대화 기록을 보존할 수 있습니다. 자세한 내용은 [OpenAI Conversation state 가이드](https://platform.openai.com/docs/guides/conversation-state?api-mode=responses)에서 확인하세요. + +OpenAI 는 턴 간 상태를 추적하는 두 가지 방법을 제공합니다: + +#### 1. `conversation_id` 사용 + +먼저 OpenAI Conversations API 를 사용해 대화를 생성한 뒤, 이후 모든 호출에서 해당 ID 를 재사용합니다: + +```python +from agents import Agent, Runner +from openai import AsyncOpenAI + +client = AsyncOpenAI() + +async def main(): + # Create a server-managed conversation + conversation = await client.conversations.create() + conv_id = conversation.id + + agent = Agent(name="Assistant", instructions="Reply very concisely.") + + # First turn + result1 = await Runner.run(agent, "What city is the Golden Gate Bridge in?", conversation_id=conv_id) + print(result1.final_output) + # San Francisco + + # Second turn reuses the same conversation_id + result2 = await Runner.run( + agent, + "What state is it in?", + conversation_id=conv_id, + ) + print(result2.final_output) + # California +``` + +#### 2. `previous_response_id` 사용 + +다른 옵션은 **response chaining** 으로, 각 턴이 이전 턴의 response ID 에 명시적으로 연결됩니다. + +```python +from agents import Agent, Runner + +async def main(): + agent = Agent(name="Assistant", instructions="Reply very concisely.") + + # First turn + result1 = await Runner.run(agent, "What city is the Golden Gate Bridge in?") + print(result1.final_output) + # San Francisco + + # Second turn, chained to the previous response + result2 = await Runner.run( + agent, + "What state is it in?", + previous_response_id=result1.last_response_id, + ) + print(result2.final_output) + # California +``` + + +## 장기 실행 에이전트 및 휴먼인더루프 (HITL) + +Agents SDK 의 [Temporal](https://temporal.io/) 통합을 사용하여 내구성이 있는 장기 실행 워크플로, 휴먼인더루프 작업을 포함해 실행할 수 있습니다. Temporal 과 Agents SDK 가 장기 실행 작업을 완료하는 데 함께 동작하는 데모는 [이 영상](https://www.youtube.com/watch?v=fFBZqzT4DD8)에서 볼 수 있으며, [문서는 여기](https://github.com/temporalio/sdk-python/tree/main/temporalio/contrib/openai_agents)에서 확인하세요. + +## 예외 + +SDK 는 특정 상황에서 예외를 발생시킵니다. 전체 목록은 [`agents.exceptions`][] 에 있습니다. 개요는 다음과 같습니다: + +- [`AgentsException`][agents.exceptions.AgentsException]: SDK 내에서 발생하는 모든 예외의 기본 클래스. 다른 모든 구체적 예외의 상위 타입으로 사용 +- [`MaxTurnsExceeded`][agents.exceptions.MaxTurnsExceeded]: 에이전트 실행이 `Runner.run`, `Runner.run_sync`, `Runner.run_streamed` 메서드에 전달된 `max_turns` 한도를 초과했을 때 발생. 에이전트가 지정된 상호작용 턴 수 내에 작업을 완료하지 못했음을 의미 +- [`ModelBehaviorError`][agents.exceptions.ModelBehaviorError]: 기반 모델(LLM) 이 예상치 못했거나 잘못된 출력을 생성했을 때 발생. 예를 들면: + - 형식이 잘못된 JSON: 도구 호출 또는 직접 출력에서 잘못된 JSON 구조를 제공하는 경우, 특히 특정 `output_type` 이 정의된 경우 + - 예상치 못한 도구 관련 실패: 모델이 도구를 예상된 방식으로 사용하지 못한 경우 +- [`UserError`][agents.exceptions.UserError]: SDK 를 사용하는 개발자(코드를 작성하는 사람) 가 SDK 사용 중 오류를 일으켰을 때 발생. 보통 잘못된 코드 구현, 유효하지 않은 구성, SDK API 오사용에서 기인 +- [`InputGuardrailTripwireTriggered`][agents.exceptions.InputGuardrailTripwireTriggered], [`OutputGuardrailTripwireTriggered`][agents.exceptions.OutputGuardrailTripwireTriggered]: 각각 입력 가드레일 또는 출력 가드레일의 조건이 충족될 때 발생. 입력 가드레일은 처리 전에 수신 메시지를 검사하고, 출력 가드레일은 에이전트의 최종 응답을 전달하기 전에 검사 \ No newline at end of file diff --git a/docs/ko/sessions.md b/docs/ko/sessions.md new file mode 100644 index 000000000..ddc452633 --- /dev/null +++ b/docs/ko/sessions.md @@ -0,0 +1,460 @@ +--- +search: + exclude: true +--- +# 세션 + +Agents SDK는 여러 에이전트 실행(run) 간 대화 기록을 자동으로 유지하는 내장 세션 메모리를 제공합니다. 이를 통해 턴 사이에 `.to_input_list()`를 수동으로 처리할 필요가 없습니다. + +세션은 특정 세션의 대화 기록을 저장하여, 에이전트가 명시적인 수동 메모리 관리 없이도 컨텍스트를 유지할 수 있도록 합니다. 이는 이전 상호작용을 기억해야 하는 채팅 애플리케이션 또는 멀티 턴 대화를 구축할 때 특히 유용합니다. + +## 빠른 시작 + +```python +from agents import Agent, Runner, SQLiteSession + +# Create agent +agent = Agent( + name="Assistant", + instructions="Reply very concisely.", +) + +# Create a session instance with a session ID +session = SQLiteSession("conversation_123") + +# First turn +result = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session +) +print(result.final_output) # "San Francisco" + +# Second turn - agent automatically remembers previous context +result = await Runner.run( + agent, + "What state is it in?", + session=session +) +print(result.final_output) # "California" + +# Also works with synchronous runner +result = Runner.run_sync( + agent, + "What's the population?", + session=session +) +print(result.final_output) # "Approximately 39 million" +``` + +## 동작 방식 + +세션 메모리가 활성화되면: + +1. **각 실행 전**: 러너가 세션의 대화 기록을 자동으로 가져와 입력 항목 앞에 추가합니다 +2. **각 실행 후**: 실행 중 생성된 모든 새 항목(사용자 입력, 어시스턴트 응답, 도구 호출 등)이 자동으로 세션에 저장됩니다 +3. **컨텍스트 보존**: 동일한 세션으로 이어지는 이후 실행에는 전체 대화 기록이 포함되어 에이전트가 컨텍스트를 유지할 수 있습니다 + +이를 통해 `.to_input_list()`를 수동으로 호출하고 실행 간 대화 상태를 관리할 필요가 없어집니다. + +## 메모리 작업 + +### 기본 작업 + +세션은 대화 기록 관리를 위한 여러 작업을 지원합니다: + +```python +from agents import SQLiteSession + +session = SQLiteSession("user_123", "conversations.db") + +# Get all items in a session +items = await session.get_items() + +# Add new items to a session +new_items = [ + {"role": "user", "content": "Hello"}, + {"role": "assistant", "content": "Hi there!"} +] +await session.add_items(new_items) + +# Remove and return the most recent item +last_item = await session.pop_item() +print(last_item) # {"role": "assistant", "content": "Hi there!"} + +# Clear all items from a session +await session.clear_session() +``` + +### 수정 시 pop_item 사용 + +`pop_item` 메서드는 대화에서 마지막 항목을 취소하거나 수정하고 싶을 때 특히 유용합니다: + +```python +from agents import Agent, Runner, SQLiteSession + +agent = Agent(name="Assistant") +session = SQLiteSession("correction_example") + +# Initial conversation +result = await Runner.run( + agent, + "What's 2 + 2?", + session=session +) +print(f"Agent: {result.final_output}") + +# User wants to correct their question +assistant_item = await session.pop_item() # Remove agent's response +user_item = await session.pop_item() # Remove user's question + +# Ask a corrected question +result = await Runner.run( + agent, + "What's 2 + 3?", + session=session +) +print(f"Agent: {result.final_output}") +``` + +## 메모리 옵션 + +### 메모리 없음(기본값) + +```python +# Default behavior - no session memory +result = await Runner.run(agent, "Hello") +``` + +### OpenAI Conversations API 메모리 + +자체 데이터베이스를 관리하지 않고 +[대화 상태](https://platform.openai.com/docs/guides/conversation-state?api-mode=responses#using-the-conversations-api)를 지속하려면 [OpenAI Conversations API](https://platform.openai.com/docs/api-reference/conversations/create)를 사용하세요. 이는 대화 기록 저장을 위해 OpenAI 호스트하는 인프라에 이미 의존하는 경우에 유용합니다. + +```python +from agents import OpenAIConversationsSession + +session = OpenAIConversationsSession() + +# Optionally resume a previous conversation by passing a conversation ID +# session = OpenAIConversationsSession(conversation_id="conv_123") + +result = await Runner.run( + agent, + "Hello", + session=session, +) +``` + +### SQLite 메모리 + +```python +from agents import SQLiteSession + +# In-memory database (lost when process ends) +session = SQLiteSession("user_123") + +# Persistent file-based database +session = SQLiteSession("user_123", "conversations.db") + +# Use the session +result = await Runner.run( + agent, + "Hello", + session=session +) +``` + +### 다중 세션 + +```python +from agents import Agent, Runner, SQLiteSession + +agent = Agent(name="Assistant") + +# Different sessions maintain separate conversation histories +session_1 = SQLiteSession("user_123", "conversations.db") +session_2 = SQLiteSession("user_456", "conversations.db") + +result1 = await Runner.run( + agent, + "Hello", + session=session_1 +) +result2 = await Runner.run( + agent, + "Hello", + session=session_2 +) +``` + +### SQLAlchemy 기반 세션 + +더 고급 사용 사례의 경우, SQLAlchemy 기반 세션 백엔드를 사용할 수 있습니다. 이를 통해 SQLAlchemy가 지원하는 모든 데이터베이스(PostgreSQL, MySQL, SQLite 등)를 세션 저장소로 사용할 수 있습니다. + +**예시 1: 메모리 내 SQLite와 `from_url` 사용** + +개발 및 테스트에 적합한 가장 간단한 시작 방법입니다. + +```python +import asyncio +from agents import Agent, Runner +from agents.extensions.memory.sqlalchemy_session import SQLAlchemySession + +async def main(): + agent = Agent("Assistant") + session = SQLAlchemySession.from_url( + "user-123", + url="sqlite+aiosqlite:///:memory:", + create_tables=True, # Auto-create tables for the demo + ) + + result = await Runner.run(agent, "Hello", session=session) + +if __name__ == "__main__": + asyncio.run(main()) +``` + +**예시 2: 기존 SQLAlchemy 엔진 사용** + +프로덕션 애플리케이션에서는 이미 SQLAlchemy `AsyncEngine` 인스턴스를 가지고 있을 수 있습니다. 이를 세션에 직접 전달할 수 있습니다. + +```python +import asyncio +from agents import Agent, Runner +from agents.extensions.memory.sqlalchemy_session import SQLAlchemySession +from sqlalchemy.ext.asyncio import create_async_engine + +async def main(): + # In your application, you would use your existing engine + engine = create_async_engine("sqlite+aiosqlite:///conversations.db") + + agent = Agent("Assistant") + session = SQLAlchemySession( + "user-456", + engine=engine, + create_tables=True, # Auto-create tables for the demo + ) + + result = await Runner.run(agent, "Hello", session=session) + print(result.final_output) + + await engine.dispose() + +if __name__ == "__main__": + asyncio.run(main()) +``` + +### 암호화된 세션 + +보관 중인 대화 데이터를 암호화해야 하는 애플리케이션의 경우, `EncryptedSession`을 사용해 투명한 암호화와 자동 TTL 기반 만료로 어떤 세션 백엔드든 래핑할 수 있습니다. `encrypt` extra가 필요합니다: `pip install openai-agents[encrypt]`. + +`EncryptedSession`은 세션별 키 유도(HKDF)를 사용하는 Fernet 암호화를 사용하며, 오래된 메시지의 자동 만료를 지원합니다. 항목이 TTL을 초과하면 검색 시 조용히 건너뜁니다. + +**예시: SQLAlchemy 세션 데이터 암호화** + +```python +import asyncio +from agents import Agent, Runner +from agents.extensions.memory import EncryptedSession, SQLAlchemySession + +async def main(): + # Create underlying session (works with any SessionABC implementation) + underlying_session = SQLAlchemySession.from_url( + session_id="user-123", + url="postgresql+asyncpg://app:secret@db.example.com/agents", + create_tables=True, + ) + + # Wrap with encryption and TTL-based expiration + session = EncryptedSession( + session_id="user-123", + underlying_session=underlying_session, + encryption_key="your-encryption-key", # Use a secure key from your secrets management + ttl=600, # 10 minutes - items older than this are silently skipped + ) + + agent = Agent("Assistant") + result = await Runner.run(agent, "Hello", session=session) + print(result.final_output) + +if __name__ == "__main__": + asyncio.run(main()) +``` + +**주요 기능:** + +- **투명한 암호화**: 저장 전 모든 세션 항목을 자동으로 암호화하고, 검색 시 복호화 +- **세션별 키 유도**: 세션 ID를 솔트로 사용하는 HKDF로 고유한 암호화 키 생성 +- **TTL 기반 만료**: 구성 가능한 TTL(기본값: 10분)에 따라 오래된 메시지를 자동 만료 +- **유연한 키 입력**: Fernet 키 또는 원문 문자열을 암호화 키로 허용 +- **어떤 세션이든 래핑**: SQLite, SQLAlchemy 또는 커스텀 세션 구현과 호환 + +!!! warning "중요한 보안 참고" + + - 암호화 키를 안전하게 저장하세요(예: 환경 변수, 시크릿 매니저) + - 만료된 토큰은 애플리케이션 서버의 시스템 시계를 기준으로 거부됩니다 - 유효한 토큰이 시계 드리프트로 인해 거부되지 않도록 모든 서버가 NTP로 시간 동기화되어 있는지 확인하세요 + - 기본 세션은 여전히 암호화된 데이터를 저장하므로 데이터베이스 인프라에 대한 제어권을 유지합니다 + + +## 커스텀 메모리 구현 + +[`Session`][agents.memory.session.Session] 프로토콜을 따르는 클래스를 생성하여 자체 세션 메모리를 구현할 수 있습니다: + +```python +from agents.memory.session import SessionABC +from agents.items import TResponseInputItem +from typing import List + +class MyCustomSession(SessionABC): + """Custom session implementation following the Session protocol.""" + + def __init__(self, session_id: str): + self.session_id = session_id + # Your initialization here + + async def get_items(self, limit: int | None = None) -> List[TResponseInputItem]: + """Retrieve conversation history for this session.""" + # Your implementation here + pass + + async def add_items(self, items: List[TResponseInputItem]) -> None: + """Store new items for this session.""" + # Your implementation here + pass + + async def pop_item(self) -> TResponseInputItem | None: + """Remove and return the most recent item from this session.""" + # Your implementation here + pass + + async def clear_session(self) -> None: + """Clear all items for this session.""" + # Your implementation here + pass + +# Use your custom session +agent = Agent(name="Assistant") +result = await Runner.run( + agent, + "Hello", + session=MyCustomSession("my_session") +) +``` + +## 세션 관리 + +### 세션 ID 네이밍 + +대화를 체계적으로 구성할 수 있는 의미 있는 세션 ID를 사용하세요: + +- 사용자 기반: `"user_12345"` +- 스레드 기반: `"thread_abc123"` +- 컨텍스트 기반: `"support_ticket_456"` + +### 메모리 지속성 + +- 임시 대화에는 메모리 내 SQLite(`SQLiteSession("session_id")`) 사용 +- 지속형 대화에는 파일 기반 SQLite(`SQLiteSession("session_id", "path/to/db.sqlite")`) 사용 +- SQLAlchemy가 지원하는 기존 데이터베이스가 있는 프로덕션 시스템에는 SQLAlchemy 기반 세션(`SQLAlchemySession("session_id", engine=engine, create_tables=True)`) 사용 +- 기록을 OpenAI Conversations API에 저장하기를 원하면 OpenAI 호스트하는 스토리지(`OpenAIConversationsSession()`) 사용 +- 투명한 암호화와 TTL 기반 만료를 위해 어떤 세션이든 래핑하려면 암호화된 세션(`EncryptedSession(session_id, underlying_session, encryption_key)`) 사용 +- 더 고급 사용 사례를 위해 다른 프로덕션 시스템(Redis, Django 등)에 대한 커스텀 세션 백엔드 구현 고려 + +### 세션 관리 + +```python +# Clear a session when conversation should start fresh +await session.clear_session() + +# Different agents can share the same session +support_agent = Agent(name="Support") +billing_agent = Agent(name="Billing") +session = SQLiteSession("user_123") + +# Both agents will see the same conversation history +result1 = await Runner.run( + support_agent, + "Help me with my account", + session=session +) +result2 = await Runner.run( + billing_agent, + "What are my charges?", + session=session +) +``` + +## 전체 예시 + +다음은 세션 메모리가 작동하는 방식을 보여주는 전체 예시입니다: + +```python +import asyncio +from agents import Agent, Runner, SQLiteSession + + +async def main(): + # Create an agent + agent = Agent( + name="Assistant", + instructions="Reply very concisely.", + ) + + # Create a session instance that will persist across runs + session = SQLiteSession("conversation_123", "conversation_history.db") + + print("=== Sessions Example ===") + print("The agent will remember previous messages automatically.\n") + + # First turn + print("First turn:") + print("User: What city is the Golden Gate Bridge in?") + result = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session + ) + print(f"Assistant: {result.final_output}") + print() + + # Second turn - the agent will remember the previous conversation + print("Second turn:") + print("User: What state is it in?") + result = await Runner.run( + agent, + "What state is it in?", + session=session + ) + print(f"Assistant: {result.final_output}") + print() + + # Third turn - continuing the conversation + print("Third turn:") + print("User: What's the population of that state?") + result = await Runner.run( + agent, + "What's the population of that state?", + session=session + ) + print(f"Assistant: {result.final_output}") + print() + + print("=== Conversation Complete ===") + print("Notice how the agent remembered the context from previous turns!") + print("Sessions automatically handles conversation history.") + + +if __name__ == "__main__": + asyncio.run(main()) +``` + +## API 레퍼런스 + +자세한 API 문서는 다음을 참고하세요: + +- [`Session`][agents.memory.Session] - 프로토콜 인터페이스 +- [`SQLiteSession`][agents.memory.SQLiteSession] - SQLite 구현 +- [`OpenAIConversationsSession`](ref/memory/openai_conversations_session.md) - OpenAI Conversations API 구현 +- [`SQLAlchemySession`][agents.extensions.memory.sqlalchemy_session.SQLAlchemySession] - SQLAlchemy 기반 구현 +- [`EncryptedSession`][agents.extensions.memory.encrypt_session.EncryptedSession] - TTL이 포함된 암호화 세션 래퍼 \ No newline at end of file diff --git a/docs/ko/sessions/advanced_sqlite_session.md b/docs/ko/sessions/advanced_sqlite_session.md new file mode 100644 index 000000000..7084b4a9e --- /dev/null +++ b/docs/ko/sessions/advanced_sqlite_session.md @@ -0,0 +1,307 @@ +--- +search: + exclude: true +--- +# 고급 SQLite 세션 + +`AdvancedSQLiteSession`은 기본 `SQLiteSession`을 확장한 버전으로, 대화 분기, 상세 사용량 분석, 구조화된 대화 쿼리 등 고급 대화 관리 기능을 제공합니다. + +## 기능 + +- **대화 분기**: 임의의 사용자 메시지에서 대체 대화 경로 생성 +- **사용량 추적**: 각 턴별 상세 토큰 사용량 분석과 전체 JSON 분해 제공 +- **구조화된 쿼리**: 턴 기준 대화 조회, 도구 사용 통계 등 +- **분기 관리**: 독립적인 분기 전환 및 관리 +- **메시지 구조 메타데이터**: 메시지 유형, 도구 사용, 대화 흐름 추적 + +## 빠른 시작 + +```python +from agents import Agent, Runner +from agents.extensions.memory import AdvancedSQLiteSession + +# Create agent +agent = Agent( + name="Assistant", + instructions="Reply very concisely.", +) + +# Create an advanced session +session = AdvancedSQLiteSession( + session_id="conversation_123", + db_path="conversations.db", + create_tables=True +) + +# First conversation turn +result = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session +) +print(result.final_output) # "San Francisco" + +# IMPORTANT: Store usage data +await session.store_run_usage(result) + +# Continue conversation +result = await Runner.run( + agent, + "What state is it in?", + session=session +) +print(result.final_output) # "California" +await session.store_run_usage(result) +``` + +## 초기화 + +```python +from agents.extensions.memory import AdvancedSQLiteSession + +# Basic initialization +session = AdvancedSQLiteSession( + session_id="my_conversation", + create_tables=True # Auto-create advanced tables +) + +# With persistent storage +session = AdvancedSQLiteSession( + session_id="user_123", + db_path="path/to/conversations.db", + create_tables=True +) + +# With custom logger +import logging +logger = logging.getLogger("my_app") +session = AdvancedSQLiteSession( + session_id="session_456", + create_tables=True, + logger=logger +) +``` + +### 매개변수 + +- `session_id` (str): 대화 세션의 고유 식별자 +- `db_path` (str | Path): SQLite 데이터베이스 파일 경로. 인메모리 저장을 위해 기본값은 `:memory:` +- `create_tables` (bool): 고급 테이블을 자동으로 생성할지 여부. 기본값은 `False` +- `logger` (logging.Logger | None): 세션에 사용할 커스텀 로거. 기본값은 모듈 로거 + +## 사용량 추적 + +AdvancedSQLiteSession은 대화의 각 턴마다 토큰 사용 데이터를 저장하여 상세한 사용량 분석을 제공합니다. **이는 각 에이전트 실행 후 `store_run_usage` 메서드를 호출하는 것에 전적으로 의존합니다.** + +### 사용 데이터 저장 + +```python +# After each agent run, store the usage data +result = await Runner.run(agent, "Hello", session=session) +await session.store_run_usage(result) + +# This stores: +# - Total tokens used +# - Input/output token breakdown +# - Request count +# - Detailed JSON token information (if available) +``` + +### 사용 통계 조회 + +```python +# Get session-level usage (all branches) +session_usage = await session.get_session_usage() +if session_usage: + print(f"Total requests: {session_usage['requests']}") + print(f"Total tokens: {session_usage['total_tokens']}") + print(f"Input tokens: {session_usage['input_tokens']}") + print(f"Output tokens: {session_usage['output_tokens']}") + print(f"Total turns: {session_usage['total_turns']}") + +# Get usage for specific branch +branch_usage = await session.get_session_usage(branch_id="main") + +# Get usage by turn +turn_usage = await session.get_turn_usage() +for turn_data in turn_usage: + print(f"Turn {turn_data['user_turn_number']}: {turn_data['total_tokens']} tokens") + if turn_data['input_tokens_details']: + print(f" Input details: {turn_data['input_tokens_details']}") + if turn_data['output_tokens_details']: + print(f" Output details: {turn_data['output_tokens_details']}") + +# Get usage for specific turn +turn_2_usage = await session.get_turn_usage(user_turn_number=2) +``` + +## 대화 분기 + +AdvancedSQLiteSession의 핵심 기능 중 하나는 임의의 사용자 메시지에서 대화 분기를 생성해 대체 대화 경로를 탐색할 수 있는 능력입니다. + +### 분기 생성 + +```python +# Get available turns for branching +turns = await session.get_conversation_turns() +for turn in turns: + print(f"Turn {turn['turn']}: {turn['content']}") + print(f"Can branch: {turn['can_branch']}") + +# Create a branch from turn 2 +branch_id = await session.create_branch_from_turn(2) +print(f"Created branch: {branch_id}") + +# Create a branch with custom name +branch_id = await session.create_branch_from_turn( + 2, + branch_name="alternative_path" +) + +# Create branch by searching for content +branch_id = await session.create_branch_from_content( + "weather", + branch_name="weather_focus" +) +``` + +### 분기 관리 + +```python +# List all branches +branches = await session.list_branches() +for branch in branches: + current = " (current)" if branch["is_current"] else "" + print(f"{branch['branch_id']}: {branch['user_turns']} turns, {branch['message_count']} messages{current}") + +# Switch between branches +await session.switch_to_branch("main") +await session.switch_to_branch(branch_id) + +# Delete a branch +await session.delete_branch(branch_id, force=True) # force=True allows deleting current branch +``` + +### 분기 워크플로 예시 + +```python +# Original conversation +result = await Runner.run(agent, "What's the capital of France?", session=session) +await session.store_run_usage(result) + +result = await Runner.run(agent, "What's the weather like there?", session=session) +await session.store_run_usage(result) + +# Create branch from turn 2 (weather question) +branch_id = await session.create_branch_from_turn(2, "weather_focus") + +# Continue in new branch with different question +result = await Runner.run( + agent, + "What are the main tourist attractions in Paris?", + session=session +) +await session.store_run_usage(result) + +# Switch back to main branch +await session.switch_to_branch("main") + +# Continue original conversation +result = await Runner.run( + agent, + "How expensive is it to visit?", + session=session +) +await session.store_run_usage(result) +``` + +## 구조화된 쿼리 + +AdvancedSQLiteSession은 대화의 구조와 내용을 분석하기 위한 여러 메서드를 제공합니다. + +### 대화 분석 + +```python +# Get conversation organized by turns +conversation_by_turns = await session.get_conversation_by_turns() +for turn_num, items in conversation_by_turns.items(): + print(f"Turn {turn_num}: {len(items)} items") + for item in items: + if item["tool_name"]: + print(f" - {item['type']} (tool: {item['tool_name']})") + else: + print(f" - {item['type']}") + +# Get tool usage statistics +tool_usage = await session.get_tool_usage() +for tool_name, count, turn in tool_usage: + print(f"{tool_name}: used {count} times in turn {turn}") + +# Find turns by content +matching_turns = await session.find_turns_by_content("weather") +for turn in matching_turns: + print(f"Turn {turn['turn']}: {turn['content']}") +``` + +### 메시지 구조 + +세션은 다음을 포함한 메시지 구조를 자동으로 추적합니다: + +- 메시지 유형(user, assistant, tool_call 등) +- 도구 호출의 도구 이름 +- 턴 번호와 시퀀스 번호 +- 분기 연관성 +- 타임스탬프 + +## 데이터베이스 스키마 + +AdvancedSQLiteSession은 기본 SQLite 스키마를 두 개의 추가 테이블로 확장합니다: + +### message_structure 테이블 + +```sql +CREATE TABLE message_structure ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + session_id TEXT NOT NULL, + message_id INTEGER NOT NULL, + branch_id TEXT NOT NULL DEFAULT 'main', + message_type TEXT NOT NULL, + sequence_number INTEGER NOT NULL, + user_turn_number INTEGER, + branch_turn_number INTEGER, + tool_name TEXT, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (session_id) REFERENCES agent_sessions(session_id) ON DELETE CASCADE, + FOREIGN KEY (message_id) REFERENCES agent_messages(id) ON DELETE CASCADE +); +``` + +### turn_usage 테이블 + +```sql +CREATE TABLE turn_usage ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + session_id TEXT NOT NULL, + branch_id TEXT NOT NULL DEFAULT 'main', + user_turn_number INTEGER NOT NULL, + requests INTEGER DEFAULT 0, + input_tokens INTEGER DEFAULT 0, + output_tokens INTEGER DEFAULT 0, + total_tokens INTEGER DEFAULT 0, + input_tokens_details JSON, + output_tokens_details JSON, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (session_id) REFERENCES agent_sessions(session_id) ON DELETE CASCADE, + UNIQUE(session_id, branch_id, user_turn_number) +); +``` + +## 전체 예제 + +모든 기능을 종합적으로 보여주는 [완전한 예제](https://github.com/openai/openai-agents-python/tree/main/examples/memory/advanced_sqlite_session_example.py)를 확인하세요. + + +## API 레퍼런스 + +- [`AdvancedSQLiteSession`][agents.extensions.memory.advanced_sqlite_session.AdvancedSQLiteSession] - 메인 클래스 +- [`Session`][agents.memory.session.Session] - 기본 세션 프로토콜 \ No newline at end of file diff --git a/docs/ko/sessions/encrypted_session.md b/docs/ko/sessions/encrypted_session.md new file mode 100644 index 000000000..2ea020ac1 --- /dev/null +++ b/docs/ko/sessions/encrypted_session.md @@ -0,0 +1,179 @@ +--- +search: + exclude: true +--- +# 암호화된 세션 + +`EncryptedSession`은 모든 세션 구현에 투명한 암호화를 제공하며, 대화 데이터를 보호하고 오래된 항목을 자동으로 만료합니다. + +## 기능 + +- **투명한 암호화**: 어떤 세션이든 Fernet 암호화로 감쌉니다 +- **세션별 키**: HKDF 키 파생을 사용해 세션마다 고유한 암호화를 적용합니다 +- **자동 만료**: TTL이 만료되면 오래된 항목은 자동으로 건너뜁니다 +- **대체 가능**: 기존의 어떤 세션 구현과도 함께 동작합니다 + +## 설치 + +암호화된 세션을 사용하려면 `encrypt` extra가 필요합니다: + +```bash +pip install openai-agents[encrypt] +``` + +## 빠른 시작 + +```python +import asyncio +from agents import Agent, Runner +from agents.extensions.memory import EncryptedSession, SQLAlchemySession + +async def main(): + agent = Agent("Assistant") + + # Create underlying session + underlying_session = SQLAlchemySession.from_url( + "user-123", + url="sqlite+aiosqlite:///:memory:", + create_tables=True + ) + + # Wrap with encryption + session = EncryptedSession( + session_id="user-123", + underlying_session=underlying_session, + encryption_key="your-secret-key-here", + ttl=600 # 10 minutes + ) + + result = await Runner.run(agent, "Hello", session=session) + print(result.final_output) + +if __name__ == "__main__": + asyncio.run(main()) +``` + +## 구성 + +### 암호화 키 + +암호화 키는 Fernet 키이거나 임의의 문자열일 수 있습니다: + +```python +from agents.extensions.memory import EncryptedSession + +# Using a Fernet key (base64-encoded) +session = EncryptedSession( + session_id="user-123", + underlying_session=underlying_session, + encryption_key="your-fernet-key-here", + ttl=600 +) + +# Using a raw string (will be derived to a key) +session = EncryptedSession( + session_id="user-123", + underlying_session=underlying_session, + encryption_key="my-secret-password", + ttl=600 +) +``` + +### TTL (Time To Live) + +암호화된 항목이 유효한 기간을 설정합니다: + +```python +# Items expire after 1 hour +session = EncryptedSession( + session_id="user-123", + underlying_session=underlying_session, + encryption_key="secret", + ttl=3600 # 1 hour in seconds +) + +# Items expire after 1 day +session = EncryptedSession( + session_id="user-123", + underlying_session=underlying_session, + encryption_key="secret", + ttl=86400 # 24 hours in seconds +) +``` + +## 다양한 세션 유형과의 사용 + +### SQLite 세션 사용 + +```python +from agents import SQLiteSession +from agents.extensions.memory import EncryptedSession + +# Create encrypted SQLite session +underlying = SQLiteSession("user-123", "conversations.db") + +session = EncryptedSession( + session_id="user-123", + underlying_session=underlying, + encryption_key="secret-key" +) +``` + +### SQLAlchemy 세션 사용 + +```python +from agents.extensions.memory import EncryptedSession, SQLAlchemySession + +# Create encrypted SQLAlchemy session +underlying = SQLAlchemySession.from_url( + "user-123", + url="postgresql+asyncpg://user:pass@localhost/db", + create_tables=True +) + +session = EncryptedSession( + session_id="user-123", + underlying_session=underlying, + encryption_key="secret-key" +) +``` + +!!! warning "고급 세션 기능" + + `EncryptedSession`을 `AdvancedSQLiteSession` 같은 고급 세션 구현과 함께 사용할 때 다음 사항에 유의하세요: + + - 메시지 내용이 암호화되므로 `find_turns_by_content()` 같은 메서드는 효과적으로 동작하지 않습니다 + - 내용 기반 검색은 암호화된 데이터에서 수행되어 효율이 제한됩니다 + + + +## 키 파생 + +EncryptedSession은 HKDF(HMAC 기반 키 파생 함수)를 사용하여 세션마다 고유한 암호화 키를 파생합니다: + +- **마스터 키**: 제공한 암호화 키 +- **세션 솔트**: 세션 ID +- **Info 문자열**: `"agents.session-store.hkdf.v1"` +- **출력**: 32바이트 Fernet 키 + +이는 다음을 보장합니다: +- 각 세션은 고유한 암호화 키를 가집니다 +- 마스터 키 없이는 키를 파생할 수 없습니다 +- 서로 다른 세션 간에는 세션 데이터를 복호화할 수 없습니다 + +## 자동 만료 + +항목이 TTL을 초과하면 검색 중에 자동으로 건너뜁니다: + +```python +# Items older than TTL are silently ignored +items = await session.get_items() # Only returns non-expired items + +# Expired items don't affect session behavior +result = await Runner.run(agent, "Continue conversation", session=session) +``` + +## API 레퍼런스 + +- [`EncryptedSession`][agents.extensions.memory.encrypt_session.EncryptedSession] - 기본 클래스 +- [`Session`][agents.memory.session.Session] - 기본 세션 프로토콜 \ No newline at end of file diff --git a/docs/ko/sessions/index.md b/docs/ko/sessions/index.md new file mode 100644 index 000000000..47e536fd2 --- /dev/null +++ b/docs/ko/sessions/index.md @@ -0,0 +1,435 @@ +--- +search: + exclude: true +--- +# 세션 + +Agents SDK 는 여러 에이전트 실행에 걸쳐 대화 이력을 자동으로 유지하는 내장 세션 메모리를 제공합니다. 이를 통해 턴 사이에 `.to_input_list()`를 수동으로 처리할 필요가 없습니다. + +세션은 특정 세션에 대한 대화 이력을 저장하여, 에이전트가 명시적인 수동 메모리 관리 없이도 컨텍스트를 유지할 수 있도록 합니다. 이는 에이전트가 이전 상호작용을 기억하기를 원하는 채팅 애플리케이션이나 멀티 턴 대화를 구축할 때 특히 유용합니다. + +## 빠른 시작 + +```python +from agents import Agent, Runner, SQLiteSession + +# Create agent +agent = Agent( + name="Assistant", + instructions="Reply very concisely.", +) + +# Create a session instance with a session ID +session = SQLiteSession("conversation_123") + +# First turn +result = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session +) +print(result.final_output) # "San Francisco" + +# Second turn - agent automatically remembers previous context +result = await Runner.run( + agent, + "What state is it in?", + session=session +) +print(result.final_output) # "California" + +# Also works with synchronous runner +result = Runner.run_sync( + agent, + "What's the population?", + session=session +) +print(result.final_output) # "Approximately 39 million" +``` + +## 동작 방식 + +세션 메모리가 활성화되면: + +1. **각 실행 전**: 러너가 세션의 대화 이력을 자동으로 가져와 입력 항목 앞에 추가합니다 +2. **각 실행 후**: 실행 중에 생성된 모든 새 항목(사용자 입력, 어시스턴트 응답, 도구 호출 등)이 세션에 자동으로 저장됩니다 +3. **컨텍스트 유지**: 동일한 세션으로 후속 실행을 수행하면 전체 대화 이력이 포함되어 에이전트가 컨텍스트를 유지할 수 있습니다 + +이로써 `.to_input_list()`를 수동으로 호출하고 실행 간 대화 상태를 관리할 필요가 없어집니다. + +## 메모리 작업 + +### 기본 작업 + +세션은 대화 이력을 관리하기 위한 여러 작업을 지원합니다: + +```python +from agents import SQLiteSession + +session = SQLiteSession("user_123", "conversations.db") + +# Get all items in a session +items = await session.get_items() + +# Add new items to a session +new_items = [ + {"role": "user", "content": "Hello"}, + {"role": "assistant", "content": "Hi there!"} +] +await session.add_items(new_items) + +# Remove and return the most recent item +last_item = await session.pop_item() +print(last_item) # {"role": "assistant", "content": "Hi there!"} + +# Clear all items from a session +await session.clear_session() +``` + +### 수정용 pop_item 사용 + +`pop_item` 메서드는 대화에서 마지막 항목을 되돌리거나 수정하려는 경우에 특히 유용합니다: + +```python +from agents import Agent, Runner, SQLiteSession + +agent = Agent(name="Assistant") +session = SQLiteSession("correction_example") + +# Initial conversation +result = await Runner.run( + agent, + "What's 2 + 2?", + session=session +) +print(f"Agent: {result.final_output}") + +# User wants to correct their question +assistant_item = await session.pop_item() # Remove agent's response +user_item = await session.pop_item() # Remove user's question + +# Ask a corrected question +result = await Runner.run( + agent, + "What's 2 + 3?", + session=session +) +print(f"Agent: {result.final_output}") +``` + +## 세션 유형 + +SDK 는 다양한 사용 사례를 위한 여러 세션 구현을 제공합니다: + +### OpenAI Conversations API 세션 + +`OpenAIConversationsSession`을 통해 [OpenAI's Conversations API](https://platform.openai.com/docs/api-reference/conversations)를 사용하세요. + +```python +from agents import Agent, Runner, OpenAIConversationsSession + +# Create agent +agent = Agent( + name="Assistant", + instructions="Reply very concisely.", +) + +# Create a new conversation +session = OpenAIConversationsSession() + +# Optionally resume a previous conversation by passing a conversation ID +# session = OpenAIConversationsSession(conversation_id="conv_123") + +# Start conversation +result = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session +) +print(result.final_output) # "San Francisco" + +# Continue the conversation +result = await Runner.run( + agent, + "What state is it in?", + session=session +) +print(result.final_output) # "California" +``` + +### SQLite 세션 + +기본 제공되는 경량의 SQLite 기반 세션 구현: + +```python +from agents import SQLiteSession + +# In-memory database (lost when process ends) +session = SQLiteSession("user_123") + +# Persistent file-based database +session = SQLiteSession("user_123", "conversations.db") + +# Use the session +result = await Runner.run( + agent, + "Hello", + session=session +) +``` + +### SQLAlchemy 세션 + +SQLAlchemy 가 지원하는 모든 데이터베이스를 사용하는 프로덕션 준비 세션: + +```python +from agents.extensions.memory import SQLAlchemySession + +# Using database URL +session = SQLAlchemySession.from_url( + "user_123", + url="postgresql+asyncpg://user:pass@localhost/db", + create_tables=True +) + +# Using existing engine +from sqlalchemy.ext.asyncio import create_async_engine +engine = create_async_engine("postgresql+asyncpg://user:pass@localhost/db") +session = SQLAlchemySession("user_123", engine=engine, create_tables=True) +``` + +자세한 문서는 [SQLAlchemy 세션](sqlalchemy_session.md)을 참조하세요. + +### 고급 SQLite 세션 + +대화 분기, 사용량 분석, 구조화된 쿼리를 제공하는 향상된 SQLite 세션: + +```python +from agents.extensions.memory import AdvancedSQLiteSession + +# Create with advanced features +session = AdvancedSQLiteSession( + session_id="user_123", + db_path="conversations.db", + create_tables=True +) + +# Automatic usage tracking +result = await Runner.run(agent, "Hello", session=session) +await session.store_run_usage(result) # Track token usage + +# Conversation branching +await session.create_branch_from_turn(2) # Branch from turn 2 +``` + +자세한 문서는 [고급 SQLite 세션](advanced_sqlite_session.md)을 참조하세요. + +### 암호화 세션 + +모든 세션 구현에 사용할 수 있는 투명한 암호화 래퍼: + +```python +from agents.extensions.memory import EncryptedSession, SQLAlchemySession + +# Create underlying session +underlying_session = SQLAlchemySession.from_url( + "user_123", + url="sqlite+aiosqlite:///conversations.db", + create_tables=True +) + +# Wrap with encryption and TTL +session = EncryptedSession( + session_id="user_123", + underlying_session=underlying_session, + encryption_key="your-secret-key", + ttl=600 # 10 minutes +) + +result = await Runner.run(agent, "Hello", session=session) +``` + +자세한 문서는 [암호화 세션](encrypted_session.md)을 참조하세요. + +## 세션 관리 + +### 세션 ID 네이밍 + +대화를 구성하는 데 도움이 되는 의미 있는 세션 ID 를 사용하세요: + +- User 기반: `"user_12345"` +- 스레드 기반: `"thread_abc123"` +- 컨텍스트 기반: `"support_ticket_456"` + +### 메모리 지속성 + +- 임시 대화에는 인메모리 SQLite(`SQLiteSession("session_id")`) 사용 +- 지속형 대화에는 파일 기반 SQLite(`SQLiteSession("session_id", "path/to/db.sqlite")`) 사용 +- SQLAlchemy 가 지원하는 기존 데이터베이스가 있는 프로덕션 시스템에는 SQLAlchemy 기반 세션(`SQLAlchemySession("session_id", engine=engine, create_tables=True)`) 사용 +- 이력을 OpenAI Conversations API 에 저장하길 원할 때는 OpenAI 호스트하는 스토리지(`OpenAIConversationsSession()`) 사용 +- 투명한 암호화와 TTL 기반 만료를 위해 암호화 세션(`EncryptedSession(session_id, underlying_session, encryption_key)`)으로 어떤 세션이든 래핑 +- 더 고급 사용 사례를 위해 다른 프로덕션 시스템(Redis, Django 등)에 대한 커스텀 세션 백엔드 구현 고려 + +### 다중 세션 + +```python +from agents import Agent, Runner, SQLiteSession + +agent = Agent(name="Assistant") + +# Different sessions maintain separate conversation histories +session_1 = SQLiteSession("user_123", "conversations.db") +session_2 = SQLiteSession("user_456", "conversations.db") + +result1 = await Runner.run( + agent, + "Help me with my account", + session=session_1 +) +result2 = await Runner.run( + agent, + "What are my charges?", + session=session_2 +) +``` + +### 세션 공유 + +```python +# Different agents can share the same session +support_agent = Agent(name="Support") +billing_agent = Agent(name="Billing") +session = SQLiteSession("user_123") + +# Both agents will see the same conversation history +result1 = await Runner.run( + support_agent, + "Help me with my account", + session=session +) +result2 = await Runner.run( + billing_agent, + "What are my charges?", + session=session +) +``` + +## 전체 예시 + +다음은 세션 메모리가 동작하는 완전한 예시입니다: + +```python +import asyncio +from agents import Agent, Runner, SQLiteSession + + +async def main(): + # Create an agent + agent = Agent( + name="Assistant", + instructions="Reply very concisely.", + ) + + # Create a session instance that will persist across runs + session = SQLiteSession("conversation_123", "conversation_history.db") + + print("=== Sessions Example ===") + print("The agent will remember previous messages automatically.\n") + + # First turn + print("First turn:") + print("User: What city is the Golden Gate Bridge in?") + result = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session + ) + print(f"Assistant: {result.final_output}") + print() + + # Second turn - the agent will remember the previous conversation + print("Second turn:") + print("User: What state is it in?") + result = await Runner.run( + agent, + "What state is it in?", + session=session + ) + print(f"Assistant: {result.final_output}") + print() + + # Third turn - continuing the conversation + print("Third turn:") + print("User: What's the population of that state?") + result = await Runner.run( + agent, + "What's the population of that state?", + session=session + ) + print(f"Assistant: {result.final_output}") + print() + + print("=== Conversation Complete ===") + print("Notice how the agent remembered the context from previous turns!") + print("Sessions automatically handles conversation history.") + + +if __name__ == "__main__": + asyncio.run(main()) +``` + +## 커스텀 세션 구현 + +[`Session`][agents.memory.session.Session] 프로토콜을 따르는 클래스를 만들어 자체 세션 메모리를 구현할 수 있습니다: + +```python +from agents.memory.session import SessionABC +from agents.items import TResponseInputItem +from typing import List + +class MyCustomSession(SessionABC): + """Custom session implementation following the Session protocol.""" + + def __init__(self, session_id: str): + self.session_id = session_id + # Your initialization here + + async def get_items(self, limit: int | None = None) -> List[TResponseInputItem]: + """Retrieve conversation history for this session.""" + # Your implementation here + pass + + async def add_items(self, items: List[TResponseInputItem]) -> None: + """Store new items for this session.""" + # Your implementation here + pass + + async def pop_item(self) -> TResponseInputItem | None: + """Remove and return the most recent item from this session.""" + # Your implementation here + pass + + async def clear_session(self) -> None: + """Clear all items for this session.""" + # Your implementation here + pass + +# Use your custom session +agent = Agent(name="Assistant") +result = await Runner.run( + agent, + "Hello", + session=MyCustomSession("my_session") +) +``` + +## API Reference + +자세한 API 문서는 다음을 참조하세요: + +- [`Session`][agents.memory.session.Session] - 프로토콜 인터페이스 +- [`OpenAIConversationsSession`][agents.memory.OpenAIConversationsSession] - OpenAI Conversations API 구현 +- [`SQLiteSession`][agents.memory.sqlite_session.SQLiteSession] - 기본 SQLite 구현 +- [`SQLAlchemySession`][agents.extensions.memory.sqlalchemy_session.SQLAlchemySession] - SQLAlchemy 기반 구현 +- [`AdvancedSQLiteSession`][agents.extensions.memory.advanced_sqlite_session.AdvancedSQLiteSession] - 분기와 분석을 지원하는 향상된 SQLite +- [`EncryptedSession`][agents.extensions.memory.encrypt_session.EncryptedSession] - 모든 세션용 암호화 래퍼 \ No newline at end of file diff --git a/docs/ko/sessions/sqlalchemy_session.md b/docs/ko/sessions/sqlalchemy_session.md new file mode 100644 index 000000000..bf2a171be --- /dev/null +++ b/docs/ko/sessions/sqlalchemy_session.md @@ -0,0 +1,80 @@ +--- +search: + exclude: true +--- +# SQLAlchemy 세션 + +`SQLAlchemySession`은 SQLAlchemy를 사용해 프로덕션급 세션 구현을 제공합니다. 이를 통해 세션 저장소로 SQLAlchemy가 지원하는 모든 데이터베이스(PostgreSQL, MySQL, SQLite 등)를 사용할 수 있습니다. + +## 설치 + +SQLAlchemy 세션에는 `sqlalchemy` extra가 필요합니다: + +```bash +pip install openai-agents[sqlalchemy] +``` + +## 빠른 시작 + +### 데이터베이스 URL 사용 + +가장 간단한 시작 방법: + +```python +import asyncio +from agents import Agent, Runner +from agents.extensions.memory import SQLAlchemySession + +async def main(): + agent = Agent("Assistant") + + # Create session using database URL + session = SQLAlchemySession.from_url( + "user-123", + url="sqlite+aiosqlite:///:memory:", + create_tables=True + ) + + result = await Runner.run(agent, "Hello", session=session) + print(result.final_output) + +if __name__ == "__main__": + asyncio.run(main()) +``` + +### 기존 엔진 사용 + +기존 SQLAlchemy 엔진을 사용하는 애플리케이션의 경우: + +```python +import asyncio +from agents import Agent, Runner +from agents.extensions.memory import SQLAlchemySession +from sqlalchemy.ext.asyncio import create_async_engine + +async def main(): + # Create your database engine + engine = create_async_engine("postgresql+asyncpg://user:pass@localhost/db") + + agent = Agent("Assistant") + session = SQLAlchemySession( + "user-456", + engine=engine, + create_tables=True + ) + + result = await Runner.run(agent, "Hello", session=session) + print(result.final_output) + + # Clean up + await engine.dispose() + +if __name__ == "__main__": + asyncio.run(main()) +``` + + +## API 참고 + +- [`SQLAlchemySession`][agents.extensions.memory.sqlalchemy_session.SQLAlchemySession] - 기본 클래스 +- [`Session`][agents.memory.session.Session] - 베이스 세션 프로토콜 \ No newline at end of file diff --git a/docs/ko/streaming.md b/docs/ko/streaming.md new file mode 100644 index 000000000..e9ab2dd70 --- /dev/null +++ b/docs/ko/streaming.md @@ -0,0 +1,91 @@ +--- +search: + exclude: true +--- +# 스트리밍 + +스트리밍을 사용하면 에이전트 실행이 진행되는 동안 업데이트를 구독할 수 있습니다. 이는 최종 사용자에게 진행 상황과 부분 응답을 보여주는 데 유용합니다. + +스트리밍하려면 [`Runner.run_streamed()`][agents.run.Runner.run_streamed]를 호출하여 [`RunResultStreaming`][agents.result.RunResultStreaming]을 받을 수 있습니다. `result.stream_events()`를 호출하면 아래에 설명된 [`StreamEvent`][agents.stream_events.StreamEvent] 객체의 비동기 스트림을 제공합니다. + +## 원문 응답 이벤트 + +[`RawResponsesStreamEvent`][agents.stream_events.RawResponsesStreamEvent]는 LLM에서 직접 전달되는 원문 이벤트입니다. OpenAI Responses API 형식이며, 각 이벤트에는 타입(예: `response.created`, `response.output_text.delta` 등)과 데이터가 있습니다. 생성되는 즉시 사용자에게 응답 메시지를 스트리밍하려는 경우 유용합니다. + +예를 들어, 다음은 LLM이 생성한 텍스트를 토큰 단위로 출력합니다. + +```python +import asyncio +from openai.types.responses import ResponseTextDeltaEvent +from agents import Agent, Runner + +async def main(): + agent = Agent( + name="Joker", + instructions="You are a helpful assistant.", + ) + + result = Runner.run_streamed(agent, input="Please tell me 5 jokes.") + async for event in result.stream_events(): + if event.type == "raw_response_event" and isinstance(event.data, ResponseTextDeltaEvent): + print(event.data.delta, end="", flush=True) + + +if __name__ == "__main__": + asyncio.run(main()) +``` + +## 실행 항목 이벤트와 에이전트 이벤트 + +[`RunItemStreamEvent`][agents.stream_events.RunItemStreamEvent]는 더 높은 수준의 이벤트입니다. 항목이 완전히 생성되었을 때 알려줍니다. 이를 통해 각 토큰이 아닌 "메시지 생성됨", "도구 실행됨" 등의 수준에서 진행 상태를 전달할 수 있습니다. 유사하게, [`AgentUpdatedStreamEvent`][agents.stream_events.AgentUpdatedStreamEvent]는 현재 에이전트가 변경될 때 업데이트를 제공합니다(예: 핸드오프의 결과로). + +예를 들어, 다음은 원문 이벤트를 무시하고 사용자에게 업데이트를 스트리밍합니다. + +```python +import asyncio +import random +from agents import Agent, ItemHelpers, Runner, function_tool + +@function_tool +def how_many_jokes() -> int: + return random.randint(1, 10) + + +async def main(): + agent = Agent( + name="Joker", + instructions="First call the `how_many_jokes` tool, then tell that many jokes.", + tools=[how_many_jokes], + ) + + result = Runner.run_streamed( + agent, + input="Hello", + ) + print("=== Run starting ===") + + async for event in result.stream_events(): + # We'll ignore the raw responses event deltas + if event.type == "raw_response_event": + continue + # When the agent updates, print that + elif event.type == "agent_updated_stream_event": + print(f"Agent updated: {event.new_agent.name}") + continue + # When items are generated, print them + elif event.type == "run_item_stream_event": + if event.item.type == "tool_call_item": + print("-- Tool was called") + elif event.item.type == "tool_call_output_item": + print(f"-- Tool output: {event.item.output}") + elif event.item.type == "message_output_item": + print(f"-- Message output:\n {ItemHelpers.text_message_output(event.item)}") + else: + pass # Ignore other event types + + print("=== Run complete ===") + + +if __name__ == "__main__": + asyncio.run(main()) +``` \ No newline at end of file diff --git a/docs/ko/tools.md b/docs/ko/tools.md new file mode 100644 index 000000000..9a04a2105 --- /dev/null +++ b/docs/ko/tools.md @@ -0,0 +1,425 @@ +--- +search: + exclude: true +--- +# 도구 + +도구는 에이전트가 데이터를 가져오고, 코드를 실행하고, 외부 API 를 호출하고, 심지어 컴퓨터를 사용하는 등 행동을 취할 수 있게 합니다. Agent SDK 에는 세 가지 종류의 도구가 있습니다: + +- 호스티드 툴: AI 모델과 함께 LLM 서버에서 실행됩니다. OpenAI 는 retrieval, 웹 검색 및 컴퓨터 사용을 호스티드 툴로 제공합니다 +- 함수 호출: 임의의 Python 함수를 도구로 사용할 수 있게 합니다 +- 도구로서의 에이전트: 에이전트를 도구로 사용하여, 핸드오프 없이 에이전트가 다른 에이전트를 호출할 수 있게 합니다 + +## 호스티드 툴 + +OpenAI 는 [`OpenAIResponsesModel`][agents.models.openai_responses.OpenAIResponsesModel] 사용 시 몇 가지 기본 제공 도구를 제공합니다: + +- [`WebSearchTool`][agents.tool.WebSearchTool] 은 에이전트가 웹을 검색할 수 있게 합니다 +- [`FileSearchTool`][agents.tool.FileSearchTool] 은 OpenAI 벡터 스토어에서 정보를 검색할 수 있게 합니다 +- [`ComputerTool`][agents.tool.ComputerTool] 은 컴퓨터 사용 작업을 자동화할 수 있게 합니다 +- [`CodeInterpreterTool`][agents.tool.CodeInterpreterTool] 은 LLM 이 샌드박스 환경에서 코드를 실행할 수 있게 합니다 +- [`HostedMCPTool`][agents.tool.HostedMCPTool] 은 원격 MCP 서버의 도구를 모델에 노출합니다 +- [`ImageGenerationTool`][agents.tool.ImageGenerationTool] 은 프롬프트로부터 이미지를 생성합니다 +- [`LocalShellTool`][agents.tool.LocalShellTool] 은 로컬 머신에서 셸 명령을 실행합니다 + +```python +from agents import Agent, FileSearchTool, Runner, WebSearchTool + +agent = Agent( + name="Assistant", + tools=[ + WebSearchTool(), + FileSearchTool( + max_num_results=3, + vector_store_ids=["VECTOR_STORE_ID"], + ), + ], +) + +async def main(): + result = await Runner.run(agent, "Which coffee shop should I go to, taking into account my preferences and the weather today in SF?") + print(result.final_output) +``` + +## 함수 도구 + +임의의 Python 함수를 도구로 사용할 수 있습니다. Agents SDK 가 도구를 자동으로 설정합니다: + +- 도구 이름은 Python 함수 이름이 됩니다(또는 이름을 직접 지정할 수 있음) +- 도구 설명은 함수의 docstring 에서 가져옵니다(또는 설명을 직접 지정할 수 있음) +- 함수 입력에 대한 스키마는 함수의 인자에서 자동으로 생성됨 +- 각 입력에 대한 설명은 비활성화하지 않는 한 함수의 docstring 에서 가져옴 + +Python 의 `inspect` 모듈을 사용해 함수 시그니처를 추출하고, [`griffe`](https://mkdocstrings.github.io/griffe/) 로 docstring 을 파싱하며 스키마 생성에는 `pydantic` 을 사용합니다. + +```python +import json + +from typing_extensions import TypedDict, Any + +from agents import Agent, FunctionTool, RunContextWrapper, function_tool + + +class Location(TypedDict): + lat: float + long: float + +@function_tool # (1)! +async def fetch_weather(location: Location) -> str: + # (2)! + """Fetch the weather for a given location. + + Args: + location: The location to fetch the weather for. + """ + # In real life, we'd fetch the weather from a weather API + return "sunny" + + +@function_tool(name_override="fetch_data") # (3)! +def read_file(ctx: RunContextWrapper[Any], path: str, directory: str | None = None) -> str: + """Read the contents of a file. + + Args: + path: The path to the file to read. + directory: The directory to read the file from. + """ + # In real life, we'd read the file from the file system + return "" + + +agent = Agent( + name="Assistant", + tools=[fetch_weather, read_file], # (4)! +) + +for tool in agent.tools: + if isinstance(tool, FunctionTool): + print(tool.name) + print(tool.description) + print(json.dumps(tool.params_json_schema, indent=2)) + print() + +``` + +1. 함수 인자로는 어떤 Python 타입이든 사용할 수 있으며, 함수는 동기 또는 비동기일 수 있습니다 +2. docstring 이 있으면 설명과 인자 설명을 추출하는 데 사용합니다 +3. 선택적으로 `context` 를 받을 수 있습니다(첫 번째 인자여야 함). 도구 이름, 설명, 사용할 docstring 스타일 등도 오버라이드할 수 있습니다 +4. 데코레이터가 적용된 함수를 도구 목록에 전달하면 됩니다 + +??? note "Expand to see output" + + ``` + fetch_weather + Fetch the weather for a given location. + { + "$defs": { + "Location": { + "properties": { + "lat": { + "title": "Lat", + "type": "number" + }, + "long": { + "title": "Long", + "type": "number" + } + }, + "required": [ + "lat", + "long" + ], + "title": "Location", + "type": "object" + } + }, + "properties": { + "location": { + "$ref": "#/$defs/Location", + "description": "The location to fetch the weather for." + } + }, + "required": [ + "location" + ], + "title": "fetch_weather_args", + "type": "object" + } + + fetch_data + Read the contents of a file. + { + "properties": { + "path": { + "description": "The path to the file to read.", + "title": "Path", + "type": "string" + }, + "directory": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The directory to read the file from.", + "title": "Directory" + } + }, + "required": [ + "path" + ], + "title": "fetch_data_args", + "type": "object" + } + ``` + +### 함수 도구에서 이미지 또는 파일 반환 + +텍스트 출력과 더불어, 함수 도구의 출력으로 하나 이상의 이미지 또는 파일을 반환할 수 있습니다. 이를 위해 다음 중 아무 것이나 반환할 수 있습니다: + +- 이미지: [`ToolOutputImage`][agents.tool.ToolOutputImage] (TypedDict 버전: [`ToolOutputImageDict`][agents.tool.ToolOutputImageDict]) +- 파일: [`ToolOutputFileContent`][agents.tool.ToolOutputFileContent] (TypedDict 버전: [`ToolOutputFileContentDict`][agents.tool.ToolOutputFileContentDict]) +- 텍스트: 문자열 또는 문자열로 변환 가능한 객체, 혹은 [`ToolOutputText`][agents.tool.ToolOutputText] (TypedDict 버전: [`ToolOutputTextDict`][agents.tool.ToolOutputTextDict]) + +### 사용자 지정 함수 도구 + +때로는 Python 함수를 도구로 사용하고 싶지 않을 수 있습니다. 이 경우 [`FunctionTool`][agents.tool.FunctionTool] 을 직접 생성할 수 있습니다. 다음을 제공해야 합니다: + +- `name` +- `description` +- `params_json_schema` (인자를 위한 JSON 스키마) +- `on_invoke_tool` (async 함수로, [`ToolContext`][agents.tool_context.ToolContext] 와 JSON 문자열 형태의 인자를 받아야 하며, 도구 출력을 문자열로 반환해야 함) + +```python +from typing import Any + +from pydantic import BaseModel + +from agents import RunContextWrapper, FunctionTool + + + +def do_some_work(data: str) -> str: + return "done" + + +class FunctionArgs(BaseModel): + username: str + age: int + + +async def run_function(ctx: RunContextWrapper[Any], args: str) -> str: + parsed = FunctionArgs.model_validate_json(args) + return do_some_work(data=f"{parsed.username} is {parsed.age} years old") + + +tool = FunctionTool( + name="process_user", + description="Processes extracted user data", + params_json_schema=FunctionArgs.model_json_schema(), + on_invoke_tool=run_function, +) +``` + +### 인자 및 docstring 자동 파싱 + +앞서 언급했듯이, 도구의 스키마를 추출하기 위해 함수 시그니처를 자동으로 파싱하고, 도구 및 개별 인자에 대한 설명을 추출하기 위해 docstring 을 파싱합니다. 이에 대한 몇 가지 참고 사항: + +1. 시그니처 파싱은 `inspect` 모듈로 수행합니다. 타입 힌트를 사용해 인자 타입을 파악하고, 전체 스키마를 나타내는 Pydantic 모델을 동적으로 빌드합니다. Python 기본형, Pydantic 모델, TypedDict 등 대부분의 타입을 지원합니다 +2. docstring 파싱에는 `griffe` 를 사용합니다. 지원하는 docstring 포맷은 `google`, `sphinx`, `numpy` 입니다. 포맷을 자동 감지하려고 시도하지만 최선의 노력일 뿐이므로, `function_tool` 호출 시 명시적으로 설정할 수 있습니다. `use_docstring_info` 를 `False` 로 설정해 docstring 파싱을 비활성화할 수도 있습니다 + +스키마 추출 코드는 [`agents.function_schema`][] 에 있습니다. + +## 도구로서의 에이전트 + +일부 워크플로에서는 제어를 넘기지 않고 중앙 에이전트가 특화된 에이전트들의 네트워크를 오케스트레이션하기를 원할 수 있습니다. 에이전트를 도구로 모델링하여 이를 수행할 수 있습니다. + +```python +from agents import Agent, Runner +import asyncio + +spanish_agent = Agent( + name="Spanish agent", + instructions="You translate the user's message to Spanish", +) + +french_agent = Agent( + name="French agent", + instructions="You translate the user's message to French", +) + +orchestrator_agent = Agent( + name="orchestrator_agent", + instructions=( + "You are a translation agent. You use the tools given to you to translate." + "If asked for multiple translations, you call the relevant tools." + ), + tools=[ + spanish_agent.as_tool( + tool_name="translate_to_spanish", + tool_description="Translate the user's message to Spanish", + ), + french_agent.as_tool( + tool_name="translate_to_french", + tool_description="Translate the user's message to French", + ), + ], +) + +async def main(): + result = await Runner.run(orchestrator_agent, input="Say 'Hello, how are you?' in Spanish.") + print(result.final_output) +``` + +### 도구형 에이전트 사용자 지정 + +`agent.as_tool` 함수는 에이전트를 도구로 쉽게 전환하기 위한 편의 메서드입니다. 하지만 모든 구성을 지원하지는 않습니다. 예를 들어 `max_turns` 를 설정할 수 없습니다. 고급 사용 사례에서는 도구 구현 내에서 `Runner.run` 을 직접 사용하세요: + +```python +@function_tool +async def run_my_agent() -> str: + """A tool that runs the agent with custom configs""" + + agent = Agent(name="My agent", instructions="...") + + result = await Runner.run( + agent, + input="...", + max_turns=5, + run_config=... + ) + + return str(result.final_output) +``` + +### 사용자 지정 출력 추출 + +특정 경우, 중앙 에이전트로 반환하기 전에 도구형 에이전트의 출력을 수정하고 싶을 수 있습니다. 이는 다음과 같은 경우에 유용합니다: + +- 하위 에이전트의 대화 기록에서 특정 정보(예: JSON 페이로드)만 추출 +- 에이전트의 최종 답변을 변환 또는 재포맷(예: Markdown 을 일반 텍스트나 CSV 로 변환) +- 에이전트의 응답이 없거나 형식이 잘못된 경우 출력을 검증하거나 대체 값을 제공 + +이를 위해 `as_tool` 메서드에 `custom_output_extractor` 매개변수를 제공하면 됩니다: + +```python +async def extract_json_payload(run_result: RunResult) -> str: + # Scan the agent’s outputs in reverse order until we find a JSON-like message from a tool call. + for item in reversed(run_result.new_items): + if isinstance(item, ToolCallOutputItem) and item.output.strip().startswith("{"): + return item.output.strip() + # Fallback to an empty JSON object if nothing was found + return "{}" + + +json_tool = data_agent.as_tool( + tool_name="get_data_json", + tool_description="Run the data agent and return only its JSON payload", + custom_output_extractor=extract_json_payload, +) +``` + +### 조건부 도구 활성화 + +런타임에 `is_enabled` 매개변수를 사용해 에이전트 도구를 조건부로 활성화하거나 비활성화할 수 있습니다. 이를 통해 컨텍스트, 사용자 선호도, 런타임 조건에 따라 LLM 에 제공되는 도구를 동적으로 필터링할 수 있습니다. + +```python +import asyncio +from agents import Agent, AgentBase, Runner, RunContextWrapper +from pydantic import BaseModel + +class LanguageContext(BaseModel): + language_preference: str = "french_spanish" + +def french_enabled(ctx: RunContextWrapper[LanguageContext], agent: AgentBase) -> bool: + """Enable French for French+Spanish preference.""" + return ctx.context.language_preference == "french_spanish" + +# Create specialized agents +spanish_agent = Agent( + name="spanish_agent", + instructions="You respond in Spanish. Always reply to the user's question in Spanish.", +) + +french_agent = Agent( + name="french_agent", + instructions="You respond in French. Always reply to the user's question in French.", +) + +# Create orchestrator with conditional tools +orchestrator = Agent( + name="orchestrator", + instructions=( + "You are a multilingual assistant. You use the tools given to you to respond to users. " + "You must call ALL available tools to provide responses in different languages. " + "You never respond in languages yourself, you always use the provided tools." + ), + tools=[ + spanish_agent.as_tool( + tool_name="respond_spanish", + tool_description="Respond to the user's question in Spanish", + is_enabled=True, # Always enabled + ), + french_agent.as_tool( + tool_name="respond_french", + tool_description="Respond to the user's question in French", + is_enabled=french_enabled, + ), + ], +) + +async def main(): + context = RunContextWrapper(LanguageContext(language_preference="french_spanish")) + result = await Runner.run(orchestrator, "How are you?", context=context.context) + print(result.final_output) + +asyncio.run(main()) +``` + +`is_enabled` 매개변수는 다음을 허용합니다: + +- **Boolean values**: `True` (항상 활성) 또는 `False` (항상 비활성) +- **Callable functions**: `(context, agent)` 를 받아 불리언을 반환하는 함수 +- **Async functions**: 더 복잡한 조건부 로직을 위한 비동기 함수 + +비활성화된 도구는 런타임에 LLM 에 완전히 숨겨지므로 다음에 유용합니다: + +- 사용자 권한 기반 기능 게이팅 +- 환경별 도구 가용성 설정(개발/프로덕션) +- 서로 다른 도구 구성을 A/B 테스트 +- 런타임 상태에 따른 동적 도구 필터링 + +## 함수 도구 오류 처리 + +`@function_tool` 로 함수 도구를 만들 때 `failure_error_function` 을 전달할 수 있습니다. 이는 도구 호출이 크래시한 경우 LLM 에 오류 응답을 제공하는 함수입니다. + +- 기본값(즉, 아무것도 전달하지 않은 경우)으로, 오류가 발생했음을 LLM 에 알리는 `default_tool_error_function` 이 실행됩니다 +- 사용자 정의 오류 함수를 전달하면 해당 함수가 대신 실행되어 그 응답이 LLM 에 전송됩니다 +- 명시적으로 `None` 을 전달하면, 도구 호출 오류가 다시 발생(raise)하여 직접 처리해야 합니다. 모델이 잘못된 JSON 을 생성한 경우 `ModelBehaviorError`, 코드가 크래시한 경우 `UserError` 등이 될 수 있습니다 + +```python +from agents import function_tool, RunContextWrapper +from typing import Any + +def my_custom_error_function(context: RunContextWrapper[Any], error: Exception) -> str: + """A custom function to provide a user-friendly error message.""" + print(f"A tool call failed with the following error: {error}") + return "An internal server error occurred. Please try again later." + +@function_tool(failure_error_function=my_custom_error_function) +def get_user_profile(user_id: str) -> str: + """Fetches a user profile from a mock API. + This function demonstrates a 'flaky' or failing API call. + """ + if user_id == "user_123": + return "User profile for user_123 successfully retrieved." + else: + raise ValueError(f"Could not retrieve profile for user_id: {user_id}. API returned an error.") + +``` + +`FunctionTool` 객체를 수동으로 생성하는 경우, `on_invoke_tool` 함수 내부에서 오류를 직접 처리해야 합니다. \ No newline at end of file diff --git a/docs/ko/tracing.md b/docs/ko/tracing.md new file mode 100644 index 000000000..a18fe9d5b --- /dev/null +++ b/docs/ko/tracing.md @@ -0,0 +1,151 @@ +--- +search: + exclude: true +--- +# 트레이싱 + +Agents SDK에는 기본 제공 트레이싱이 포함되어 있어 에이전트 실행 중 발생하는 이벤트의 포괄적인 기록을 수집합니다: LLM 생성, 도구 호출, 핸드오프, 가드레일, 그리고 사용자 정의 이벤트까지. [Traces 대시보드](https://platform.openai.com/traces)를 사용하여 개발 중과 프로덕션 환경에서 워크플로를 디버깅, 시각화, 모니터링할 수 있습니다. + +!!!note + + 트레이싱은 기본적으로 활성화되어 있습니다. 트레이싱을 비활성화하는 방법은 두 가지입니다: + + 1. 환경 변수 `OPENAI_AGENTS_DISABLE_TRACING=1` 를 설정하여 전역적으로 트레이싱을 비활성화할 수 있습니다 + 2. 단일 실행에 대해서는 [`agents.run.RunConfig.tracing_disabled`][] 를 `True` 로 설정하여 트레이싱을 비활성화할 수 있습니다 + +***OpenAI의 API를 사용하는 Zero Data Retention (ZDR) 정책 하의 조직에서는 트레이싱을 사용할 수 없습니다.*** + +## 트레이스와 스팬 + +- **트레이스(Traces)** 는 "워크플로"의 단일 엔드투엔드 동작을 나타냅니다. 스팬으로 구성됩니다. 트레이스에는 다음 속성이 있습니다: + - `workflow_name`: 논리적 워크플로 또는 앱입니다. 예: "Code generation" 또는 "Customer service" + - `trace_id`: 트레이스의 고유 ID입니다. 전달하지 않으면 자동으로 생성됩니다. 형식은 `trace_<32_alphanumeric>` 이어야 합니다 + - `group_id`: 선택적 그룹 ID로, 동일한 대화의 여러 트레이스를 연결합니다. 예를 들어 채팅 스레드 ID를 사용할 수 있습니다 + - `disabled`: True 인 경우 트레이스가 기록되지 않습니다 + - `metadata`: 트레이스의 선택적 메타데이터 +- **스팬(Spans)** 은 시작 및 종료 시간이 있는 작업을 나타냅니다. 스팬에는 다음이 포함됩니다: + - `started_at` 및 `ended_at` 타임스탬프 + - 속한 트레이스를 나타내는 `trace_id` + - 이 스팬의 상위 스팬(있는 경우)을 가리키는 `parent_id` + - 스팬에 대한 정보인 `span_data`. 예를 들어, `AgentSpanData` 는 에이전트 정보, `GenerationSpanData` 는 LLM 생성 정보를 포함합니다 + +## 기본 트레이싱 + +기본적으로 SDK는 다음을 트레이싱합니다: + +- 전체 `Runner.{run, run_sync, run_streamed}()` 가 `trace()` 로 감싸집니다 +- 에이전트가 실행될 때마다 `agent_span()` 으로 감싸집니다 +- LLM 생성은 `generation_span()` 으로 감싸집니다 +- 함수 도구 호출은 각각 `function_span()` 으로 감싸집니다 +- 가드레일은 `guardrail_span()` 으로 감싸집니다 +- 핸드오프는 `handoff_span()` 으로 감싸집니다 +- 오디오 입력(음성-텍스트)은 `transcription_span()` 으로 감싸집니다 +- 오디오 출력(텍스트-음성)은 `speech_span()` 으로 감싸집니다 +- 관련 오디오 스팬은 `speech_group_span()` 아래에 상위로 배치될 수 있습니다 + +기본적으로 트레이스 이름은 "Agent workflow" 입니다. `trace` 를 사용하면 이 이름을 설정할 수 있고, [`RunConfig`][agents.run.RunConfig] 를 통해 이름 및 기타 속성을 구성할 수도 있습니다. + +또한, [사용자 정의 트레이스 프로세서](#custom-tracing-processors)를 설정하여 트레이스를 다른 대상으로 전송할 수 있습니다(대체 또는 보조 대상으로). + +## 더 높은 수준의 트레이스 + +때때로 여러 번의 `run()` 호출을 단일 트레이스의 일부로 만들고 싶을 수 있습니다. 이때 전체 코드를 `trace()` 로 감싸면 됩니다. + +```python +from agents import Agent, Runner, trace + +async def main(): + agent = Agent(name="Joke generator", instructions="Tell funny jokes.") + + with trace("Joke workflow"): # (1)! + first_result = await Runner.run(agent, "Tell me a joke") + second_result = await Runner.run(agent, f"Rate this joke: {first_result.final_output}") + print(f"Joke: {first_result.final_output}") + print(f"Rating: {second_result.final_output}") +``` + +1. `Runner.run` 에 대한 두 호출이 `with trace()` 로 감싸져 있으므로, 개별 실행은 두 개의 트레이스를 생성하는 대신 전체 트레이스의 일부가 됩니다. + +## 트레이스 생성 + +[`trace()`][agents.tracing.trace] 함수를 사용하여 트레이스를 생성할 수 있습니다. 트레이스는 시작과 종료가 필요합니다. 이를 수행하는 방법은 두 가지입니다: + +1. 권장: 트레이스를 컨텍스트 매니저로 사용합니다. 예: `with trace(...) as my_trace`. 이렇게 하면 적절한 시점에 트레이스가 자동으로 시작되고 종료됩니다 +2. 직접 [`trace.start()`][agents.tracing.Trace.start] 와 [`trace.finish()`][agents.tracing.Trace.finish] 를 호출할 수도 있습니다 + +현재 트레이스는 Python의 [`contextvar`](https://docs.python.org/3/library/contextvars.html) 를 통해 추적됩니다. 이는 자동으로 동시성과 함께 작동함을 의미합니다. 트레이스를 수동으로 시작/종료하는 경우 현재 트레이스를 업데이트하기 위해 `start()`/`finish()` 에 `mark_as_current` 와 `reset_current` 를 전달해야 합니다. + +## 스팬 생성 + +여러 [`*_span()`][agents.tracing.create] 메서드를 사용하여 스팬을 생성할 수 있습니다. 일반적으로 스팬을 수동으로 생성할 필요는 없습니다. 사용자 정의 스팬 정보를 추적하기 위한 [`custom_span()`][agents.tracing.custom_span] 함수가 제공됩니다. + +스팬은 자동으로 현재 트레이스의 일부가 되며, Python의 [`contextvar`](https://docs.python.org/3/library/contextvars.html) 를 통해 추적되는 가장 가까운 현재 스팬 아래에 중첩됩니다. + +## 민감한 데이터 + +특정 스팬은 잠재적으로 민감한 데이터를 캡처할 수 있습니다. + +`generation_span()` 은 LLM 생성의 입력/출력을 저장하고, `function_span()` 은 함수 호출의 입력/출력을 저장합니다. 여기에는 민감한 데이터가 포함될 수 있으므로, [`RunConfig.trace_include_sensitive_data`][agents.run.RunConfig.trace_include_sensitive_data] 를 통해 해당 데이터 캡처를 비활성화할 수 있습니다. + +마찬가지로, 오디오 스팬은 기본적으로 입력 및 출력 오디오에 대해 base64 로 인코딩된 PCM 데이터를 포함합니다. [`VoicePipelineConfig.trace_include_sensitive_audio_data`][agents.voice.pipeline_config.VoicePipelineConfig.trace_include_sensitive_audio_data] 를 구성하여 이 오디오 데이터 캡처를 비활성화할 수 있습니다. + +## 사용자 정의 트레이싱 프로세서 + +트레이싱의 상위 수준 아키텍처는 다음과 같습니다: + +- 초기화 시, 트레이스를 생성하는 역할을 하는 전역 [`TraceProvider`][agents.tracing.setup.TraceProvider] 를 생성합니다 +- 트레이스/스팬을 배치로 [`BackendSpanExporter`][agents.tracing.processors.BackendSpanExporter] 에 보내는 [`BatchTraceProcessor`][agents.tracing.processors.BatchTraceProcessor] 로 `TraceProvider` 를 구성합니다. 이는 스팬과 트레이스를 배치로 OpenAI 백엔드에 내보냅니다 + +기본 설정을 사용자 정의하여 대체 또는 추가 백엔드로 트레이스를 전송하거나 내보내기 동작을 변경하려면 두 가지 옵션이 있습니다: + +1. [`add_trace_processor()`][agents.tracing.add_trace_processor] 를 사용하면 트레이스와 스팬이 준비될 때 수신할 **추가** 트레이스 프로세서를 추가할 수 있습니다. 이를 통해 OpenAI 백엔드로 트레이스를 전송하는 것에 더해 자체 처리를 수행할 수 있습니다 +2. [`set_trace_processors()`][agents.tracing.set_trace_processors] 를 사용하면 기본 프로세서를 사용자 정의 트레이스 프로세서로 **교체** 할 수 있습니다. 이 경우 OpenAI 백엔드로 트레이스가 전송되지 않으며, 그렇게 하는 `TracingProcessor` 를 포함해야 합니다 + +## 비 OpenAI 모델과의 트레이싱 + +트레이싱을 비활성화할 필요 없이 OpenAI API 키를 비 OpenAI 모델과 함께 사용하여 OpenAI Traces 대시보드에서 무료 트레이싱을 활성화할 수 있습니다. + +```python +import os +from agents import set_tracing_export_api_key, Agent, Runner +from agents.extensions.models.litellm_model import LitellmModel + +tracing_api_key = os.environ["OPENAI_API_KEY"] +set_tracing_export_api_key(tracing_api_key) + +model = LitellmModel( + model="your-model-name", + api_key="your-api-key", +) + +agent = Agent( + name="Assistant", + model=model, +) +``` + +## 참고 +- OpenAI Traces 대시보드에서 무료 트레이스를 확인하세요 + +## 외부 트레이싱 프로세서 목록 + +- [Weights & Biases](https://weave-docs.wandb.ai/guides/integrations/openai_agents) +- [Arize-Phoenix](https://docs.arize.com/phoenix/tracing/integrations-tracing/openai-agents-sdk) +- [Future AGI](https://docs.futureagi.com/future-agi/products/observability/auto-instrumentation/openai_agents) +- [MLflow (self-hosted/OSS)](https://mlflow.org/docs/latest/tracing/integrations/openai-agent) +- [MLflow (Databricks hosted)](https://docs.databricks.com/aws/en/mlflow/mlflow-tracing#-automatic-tracing) +- [Braintrust](https://braintrust.dev/docs/guides/traces/integrations#openai-agents-sdk) +- [Pydantic Logfire](https://logfire.pydantic.dev/docs/integrations/llms/openai/#openai-agents) +- [AgentOps](https://docs.agentops.ai/v1/integrations/agentssdk) +- [Scorecard](https://docs.scorecard.io/docs/documentation/features/tracing#openai-agents-sdk-integration) +- [Keywords AI](https://docs.keywordsai.co/integration/development-frameworks/openai-agent) +- [LangSmith](https://docs.smith.langchain.com/observability/how_to_guides/trace_with_openai_agents_sdk) +- [Maxim AI](https://www.getmaxim.ai/docs/observe/integrations/openai-agents-sdk) +- [Comet Opik](https://www.comet.com/docs/opik/tracing/integrations/openai_agents) +- [Langfuse](https://langfuse.com/docs/integrations/openaiagentssdk/openai-agents) +- [Langtrace](https://docs.langtrace.ai/supported-integrations/llm-frameworks/openai-agents-sdk) +- [Okahu-Monocle](https://github.com/monocle2ai/monocle) +- [Galileo](https://v2docs.galileo.ai/integrations/openai-agent-integration#openai-agent-integration) +- [Portkey AI](https://portkey.ai/docs/integrations/agents/openai-agents) +- [LangDB AI](https://docs.langdb.ai/getting-started/working-with-agent-frameworks/working-with-openai-agents-sdk) +- [Agenta](https://docs.agenta.ai/observability/integrations/openai-agents) \ No newline at end of file diff --git a/docs/ko/usage.md b/docs/ko/usage.md new file mode 100644 index 000000000..a5546494f --- /dev/null +++ b/docs/ko/usage.md @@ -0,0 +1,86 @@ +--- +search: + exclude: true +--- +# 사용량 + +Agents SDK는 실행마다 토큰 사용량을 자동으로 추적합니다. 실행 컨텍스트에서 접근하여 비용 모니터링, 한도 적용, 분석 기록에 사용할 수 있습니다. + +## 추적 항목 + +- **requests**: 수행된 LLM API 호출 수 +- **input_tokens**: 전송된 입력 토큰 총합 +- **output_tokens**: 수신된 출력 토큰 총합 +- **total_tokens**: input + output +- **details**: + - `input_tokens_details.cached_tokens` + - `output_tokens_details.reasoning_tokens` + +## 실행에서 사용량 접근 + +`Runner.run(...)` 이후, `result.context_wrapper.usage`를 통해 사용량에 접근합니다. + +```python +result = await Runner.run(agent, "What's the weather in Tokyo?") +usage = result.context_wrapper.usage + +print("Requests:", usage.requests) +print("Input tokens:", usage.input_tokens) +print("Output tokens:", usage.output_tokens) +print("Total tokens:", usage.total_tokens) +``` + +사용량은 실행 중 이루어진 모든 모델 호출 전반에 걸쳐 집계됩니다(도구 호출과 핸드오프 포함). + +### LiteLLM 모델에서 사용량 활성화 + +LiteLLM 제공자는 기본적으로 사용량 지표를 보고하지 않습니다. [`LitellmModel`](models/litellm.md)을 사용할 때, 에이전트에 `ModelSettings(include_usage=True)`를 전달하면 LiteLLM 응답이 `result.context_wrapper.usage`를 채웁니다. + +```python +from agents import Agent, ModelSettings, Runner +from agents.extensions.models.litellm_model import LitellmModel + +agent = Agent( + name="Assistant", + model=LitellmModel(model="your/model", api_key="..."), + model_settings=ModelSettings(include_usage=True), +) + +result = await Runner.run(agent, "What's the weather in Tokyo?") +print(result.context_wrapper.usage.total_tokens) +``` + +## 세션에서 사용량 접근 + +`Session`(예: `SQLiteSession`)을 사용할 때는 `Runner.run(...)` 호출마다 해당 실행에 대한 사용량이 반환됩니다. 세션은 컨텍스트를 위한 대화 기록을 유지하지만, 각 실행의 사용량은 독립적입니다. + +```python +session = SQLiteSession("my_conversation") + +first = await Runner.run(agent, "Hi!", session=session) +print(first.context_wrapper.usage.total_tokens) # Usage for first run + +second = await Runner.run(agent, "Can you elaborate?", session=session) +print(second.context_wrapper.usage.total_tokens) # Usage for second run +``` + +세션은 실행 간 대화 컨텍스트를 보존하지만, 각 `Runner.run()` 호출이 반환하는 사용량 지표는 해당 실행만을 나타냅니다. 세션에서는 이전 메시지가 각 실행의 입력으로 다시 제공될 수 있으며, 이는 이후 턴의 입력 토큰 수에 영향을 줍니다. + +## 훅에서 사용량 활용 + +`RunHooks`를 사용하는 경우, 각 훅에 전달되는 `context` 객체에 `usage`가 포함됩니다. 이를 통해 수명 주기의 주요 시점에서 사용량을 로깅할 수 있습니다. + +```python +class MyHooks(RunHooks): + async def on_agent_end(self, context: RunContextWrapper, agent: Agent, output: Any) -> None: + u = context.usage + print(f"{agent.name} → {u.requests} requests, {u.total_tokens} total tokens") +``` + +## API 참고 + +자세한 API 문서는 다음을 참조하세요: + +- [`Usage`][agents.usage.Usage] - 사용량 추적 데이터 구조 +- [`RunContextWrapper`][agents.run.RunContextWrapper] - 실행 컨텍스트에서 사용량 접근 +- [`RunHooks`][agents.run.RunHooks] - 사용량 트래킹 수명 주기에 훅 연결 \ No newline at end of file diff --git a/docs/ko/visualization.md b/docs/ko/visualization.md new file mode 100644 index 000000000..85d6a7423 --- /dev/null +++ b/docs/ko/visualization.md @@ -0,0 +1,106 @@ +--- +search: + exclude: true +--- +# 에이전트 시각화 + +에이전트 시각화는 **Graphviz**를 사용하여 에이전트와 그 관계를 구조화된 그래픽으로 생성할 수 있게 합니다. 이는 애플리케이션 내에서 에이전트, 도구, 핸드오프가 어떻게 상호작용하는지 이해하는 데 유용합니다. + +## 설치 + +선택적 `viz` 종속성 그룹을 설치하세요: + +```bash +pip install "openai-agents[viz]" +``` + +## 그래프 생성 + +`draw_graph` 함수를 사용하여 에이전트 시각화를 생성할 수 있습니다. 이 함수는 다음과 같은 유향 그래프를 생성합니다: + +- **에이전트**는 노란색 상자로 표시됩니다 +- **MCP 서버**는 회색 상자로 표시됩니다 +- **도구**는 녹색 타원으로 표시됩니다 +- **핸드오프**는 한 에이전트에서 다른 에이전트로 향하는 방향 간선으로 표시됩니다 + +### 사용 예시 + +```python +import os + +from agents import Agent, function_tool +from agents.mcp.server import MCPServerStdio +from agents.extensions.visualization import draw_graph + +@function_tool +def get_weather(city: str) -> str: + return f"The weather in {city} is sunny." + +spanish_agent = Agent( + name="Spanish agent", + instructions="You only speak Spanish.", +) + +english_agent = Agent( + name="English agent", + instructions="You only speak English", +) + +current_dir = os.path.dirname(os.path.abspath(__file__)) +samples_dir = os.path.join(current_dir, "sample_files") +mcp_server = MCPServerStdio( + name="Filesystem Server, via npx", + params={ + "command": "npx", + "args": ["-y", "@modelcontextprotocol/server-filesystem", samples_dir], + }, +) + +triage_agent = Agent( + name="Triage agent", + instructions="Handoff to the appropriate agent based on the language of the request.", + handoffs=[spanish_agent, english_agent], + tools=[get_weather], + mcp_servers=[mcp_server], +) + +draw_graph(triage_agent) +``` + +![Agent Graph](../assets/images/graph.png) + +이는 **트리아지 에이전트**와 하위 에이전트 및 도구와의 연결 구조를 시 بص각적으로 나타내는 그래프를 생성합니다. + +## 시각화 이해 + +생성된 그래프는 다음을 포함합니다: + +- 진입점을 나타내는 **시작 노드**(`__start__`) +- 노란색 채우기의 **직사각형**으로 표시된 에이전트 +- 녹색 채우기의 **타원**으로 표시된 도구 +- 회색 채우기의 **직사각형**으로 표시된 MCP 서버 +- 상호작용을 나타내는 방향 간선: + - 에이전트 간 핸드오프는 **실선 화살표** + - 도구 호출은 **점선 화살표** + - MCP 서버 호출은 **파선 화살표** +- 실행 종료 지점을 나타내는 **종료 노드**(`__end__`) + +**참고:** MCP 서버는 최신 버전의 `agents` 패키지에서 렌더링됩니다( **v0.2.8** 에서 확인됨). 시각화에 MCP 상자가 보이지 않으면 최신 릴리스로 업그레이드하세요. + +## 그래프 사용자 지정 + +### 그래프 표시 +기본적으로 `draw_graph`는 그래프를 인라인으로 표시합니다. 그래프를 별도 창에서 표시하려면 다음을 작성하세요: + +```python +draw_graph(triage_agent).view() +``` + +### 그래프 저장 +기본적으로 `draw_graph`는 그래프를 인라인으로 표시합니다. 파일로 저장하려면 파일 이름을 지정하세요: + +```python +draw_graph(triage_agent, filename="agent_graph") +``` + +이렇게 하면 작업 디렉터리에 `agent_graph.png`가 생성됩니다. \ No newline at end of file diff --git a/docs/ko/voice/pipeline.md b/docs/ko/voice/pipeline.md new file mode 100644 index 000000000..d1790b569 --- /dev/null +++ b/docs/ko/voice/pipeline.md @@ -0,0 +1,79 @@ +--- +search: + exclude: true +--- +# 파이프라인과 워크플로우 + +[`VoicePipeline`][agents.voice.pipeline.VoicePipeline] 클래스는 에이전트형 워크플로우를 손쉽게 음성 앱으로 전환할 수 있게 해줍니다. 실행할 워크플로우를 전달하면, 파이프라인이 입력 오디오의 음성 인식, 오디오 종료 감지, 적절한 타이밍에 워크플로우 호출, 워크플로우 출력의 오디오 변환까지 처리합니다. + +```mermaid +graph LR + %% Input + A["🎤 Audio Input"] + + %% Voice Pipeline + subgraph Voice_Pipeline [Voice Pipeline] + direction TB + B["Transcribe (speech-to-text)"] + C["Your Code"]:::highlight + D["Text-to-speech"] + B --> C --> D + end + + %% Output + E["🎧 Audio Output"] + + %% Flow + A --> Voice_Pipeline + Voice_Pipeline --> E + + %% Custom styling + classDef highlight fill:#ffcc66,stroke:#333,stroke-width:1px,font-weight:700; + +``` + +## 파이프라인 구성 + +파이프라인을 생성할 때 다음을 설정할 수 있습니다: + +1. [`workflow`][agents.voice.workflow.VoiceWorkflowBase] — 새 오디오가 전사될 때마다 실행되는 코드 +2. 사용하는 [`speech-to-text`][agents.voice.model.STTModel] 및 [`text-to-speech`][agents.voice.model.TTSModel] 모델 +3. [`config`][agents.voice.pipeline_config.VoicePipelineConfig] — 다음과 같은 항목을 구성 가능: + - 모델 제공자(모델 이름을 실제 모델로 매핑) + - 트레이싱 설정(트레이싱 비활성화 여부, 오디오 파일 업로드 여부, 워크플로우 이름, 트레이스 ID 등) + - TTS/STT 모델의 설정(프롬프트, 언어, 사용되는 데이터 타입 등) + +## 파이프라인 실행 + +파이프라인은 [`run()`][agents.voice.pipeline.VoicePipeline.run] 메서드로 실행하며, 두 가지 형태로 오디오 입력을 전달할 수 있습니다: + +1. [`AudioInput`][agents.voice.input.AudioInput] — 전체 오디오 전사가 있고 그에 대한 결과만 생성하면 되는 경우 사용합니다. 예를 들어, 사전 녹음된 오디오나 사용자가 말하기를 마치는 시점이 명확한 푸시투토크 앱처럼 발화 종료 감지가 필요 없는 경우에 유용합니다 +2. [`StreamedAudioInput`][agents.voice.input.StreamedAudioInput] — 사용자의 발화 종료 감지가 필요할 수 있는 경우에 사용합니다. 감지된 대로 오디오 청크를 푸시할 수 있으며, 음성 파이프라인은 "activity detection(활동 감지)"이라는 프로세스를 통해 적절한 시점에 에이전트 워크플로우를 자동으로 실행합니다 + +## 결과 + +음성 파이프라인 실행 결과는 [`StreamedAudioResult`][agents.voice.result.StreamedAudioResult] 입니다. 이는 발생하는 이벤트를 스트리밍할 수 있는 객체입니다. 다음과 같은 여러 종류의 [`VoiceStreamEvent`][agents.voice.events.VoiceStreamEvent] 가 있습니다: + +1. [`VoiceStreamEventAudio`][agents.voice.events.VoiceStreamEventAudio] — 오디오 청크를 포함 +2. [`VoiceStreamEventLifecycle`][agents.voice.events.VoiceStreamEventLifecycle] — 턴 시작/종료와 같은 라이프사이클 이벤트 알림 +3. [`VoiceStreamEventError`][agents.voice.events.VoiceStreamEventError] — 오류 이벤트 + +```python + +result = await pipeline.run(input) + +async for event in result.stream(): + if event.type == "voice_stream_event_audio": + # play audio + elif event.type == "voice_stream_event_lifecycle": + # lifecycle + elif event.type == "voice_stream_event_error" + # error + ... +``` + +## 모범 사례 + +### 인터럽션(중단 처리) + +Agents SDK 는 현재 [`StreamedAudioInput`][agents.voice.input.StreamedAudioInput] 에 대해 내장된 인터럽션(중단 처리) 기능을 지원하지 않습니다. 대신, 감지된 각 턴마다 워크플로우의 별도 실행이 트리거됩니다. 애플리케이션 내부에서 인터럽션(중단 처리)을 다루고자 한다면 [`VoiceStreamEventLifecycle`][agents.voice.events.VoiceStreamEventLifecycle] 이벤트를 구독할 수 있습니다. `turn_started` 는 새 턴이 전사되어 처리가 시작되었음을 나타냅니다. `turn_ended` 는 해당 턴의 모든 오디오 디스패치가 완료된 후 트리거됩니다. 이 이벤트를 사용해 모델이 턴을 시작할 때 화자의 마이크를 음소거하고, 해당 턴의 관련 오디오를 모두 플러시한 후 음소거를 해제할 수 있습니다. \ No newline at end of file diff --git a/docs/ko/voice/quickstart.md b/docs/ko/voice/quickstart.md new file mode 100644 index 000000000..d33b1a881 --- /dev/null +++ b/docs/ko/voice/quickstart.md @@ -0,0 +1,198 @@ +--- +search: + exclude: true +--- +# 빠른 시작 + +## 사전 준비 + +OpenAI Agents SDK의 기본 [빠른 시작 안내](../quickstart.md)를 따라 가상 환경을 설정했는지 확인하세요. 그런 다음 SDK에서 선택적 음성 관련 의존성을 설치하세요: + +```bash +pip install 'openai-agents[voice]' +``` + +## 개념 + +핵심 개념은 [`VoicePipeline`][agents.voice.pipeline.VoicePipeline]이며, 3단계 프로세스로 구성됩니다: + +1. 음성을 텍스트로 변환하기 위해 음성-텍스트 모델을 실행 +2. 결과를 생성하기 위해 보통 에이전트형 워크플로인 코드를 실행 +3. 결과 텍스트를 다시 오디오로 변환하기 위해 텍스트-음성 모델을 실행 + +```mermaid +graph LR + %% Input + A["🎤 Audio Input"] + + %% Voice Pipeline + subgraph Voice_Pipeline [Voice Pipeline] + direction TB + B["Transcribe (speech-to-text)"] + C["Your Code"]:::highlight + D["Text-to-speech"] + B --> C --> D + end + + %% Output + E["🎧 Audio Output"] + + %% Flow + A --> Voice_Pipeline + Voice_Pipeline --> E + + %% Custom styling + classDef highlight fill:#ffcc66,stroke:#333,stroke-width:1px,font-weight:700; + +``` + +## 에이전트 + +먼저 에이전트를 몇 개 설정해 봅시다. 이 SDK로 에이전트를 만들어 본 적이 있다면 익숙하게 느껴질 것입니다. 에이전트 몇 개와 핸드오프, 그리고 하나의 도구를 사용합니다. + +```python +import asyncio +import random + +from agents import ( + Agent, + function_tool, +) +from agents.extensions.handoff_prompt import prompt_with_handoff_instructions + + + +@function_tool +def get_weather(city: str) -> str: + """Get the weather for a given city.""" + print(f"[debug] get_weather called with city: {city}") + choices = ["sunny", "cloudy", "rainy", "snowy"] + return f"The weather in {city} is {random.choice(choices)}." + + +spanish_agent = Agent( + name="Spanish", + handoff_description="A spanish speaking agent.", + instructions=prompt_with_handoff_instructions( + "You're speaking to a human, so be polite and concise. Speak in Spanish.", + ), + model="gpt-4.1", +) + +agent = Agent( + name="Assistant", + instructions=prompt_with_handoff_instructions( + "You're speaking to a human, so be polite and concise. If the user speaks in Spanish, handoff to the spanish agent.", + ), + model="gpt-4.1", + handoffs=[spanish_agent], + tools=[get_weather], +) +``` + +## 음성 파이프라인 + +워크플로로 [`SingleAgentVoiceWorkflow`][agents.voice.workflow.SingleAgentVoiceWorkflow]를 사용해 간단한 음성 파이프라인을 설정합니다. + +```python +from agents.voice import SingleAgentVoiceWorkflow, VoicePipeline +pipeline = VoicePipeline(workflow=SingleAgentVoiceWorkflow(agent)) +``` + +## 파이프라인 실행 + +```python +import numpy as np +import sounddevice as sd +from agents.voice import AudioInput + +# For simplicity, we'll just create 3 seconds of silence +# In reality, you'd get microphone data +buffer = np.zeros(24000 * 3, dtype=np.int16) +audio_input = AudioInput(buffer=buffer) + +result = await pipeline.run(audio_input) + +# Create an audio player using `sounddevice` +player = sd.OutputStream(samplerate=24000, channels=1, dtype=np.int16) +player.start() + +# Play the audio stream as it comes in +async for event in result.stream(): + if event.type == "voice_stream_event_audio": + player.write(event.data) + +``` + +## 통합 + +```python +import asyncio +import random + +import numpy as np +import sounddevice as sd + +from agents import ( + Agent, + function_tool, + set_tracing_disabled, +) +from agents.voice import ( + AudioInput, + SingleAgentVoiceWorkflow, + VoicePipeline, +) +from agents.extensions.handoff_prompt import prompt_with_handoff_instructions + + +@function_tool +def get_weather(city: str) -> str: + """Get the weather for a given city.""" + print(f"[debug] get_weather called with city: {city}") + choices = ["sunny", "cloudy", "rainy", "snowy"] + return f"The weather in {city} is {random.choice(choices)}." + + +spanish_agent = Agent( + name="Spanish", + handoff_description="A spanish speaking agent.", + instructions=prompt_with_handoff_instructions( + "You're speaking to a human, so be polite and concise. Speak in Spanish.", + ), + model="gpt-4.1", +) + +agent = Agent( + name="Assistant", + instructions=prompt_with_handoff_instructions( + "You're speaking to a human, so be polite and concise. If the user speaks in Spanish, handoff to the spanish agent.", + ), + model="gpt-4.1", + handoffs=[spanish_agent], + tools=[get_weather], +) + + +async def main(): + pipeline = VoicePipeline(workflow=SingleAgentVoiceWorkflow(agent)) + buffer = np.zeros(24000 * 3, dtype=np.int16) + audio_input = AudioInput(buffer=buffer) + + result = await pipeline.run(audio_input) + + # Create an audio player using `sounddevice` + player = sd.OutputStream(samplerate=24000, channels=1, dtype=np.int16) + player.start() + + # Play the audio stream as it comes in + async for event in result.stream(): + if event.type == "voice_stream_event_audio": + player.write(event.data) + + +if __name__ == "__main__": + asyncio.run(main()) +``` + +이 예제를 실행하면 에이전트가 직접 말을 겁니다! 직접 에이전트와 대화할 수 있는 데모는 [examples/voice/static](https://github.com/openai/openai-agents-python/tree/main/examples/voice/static)에서 확인하세요. \ No newline at end of file diff --git a/docs/ko/voice/tracing.md b/docs/ko/voice/tracing.md new file mode 100644 index 000000000..2546302f0 --- /dev/null +++ b/docs/ko/voice/tracing.md @@ -0,0 +1,18 @@ +--- +search: + exclude: true +--- +# 트레이싱 + +[에이전트가 트레이싱되는 방식](../tracing.md)과 마찬가지로, 음성 파이프라인도 자동으로 트레이싱됩니다. + +기본적인 트레이싱 정보는 위의 문서를 참고하시면 되며, 추가로 [`VoicePipelineConfig`][agents.voice.pipeline_config.VoicePipelineConfig]를 통해 파이프라인의 트레이싱을 구성할 수 있습니다. + +주요 트레이싱 관련 필드는 다음과 같습니다: + +- [`tracing_disabled`][agents.voice.pipeline_config.VoicePipelineConfig.tracing_disabled]: 트레이싱 비활성화 여부를 제어합니다. 기본값은 활성화입니다. +- [`trace_include_sensitive_data`][agents.voice.pipeline_config.VoicePipelineConfig.trace_include_sensitive_data]: 오디오 전사본과 같은 잠재적으로 민감한 데이터를 트레이스에 포함할지 제어합니다. 이는 음성 파이프라인에만 적용되며, 워크플로 내부에서 발생하는 작업에는 적용되지 않습니다. +- [`trace_include_sensitive_audio_data`][agents.voice.pipeline_config.VoicePipelineConfig.trace_include_sensitive_audio_data]: 트레이스에 오디오 데이터를 포함할지 제어합니다. +- [`workflow_name`][agents.voice.pipeline_config.VoicePipelineConfig.workflow_name]: 트레이스 워크플로 이름 +- [`group_id`][agents.voice.pipeline_config.VoicePipelineConfig.group_id]: 트레이스의 `group_id`로, 여러 트레이스를 연결할 수 있습니다. +- [`trace_metadata`][agents.voice.pipeline_config.VoicePipelineConfig.tracing_disabled]: 트레이스에 포함할 추가 메타데이터 \ No newline at end of file diff --git a/docs/llms-full.txt b/docs/llms-full.txt new file mode 100644 index 000000000..e33b033c0 --- /dev/null +++ b/docs/llms-full.txt @@ -0,0 +1,112 @@ +# OpenAI Agents SDK Documentation (Full Context) + +> Extended reference map for the OpenAI Agents SDK documentation site. Use these curated links when assembling prompts that need authoritative guidance on building, operating, and extending agentic applications with the SDK. + +The Agents SDK delivers a focused set of Python primitives—agents, tools, guardrails, handoffs, sessions, and tracing—plus voice and realtime interfaces. The pages below provide detailed walkthroughs, architectural patterns, and API-level documentation for integrating those capabilities into production systems. + +## Getting Started and Orientation +- [Overview](https://openai.github.io/openai-agents-python/): Conceptual tour of the SDK, covering the core agent loop, motivation, installation snippet, and a runnable hello-world. +- [Quickstart](https://openai.github.io/openai-agents-python/quickstart/): Guided setup from environment preparation through running and monitoring your first agent, including troubleshooting tips. +- [Example Gallery](https://openai.github.io/openai-agents-python/examples/): Realistic Python samples that demonstrate tool orchestration, guardrails, streaming, and integrations with external systems. +- [Release notes](https://openai.github.io/openai-agents-python/release/): Version-by-version change log with migration notes for breaking updates. +- [Usage and pricing](https://openai.github.io/openai-agents-python/usage/): Explains how token usage is tracked, how to retrieve usage metadata, and how to forecast cost for different deployment patterns. +- [Configuration](https://openai.github.io/openai-agents-python/config/): Centralized reference for tuning model settings, retries, rate limits, timeouts, logging, and runner behavior. + +## Core Agent Workflows +- [Agents](https://openai.github.io/openai-agents-python/agents/): Defines agent objects, instruction design, tool registration, guardrail attachment, streaming options, and lifecycle hooks. +- [Running agents](https://openai.github.io/openai-agents-python/running_agents/): Covers synchronous and asynchronous execution, concurrency controls, background tasks, cancellation, and handling failures. +- [Sessions](https://openai.github.io/openai-agents-python/sessions/): Describes persistent session state, conversation threading, history pruning, and custom session storage backends. +- [Context strategies](https://openai.github.io/openai-agents-python/context/): Techniques for tailoring prompts, managing attachments, trimming history, and injecting auxiliary context into runs. +- [Results](https://openai.github.io/openai-agents-python/results/): Breaks down the result object, including final output, tool call transcripts, intermediate messages, and metadata fields. +- [Streaming](https://openai.github.io/openai-agents-python/streaming/): Shows how to subscribe to incremental events, stream tool progress, and render partial model outputs in real time. +- [REPL](https://openai.github.io/openai-agents-python/repl/): Interactive runner for exploring agent behavior, step-by-step execution, and debugging tool calls. +- [Visualization](https://openai.github.io/openai-agents-python/visualization/): Demonstrates embeddable visualizations for session timelines, message flows, and tool interactions. + +## Coordination, Safety, and Tooling +- [Handoffs](https://openai.github.io/openai-agents-python/handoffs/): Implements delegation between agents, argument passing, completion handling, and error recovery across agent boundaries. +- [Multi-agent patterns](https://openai.github.io/openai-agents-python/multi_agent/): Architecture playbook for designing specialist teams, escalation workflows, and role-based collaboration strategies. +- [Guardrails](https://openai.github.io/openai-agents-python/guardrails/): Create synchronous or asynchronous checks, short-circuit runs, and emit structured validation reports. +- [Tools](https://openai.github.io/openai-agents-python/tools/): Turn Python callables into structured tools, manage schemas, compose tool contexts, and test tool execution paths. +- [Model Context Protocol](https://openai.github.io/openai-agents-python/mcp/): Integrate MCP servers so agents can dynamically request data or actions from external providers via a standard protocol. + +## Modality-Specific Guides +- [Voice quickstart](https://openai.github.io/openai-agents-python/voice/quickstart/): Build an end-to-end voice assistant with streaming transcription, text-to-speech, and event-driven responses. +- [Voice pipeline](https://openai.github.io/openai-agents-python/voice/pipeline/): Customize audio capture, buffering, model invocation, and playback in voice-first experiences. +- [Voice tracing](https://openai.github.io/openai-agents-python/voice/tracing/): Inspect voice session traces, latency breakdowns, and audio event timelines. +- [Realtime quickstart](https://openai.github.io/openai-agents-python/realtime/quickstart/): Launch realtime agents over WebRTC or websockets, subscribe to events, and manage low-latency execution. +- [Realtime guide](https://openai.github.io/openai-agents-python/realtime/guide/): Deep dive into realtime session lifecycle, event schemas, concurrency, and backpressure handling. + +## Models and Provider Integrations +- [Model catalog](https://openai.github.io/openai-agents-python/models/): Lists supported OpenAI and partner models with guidance on selecting capabilities for different workloads. +- [LiteLLM integration](https://openai.github.io/openai-agents-python/models/litellm/): Configure LiteLLM as a provider, map model aliases, and route requests across heterogeneous backends. + +## API Reference – Agents SDK Core +- [API index](https://openai.github.io/openai-agents-python/ref/index/): Directory of all documented modules, classes, and functions in the SDK. +- [agents.Agent](https://openai.github.io/openai-agents-python/ref/agent/): Constructor arguments, behaviors, guardrail hooks, and serialization helpers. +- [runs and runners](https://openai.github.io/openai-agents-python/ref/run/): Runner interfaces for launching agents, streaming events, handling cancellations, and background execution. +- [memory interfaces](https://openai.github.io/openai-agents-python/ref/memory/): Session memory primitives, storage adapters, and utilities for retrieving historical context. +- [repl utilities](https://openai.github.io/openai-agents-python/ref/repl/): Programmatic access to the interactive REPL loop and inspection helpers. +- [tool base classes](https://openai.github.io/openai-agents-python/ref/tool/): Tool registration, invocation, and structured argument parsing. +- [tool context helpers](https://openai.github.io/openai-agents-python/ref/tool_context/): Manage shared resources, dependency injection, and cleanup for tool execution. +- [result objects](https://openai.github.io/openai-agents-python/ref/result/): Fields exposed on run results, including final content, tool call summaries, and attachments. +- [stream events](https://openai.github.io/openai-agents-python/ref/stream_events/): Event models emitted during streaming runs and their payload schemas. +- [handoffs module](https://openai.github.io/openai-agents-python/ref/handoffs/): Programmatic API for defining, routing, and resolving handoffs between agents. +- [lifecycle callbacks](https://openai.github.io/openai-agents-python/ref/lifecycle/): Hooks for intercepting agent stages, customizing evaluation, and logging intermediate data. +- [items API](https://openai.github.io/openai-agents-python/ref/items/): Low-level primitives that represent agent messages, tool calls, and attachments. +- [run context utilities](https://openai.github.io/openai-agents-python/ref/run_context/): Context managers and helpers for passing metadata through nested tool executions. +- [usage tracking](https://openai.github.io/openai-agents-python/ref/usage/): Inspect token usage, durations, and cost metrics from completed runs. +- [exceptions](https://openai.github.io/openai-agents-python/ref/exceptions/): Exception hierarchy raised by the SDK and recommendations for resilient error handling. +- [guardrail APIs](https://openai.github.io/openai-agents-python/ref/guardrail/): Build custom guardrails, interpret validation outcomes, and integrate enforcement logic. +- [model settings](https://openai.github.io/openai-agents-python/ref/model_settings/): Shared configuration objects for model parameters, temperature, and tool invocation settings. +- [agent output models](https://openai.github.io/openai-agents-python/ref/agent_output/): Typed models describing message content, tool calls, and aggregated agent responses. +- [function schema utilities](https://openai.github.io/openai-agents-python/ref/function_schema/): Helpers for generating JSON schemas from Python functions and Pydantic models. +- [model interfaces](https://openai.github.io/openai-agents-python/ref/models/interface/): Abstractions for pluggable model providers. +- [OpenAI chat completions provider](https://openai.github.io/openai-agents-python/ref/models/openai_chatcompletions/): Implementation details for the chat-completions-based model adapter. +- [OpenAI responses provider](https://openai.github.io/openai-agents-python/ref/models/openai_responses/): Implementation details for the responses API adapter. +- [MCP server helpers](https://openai.github.io/openai-agents-python/ref/mcp/server/): Utilities for building MCP servers that expose tools to agents. +- [MCP client utilities](https://openai.github.io/openai-agents-python/ref/mcp/util/): Helpers for consuming MCP servers from within agents. + +## API Reference – Tracing +- [Tracing overview](https://openai.github.io/openai-agents-python/ref/tracing/index/): End-to-end API documentation for tracing components. +- [Creating traces](https://openai.github.io/openai-agents-python/ref/tracing/create/): Programmatic APIs for instantiating traces and attaching metadata. +- [Trace model](https://openai.github.io/openai-agents-python/ref/tracing/traces/): Data models representing traces and their relationships. +- [Span model](https://openai.github.io/openai-agents-python/ref/tracing/spans/): Span structure, timing data, and message attribution. +- [Processor interface](https://openai.github.io/openai-agents-python/ref/tracing/processor_interface/): Contract for custom processors that consume trace events. +- [Bundled processors](https://openai.github.io/openai-agents-python/ref/tracing/processors/): Built-in processors for exporting traces to external systems. +- [Tracing scope](https://openai.github.io/openai-agents-python/ref/tracing/scope/): Context managers that manage active traces and spans. +- [Tracing setup](https://openai.github.io/openai-agents-python/ref/tracing/setup/): Configuration helpers for initializing tracing in applications and tests. +- [Span data utilities](https://openai.github.io/openai-agents-python/ref/tracing/span_data/): Helper models for span payloads and events. +- [Tracing utility helpers](https://openai.github.io/openai-agents-python/ref/tracing/util/): Miscellaneous tracing utilities, exporters, and logging helpers. + +## API Reference – Realtime +- [Realtime agent API](https://openai.github.io/openai-agents-python/ref/realtime/agent/): Programmatic interface for realtime agents. +- [Realtime runner](https://openai.github.io/openai-agents-python/ref/realtime/runner/): Manage realtime execution loops, concurrency, and cleanup. +- [Realtime session](https://openai.github.io/openai-agents-python/ref/realtime/session/): Lifecycle and state management for realtime sessions. +- [Realtime events](https://openai.github.io/openai-agents-python/ref/realtime/events/): Event payload types delivered over realtime channels. +- [Realtime config](https://openai.github.io/openai-agents-python/ref/realtime/config/): Configuration models for realtime transports and behaviors. +- [Realtime model interface](https://openai.github.io/openai-agents-python/ref/realtime/model/): Interfaces for plugging in realtime-capable models. + +## API Reference – Voice +- [Voice pipeline API](https://openai.github.io/openai-agents-python/ref/voice/pipeline/): Programmatic control over the voice pipeline and event flow. +- [Voice workflow helpers](https://openai.github.io/openai-agents-python/ref/voice/workflow/): Orchestrate conversational voice workflows. +- [Voice input models](https://openai.github.io/openai-agents-python/ref/voice/input/): Structured representations of microphone and streaming audio input. +- [Voice result models](https://openai.github.io/openai-agents-python/ref/voice/result/): Output schema for voice responses, transcripts, and tool invocations. +- [Voice pipeline config](https://openai.github.io/openai-agents-python/ref/voice/pipeline_config/): Configuration options for buffer sizes, concurrency, and model routing. +- [Voice events](https://openai.github.io/openai-agents-python/ref/voice/events/): Event payloads describing voice session updates. +- [Voice exceptions](https://openai.github.io/openai-agents-python/ref/voice/exceptions/): Exception types for voice pipelines and error handling guidance. +- [Voice model adapters](https://openai.github.io/openai-agents-python/ref/voice/model/): Interfaces for voice-enabled models and synthesis engines. +- [Voice utility helpers](https://openai.github.io/openai-agents-python/ref/voice/utils/): Audio conversion, streaming helpers, and testing utilities. +- [OpenAI voice provider](https://openai.github.io/openai-agents-python/ref/voice/models/openai_provider/): Adapter for OpenAI voice models. +- [OpenAI speech-to-text provider](https://openai.github.io/openai-agents-python/ref/voice/models/openai_stt/): Integration for STT models used in the pipeline. +- [OpenAI text-to-speech provider](https://openai.github.io/openai-agents-python/ref/voice/models/openai_tts/): Adapter for OpenAI TTS output. + +## API Reference – Extensions +- [Handoff filters extension](https://openai.github.io/openai-agents-python/ref/extensions/handoff_filters/): Build filters that decide whether to trigger a handoff. +- [Handoff prompt extension](https://openai.github.io/openai-agents-python/ref/extensions/handoff_prompt/): Customize prompt templates used when transferring control. +- [LiteLLM extension](https://openai.github.io/openai-agents-python/ref/extensions/litellm/): Adapter for using LiteLLM-managed providers inside the SDK. +- [SQLAlchemy session memory](https://openai.github.io/openai-agents-python/ref/extensions/memory/sqlalchemy_session/): Persist agent session history to SQL databases. + +## Optional +- [Japanese documentation](https://openai.github.io/openai-agents-python/ja/): Localized guides mirroring the core English documentation. +- [GitHub repository](https://github.com/openai/openai-agents-python): Source code, issues, and contribution resources. +- [Agents SDK package on PyPI](https://pypi.org/project/openai-agents/): Distribution page with installation command and release history. diff --git a/docs/llms.txt b/docs/llms.txt new file mode 100644 index 000000000..d7dc81c7c --- /dev/null +++ b/docs/llms.txt @@ -0,0 +1,60 @@ +# OpenAI Agents SDK Documentation + +> Official documentation for building production-ready agentic applications with the OpenAI Agents SDK, a Python toolkit that equips LLM-powered assistants with tools, guardrails, handoffs, sessions, tracing, voice, and realtime capabilities. + +The SDK focuses on a concise set of primitives so you can orchestrate multi-agent workflows without heavy abstractions. These pages explain how to install the library, design agents, coordinate tools, handle results, and extend the platform to new modalities. + +## Start Here +- [Overview](https://openai.github.io/openai-agents-python/): Learn the core primitives—agents, handoffs, guardrails, sessions, and tracing—and see a minimal hello-world example. +- [Quickstart](https://openai.github.io/openai-agents-python/quickstart/): Step-by-step setup for installing the package, configuring API keys, and running your first agent locally. +- [Example Gallery](https://openai.github.io/openai-agents-python/examples/): Task-oriented examples that demonstrate agent loops, tool usage, guardrails, and integration patterns. + +## Core Concepts +- [Agents](https://openai.github.io/openai-agents-python/agents/): Configure agent instructions, tools, guardrails, memory, and streaming behavior. +- [Running agents](https://openai.github.io/openai-agents-python/running_agents/): Learn synchronous, asynchronous, and batched execution, plus cancellation and error handling. +- [Sessions](https://openai.github.io/openai-agents-python/sessions/): Manage stateful conversations with automatic history persistence and memory controls. +- [Results](https://openai.github.io/openai-agents-python/results/): Inspect agent outputs, tool calls, follow-up actions, and metadata returned by the runner. +- [Streaming](https://openai.github.io/openai-agents-python/streaming/): Stream intermediate tool usage and LLM responses for responsive UIs. +- [REPL](https://openai.github.io/openai-agents-python/repl/): Use the interactive runner to prototype agents and inspect execution step by step. +- [Context strategies](https://openai.github.io/openai-agents-python/context/): Control what past messages, attachments, and tool runs are injected into prompts. + +## Coordination and Safety +- [Handoffs](https://openai.github.io/openai-agents-python/handoffs/): Delegate tasks between agents with intent classification, argument passing, and return values. +- [Multi-agent patterns](https://openai.github.io/openai-agents-python/multi_agent/): Architect teams of agents that collaborate, escalate, or specialize by capability. +- [Guardrails](https://openai.github.io/openai-agents-python/guardrails/): Define validators that run alongside the agent loop to enforce business and safety rules. +- [Tools](https://openai.github.io/openai-agents-python/tools/): Register Python callables as structured tools, manage schemas, and work with tool contexts. +- [Model Context Protocol](https://openai.github.io/openai-agents-python/mcp/): Connect MCP servers so agents can request external data or actions through standardized tool APIs. + +## Operations and Configuration +- [Usage and pricing](https://openai.github.io/openai-agents-python/usage/): Understand token accounting, usage metrics, and cost estimation. +- [Configuration](https://openai.github.io/openai-agents-python/config/): Tune model selection, retry logic, rate limits, and runner policies for production workloads. +- [Visualization](https://openai.github.io/openai-agents-python/visualization/): Embed tracing dashboards and visualize agent runs directly in notebooks and web apps. + +## Observability and Tracing +- [Tracing](https://openai.github.io/openai-agents-python/tracing/): Capture spans for every agent step, emit data to OpenAI traces, and integrate third-party processors. + +## Modalities and Interfaces +- [Voice quickstart](https://openai.github.io/openai-agents-python/voice/quickstart/): Build speech-enabled agents with streaming transcription and TTS. +- [Voice pipeline](https://openai.github.io/openai-agents-python/voice/pipeline/): Customize audio ingestion, tool execution, and response rendering. +- [Realtime quickstart](https://openai.github.io/openai-agents-python/realtime/quickstart/): Stand up low-latency realtime agents with WebRTC and websocket transports. +- [Realtime guide](https://openai.github.io/openai-agents-python/realtime/guide/): Deep dive into session lifecycle, event formats, and concurrency patterns. + +## API Reference Highlights +- [Agents API index](https://openai.github.io/openai-agents-python/ref/index/): Entry point for class and function documentation throughout the SDK. +- [Agent lifecycle](https://openai.github.io/openai-agents-python/ref/lifecycle/): Understand the runner, evaluation phases, and callbacks triggered during execution. +- [Runs and sessions](https://openai.github.io/openai-agents-python/ref/run/): API for launching runs, streaming updates, and handling cancellations. +- [Results objects](https://openai.github.io/openai-agents-python/ref/result/): Data structures returned from agent runs, including final output and tool calls. +- [Tool interfaces](https://openai.github.io/openai-agents-python/ref/tool/): Create tools, parse arguments, and manage tool execution contexts. +- [Tracing APIs](https://openai.github.io/openai-agents-python/ref/tracing/index/): Programmatic interfaces for creating traces, spans, and integrating custom processors. +- [Realtime APIs](https://openai.github.io/openai-agents-python/ref/realtime/agent/): Classes for realtime agents, runners, sessions, and event payloads. +- [Voice APIs](https://openai.github.io/openai-agents-python/ref/voice/pipeline/): Configure voice pipelines, inputs, events, and model adapters. +- [Extensions](https://openai.github.io/openai-agents-python/ref/extensions/handoff_filters/): Extend the SDK with custom handoff filters, prompts, LiteLLM integration, and SQLAlchemy session memory. + +## Models and Providers +- [Model catalog](https://openai.github.io/openai-agents-python/models/): Overview of supported model families and configuration guidance. +- [LiteLLM integration](https://openai.github.io/openai-agents-python/models/litellm/): Configure LiteLLM as a provider to fan out across multiple model backends. + +## Optional +- [Release notes](https://openai.github.io/openai-agents-python/release/): Track SDK changes, migration notes, and deprecations. +- [Japanese documentation](https://openai.github.io/openai-agents-python/ja/): Localized overview and quickstart for Japanese-speaking developers. +- [Repository on GitHub](https://github.com/openai/openai-agents-python): Source code, issues, and contribution guidelines for the SDK. diff --git a/docs/mcp.md b/docs/mcp.md index eef61a047..4ee7b5781 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -1,187 +1,342 @@ # Model context protocol (MCP) -The [Model context protocol](https://modelcontextprotocol.io/introduction) (aka MCP) is a way to provide tools and context to the LLM. From the MCP docs: +The [Model context protocol](https://modelcontextprotocol.io/introduction) (MCP) standardises how applications expose tools and +context to language models. From the official documentation: -> MCP is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications. Just as USB-C provides a standardized way to connect your devices to various peripherals and accessories, MCP provides a standardized way to connect AI models to different data sources and tools. +> MCP is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI +> applications. Just as USB-C provides a standardized way to connect your devices to various peripherals and accessories, MCP +> provides a standardized way to connect AI models to different data sources and tools. -The Agents SDK has support for MCP. This enables you to use a wide range of MCP servers to provide tools and prompts to your Agents. +The Agents Python SDK understands multiple MCP transports. This lets you reuse existing MCP servers or build your own to expose +filesystem, HTTP, or connector backed tools to an agent. -## MCP servers +## Choosing an MCP integration -Currently, the MCP spec defines three kinds of servers, based on the transport mechanism they use: +Before wiring an MCP server into an agent decide where the tool calls should execute and which transports you can reach. The +matrix below summarises the options that the Python SDK supports. -1. **stdio** servers run as a subprocess of your application. You can think of them as running "locally". -2. **HTTP over SSE** servers run remotely. You connect to them via a URL. -3. **Streamable HTTP** servers run remotely using the Streamable HTTP transport defined in the MCP spec. +| What you need | Recommended option | +| ------------------------------------------------------------------------------------ | ----------------------------------------------------- | +| Let OpenAI's Responses API call a publicly reachable MCP server on the model's behalf| **Hosted MCP server tools** via [`HostedMCPTool`][agents.tool.HostedMCPTool] | +| Connect to Streamable HTTP servers that you run locally or remotely | **Streamable HTTP MCP servers** via [`MCPServerStreamableHttp`][agents.mcp.server.MCPServerStreamableHttp] | +| Talk to servers that implement HTTP with Server-Sent Events | **HTTP with SSE MCP servers** via [`MCPServerSse`][agents.mcp.server.MCPServerSse] | +| Launch a local process and communicate over stdin/stdout | **stdio MCP servers** via [`MCPServerStdio`][agents.mcp.server.MCPServerStdio] | -You can use the [`MCPServerStdio`][agents.mcp.server.MCPServerStdio], [`MCPServerSse`][agents.mcp.server.MCPServerSse], and [`MCPServerStreamableHttp`][agents.mcp.server.MCPServerStreamableHttp] classes to connect to these servers. +The sections below walk through each option, how to configure it, and when to prefer one transport over another. -For example, this is how you'd use the [official MCP filesystem server](https://www.npmjs.com/package/@modelcontextprotocol/server-filesystem). +## 1. Hosted MCP server tools + +Hosted tools push the entire tool round-trip into OpenAI's infrastructure. Instead of your code listing and calling tools, the +[`HostedMCPTool`][agents.tool.HostedMCPTool] forwards a server label (and optional connector metadata) to the Responses API. The +model lists the remote server's tools and invokes them without an extra callback to your Python process. Hosted tools currently +work with OpenAI models that support the Responses API's hosted MCP integration. + +### Basic hosted MCP tool + +Create a hosted tool by adding a [`HostedMCPTool`][agents.tool.HostedMCPTool] to the agent's `tools` list. The `tool_config` +dict mirrors the JSON you would send to the REST API: ```python -from agents.run_context import RunContextWrapper +import asyncio + +from agents import Agent, HostedMCPTool, Runner + +async def main() -> None: + agent = Agent( + name="Assistant", + tools=[ + HostedMCPTool( + tool_config={ + "type": "mcp", + "server_label": "gitmcp", + "server_url": "https://gitmcp.io/openai/codex", + "require_approval": "never", + } + ) + ], + ) -async with MCPServerStdio( - params={ - "command": "npx", - "args": ["-y", "@modelcontextprotocol/server-filesystem", samples_dir], - } -) as server: - # Note: In practice, you typically add the server to an Agent - # and let the framework handle tool listing automatically. - # Direct calls to list_tools() require run_context and agent parameters. - run_context = RunContextWrapper(context=None) - agent = Agent(name="test", instructions="test") - tools = await server.list_tools(run_context, agent) + result = await Runner.run(agent, "Which language is this repository written in?") + print(result.final_output) + +asyncio.run(main()) ``` -## Using MCP servers +The hosted server exposes its tools automatically; you do not add it to `mcp_servers`. -MCP servers can be added to Agents. The Agents SDK will call `list_tools()` on the MCP servers each time the Agent is run. This makes the LLM aware of the MCP server's tools. When the LLM calls a tool from an MCP server, the SDK calls `call_tool()` on that server. +### Streaming hosted MCP results + +Hosted tools support streaming results in exactly the same way as function tools. Pass `stream=True` to `Runner.run_streamed` to +consume incremental MCP output while the model is still working: + +```python +result = Runner.run_streamed(agent, "Summarise this repository's top languages") +async for event in result.stream_events(): + if event.type == "run_item_stream_event": + print(f"Received: {event.item}") +print(result.final_output) +``` + +### Optional approval flows + +If a server can perform sensitive operations you can require human or programmatic approval before each tool execution. Configure +`require_approval` in the `tool_config` with either a single policy (`"always"`, `"never"`) or a dict mapping tool names to +policies. To make the decision inside Python, provide an `on_approval_request` callback. ```python +from agents import MCPToolApprovalFunctionResult, MCPToolApprovalRequest + +SAFE_TOOLS = {"read_project_metadata"} + +def approve_tool(request: MCPToolApprovalRequest) -> MCPToolApprovalFunctionResult: + if request.data.name in SAFE_TOOLS: + return {"approve": True} + return {"approve": False, "reason": "Escalate to a human reviewer"} -agent=Agent( +agent = Agent( name="Assistant", - instructions="Use the tools to achieve the task", - mcp_servers=[mcp_server_1, mcp_server_2] + tools=[ + HostedMCPTool( + tool_config={ + "type": "mcp", + "server_label": "gitmcp", + "server_url": "https://gitmcp.io/openai/codex", + "require_approval": "always", + }, + on_approval_request=approve_tool, + ) + ], ) ``` -## Tool filtering +The callback can be synchronous or asynchronous and is invoked whenever the model needs approval data to keep running. -You can filter which tools are available to your Agent by configuring tool filters on MCP servers. The SDK supports both static and dynamic tool filtering. +### Connector-backed hosted servers -### Static tool filtering +Hosted MCP also supports OpenAI connectors. Instead of specifying a `server_url`, supply a `connector_id` and an access token. The +Responses API handles authentication and the hosted server exposes the connector's tools. + +```python +import os + +HostedMCPTool( + tool_config={ + "type": "mcp", + "server_label": "google_calendar", + "connector_id": "connector_googlecalendar", + "authorization": os.environ["GOOGLE_CALENDAR_AUTHORIZATION"], + "require_approval": "never", + } +) +``` + +Fully working hosted tool samples—including streaming, approvals, and connectors—live in +[`examples/hosted_mcp`](https://github.com/openai/openai-agents-python/tree/main/examples/hosted_mcp). + +## 2. Streamable HTTP MCP servers -For simple allow/block lists, you can use static filtering: +When you want to manage the network connection yourself, use +[`MCPServerStreamableHttp`][agents.mcp.server.MCPServerStreamableHttp]. Streamable HTTP servers are ideal when you control the +transport or want to run the server inside your own infrastructure while keeping latency low. ```python -from agents.mcp import create_static_tool_filter +import asyncio +import os + +from agents import Agent, Runner +from agents.mcp import MCPServerStreamableHttp +from agents.model_settings import ModelSettings + +async def main() -> None: + token = os.environ["MCP_SERVER_TOKEN"] + async with MCPServerStreamableHttp( + name="Streamable HTTP Python Server", + params={ + "url": "http://localhost:8000/mcp", + "headers": {"Authorization": f"Bearer {token}"}, + "timeout": 10, + }, + cache_tools_list=True, + max_retry_attempts=3, + ) as server: + agent = Agent( + name="Assistant", + instructions="Use the MCP tools to answer the questions.", + mcp_servers=[server], + model_settings=ModelSettings(tool_choice="required"), + ) + + result = await Runner.run(agent, "Add 7 and 22.") + print(result.final_output) + +asyncio.run(main()) +``` + +The constructor accepts additional options: -# Only expose specific tools from this server -server = MCPServerStdio( +- `client_session_timeout_seconds` controls HTTP read timeouts. +- `use_structured_content` toggles whether `tool_result.structured_content` is preferred over textual output. +- `max_retry_attempts` and `retry_backoff_seconds_base` add automatic retries for `list_tools()` and `call_tool()`. +- `tool_filter` lets you expose only a subset of tools (see [Tool filtering](#tool-filtering)). + +## 3. HTTP with SSE MCP servers + +If the MCP server implements the HTTP with SSE transport, instantiate +[`MCPServerSse`][agents.mcp.server.MCPServerSse]. Apart from the transport, the API is identical to the Streamable HTTP server. + +```python + +from agents import Agent, Runner +from agents.model_settings import ModelSettings +from agents.mcp import MCPServerSse + +workspace_id = "demo-workspace" + +async with MCPServerSse( + name="SSE Python Server", params={ - "command": "npx", - "args": ["-y", "@modelcontextprotocol/server-filesystem", samples_dir], + "url": "http://localhost:8000/sse", + "headers": {"X-Workspace": workspace_id}, }, - tool_filter=create_static_tool_filter( - allowed_tool_names=["read_file", "write_file"] + cache_tools_list=True, +) as server: + agent = Agent( + name="Assistant", + mcp_servers=[server], + model_settings=ModelSettings(tool_choice="required"), ) -) + result = await Runner.run(agent, "What's the weather in Tokyo?") + print(result.final_output) +``` + +## 4. stdio MCP servers + +For MCP servers that run as local subprocesses, use [`MCPServerStdio`][agents.mcp.server.MCPServerStdio]. The SDK spawns the +process, keeps the pipes open, and closes them automatically when the context manager exits. This option is helpful for quick +proofs of concept or when the server only exposes a command line entry point. + +```python +from pathlib import Path +from agents import Agent, Runner +from agents.mcp import MCPServerStdio + +current_dir = Path(__file__).parent +samples_dir = current_dir / "sample_files" -# Exclude specific tools from this server -server = MCPServerStdio( +async with MCPServerStdio( + name="Filesystem Server via npx", params={ - "command": "npx", - "args": ["-y", "@modelcontextprotocol/server-filesystem", samples_dir], + "command": "npx", + "args": ["-y", "@modelcontextprotocol/server-filesystem", str(samples_dir)], }, - tool_filter=create_static_tool_filter( - blocked_tool_names=["delete_file"] +) as server: + agent = Agent( + name="Assistant", + instructions="Use the files in the sample directory to answer questions.", + mcp_servers=[server], ) -) - + result = await Runner.run(agent, "List the files available to you.") + print(result.final_output) ``` -**When both `allowed_tool_names` and `blocked_tool_names` are configured, the processing order is:** -1. First apply `allowed_tool_names` (allowlist) - only keep the specified tools -2. Then apply `blocked_tool_names` (blocklist) - exclude specified tools from the remaining tools +## Tool filtering -For example, if you configure `allowed_tool_names=["read_file", "write_file", "delete_file"]` and `blocked_tool_names=["delete_file"]`, only `read_file` and `write_file` tools will be available. +Each MCP server supports tool filters so that you can expose only the functions that your agent needs. Filtering can happen at +construction time or dynamically per run. -### Dynamic tool filtering +### Static tool filtering -For more complex filtering logic, you can use dynamic filters with functions: +Use [`create_static_tool_filter`][agents.mcp.create_static_tool_filter] to configure simple allow/block lists: ```python -from agents.mcp import ToolFilterContext - -# Simple synchronous filter -def custom_filter(context: ToolFilterContext, tool) -> bool: - """Example of a custom tool filter.""" - # Filter logic based on tool name patterns - return tool.name.startswith("allowed_prefix") - -# Context-aware filter -def context_aware_filter(context: ToolFilterContext, tool) -> bool: - """Filter tools based on context information.""" - # Access agent information - agent_name = context.agent.name - - # Access server information - server_name = context.server_name - - # Implement your custom filtering logic here - return some_filtering_logic(agent_name, server_name, tool) - -# Asynchronous filter -async def async_filter(context: ToolFilterContext, tool) -> bool: - """Example of an asynchronous filter.""" - # Perform async operations if needed - result = await some_async_check(context, tool) - return result - -server = MCPServerStdio( +from pathlib import Path + +from agents.mcp import MCPServerStdio, create_static_tool_filter + +samples_dir = Path("/path/to/files") + +filesystem_server = MCPServerStdio( params={ "command": "npx", - "args": ["-y", "@modelcontextprotocol/server-filesystem", samples_dir], + "args": ["-y", "@modelcontextprotocol/server-filesystem", str(samples_dir)], }, - tool_filter=custom_filter # or context_aware_filter or async_filter + tool_filter=create_static_tool_filter(allowed_tool_names=["read_file", "write_file"]), ) ``` -The `ToolFilterContext` provides access to: -- `run_context`: The current run context -- `agent`: The agent requesting the tools -- `server_name`: The name of the MCP server +When both `allowed_tool_names` and `blocked_tool_names` are supplied the SDK applies the allow-list first and then removes any +blocked tools from the remaining set. -## Prompts +### Dynamic tool filtering -MCP servers can also provide prompts that can be used to dynamically generate agent instructions. This allows you to create reusable instruction templates that can be customized with parameters. +For more elaborate logic pass a callable that receives a [`ToolFilterContext`][agents.mcp.ToolFilterContext]. The callable can be +synchronous or asynchronous and returns `True` when the tool should be exposed. -### Using prompts +```python +from pathlib import Path + +from agents.mcp import MCPServerStdio, ToolFilterContext + +samples_dir = Path("/path/to/files") -MCP servers that support prompts provide two key methods: +async def context_aware_filter(context: ToolFilterContext, tool) -> bool: + if context.agent.name == "Code Reviewer" and tool.name.startswith("danger_"): + return False + return True + +async with MCPServerStdio( + params={ + "command": "npx", + "args": ["-y", "@modelcontextprotocol/server-filesystem", str(samples_dir)], + }, + tool_filter=context_aware_filter, +) as server: + ... +``` -- `list_prompts()`: Lists all available prompts on the server -- `get_prompt(name, arguments)`: Gets a specific prompt with optional parameters +The filter context exposes the active `run_context`, the `agent` requesting the tools, and the `server_name`. + +## Prompts + +MCP servers can also provide prompts that dynamically generate agent instructions. Servers that support prompts expose two +methods: + +- `list_prompts()` enumerates the available prompt templates. +- `get_prompt(name, arguments)` fetches a concrete prompt, optionally with parameters. ```python -# List available prompts -prompts_result = await server.list_prompts() -for prompt in prompts_result.prompts: - print(f"Prompt: {prompt.name} - {prompt.description}") +from agents import Agent -# Get a specific prompt with parameters prompt_result = await server.get_prompt( "generate_code_review_instructions", - {"focus": "security vulnerabilities", "language": "python"} + {"focus": "security vulnerabilities", "language": "python"}, ) instructions = prompt_result.messages[0].content.text -# Use the prompt-generated instructions with an Agent agent = Agent( name="Code Reviewer", - instructions=instructions, # Instructions from MCP prompt - mcp_servers=[server] + instructions=instructions, + mcp_servers=[server], ) ``` ## Caching -Every time an Agent runs, it calls `list_tools()` on the MCP server. This can be a latency hit, especially if the server is a remote server. To automatically cache the list of tools, you can pass `cache_tools_list=True` to [`MCPServerStdio`][agents.mcp.server.MCPServerStdio], [`MCPServerSse`][agents.mcp.server.MCPServerSse], and [`MCPServerStreamableHttp`][agents.mcp.server.MCPServerStreamableHttp]. You should only do this if you're certain the tool list will not change. - -If you want to invalidate the cache, you can call `invalidate_tools_cache()` on the servers. - -## End-to-end examples - -View complete working examples at [examples/mcp](https://github.com/openai/openai-agents-python/tree/main/examples/mcp). +Every agent run calls `list_tools()` on each MCP server. Remote servers can introduce noticeable latency, so all of the MCP +server classes expose a `cache_tools_list` option. Set it to `True` only if you are confident that the tool definitions do not +change frequently. To force a fresh list later, call `invalidate_tools_cache()` on the server instance. ## Tracing -[Tracing](./tracing.md) automatically captures MCP operations, including: +[Tracing](./tracing.md) automatically captures MCP activity, including: -1. Calls to the MCP server to list tools -2. MCP-related info on function calls +1. Calls to the MCP server to list tools. +2. MCP-related information on tool calls. ![MCP Tracing Screenshot](./assets/images/mcp-tracing.jpg) + +## Further reading + +- [Model Context Protocol](https://modelcontextprotocol.io/) – the specification and design guides. +- [examples/mcp](https://github.com/openai/openai-agents-python/tree/main/examples/mcp) – runnable stdio, SSE, and Streamable HTTP samples. +- [examples/hosted_mcp](https://github.com/openai/openai-agents-python/tree/main/examples/hosted_mcp) – complete hosted MCP demonstrations including approvals and connectors. diff --git a/docs/models/index.md b/docs/models/index.md index b3b2b7f0b..ca3a2bbf3 100644 --- a/docs/models/index.md +++ b/docs/models/index.md @@ -5,6 +5,47 @@ The Agents SDK comes with out-of-the-box support for OpenAI models in two flavor - **Recommended**: the [`OpenAIResponsesModel`][agents.models.openai_responses.OpenAIResponsesModel], which calls OpenAI APIs using the new [Responses API](https://platform.openai.com/docs/api-reference/responses). - The [`OpenAIChatCompletionsModel`][agents.models.openai_chatcompletions.OpenAIChatCompletionsModel], which calls OpenAI APIs using the [Chat Completions API](https://platform.openai.com/docs/api-reference/chat). +## OpenAI models + +When you don't specify a model when initializing an `Agent`, the default model will be used. The default is currently [`gpt-4.1`](https://platform.openai.com/docs/models/gpt-4.1), which offers a strong balance of predictability for agentic workflows and low latency. + +If you want to switch to other models like [`gpt-5`](https://platform.openai.com/docs/models/gpt-5), follow the steps in the next section. + +### Default OpenAI model + +If you want to consistently use a specific model for all agents that do not set a custom model, set the `OPENAI_DEFAULT_MODEL` environment variable before running your agents. + +```bash +export OPENAI_DEFAULT_MODEL=gpt-5 +python3 my_awesome_agent.py +``` + +#### GPT-5 models + +When you use any of GPT-5's reasoning models ([`gpt-5`](https://platform.openai.com/docs/models/gpt-5), [`gpt-5-mini`](https://platform.openai.com/docs/models/gpt-5-mini), or [`gpt-5-nano`](https://platform.openai.com/docs/models/gpt-5-nano)) this way, the SDK applies sensible `ModelSettings` by default. Specifically, it sets both `reasoning.effort` and `verbosity` to `"low"`. If you want to build these settings yourself, call `agents.models.get_default_model_settings("gpt-5")`. + +For lower latency or specific requirements, you can choose a different model and settings. To adjust the reasoning effort for the default model, pass your own `ModelSettings`: + +```python +from openai.types.shared import Reasoning +from agents import Agent, ModelSettings + +my_agent = Agent( + name="My Agent", + instructions="You're a helpful agent.", + model_settings=ModelSettings(reasoning=Reasoning(effort="minimal"), verbosity="low") + # If OPENAI_DEFAULT_MODEL=gpt-5 is set, passing only model_settings works. + # It's also fine to pass a GPT-5 model name explicitly: + # model="gpt-5", +) +``` + +Specifically for lower latency, using either [`gpt-5-mini`](https://platform.openai.com/docs/models/gpt-5-mini) or [`gpt-5-nano`](https://platform.openai.com/docs/models/gpt-5-nano) model with `reasoning.effort="minimal"` will often return responses faster than the default settings. However, some built-in tools (such as file search and image generation) in Responses API do not support `"minimal"` reasoning effort, which is why this Agents SDK defaults to `"low"`. + +#### Non-GPT-5 models + +If you pass a non–GPT-5 model name without custom `model_settings`, the SDK reverts to generic `ModelSettings` compatible with any model. + ## Non-OpenAI models You can use most other non-OpenAI models via the [LiteLLM integration](./litellm.md). First, install the litellm dependency group: @@ -53,14 +94,14 @@ import asyncio spanish_agent = Agent( name="Spanish agent", instructions="You only speak Spanish.", - model="o3-mini", # (1)! + model="gpt-5-mini", # (1)! ) english_agent = Agent( name="English agent", instructions="You only speak English", model=OpenAIChatCompletionsModel( # (2)! - model="gpt-4o", + model="gpt-5-nano", openai_client=AsyncOpenAI() ), ) @@ -69,7 +110,7 @@ triage_agent = Agent( name="Triage agent", instructions="Handoff to the appropriate agent based on the language of the request.", handoffs=[spanish_agent, english_agent], - model="gpt-3.5-turbo", + model="gpt-5", ) async def main(): @@ -88,7 +129,7 @@ from agents import Agent, ModelSettings english_agent = Agent( name="English agent", instructions="You only speak English", - model="gpt-4o", + model="gpt-4.1", model_settings=ModelSettings(temperature=0.1), ) ``` @@ -101,7 +142,7 @@ from agents import Agent, ModelSettings english_agent = Agent( name="English agent", instructions="You only speak English", - model="gpt-4o", + model="gpt-4.1", model_settings=ModelSettings( temperature=0.1, extra_args={"service_tier": "flex", "user": "user_12345"}, diff --git a/docs/models/litellm.md b/docs/models/litellm.md index 90572a28c..08263feef 100644 --- a/docs/models/litellm.md +++ b/docs/models/litellm.md @@ -71,3 +71,20 @@ if __name__ == "__main__": asyncio.run(main(model, api_key)) ``` + +## Tracking usage data + +If you want LiteLLM responses to populate the Agents SDK usage metrics, pass `ModelSettings(include_usage=True)` when creating your agent. + +```python +from agents import Agent, ModelSettings +from agents.extensions.models.litellm_model import LitellmModel + +agent = Agent( + name="Assistant", + model=LitellmModel(model="your/model", api_key="..."), + model_settings=ModelSettings(include_usage=True), +) +``` + +With `include_usage=True`, LiteLLM requests report token and request counts through `result.context_wrapper.usage` just like the built-in OpenAI models. diff --git a/docs/quickstart.md b/docs/quickstart.md index 213d16e5d..b5bc7177d 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -97,6 +97,7 @@ You can define custom guardrails to run on the input or output. from agents import GuardrailFunctionOutput, Agent, Runner from pydantic import BaseModel + class HomeworkOutput(BaseModel): is_homework: bool reasoning: str @@ -122,6 +123,7 @@ Let's put it all together and run the entire workflow, using handoffs and the in ```python from agents import Agent, InputGuardrail, GuardrailFunctionOutput, Runner +from agents.exceptions import InputGuardrailTripwireTriggered from pydantic import BaseModel import asyncio @@ -166,11 +168,19 @@ triage_agent = Agent( ) async def main(): - result = await Runner.run(triage_agent, "who was the first president of the united states?") - print(result.final_output) - - result = await Runner.run(triage_agent, "what is life") - print(result.final_output) + # Example 1: History question + try: + result = await Runner.run(triage_agent, "who was the first president of the united states?") + print(result.final_output) + except InputGuardrailTripwireTriggered as e: + print("Guardrail blocked this input:", e) + + # Example 2: General/philosophical question + try: + result = await Runner.run(triage_agent, "What is the meaning of life?") + print(result.final_output) + except InputGuardrailTripwireTriggered as e: + print("Guardrail blocked this input:", e) if __name__ == "__main__": asyncio.run(main()) diff --git a/docs/realtime/guide.md b/docs/realtime/guide.md new file mode 100644 index 000000000..3e36a6b1f --- /dev/null +++ b/docs/realtime/guide.md @@ -0,0 +1,172 @@ +# Guide + +This guide provides an in-depth look at building voice-enabled AI agents using the OpenAI Agents SDK's realtime capabilities. + +!!! warning "Beta feature" +Realtime agents are in beta. Expect some breaking changes as we improve the implementation. + +## Overview + +Realtime agents allow for conversational flows, processing audio and text inputs in real time and responding with realtime audio. They maintain persistent connections with OpenAI's Realtime API, enabling natural voice conversations with low latency and the ability to handle interruptions gracefully. + +## Architecture + +### Core Components + +The realtime system consists of several key components: + +- **RealtimeAgent**: An agent, configured with instructions, tools and handoffs. +- **RealtimeRunner**: Manages configuration. You can call `runner.run()` to get a session. +- **RealtimeSession**: A single interaction session. You typically create one each time a user starts a conversation, and keep it alive until the conversation is done. +- **RealtimeModel**: The underlying model interface (typically OpenAI's WebSocket implementation) + +### Session flow + +A typical realtime session follows this flow: + +1. **Create your RealtimeAgent(s)** with instructions, tools and handoffs. +2. **Set up a RealtimeRunner** with the agent and configuration options +3. **Start the session** using `await runner.run()` which returns a RealtimeSession. +4. **Send audio or text messages** to the session using `send_audio()` or `send_message()` +5. **Listen for events** by iterating over the session - events include audio output, transcripts, tool calls, handoffs, and errors +6. **Handle interruptions** when users speak over the agent, which automatically stops current audio generation + +The session maintains the conversation history and manages the persistent connection with the realtime model. + +## Agent configuration + +RealtimeAgent works similarly to the regular Agent class with some key differences. For full API details, see the [`RealtimeAgent`][agents.realtime.agent.RealtimeAgent] API reference. + +Key differences from regular agents: + +- Model choice is configured at the session level, not the agent level. +- No structured output support (`outputType` is not supported). +- Voice can be configured per agent but cannot be changed after the first agent speaks. +- All other features like tools, handoffs, and instructions work the same way. + +## Session configuration + +### Model settings + +The session configuration allows you to control the underlying realtime model behavior. You can configure the model name (such as `gpt-realtime`), voice selection (alloy, echo, fable, onyx, nova, shimmer), and supported modalities (text and/or audio). Audio formats can be set for both input and output, with PCM16 being the default. + +### Audio configuration + +Audio settings control how the session handles voice input and output. You can configure input audio transcription using models like Whisper, set language preferences, and provide transcription prompts to improve accuracy for domain-specific terms. Turn detection settings control when the agent should start and stop responding, with options for voice activity detection thresholds, silence duration, and padding around detected speech. + +## Tools and Functions + +### Adding Tools + +Just like regular agents, realtime agents support function tools that execute during conversations: + +```python +from agents import function_tool + +@function_tool +def get_weather(city: str) -> str: + """Get current weather for a city.""" + # Your weather API logic here + return f"The weather in {city} is sunny, 72°F" + +@function_tool +def book_appointment(date: str, time: str, service: str) -> str: + """Book an appointment.""" + # Your booking logic here + return f"Appointment booked for {service} on {date} at {time}" + +agent = RealtimeAgent( + name="Assistant", + instructions="You can help with weather and appointments.", + tools=[get_weather, book_appointment], +) +``` + +## Handoffs + +### Creating Handoffs + +Handoffs allow transferring conversations between specialized agents. + +```python +from agents.realtime import realtime_handoff + +# Specialized agents +billing_agent = RealtimeAgent( + name="Billing Support", + instructions="You specialize in billing and payment issues.", +) + +technical_agent = RealtimeAgent( + name="Technical Support", + instructions="You handle technical troubleshooting.", +) + +# Main agent with handoffs +main_agent = RealtimeAgent( + name="Customer Service", + instructions="You are the main customer service agent. Hand off to specialists when needed.", + handoffs=[ + realtime_handoff(billing_agent, tool_description="Transfer to billing support"), + realtime_handoff(technical_agent, tool_description="Transfer to technical support"), + ] +) +``` + +## Event handling + +The session streams events that you can listen to by iterating over the session object. Events include audio output chunks, transcription results, tool execution start and end, agent handoffs, and errors. Key events to handle include: + +- **audio**: Raw audio data from the agent's response +- **audio_end**: Agent finished speaking +- **audio_interrupted**: User interrupted the agent +- **tool_start/tool_end**: Tool execution lifecycle +- **handoff**: Agent handoff occurred +- **error**: Error occurred during processing + +For complete event details, see [`RealtimeSessionEvent`][agents.realtime.events.RealtimeSessionEvent]. + +## Guardrails + +Only output guardrails are supported for realtime agents. These guardrails are debounced and run periodically (not on every word) to avoid performance issues during real-time generation. The default debounce length is 100 characters, but this is configurable. + +Guardrails can be attached directly to a `RealtimeAgent` or provided via the session's `run_config`. Guardrails from both sources run together. + +```python +from agents.guardrail import GuardrailFunctionOutput, OutputGuardrail + +def sensitive_data_check(context, agent, output): + return GuardrailFunctionOutput( + tripwire_triggered="password" in output, + output_info=None, + ) + +agent = RealtimeAgent( + name="Assistant", + instructions="...", + output_guardrails=[OutputGuardrail(guardrail_function=sensitive_data_check)], +) +``` + +When a guardrail is triggered, it generates a `guardrail_tripped` event and can interrupt the agent's current response. The debounce behavior helps balance safety with real-time performance requirements. Unlike text agents, realtime agents do **not** raise an Exception when guardrails are tripped. + +## Audio processing + +Send audio to the session using [`session.send_audio(audio_bytes)`][agents.realtime.session.RealtimeSession.send_audio] or send text using [`session.send_message()`][agents.realtime.session.RealtimeSession.send_message]. + +For audio output, listen for `audio` events and play the audio data through your preferred audio library. Make sure to listen for `audio_interrupted` events to stop playback immediately and clear any queued audio when the user interrupts the agent. + +## Direct model access + +You can access the underlying model to add custom listeners or perform advanced operations: + +```python +# Add a custom listener to the model +session.model.add_listener(my_custom_listener) +``` + +This gives you direct access to the [`RealtimeModel`][agents.realtime.model.RealtimeModel] interface for advanced use cases where you need lower-level control over the connection. + +## Examples + +For complete working examples, check out the [examples/realtime directory](https://github.com/openai/openai-agents-python/tree/main/examples/realtime) which includes demos with and without UI components. diff --git a/docs/realtime/quickstart.md b/docs/realtime/quickstart.md new file mode 100644 index 000000000..a88cdbf22 --- /dev/null +++ b/docs/realtime/quickstart.md @@ -0,0 +1,228 @@ +# Quickstart + +Realtime agents enable voice conversations with your AI agents using OpenAI's Realtime API. This guide walks you through creating your first realtime voice agent. + +!!! warning "Beta feature" +Realtime agents are in beta. Expect some breaking changes as we improve the implementation. + +## Prerequisites + +- Python 3.9 or higher +- OpenAI API key +- Basic familiarity with the OpenAI Agents SDK + +## Installation + +If you haven't already, install the OpenAI Agents SDK: + +```bash +pip install openai-agents +``` + +## Creating your first realtime agent + +### 1. Import required components + +```python +import asyncio +from agents.realtime import RealtimeAgent, RealtimeRunner +``` + +### 2. Create a realtime agent + +```python +agent = RealtimeAgent( + name="Assistant", + instructions="You are a helpful voice assistant. Keep your responses conversational and friendly.", +) +``` + +### 3. Set up the runner + +```python +runner = RealtimeRunner( + starting_agent=agent, + config={ + "model_settings": { + "model_name": "gpt-realtime", + "voice": "ash", + "modalities": ["audio"], + "input_audio_format": "pcm16", + "output_audio_format": "pcm16", + "input_audio_transcription": {"model": "gpt-4o-mini-transcribe"}, + "turn_detection": {"type": "semantic_vad", "interrupt_response": True}, + } + } +) +``` + +### 4. Start a session + +```python +# Start the session +session = await runner.run() + +async with session: + print("Session started! The agent will stream audio responses in real-time.") + # Process events + async for event in session: + try: + if event.type == "agent_start": + print(f"Agent started: {event.agent.name}") + elif event.type == "agent_end": + print(f"Agent ended: {event.agent.name}") + elif event.type == "handoff": + print(f"Handoff from {event.from_agent.name} to {event.to_agent.name}") + elif event.type == "tool_start": + print(f"Tool started: {event.tool.name}") + elif event.type == "tool_end": + print(f"Tool ended: {event.tool.name}; output: {event.output}") + elif event.type == "audio_end": + print("Audio ended") + elif event.type == "audio": + # Enqueue audio for callback-based playback with metadata + # Non-blocking put; queue is unbounded, so drops won’t occur. + pass + elif event.type == "audio_interrupted": + print("Audio interrupted") + # Begin graceful fade + flush in the audio callback and rebuild jitter buffer. + elif event.type == "error": + print(f"Error: {event.error}") + elif event.type == "history_updated": + pass # Skip these frequent events + elif event.type == "history_added": + pass # Skip these frequent events + elif event.type == "raw_model_event": + print(f"Raw model event: {_truncate_str(str(event.data), 200)}") + else: + print(f"Unknown event type: {event.type}") + except Exception as e: + print(f"Error processing event: {_truncate_str(str(e), 200)}") + +def _truncate_str(s: str, max_length: int) -> str: + if len(s) > max_length: + return s[:max_length] + "..." + return s +``` + +## Complete example + +Here's a complete working example: + +```python +import asyncio +from agents.realtime import RealtimeAgent, RealtimeRunner + +async def main(): + # Create the agent + agent = RealtimeAgent( + name="Assistant", + instructions="You are a helpful voice assistant. Keep responses brief and conversational.", + ) + # Set up the runner with configuration + runner = RealtimeRunner( + starting_agent=agent, + config={ + "model_settings": { + "model_name": "gpt-realtime", + "voice": "ash", + "modalities": ["audio"], + "input_audio_format": "pcm16", + "output_audio_format": "pcm16", + "input_audio_transcription": {"model": "gpt-4o-mini-transcribe"}, + "turn_detection": {"type": "semantic_vad", "interrupt_response": True}, + } + }, + ) + # Start the session + session = await runner.run() + + async with session: + print("Session started! The agent will stream audio responses in real-time.") + # Process events + async for event in session: + try: + if event.type == "agent_start": + print(f"Agent started: {event.agent.name}") + elif event.type == "agent_end": + print(f"Agent ended: {event.agent.name}") + elif event.type == "handoff": + print(f"Handoff from {event.from_agent.name} to {event.to_agent.name}") + elif event.type == "tool_start": + print(f"Tool started: {event.tool.name}") + elif event.type == "tool_end": + print(f"Tool ended: {event.tool.name}; output: {event.output}") + elif event.type == "audio_end": + print("Audio ended") + elif event.type == "audio": + # Enqueue audio for callback-based playback with metadata + # Non-blocking put; queue is unbounded, so drops won’t occur. + pass + elif event.type == "audio_interrupted": + print("Audio interrupted") + # Begin graceful fade + flush in the audio callback and rebuild jitter buffer. + elif event.type == "error": + print(f"Error: {event.error}") + elif event.type == "history_updated": + pass # Skip these frequent events + elif event.type == "history_added": + pass # Skip these frequent events + elif event.type == "raw_model_event": + print(f"Raw model event: {_truncate_str(str(event.data), 200)}") + else: + print(f"Unknown event type: {event.type}") + except Exception as e: + print(f"Error processing event: {_truncate_str(str(e), 200)}") + +def _truncate_str(s: str, max_length: int) -> str: + if len(s) > max_length: + return s[:max_length] + "..." + return s + +if __name__ == "__main__": + # Run the session + asyncio.run(main()) +``` + +## Configuration options + +### Model settings + +- `model_name`: Choose from available realtime models (e.g., `gpt-realtime`) +- `voice`: Select voice (`alloy`, `echo`, `fable`, `onyx`, `nova`, `shimmer`) +- `modalities`: Enable text or audio (`["text"]` or `["audio"]`) + +### Audio settings + +- `input_audio_format`: Format for input audio (`pcm16`, `g711_ulaw`, `g711_alaw`) +- `output_audio_format`: Format for output audio +- `input_audio_transcription`: Transcription configuration + +### Turn detection + +- `type`: Detection method (`server_vad`, `semantic_vad`) +- `threshold`: Voice activity threshold (0.0-1.0) +- `silence_duration_ms`: Silence duration to detect turn end +- `prefix_padding_ms`: Audio padding before speech + +## Next steps + +- [Learn more about realtime agents](guide.md) +- Check out working examples in the [examples/realtime](https://github.com/openai/openai-agents-python/tree/main/examples/realtime) folder +- Add tools to your agent +- Implement handoffs between agents +- Set up guardrails for safety + +## Authentication + +Make sure your OpenAI API key is set in your environment: + +```bash +export OPENAI_API_KEY="your-api-key-here" +``` + +Or pass it directly when creating the session: + +```python +session = await runner.run(model_config={"api_key": "your-api-key"}) +``` diff --git a/docs/ref/computer.md b/docs/ref/computer.md new file mode 100644 index 000000000..44a3b616f --- /dev/null +++ b/docs/ref/computer.md @@ -0,0 +1,3 @@ +# `Computer` + +::: agents.computer diff --git a/docs/ref/extensions/memory/advanced_sqlite_session.md b/docs/ref/extensions/memory/advanced_sqlite_session.md new file mode 100644 index 000000000..ee2c95434 --- /dev/null +++ b/docs/ref/extensions/memory/advanced_sqlite_session.md @@ -0,0 +1,3 @@ +# `AdvancedSQLiteSession` + +::: agents.extensions.memory.advanced_sqlite_session.AdvancedSQLiteSession \ No newline at end of file diff --git a/docs/ref/extensions/memory/encrypt_session.md b/docs/ref/extensions/memory/encrypt_session.md new file mode 100644 index 000000000..0bfacd99d --- /dev/null +++ b/docs/ref/extensions/memory/encrypt_session.md @@ -0,0 +1,3 @@ +# `EncryptedSession` + +::: agents.extensions.memory.encrypt_session.EncryptedSession diff --git a/docs/ref/extensions/memory/redis_session.md b/docs/ref/extensions/memory/redis_session.md new file mode 100644 index 000000000..886145e73 --- /dev/null +++ b/docs/ref/extensions/memory/redis_session.md @@ -0,0 +1,3 @@ +# `RedisSession` + +::: agents.extensions.memory.redis_session.RedisSession \ No newline at end of file diff --git a/docs/ref/extensions/memory/sqlalchemy_session.md b/docs/ref/extensions/memory/sqlalchemy_session.md new file mode 100644 index 000000000..b34dbbdeb --- /dev/null +++ b/docs/ref/extensions/memory/sqlalchemy_session.md @@ -0,0 +1,3 @@ +# `SQLAlchemySession` + +::: agents.extensions.memory.sqlalchemy_session.SQLAlchemySession diff --git a/docs/ref/extensions/models/litellm_model.md b/docs/ref/extensions/models/litellm_model.md new file mode 100644 index 000000000..a635daeb3 --- /dev/null +++ b/docs/ref/extensions/models/litellm_model.md @@ -0,0 +1,3 @@ +# `LiteLLM Model` + +::: agents.extensions.models.litellm_model diff --git a/docs/ref/extensions/models/litellm_provider.md b/docs/ref/extensions/models/litellm_provider.md new file mode 100644 index 000000000..0bb5083c5 --- /dev/null +++ b/docs/ref/extensions/models/litellm_provider.md @@ -0,0 +1,3 @@ +# `LiteLLM Provider` + +::: agents.extensions.models.litellm_provider diff --git a/docs/ref/extensions/visualization.md b/docs/ref/extensions/visualization.md new file mode 100644 index 000000000..d38006eb0 --- /dev/null +++ b/docs/ref/extensions/visualization.md @@ -0,0 +1,3 @@ +# `Visualization` + +::: agents.extensions.visualization diff --git a/docs/ref/logger.md b/docs/ref/logger.md new file mode 100644 index 000000000..dffdb2052 --- /dev/null +++ b/docs/ref/logger.md @@ -0,0 +1,3 @@ +# `Logger` + +::: agents.logger diff --git a/docs/ref/memory.md b/docs/ref/memory.md index 04a2258bf..eb78a51a5 100644 --- a/docs/ref/memory.md +++ b/docs/ref/memory.md @@ -6,3 +6,4 @@ members: - Session - SQLiteSession + - OpenAIConversationsSession diff --git a/docs/ref/memory/openai_conversations_session.md b/docs/ref/memory/openai_conversations_session.md new file mode 100644 index 000000000..961aeb76c --- /dev/null +++ b/docs/ref/memory/openai_conversations_session.md @@ -0,0 +1,3 @@ +# `Openai Conversations Session` + +::: agents.memory.openai_conversations_session diff --git a/docs/ref/memory/session.md b/docs/ref/memory/session.md new file mode 100644 index 000000000..37a0d50f1 --- /dev/null +++ b/docs/ref/memory/session.md @@ -0,0 +1,3 @@ +# `Session` + +::: agents.memory.session diff --git a/docs/ref/memory/sqlite_session.md b/docs/ref/memory/sqlite_session.md new file mode 100644 index 000000000..fec38c811 --- /dev/null +++ b/docs/ref/memory/sqlite_session.md @@ -0,0 +1,3 @@ +# `Sqlite Session` + +::: agents.memory.sqlite_session diff --git a/docs/ref/memory/util.md b/docs/ref/memory/util.md new file mode 100644 index 000000000..90a8d72ad --- /dev/null +++ b/docs/ref/memory/util.md @@ -0,0 +1,3 @@ +# `Util` + +::: agents.memory.util diff --git a/docs/ref/models/chatcmpl_converter.md b/docs/ref/models/chatcmpl_converter.md new file mode 100644 index 000000000..536018dbb --- /dev/null +++ b/docs/ref/models/chatcmpl_converter.md @@ -0,0 +1,3 @@ +# `Chatcmpl Converter` + +::: agents.models.chatcmpl_converter diff --git a/docs/ref/models/chatcmpl_helpers.md b/docs/ref/models/chatcmpl_helpers.md new file mode 100644 index 000000000..bf386f640 --- /dev/null +++ b/docs/ref/models/chatcmpl_helpers.md @@ -0,0 +1,3 @@ +# `Chatcmpl Helpers` + +::: agents.models.chatcmpl_helpers diff --git a/docs/ref/models/chatcmpl_stream_handler.md b/docs/ref/models/chatcmpl_stream_handler.md new file mode 100644 index 000000000..44ad50038 --- /dev/null +++ b/docs/ref/models/chatcmpl_stream_handler.md @@ -0,0 +1,3 @@ +# `Chatcmpl Stream Handler` + +::: agents.models.chatcmpl_stream_handler diff --git a/docs/ref/models/default_models.md b/docs/ref/models/default_models.md new file mode 100644 index 000000000..de0169ad1 --- /dev/null +++ b/docs/ref/models/default_models.md @@ -0,0 +1,3 @@ +# `Default Models` + +::: agents.models.default_models diff --git a/docs/ref/models/fake_id.md b/docs/ref/models/fake_id.md new file mode 100644 index 000000000..887cc8042 --- /dev/null +++ b/docs/ref/models/fake_id.md @@ -0,0 +1,3 @@ +# `Fake Id` + +::: agents.models.fake_id diff --git a/docs/ref/models/multi_provider.md b/docs/ref/models/multi_provider.md new file mode 100644 index 000000000..dc07cfba7 --- /dev/null +++ b/docs/ref/models/multi_provider.md @@ -0,0 +1,3 @@ +# `Multi Provider` + +::: agents.models.multi_provider diff --git a/docs/ref/models/openai_provider.md b/docs/ref/models/openai_provider.md new file mode 100644 index 000000000..ae713138c --- /dev/null +++ b/docs/ref/models/openai_provider.md @@ -0,0 +1,3 @@ +# `OpenAI Provider` + +::: agents.models.openai_provider diff --git a/docs/ref/prompts.md b/docs/ref/prompts.md new file mode 100644 index 000000000..80e0fb4e8 --- /dev/null +++ b/docs/ref/prompts.md @@ -0,0 +1,3 @@ +# `Prompts` + +::: agents.prompts diff --git a/docs/ref/realtime/agent.md b/docs/ref/realtime/agent.md new file mode 100644 index 000000000..d90833920 --- /dev/null +++ b/docs/ref/realtime/agent.md @@ -0,0 +1,3 @@ +# `RealtimeAgent` + +::: agents.realtime.agent.RealtimeAgent \ No newline at end of file diff --git a/docs/ref/realtime/audio_formats.md b/docs/ref/realtime/audio_formats.md new file mode 100644 index 000000000..5b5505ec0 --- /dev/null +++ b/docs/ref/realtime/audio_formats.md @@ -0,0 +1,3 @@ +# `Audio Formats` + +::: agents.realtime.audio_formats diff --git a/docs/ref/realtime/config.md b/docs/ref/realtime/config.md new file mode 100644 index 000000000..2445c6a34 --- /dev/null +++ b/docs/ref/realtime/config.md @@ -0,0 +1,42 @@ +# Realtime Configuration + +## Run Configuration + +::: agents.realtime.config.RealtimeRunConfig + +## Model Settings + +::: agents.realtime.config.RealtimeSessionModelSettings + +## Audio Configuration + +::: agents.realtime.config.RealtimeInputAudioTranscriptionConfig +::: agents.realtime.config.RealtimeInputAudioNoiseReductionConfig +::: agents.realtime.config.RealtimeTurnDetectionConfig + +## Guardrails Settings + +::: agents.realtime.config.RealtimeGuardrailsSettings + +## Model Configuration + +::: agents.realtime.model.RealtimeModelConfig + +## Tracing Configuration + +::: agents.realtime.config.RealtimeModelTracingConfig + +## User Input Types + +::: agents.realtime.config.RealtimeUserInput +::: agents.realtime.config.RealtimeUserInputText +::: agents.realtime.config.RealtimeUserInputMessage + +## Client Messages + +::: agents.realtime.config.RealtimeClientMessage + +## Type Aliases + +::: agents.realtime.config.RealtimeModelName +::: agents.realtime.config.RealtimeAudioFormat \ No newline at end of file diff --git a/docs/ref/realtime/events.md b/docs/ref/realtime/events.md new file mode 100644 index 000000000..137d9a643 --- /dev/null +++ b/docs/ref/realtime/events.md @@ -0,0 +1,36 @@ +# Realtime Events + +## Session Events + +::: agents.realtime.events.RealtimeSessionEvent + +## Event Types + +### Agent Events +::: agents.realtime.events.RealtimeAgentStartEvent +::: agents.realtime.events.RealtimeAgentEndEvent + +### Audio Events +::: agents.realtime.events.RealtimeAudio +::: agents.realtime.events.RealtimeAudioEnd +::: agents.realtime.events.RealtimeAudioInterrupted + +### Tool Events +::: agents.realtime.events.RealtimeToolStart +::: agents.realtime.events.RealtimeToolEnd + +### Handoff Events +::: agents.realtime.events.RealtimeHandoffEvent + +### Guardrail Events +::: agents.realtime.events.RealtimeGuardrailTripped + +### History Events +::: agents.realtime.events.RealtimeHistoryAdded +::: agents.realtime.events.RealtimeHistoryUpdated + +### Error Events +::: agents.realtime.events.RealtimeError + +### Raw Model Events +::: agents.realtime.events.RealtimeRawModelEvent \ No newline at end of file diff --git a/docs/ref/realtime/handoffs.md b/docs/ref/realtime/handoffs.md new file mode 100644 index 000000000..f85b010d7 --- /dev/null +++ b/docs/ref/realtime/handoffs.md @@ -0,0 +1,3 @@ +# `Handoffs` + +::: agents.realtime.handoffs diff --git a/docs/ref/realtime/items.md b/docs/ref/realtime/items.md new file mode 100644 index 000000000..49b48cc2e --- /dev/null +++ b/docs/ref/realtime/items.md @@ -0,0 +1,3 @@ +# `Items` + +::: agents.realtime.items diff --git a/docs/ref/realtime/model.md b/docs/ref/realtime/model.md new file mode 100644 index 000000000..c0d529cae --- /dev/null +++ b/docs/ref/realtime/model.md @@ -0,0 +1,3 @@ +# `Model` + +::: agents.realtime.model diff --git a/docs/ref/realtime/model_events.md b/docs/ref/realtime/model_events.md new file mode 100644 index 000000000..833b4dcef --- /dev/null +++ b/docs/ref/realtime/model_events.md @@ -0,0 +1,3 @@ +# `Model Events` + +::: agents.realtime.model_events diff --git a/docs/ref/realtime/model_inputs.md b/docs/ref/realtime/model_inputs.md new file mode 100644 index 000000000..27023cdfd --- /dev/null +++ b/docs/ref/realtime/model_inputs.md @@ -0,0 +1,3 @@ +# `Model Inputs` + +::: agents.realtime.model_inputs diff --git a/docs/ref/realtime/openai_realtime.md b/docs/ref/realtime/openai_realtime.md new file mode 100644 index 000000000..075bef650 --- /dev/null +++ b/docs/ref/realtime/openai_realtime.md @@ -0,0 +1,3 @@ +# `Openai Realtime` + +::: agents.realtime.openai_realtime diff --git a/docs/ref/realtime/runner.md b/docs/ref/realtime/runner.md new file mode 100644 index 000000000..b2d26bba5 --- /dev/null +++ b/docs/ref/realtime/runner.md @@ -0,0 +1,3 @@ +# `RealtimeRunner` + +::: agents.realtime.runner.RealtimeRunner \ No newline at end of file diff --git a/docs/ref/realtime/session.md b/docs/ref/realtime/session.md new file mode 100644 index 000000000..52ad0b09e --- /dev/null +++ b/docs/ref/realtime/session.md @@ -0,0 +1,3 @@ +# `RealtimeSession` + +::: agents.realtime.session.RealtimeSession \ No newline at end of file diff --git a/docs/ref/strict_schema.md b/docs/ref/strict_schema.md new file mode 100644 index 000000000..0ac0d964f --- /dev/null +++ b/docs/ref/strict_schema.md @@ -0,0 +1,3 @@ +# `Strict Schema` + +::: agents.strict_schema diff --git a/docs/ref/tool_context.md b/docs/ref/tool_context.md new file mode 100644 index 000000000..ea7b51a64 --- /dev/null +++ b/docs/ref/tool_context.md @@ -0,0 +1,3 @@ +# `Tool Context` + +::: agents.tool_context diff --git a/docs/ref/tool_guardrails.md b/docs/ref/tool_guardrails.md new file mode 100644 index 000000000..bc3639304 --- /dev/null +++ b/docs/ref/tool_guardrails.md @@ -0,0 +1,3 @@ +# `Tool Guardrails` + +::: agents.tool_guardrails diff --git a/docs/ref/tracing/logger.md b/docs/ref/tracing/logger.md new file mode 100644 index 000000000..0fb0c6245 --- /dev/null +++ b/docs/ref/tracing/logger.md @@ -0,0 +1,3 @@ +# `Logger` + +::: agents.tracing.logger diff --git a/docs/ref/tracing/provider.md b/docs/ref/tracing/provider.md new file mode 100644 index 000000000..f4c83b4e9 --- /dev/null +++ b/docs/ref/tracing/provider.md @@ -0,0 +1,3 @@ +# `Provider` + +::: agents.tracing.provider diff --git a/docs/ref/version.md b/docs/ref/version.md new file mode 100644 index 000000000..f2aeac9ea --- /dev/null +++ b/docs/ref/version.md @@ -0,0 +1,3 @@ +# `Version` + +::: agents.version diff --git a/docs/ref/voice/imports.md b/docs/ref/voice/imports.md new file mode 100644 index 000000000..dc781cc5b --- /dev/null +++ b/docs/ref/voice/imports.md @@ -0,0 +1,3 @@ +# `Imports` + +::: agents.voice.imports diff --git a/docs/ref/voice/models/openai_model_provider.md b/docs/ref/voice/models/openai_model_provider.md new file mode 100644 index 000000000..20ef17dd6 --- /dev/null +++ b/docs/ref/voice/models/openai_model_provider.md @@ -0,0 +1,3 @@ +# `OpenAI Model Provider` + +::: agents.voice.models.openai_model_provider diff --git a/docs/release.md b/docs/release.md index 8498c8b17..f0509b298 100644 --- a/docs/release.md +++ b/docs/release.md @@ -19,6 +19,14 @@ We will increment `Z` for non-breaking changes: ## Breaking change changelog +### 0.4.0 + +In this version, [openai](https://pypi.org/project/openai/) package v1.x versions are no longer supported. Please use openai v2.x along with this SDK. + +### 0.3.0 + +In this version, the Realtime API support migrates to gpt-realtime model and its API interface (GA version). + ### 0.2.0 In this version, a few places that used to take `Agent` as an arg, now take `AgentBase` as an arg instead. For example, the `list_tools()` call in MCP servers. This is a purely typing change, you will still receive `Agent` objects. To update, just fix type errors by replacing `Agent` with `AgentBase`. diff --git a/docs/repl.md b/docs/repl.md index 073b87f51..aeb518be2 100644 --- a/docs/repl.md +++ b/docs/repl.md @@ -1,6 +1,7 @@ # REPL utility -The SDK provides `run_demo_loop` for quick interactive testing. +The SDK provides `run_demo_loop` for quick, interactive testing of an agent's behavior directly in your terminal. + ```python import asyncio @@ -14,6 +15,6 @@ if __name__ == "__main__": asyncio.run(main()) ``` -`run_demo_loop` prompts for user input in a loop, keeping the conversation -history between turns. By default it streams model output as it is produced. -Type `quit` or `exit` (or press `Ctrl-D`) to leave the loop. +`run_demo_loop` prompts for user input in a loop, keeping the conversation history between turns. By default, it streams model output as it is produced. When you run the example above, run_demo_loop starts an interactive chat session. It continuously asks for your input, remembers the entire conversation history between turns (so your agent knows what's been discussed) and automatically streams the agent's responses to you in real-time as they are generated. + +To end this chat session, simply type `quit` or `exit` (and press Enter) or use the `Ctrl-D` keyboard shortcut. diff --git a/docs/running_agents.md b/docs/running_agents.md index 6898f5101..ab69d8463 100644 --- a/docs/running_agents.md +++ b/docs/running_agents.md @@ -16,7 +16,7 @@ async def main(): print(result.final_output) # Code within the code, # Functions calling themselves, - # Infinite loop's dance. + # Infinite loop's dance ``` Read more in the [results guide](results.md). @@ -40,7 +40,7 @@ The runner then runs a loop: ## Streaming -Streaming allows you to additionally receive streaming events as the LLM runs. Once the stream is done, the [`RunResultStreaming`][agents.result.RunResultStreaming] will contain the complete information about the run, including all the new outputs produces. You can call `.stream_events()` for the streaming events. Read more in the [streaming guide](streaming.md). +Streaming allows you to additionally receive streaming events as the LLM runs. Once the stream is done, the [`RunResultStreaming`][agents.result.RunResultStreaming] will contain the complete information about the run, including all the new outputs produced. You can call `.stream_events()` for the streaming events. Read more in the [streaming guide](streaming.md). ## Run config @@ -73,6 +73,7 @@ You can manually manage conversation history using the [`RunResultBase.to_input_ async def main(): agent = Agent(name="Assistant", instructions="Reply very concisely.") + thread_id = "thread_123" # Example thread ID with trace(workflow_name="Conversation", group_id=thread_id): # First turn result = await Runner.run(agent, "What city is the Golden Gate Bridge in?") @@ -88,7 +89,7 @@ async def main(): ### Automatic conversation management with Sessions -For a simpler approach, you can use [Sessions](sessions.md) to automatically handle conversation history without manually calling `.to_input_list()`: +For a simpler approach, you can use [Sessions](sessions/index.md) to automatically handle conversation history without manually calling `.to_input_list()`: ```python from agents import Agent, Runner, SQLiteSession @@ -99,6 +100,7 @@ async def main(): # Create session instance session = SQLiteSession("conversation_123") + thread_id = "thread_123" # Example thread ID with trace(workflow_name="Conversation", group_id=thread_id): # First turn result = await Runner.run(agent, "What city is the Golden Gate Bridge in?", session=session) @@ -117,14 +119,85 @@ Sessions automatically: - Stores new messages after each run - Maintains separate conversations for different session IDs -See the [Sessions documentation](sessions.md) for more details. +See the [Sessions documentation](sessions/index.md) for more details. + + +### Server-managed conversations + +You can also let the OpenAI conversation state feature manage conversation state on the server side, instead of handling it locally with `to_input_list()` or `Sessions`. This allows you to preserve conversation history without manually resending all past messages. See the [OpenAI Conversation state guide](https://platform.openai.com/docs/guides/conversation-state?api-mode=responses) for more details. + +OpenAI provides two ways to track state across turns: + +#### 1. Using `conversation_id` + +You first create a conversation using the OpenAI Conversations API and then reuse its ID for every subsequent call: + +```python +from agents import Agent, Runner +from openai import AsyncOpenAI + +client = AsyncOpenAI() + +async def main(): + # Create a server-managed conversation + conversation = await client.conversations.create() + conv_id = conversation.id + + agent = Agent(name="Assistant", instructions="Reply very concisely.") + + # First turn + result1 = await Runner.run(agent, "What city is the Golden Gate Bridge in?", conversation_id=conv_id) + print(result1.final_output) + # San Francisco + + # Second turn reuses the same conversation_id + result2 = await Runner.run( + agent, + "What state is it in?", + conversation_id=conv_id, + ) + print(result2.final_output) + # California +``` + +#### 2. Using `previous_response_id` + +Another option is **response chaining**, where each turn links explicitly to the response ID from the previous turn. + +```python +from agents import Agent, Runner + +async def main(): + agent = Agent(name="Assistant", instructions="Reply very concisely.") + + # First turn + result1 = await Runner.run(agent, "What city is the Golden Gate Bridge in?") + print(result1.final_output) + # San Francisco + + # Second turn, chained to the previous response + result2 = await Runner.run( + agent, + "What state is it in?", + previous_response_id=result1.last_response_id, + ) + print(result2.final_output) + # California +``` + + +## Long running agents & human-in-the-loop + +You can use the Agents SDK [Temporal](https://temporal.io/) integration to run durable, long-running workflows, including human-in-the-loop tasks. View a demo of Temporal and the Agents SDK working in action to complete long-running tasks [in this video](https://www.youtube.com/watch?v=fFBZqzT4DD8), and [view docs here](https://github.com/temporalio/sdk-python/tree/main/temporalio/contrib/openai_agents). ## Exceptions The SDK raises exceptions in certain cases. The full list is in [`agents.exceptions`][]. As an overview: -- [`AgentsException`][agents.exceptions.AgentsException] is the base class for all exceptions raised in the SDK. -- [`MaxTurnsExceeded`][agents.exceptions.MaxTurnsExceeded] is raised when the run exceeds the `max_turns` passed to the run methods. -- [`ModelBehaviorError`][agents.exceptions.ModelBehaviorError] is raised when the model produces invalid outputs, e.g. malformed JSON or using non-existent tools. -- [`UserError`][agents.exceptions.UserError] is raised when you (the person writing code using the SDK) make an error using the SDK. -- [`InputGuardrailTripwireTriggered`][agents.exceptions.InputGuardrailTripwireTriggered], [`OutputGuardrailTripwireTriggered`][agents.exceptions.OutputGuardrailTripwireTriggered] is raised when a [guardrail](guardrails.md) is tripped. +- [`AgentsException`][agents.exceptions.AgentsException]: This is the base class for all exceptions raised within the SDK. It serves as a generic type from which all other specific exceptions are derived. +- [`MaxTurnsExceeded`][agents.exceptions.MaxTurnsExceeded]: This exception is raised when the agent's run exceeds the `max_turns` limit passed to the `Runner.run`, `Runner.run_sync`, or `Runner.run_streamed` methods. It indicates that the agent could not complete its task within the specified number of interaction turns. +- [`ModelBehaviorError`][agents.exceptions.ModelBehaviorError]: This exception occurs when the underlying model (LLM) produces unexpected or invalid outputs. This can include: + - Malformed JSON: When the model provides a malformed JSON structure for tool calls or in its direct output, especially if a specific `output_type` is defined. + - Unexpected tool-related failures: When the model fails to use tools in an expected manner +- [`UserError`][agents.exceptions.UserError]: This exception is raised when you (the person writing code using the SDK) make an error while using the SDK. This typically results from incorrect code implementation, invalid configuration, or misuse of the SDK's API. +- [`InputGuardrailTripwireTriggered`][agents.exceptions.InputGuardrailTripwireTriggered], [`OutputGuardrailTripwireTriggered`][agents.exceptions.OutputGuardrailTripwireTriggered]: This exception is raised when the conditions of an input guardrail or output guardrail are met, respectively. Input guardrails check incoming messages before processing, while output guardrails check the agent's final response before delivery. \ No newline at end of file diff --git a/docs/scripts/generate_ref_files.py b/docs/scripts/generate_ref_files.py new file mode 100644 index 000000000..84ecdf148 --- /dev/null +++ b/docs/scripts/generate_ref_files.py @@ -0,0 +1,78 @@ +#!/usr/bin/env python +""" +generate_ref_files.py + +Create missing Markdown reference stubs for mkdocstrings. + +Usage: + python scripts/generate_ref_files.py +""" + +from pathlib import Path +from string import capwords + +# ---- Paths ----------------------------------------------------------- + +REPO_ROOT = Path(__file__).resolve().parent.parent.parent # adjust if layout differs +SRC_ROOT = REPO_ROOT / "src" / "agents" # source tree to scan +DOCS_ROOT = REPO_ROOT / "docs" / "ref" # where stubs go + +# ---- Helpers --------------------------------------------------------- + + +def to_identifier(py_path: Path) -> str: + """Convert src/agents/foo/bar.py -> 'agents.foo.bar'.""" + rel = py_path.relative_to(SRC_ROOT).with_suffix("") # drop '.py' + return ".".join(("agents", *rel.parts)) + + +def md_target(py_path: Path) -> Path: + """Return docs/ref/.../*.md path corresponding to py_path.""" + rel = py_path.relative_to(SRC_ROOT).with_suffix(".md") + return DOCS_ROOT / rel + + +def pretty_title(last_segment: str) -> str: + """ + Convert a module/file segment like 'tool_context' to 'Tool Context'. + Handles underscores and hyphens; leaves camelCase as‑is except first‑letter cap. + """ + cleaned = last_segment.replace("_", " ").replace("-", " ") + return capwords(cleaned) + + +# ---- Main ------------------------------------------------------------ + + +def main() -> None: + if not SRC_ROOT.exists(): + raise SystemExit(f"Source path not found: {SRC_ROOT}") + + created = 0 + for py_file in SRC_ROOT.rglob("*.py"): + if py_file.name.startswith("_"): # skip private files + continue + md_path = md_target(py_file) + if md_path.exists(): + continue # keep existing + md_path.parent.mkdir(parents=True, exist_ok=True) + + identifier = to_identifier(py_file) + title = pretty_title(identifier.split(".")[-1]) # last segment + + md_content = f"""# `{title}` + +::: {identifier} +""" + md_path.write_text(md_content, encoding="utf-8") + created += 1 + print(f"Created {md_path.relative_to(REPO_ROOT)}") + + if created == 0: + print("All reference files were already present.") + else: + print(f"Done. {created} new file(s) created.") + + +if __name__ == "__main__": + main() diff --git a/docs/scripts/translate_docs.py b/docs/scripts/translate_docs.py index ac40b6fa8..b2b619ec9 100644 --- a/docs/scripts/translate_docs.py +++ b/docs/scripts/translate_docs.py @@ -9,7 +9,7 @@ # logging.basicConfig(level=logging.INFO) # logging.getLogger("openai").setLevel(logging.DEBUG) -OPENAI_MODEL = os.environ.get("OPENAI_MODEL", "o3") +OPENAI_MODEL = os.environ.get("OPENAI_MODEL", "gpt-5") ENABLE_CODE_SNIPPET_EXCLUSION = True # gpt-4.5 needed this for better quality @@ -26,11 +26,14 @@ source_dir = "docs" languages = { "ja": "Japanese", + "ko": "Korean", + "zh": "Chinese", # Add more languages here, e.g., "fr": "French" } # Initialize OpenAI client -openai_client = OpenAI(api_key=os.getenv("OPENAI_API_KEY")) +api_key = os.getenv("PROD_OPENAI_API_KEY") or os.getenv("OPENAI_API_KEY") +openai_client = OpenAI(api_key=api_key) # Define dictionaries for translation control do_not_translate = [ @@ -78,6 +81,64 @@ "Python first": "Python ファースト", # Add more Japanese mappings here }, + "ko": { + "agents": "에이전트", + "computer use": "컴퓨터 사용", + "OAI hosted tools": "OpenAI 호스트하는 도구", + "well formed data": "적절한 형식의 데이터", + "guardrail": "가드레일", + "orchestrating multiple agents": "멀티 에이전트 오케스트레이션", + "handoffs": "핸드오프", + "function tools": "함수 도구", + "function calling": "함수 호출", + "tracing": "트레이싱", + "code examples": "코드 예제", + "vector store": "벡터 스토어", + "deep research": "딥 리서치", + "category": "카테고리", + "user": "사용자", + "parameter": "매개변수", + "processor": "프로세서", + "server": "서버", + "web search": "웹 검색", + "file search": "파일 검색", + "streaming": "스트리밍", + "system prompt": "시스템 프롬프트", + "Python-first": "파이썬 우선", + "interruption": "인터럽션(중단 처리)", + "TypeScript-first": "TypeScript 우선", + "Human in the loop": "휴먼인더루프 (HITL)", + "Hosted tool": "호스티드 툴", + "Hosted MCP server tools": "호스티드 MCP 서버 도구", + "raw": "원문", + "Realtime Agents": "실시간 에이전트", + "Build your first agent in minutes.": "단 몇 분 만에 첫 에이전트를 만들 수 있습니다", + "Let's build": "시작하기", + }, + "zh": { + "agents": "智能体", + "computer use": "计算机操作", + "OAI hosted tools": "由OpenAI托管的工具", + "well formed data": "格式良好的数据", + "guardrail": "安全防护措施", + "handoffs": "任务转移", + "function tools": "工具调用", + "tracing": "追踪", + "code examples": "代码示例", + "vector store": "向量存储", + "deep research": "深度研究", + "category": "目录", + "user": "用户", + "parameter": "参数", + "processor": "进程", + "server": "服务", + "web search": "网络检索", + "file search": "文件检索", + "streaming": "流式传输", + "system prompt": "系统提示词", + "Python first": "Python 优先", + # Add more mappings here + }, # Add more languages here } eng_to_non_eng_instructions = { @@ -86,6 +147,7 @@ "* The term 'primitives' can be translated as basic components.", "* When the terms 'instructions' and 'tools' are mentioned as API parameter names, they must be kept as is.", "* The terms 'temperature', 'top_p', 'max_tokens', 'presence_penalty', 'frequency_penalty' as parameter names must be kept as is.", + "* Keep the original structure like `* **The thing**: foo`; this needs to be translated as `* **(translation)**: (translation)`", ], "ja": [ "* The term 'result' in the Runner guide context must be translated like 'execution results'", @@ -93,6 +155,19 @@ "* You must consistently use polite wording such as です/ます rather than である/なのだ.", # Add more Japanese mappings here ], + "ko": [ + "* 공손하고 중립적인 문체(합니다/입니다체)를 일관되게 사용하세요.", + "* 개발자 문서이므로 자연스러운 의역을 허용하되 정확성을 유지하세요.", + "* 'instructions', 'tools' 같은 API 매개변수와 temperature, top_p, max_tokens, presence_penalty, frequency_penalty 등은 영문 그대로 유지하세요.", + "* 문장이 아닌 불릿 항목 끝에는 마침표를 찍지 마세요.", + ], + "zh": [ + "* The term 'examples' must be code examples when the page mentions the code examples in the repo, it can be translated as either 'code examples' or 'sample code'.", + "* The term 'primitives' can be translated as basic components.", + "* When the terms 'instructions' and 'tools' are mentioned as API parameter names, they must be kept as is.", + "* The terms 'temperature', 'top_p', 'max_tokens', 'presence_penalty', 'frequency_penalty' as parameter names must be kept as is.", + "* Keep the original structure like `* **The thing**: foo`; this needs to be translated as `* **(translation)**: (translation)`", + ], # Add more languages here } @@ -134,12 +209,36 @@ def built_instructions(target_language: str, lang_code: str) -> str: - Fenced code blocks delimited by ``` or ~~~, including all comments inside them. - Link URLs inside `[label](URL)` – translate the label, never the URL. +######################### +## HARD CONSTRAINTS ## +######################### +- Never insert spaces immediately inside emphasis markers. Use `**bold**`, not `** bold **`. +- Preserve the number of emphasis markers from the source: if the source uses `**` or `__`, keep the same pair count. +- Ensure one space after heading markers: `##Heading` -> `## Heading`. +- Ensure one space after list markers: `-Item` -> `- Item`, `*Item` -> `* Item` (does not apply to `**`). +- Trim spaces inside link/image labels: `[ Label ](url)` -> `[Label](url)`. + +########################### +## GOOD / BAD EXAMPLES ## +########################### +- Good: This is **bold** text. +- Bad: This is ** bold ** text. +- Good: ## Heading +- Bad: ##Heading +- Good: - Item +- Bad: -Item +- Good: [Label](https://example.com) +- Bad: [ Label ](https://example.com) + ######################### ## LANGUAGE‑SPECIFIC ## ######################### *(applies only when {target_language} = Japanese)* - Insert a half‑width space before and after all alphanumeric terms. - Add a half‑width space just outside markdown emphasis markers: ` **太字** ` (good) vs `** 太字 **` (bad). +*(applies only when {target_language} = Korean)* +- Do not alter spaces around code/identifiers; keep them as in the original. +- Do not add stray spaces around markdown emphasis: `**굵게**` (good) vs `** 굵게 **` (bad). ######################### ## DO NOT TRANSLATE ## @@ -157,6 +256,7 @@ def built_instructions(target_language: str, lang_code: str) -> str: ## EXTRA GUIDELINES ## ######################### {specific_instructions} +- When translating Markdown tables, preserve the exact table structure, including all delimiters (|), header separators (---), and row/column counts. Only translate the cell contents. Do not add, remove, or reorder columns or rows. ######################### ## IF UNSURE ## @@ -171,7 +271,11 @@ def built_instructions(target_language: str, lang_code: str) -> str: 1. Read the input markdown text given by the user. 2. Translate the markdown file into {target_language}, carefully following the requirements above. -3. Perform a self-review to evaluate the quality of the translation, focusing on naturalness, accuracy, and consistency in detail. +3. Perform a self-review to check for the following common issues: + - Naturalness, accuracy, and consistency throughout the text. + - Spacing inside markdown syntax such as `*` or `_`; `**bold**` is correct whereas `** bold **` is not. + - Unwanted spaces inside link or image labels, such as `[ Label ](url)`. + - Headings or list markers missing a space after their marker. 4. If improvements are necessary, refine the content without changing the original meaning. 5. Continue improving the translation until you are fully satisfied with the result. 6. Once the final output is ready, return **only** the translated markdown text. No extra commentary. @@ -206,7 +310,7 @@ def translate_file(file_path: str, target_path: str, lang_code: str) -> None: code_block_chunks.append(line) if in_code_block is True: code_blocks.append("\n".join(code_block_chunks)) - current_chunk.append(f"CODE_BLOCK_{(len(code_blocks) - 1):02}") + current_chunk.append(f"CODE_BLOCK_{(len(code_blocks) - 1):03}") code_block_chunks.clear() in_code_block = not in_code_block continue @@ -221,7 +325,16 @@ def translate_file(file_path: str, target_path: str, lang_code: str) -> None: translated_content: list[str] = [] for chunk in chunks: instructions = built_instructions(languages[lang_code], lang_code) - if OPENAI_MODEL.startswith("o"): + if OPENAI_MODEL.startswith("gpt-5"): + response = openai_client.responses.create( + model=OPENAI_MODEL, + instructions=instructions, + input=chunk, + reasoning={"effort": "low"}, + text={"verbosity": "low"}, + ) + translated_content.append(response.output_text) + elif OPENAI_MODEL.startswith("o"): response = openai_client.responses.create( model=OPENAI_MODEL, instructions=instructions, @@ -239,7 +352,7 @@ def translate_file(file_path: str, target_path: str, lang_code: str) -> None: translated_text = "\n".join(translated_content) for idx, code_block in enumerate(code_blocks): - translated_text = translated_text.replace(f"CODE_BLOCK_{idx:02}", code_block) + translated_text = translated_text.replace(f"CODE_BLOCK_{idx:03}", code_block) # FIXME: enable mkdocs search plugin to seamlessly work with i18n plugin translated_text = SEARCH_EXCLUSION + translated_text diff --git a/docs/sessions/advanced_sqlite_session.md b/docs/sessions/advanced_sqlite_session.md new file mode 100644 index 000000000..ab6bfa5d8 --- /dev/null +++ b/docs/sessions/advanced_sqlite_session.md @@ -0,0 +1,303 @@ +# Advanced SQLite Sessions + +`AdvancedSQLiteSession` is an enhanced version of the basic `SQLiteSession` that provides advanced conversation management capabilities including conversation branching, detailed usage analytics, and structured conversation queries. + +## Features + +- **Conversation branching**: Create alternative conversation paths from any user message +- **Usage tracking**: Detailed token usage analytics per turn with full JSON breakdowns +- **Structured queries**: Get conversations by turns, tool usage statistics, and more +- **Branch management**: Independent branch switching and management +- **Message structure metadata**: Track message types, tool usage, and conversation flow + +## Quick start + +```python +from agents import Agent, Runner +from agents.extensions.memory import AdvancedSQLiteSession + +# Create agent +agent = Agent( + name="Assistant", + instructions="Reply very concisely.", +) + +# Create an advanced session +session = AdvancedSQLiteSession( + session_id="conversation_123", + db_path="conversations.db", + create_tables=True +) + +# First conversation turn +result = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session +) +print(result.final_output) # "San Francisco" + +# IMPORTANT: Store usage data +await session.store_run_usage(result) + +# Continue conversation +result = await Runner.run( + agent, + "What state is it in?", + session=session +) +print(result.final_output) # "California" +await session.store_run_usage(result) +``` + +## Initialization + +```python +from agents.extensions.memory import AdvancedSQLiteSession + +# Basic initialization +session = AdvancedSQLiteSession( + session_id="my_conversation", + create_tables=True # Auto-create advanced tables +) + +# With persistent storage +session = AdvancedSQLiteSession( + session_id="user_123", + db_path="path/to/conversations.db", + create_tables=True +) + +# With custom logger +import logging +logger = logging.getLogger("my_app") +session = AdvancedSQLiteSession( + session_id="session_456", + create_tables=True, + logger=logger +) +``` + +### Parameters + +- `session_id` (str): Unique identifier for the conversation session +- `db_path` (str | Path): Path to SQLite database file. Defaults to `:memory:` for in-memory storage +- `create_tables` (bool): Whether to automatically create the advanced tables. Defaults to `False` +- `logger` (logging.Logger | None): Custom logger for the session. Defaults to module logger + +## Usage tracking + +AdvancedSQLiteSession provides detailed usage analytics by storing token usage data per conversation turn. **This is entirely dependent on the `store_run_usage` method being called after each agent run.** + +### Storing usage data + +```python +# After each agent run, store the usage data +result = await Runner.run(agent, "Hello", session=session) +await session.store_run_usage(result) + +# This stores: +# - Total tokens used +# - Input/output token breakdown +# - Request count +# - Detailed JSON token information (if available) +``` + +### Retrieving usage statistics + +```python +# Get session-level usage (all branches) +session_usage = await session.get_session_usage() +if session_usage: + print(f"Total requests: {session_usage['requests']}") + print(f"Total tokens: {session_usage['total_tokens']}") + print(f"Input tokens: {session_usage['input_tokens']}") + print(f"Output tokens: {session_usage['output_tokens']}") + print(f"Total turns: {session_usage['total_turns']}") + +# Get usage for specific branch +branch_usage = await session.get_session_usage(branch_id="main") + +# Get usage by turn +turn_usage = await session.get_turn_usage() +for turn_data in turn_usage: + print(f"Turn {turn_data['user_turn_number']}: {turn_data['total_tokens']} tokens") + if turn_data['input_tokens_details']: + print(f" Input details: {turn_data['input_tokens_details']}") + if turn_data['output_tokens_details']: + print(f" Output details: {turn_data['output_tokens_details']}") + +# Get usage for specific turn +turn_2_usage = await session.get_turn_usage(user_turn_number=2) +``` + +## Conversation branching + +One of the key features of AdvancedSQLiteSession is the ability to create conversation branches from any user message, allowing you to explore alternative conversation paths. + +### Creating branches + +```python +# Get available turns for branching +turns = await session.get_conversation_turns() +for turn in turns: + print(f"Turn {turn['turn']}: {turn['content']}") + print(f"Can branch: {turn['can_branch']}") + +# Create a branch from turn 2 +branch_id = await session.create_branch_from_turn(2) +print(f"Created branch: {branch_id}") + +# Create a branch with custom name +branch_id = await session.create_branch_from_turn( + 2, + branch_name="alternative_path" +) + +# Create branch by searching for content +branch_id = await session.create_branch_from_content( + "weather", + branch_name="weather_focus" +) +``` + +### Branch management + +```python +# List all branches +branches = await session.list_branches() +for branch in branches: + current = " (current)" if branch["is_current"] else "" + print(f"{branch['branch_id']}: {branch['user_turns']} turns, {branch['message_count']} messages{current}") + +# Switch between branches +await session.switch_to_branch("main") +await session.switch_to_branch(branch_id) + +# Delete a branch +await session.delete_branch(branch_id, force=True) # force=True allows deleting current branch +``` + +### Branch workflow example + +```python +# Original conversation +result = await Runner.run(agent, "What's the capital of France?", session=session) +await session.store_run_usage(result) + +result = await Runner.run(agent, "What's the weather like there?", session=session) +await session.store_run_usage(result) + +# Create branch from turn 2 (weather question) +branch_id = await session.create_branch_from_turn(2, "weather_focus") + +# Continue in new branch with different question +result = await Runner.run( + agent, + "What are the main tourist attractions in Paris?", + session=session +) +await session.store_run_usage(result) + +# Switch back to main branch +await session.switch_to_branch("main") + +# Continue original conversation +result = await Runner.run( + agent, + "How expensive is it to visit?", + session=session +) +await session.store_run_usage(result) +``` + +## Structured queries + +AdvancedSQLiteSession provides several methods for analyzing conversation structure and content. + +### Conversation analysis + +```python +# Get conversation organized by turns +conversation_by_turns = await session.get_conversation_by_turns() +for turn_num, items in conversation_by_turns.items(): + print(f"Turn {turn_num}: {len(items)} items") + for item in items: + if item["tool_name"]: + print(f" - {item['type']} (tool: {item['tool_name']})") + else: + print(f" - {item['type']}") + +# Get tool usage statistics +tool_usage = await session.get_tool_usage() +for tool_name, count, turn in tool_usage: + print(f"{tool_name}: used {count} times in turn {turn}") + +# Find turns by content +matching_turns = await session.find_turns_by_content("weather") +for turn in matching_turns: + print(f"Turn {turn['turn']}: {turn['content']}") +``` + +### Message structure + +The session automatically tracks message structure including: + +- Message types (user, assistant, tool_call, etc.) +- Tool names for tool calls +- Turn numbers and sequence numbers +- Branch associations +- Timestamps + +## Database schema + +AdvancedSQLiteSession extends the basic SQLite schema with two additional tables: + +### message_structure table + +```sql +CREATE TABLE message_structure ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + session_id TEXT NOT NULL, + message_id INTEGER NOT NULL, + branch_id TEXT NOT NULL DEFAULT 'main', + message_type TEXT NOT NULL, + sequence_number INTEGER NOT NULL, + user_turn_number INTEGER, + branch_turn_number INTEGER, + tool_name TEXT, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (session_id) REFERENCES agent_sessions(session_id) ON DELETE CASCADE, + FOREIGN KEY (message_id) REFERENCES agent_messages(id) ON DELETE CASCADE +); +``` + +### turn_usage table + +```sql +CREATE TABLE turn_usage ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + session_id TEXT NOT NULL, + branch_id TEXT NOT NULL DEFAULT 'main', + user_turn_number INTEGER NOT NULL, + requests INTEGER DEFAULT 0, + input_tokens INTEGER DEFAULT 0, + output_tokens INTEGER DEFAULT 0, + total_tokens INTEGER DEFAULT 0, + input_tokens_details JSON, + output_tokens_details JSON, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (session_id) REFERENCES agent_sessions(session_id) ON DELETE CASCADE, + UNIQUE(session_id, branch_id, user_turn_number) +); +``` + +## Complete example + +Check out the [complete example](https://github.com/openai/openai-agents-python/tree/main/examples/memory/advanced_sqlite_session_example.py) for a comprehensive demonstration of all features. + + +## API Reference + +- [`AdvancedSQLiteSession`][agents.extensions.memory.advanced_sqlite_session.AdvancedSQLiteSession] - Main class +- [`Session`][agents.memory.session.Session] - Base session protocol diff --git a/docs/sessions/encrypted_session.md b/docs/sessions/encrypted_session.md new file mode 100644 index 000000000..ba3755ae9 --- /dev/null +++ b/docs/sessions/encrypted_session.md @@ -0,0 +1,175 @@ +# Encrypted Sessions + +`EncryptedSession` provides transparent encryption for any session implementation, securing conversation data with automatic expiration of old items. + +## Features + +- **Transparent encryption**: Wraps any session with Fernet encryption +- **Per-session keys**: Uses HKDF key derivation for unique encryption per session +- **Automatic expiration**: Old items are silently skipped when TTL expires +- **Drop-in replacement**: Works with any existing session implementation + +## Installation + +Encrypted sessions require the `encrypt` extra: + +```bash +pip install openai-agents[encrypt] +``` + +## Quick start + +```python +import asyncio +from agents import Agent, Runner +from agents.extensions.memory import EncryptedSession, SQLAlchemySession + +async def main(): + agent = Agent("Assistant") + + # Create underlying session + underlying_session = SQLAlchemySession.from_url( + "user-123", + url="sqlite+aiosqlite:///:memory:", + create_tables=True + ) + + # Wrap with encryption + session = EncryptedSession( + session_id="user-123", + underlying_session=underlying_session, + encryption_key="your-secret-key-here", + ttl=600 # 10 minutes + ) + + result = await Runner.run(agent, "Hello", session=session) + print(result.final_output) + +if __name__ == "__main__": + asyncio.run(main()) +``` + +## Configuration + +### Encryption key + +The encryption key can be either a Fernet key or any string: + +```python +from agents.extensions.memory import EncryptedSession + +# Using a Fernet key (base64-encoded) +session = EncryptedSession( + session_id="user-123", + underlying_session=underlying_session, + encryption_key="your-fernet-key-here", + ttl=600 +) + +# Using a raw string (will be derived to a key) +session = EncryptedSession( + session_id="user-123", + underlying_session=underlying_session, + encryption_key="my-secret-password", + ttl=600 +) +``` + +### TTL (Time To Live) + +Set how long encrypted items remain valid: + +```python +# Items expire after 1 hour +session = EncryptedSession( + session_id="user-123", + underlying_session=underlying_session, + encryption_key="secret", + ttl=3600 # 1 hour in seconds +) + +# Items expire after 1 day +session = EncryptedSession( + session_id="user-123", + underlying_session=underlying_session, + encryption_key="secret", + ttl=86400 # 24 hours in seconds +) +``` + +## Usage with different session types + +### With SQLite sessions + +```python +from agents import SQLiteSession +from agents.extensions.memory import EncryptedSession + +# Create encrypted SQLite session +underlying = SQLiteSession("user-123", "conversations.db") + +session = EncryptedSession( + session_id="user-123", + underlying_session=underlying, + encryption_key="secret-key" +) +``` + +### With SQLAlchemy sessions + +```python +from agents.extensions.memory import EncryptedSession, SQLAlchemySession + +# Create encrypted SQLAlchemy session +underlying = SQLAlchemySession.from_url( + "user-123", + url="postgresql+asyncpg://user:pass@localhost/db", + create_tables=True +) + +session = EncryptedSession( + session_id="user-123", + underlying_session=underlying, + encryption_key="secret-key" +) +``` + +!!! warning "Advanced Session Features" + + When using `EncryptedSession` with advanced session implementations like `AdvancedSQLiteSession`, note that: + + - Methods like `find_turns_by_content()` won't work effectively since message content is encrypted + - Content-based searches operate on encrypted data, limiting their effectiveness + + + +## Key derivation + +EncryptedSession uses HKDF (HMAC-based Key Derivation Function) to derive unique encryption keys per session: + +- **Master key**: Your provided encryption key +- **Session salt**: The session ID +- **Info string**: `"agents.session-store.hkdf.v1"` +- **Output**: 32-byte Fernet key + +This ensures that: +- Each session has a unique encryption key +- Keys cannot be derived without the master key +- Session data cannot be decrypted across different sessions + +## Automatic expiration + +When items exceed the TTL, they are automatically skipped during retrieval: + +```python +# Items older than TTL are silently ignored +items = await session.get_items() # Only returns non-expired items + +# Expired items don't affect session behavior +result = await Runner.run(agent, "Continue conversation", session=session) +``` + +## API Reference + +- [`EncryptedSession`][agents.extensions.memory.encrypt_session.EncryptedSession] - Main class +- [`Session`][agents.memory.session.Session] - Base session protocol diff --git a/docs/sessions.md b/docs/sessions/index.md similarity index 62% rename from docs/sessions.md rename to docs/sessions/index.md index 956712438..30a0ad904 100644 --- a/docs/sessions.md +++ b/docs/sessions/index.md @@ -113,16 +113,49 @@ result = await Runner.run( print(f"Agent: {result.final_output}") ``` -## Memory options +## Session types -### No memory (default) +The SDK provides several session implementations for different use cases: + +### OpenAI Conversations API sessions + +Use [OpenAI's Conversations API](https://platform.openai.com/docs/api-reference/conversations) through `OpenAIConversationsSession`. ```python -# Default behavior - no session memory -result = await Runner.run(agent, "Hello") +from agents import Agent, Runner, OpenAIConversationsSession + +# Create agent +agent = Agent( + name="Assistant", + instructions="Reply very concisely.", +) + +# Create a new conversation +session = OpenAIConversationsSession() + +# Optionally resume a previous conversation by passing a conversation ID +# session = OpenAIConversationsSession(conversation_id="conv_123") + +# Start conversation +result = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session +) +print(result.final_output) # "San Francisco" + +# Continue the conversation +result = await Runner.run( + agent, + "What state is it in?", + session=session +) +print(result.final_output) # "California" ``` -### SQLite memory +### SQLite sessions + +The default, lightweight session implementation using SQLite: ```python from agents import SQLiteSession @@ -141,72 +174,79 @@ result = await Runner.run( ) ``` -### Multiple sessions - -```python -from agents import Agent, Runner, SQLiteSession +### SQLAlchemy sessions -agent = Agent(name="Assistant") +Production-ready sessions using any SQLAlchemy-supported database: -# Different sessions maintain separate conversation histories -session_1 = SQLiteSession("user_123", "conversations.db") -session_2 = SQLiteSession("user_456", "conversations.db") +```python +from agents.extensions.memory import SQLAlchemySession -result1 = await Runner.run( - agent, - "Hello", - session=session_1 -) -result2 = await Runner.run( - agent, - "Hello", - session=session_2 +# Using database URL +session = SQLAlchemySession.from_url( + "user_123", + url="postgresql+asyncpg://user:pass@localhost/db", + create_tables=True ) + +# Using existing engine +from sqlalchemy.ext.asyncio import create_async_engine +engine = create_async_engine("postgresql+asyncpg://user:pass@localhost/db") +session = SQLAlchemySession("user_123", engine=engine, create_tables=True) ``` -## Custom memory implementations +See [SQLAlchemy Sessions](sqlalchemy_session.md) for detailed documentation. -You can implement your own session memory by creating a class that follows the [`Session`][agents.memory.session.Session] protocol: +### Advanced SQLite sessions -````python -from agents.memory import Session -from typing import List +Enhanced SQLite sessions with conversation branching, usage analytics, and structured queries: -class MyCustomSession: - """Custom session implementation following the Session protocol.""" +```python +from agents.extensions.memory import AdvancedSQLiteSession - def __init__(self, session_id: str): - self.session_id = session_id - # Your initialization here +# Create with advanced features +session = AdvancedSQLiteSession( + session_id="user_123", + db_path="conversations.db", + create_tables=True +) - async def get_items(self, limit: int | None = None) -> List[dict]: - """Retrieve conversation history for this session.""" - # Your implementation here - pass +# Automatic usage tracking +result = await Runner.run(agent, "Hello", session=session) +await session.store_run_usage(result) # Track token usage - async def add_items(self, items: List[dict]) -> None: - """Store new items for this session.""" - # Your implementation here - pass +# Conversation branching +await session.create_branch_from_turn(2) # Branch from turn 2 +``` - async def pop_item(self) -> dict | None: - """Remove and return the most recent item from this session.""" - # Your implementation here - pass +See [Advanced SQLite Sessions](advanced_sqlite_session.md) for detailed documentation. - async def clear_session(self) -> None: - """Clear all items for this session.""" - # Your implementation here - pass +### Encrypted sessions -# Use your custom session -agent = Agent(name="Assistant") -result = await Runner.run( - agent, - "Hello", - session=MyCustomSession("my_session") +Transparent encryption wrapper for any session implementation: + +```python +from agents.extensions.memory import EncryptedSession, SQLAlchemySession + +# Create underlying session +underlying_session = SQLAlchemySession.from_url( + "user_123", + url="sqlite+aiosqlite:///conversations.db", + create_tables=True ) +# Wrap with encryption and TTL +session = EncryptedSession( + session_id="user_123", + underlying_session=underlying_session, + encryption_key="your-secret-key", + ttl=600 # 10 minutes +) + +result = await Runner.run(agent, "Hello", session=session) +``` + +See [Encrypted Sessions](encrypted_session.md) for detailed documentation. + ## Session management ### Session ID naming @@ -221,14 +261,37 @@ Use meaningful session IDs that help you organize conversations: - Use in-memory SQLite (`SQLiteSession("session_id")`) for temporary conversations - Use file-based SQLite (`SQLiteSession("session_id", "path/to/db.sqlite")`) for persistent conversations -- Consider implementing custom session backends for production systems (Redis, PostgreSQL, etc.) +- Use SQLAlchemy-powered sessions (`SQLAlchemySession("session_id", engine=engine, create_tables=True)`) for production systems with existing databases supported by SQLAlchemy +- Use OpenAI-hosted storage (`OpenAIConversationsSession()`) when you prefer to store history in the OpenAI Conversations API +- Use encrypted sessions (`EncryptedSession(session_id, underlying_session, encryption_key)`) to wrap any session with transparent encryption and TTL-based expiration +- Consider implementing custom session backends for other production systems (Redis, Django, etc.) for more advanced use cases -### Session management +### Multiple sessions ```python -# Clear a session when conversation should start fresh -await session.clear_session() +from agents import Agent, Runner, SQLiteSession + +agent = Agent(name="Assistant") + +# Different sessions maintain separate conversation histories +session_1 = SQLiteSession("user_123", "conversations.db") +session_2 = SQLiteSession("user_456", "conversations.db") +result1 = await Runner.run( + agent, + "Help me with my account", + session=session_1 +) +result2 = await Runner.run( + agent, + "What are my charges?", + session=session_2 +) +``` + +### Session sharing + +```python # Different agents can share the same session support_agent = Agent(name="Support") billing_agent = Agent(name="Billing") @@ -245,7 +308,7 @@ result2 = await Runner.run( "What are my charges?", session=session ) -```` +``` ## Complete example @@ -311,9 +374,58 @@ if __name__ == "__main__": asyncio.run(main()) ``` +## Custom session implementations + +You can implement your own session memory by creating a class that follows the [`Session`][agents.memory.session.Session] protocol: + +```python +from agents.memory.session import SessionABC +from agents.items import TResponseInputItem +from typing import List + +class MyCustomSession(SessionABC): + """Custom session implementation following the Session protocol.""" + + def __init__(self, session_id: str): + self.session_id = session_id + # Your initialization here + + async def get_items(self, limit: int | None = None) -> List[TResponseInputItem]: + """Retrieve conversation history for this session.""" + # Your implementation here + pass + + async def add_items(self, items: List[TResponseInputItem]) -> None: + """Store new items for this session.""" + # Your implementation here + pass + + async def pop_item(self) -> TResponseInputItem | None: + """Remove and return the most recent item from this session.""" + # Your implementation here + pass + + async def clear_session(self) -> None: + """Clear all items for this session.""" + # Your implementation here + pass + +# Use your custom session +agent = Agent(name="Assistant") +result = await Runner.run( + agent, + "Hello", + session=MyCustomSession("my_session") +) +``` + ## API Reference For detailed API documentation, see: -- [`Session`][agents.memory.Session] - Protocol interface -- [`SQLiteSession`][agents.memory.SQLiteSession] - SQLite implementation +- [`Session`][agents.memory.session.Session] - Protocol interface +- [`OpenAIConversationsSession`][agents.memory.OpenAIConversationsSession] - OpenAI Conversations API implementation +- [`SQLiteSession`][agents.memory.sqlite_session.SQLiteSession] - Basic SQLite implementation +- [`SQLAlchemySession`][agents.extensions.memory.sqlalchemy_session.SQLAlchemySession] - SQLAlchemy-powered implementation +- [`AdvancedSQLiteSession`][agents.extensions.memory.advanced_sqlite_session.AdvancedSQLiteSession] - Enhanced SQLite with branching and analytics +- [`EncryptedSession`][agents.extensions.memory.encrypt_session.EncryptedSession] - Encrypted wrapper for any session diff --git a/docs/sessions/sqlalchemy_session.md b/docs/sessions/sqlalchemy_session.md new file mode 100644 index 000000000..c33cd6a34 --- /dev/null +++ b/docs/sessions/sqlalchemy_session.md @@ -0,0 +1,76 @@ +# SQLAlchemy Sessions + +`SQLAlchemySession` uses SQLAlchemy to provide a production-ready session implementation, allowing you to use any database supported by SQLAlchemy (PostgreSQL, MySQL, SQLite, etc.) for session storage. + +## Installation + +SQLAlchemy sessions require the `sqlalchemy` extra: + +```bash +pip install openai-agents[sqlalchemy] +``` + +## Quick start + +### Using database URL + +The simplest way to get started: + +```python +import asyncio +from agents import Agent, Runner +from agents.extensions.memory import SQLAlchemySession + +async def main(): + agent = Agent("Assistant") + + # Create session using database URL + session = SQLAlchemySession.from_url( + "user-123", + url="sqlite+aiosqlite:///:memory:", + create_tables=True + ) + + result = await Runner.run(agent, "Hello", session=session) + print(result.final_output) + +if __name__ == "__main__": + asyncio.run(main()) +``` + +### Using existing engine + +For applications with existing SQLAlchemy engines: + +```python +import asyncio +from agents import Agent, Runner +from agents.extensions.memory import SQLAlchemySession +from sqlalchemy.ext.asyncio import create_async_engine + +async def main(): + # Create your database engine + engine = create_async_engine("postgresql+asyncpg://user:pass@localhost/db") + + agent = Agent("Assistant") + session = SQLAlchemySession( + "user-456", + engine=engine, + create_tables=True + ) + + result = await Runner.run(agent, "Hello", session=session) + print(result.final_output) + + # Clean up + await engine.dispose() + +if __name__ == "__main__": + asyncio.run(main()) +``` + + +## API Reference + +- [`SQLAlchemySession`][agents.extensions.memory.sqlalchemy_session.SQLAlchemySession] - Main class +- [`Session`][agents.memory.session.Session] - Base session protocol diff --git a/docs/tools.md b/docs/tools.md index 17f7da0a1..13606d3b5 100644 --- a/docs/tools.md +++ b/docs/tools.md @@ -173,6 +173,14 @@ for tool in agent.tools: } ``` +### Returning images or files from function tools + +In addition to returning text outputs, you can return one or many images or files as the output of a function tool. To do so, you can return any of: + +- Images: [`ToolOutputImage`][agents.tool.ToolOutputImage] (or the TypedDict version, [`ToolOutputImageDict`][agents.tool.ToolOutputImageDict]) +- Files: [`ToolOutputFileContent`][agents.tool.ToolOutputFileContent] (or the TypedDict version, [`ToolOutputFileContentDict`][agents.tool.ToolOutputFileContentDict]) +- Text: either a string or stringable objects, or [`ToolOutputText`][agents.tool.ToolOutputText] (or the TypedDict version, [`ToolOutputTextDict`][agents.tool.ToolOutputTextDict]) + ### Custom function tools Sometimes, you don't want to use a Python function as a tool. You can directly create a [`FunctionTool`][agents.tool.FunctionTool] if you prefer. You'll need to provide: @@ -288,9 +296,9 @@ async def run_my_agent() -> str: In certain cases, you might want to modify the output of the tool-agents before returning it to the central agent. This may be useful if you want to: -- Extract a specific piece of information (e.g., a JSON payload) from the sub-agent's chat history. -- Convert or reformat the agent’s final answer (e.g., transform Markdown into plain text or CSV). -- Validate the output or provide a fallback value when the agent’s response is missing or malformed. +- Extract a specific piece of information (e.g., a JSON payload) from the sub-agent's chat history. +- Convert or reformat the agent’s final answer (e.g., transform Markdown into plain text or CSV). +- Validate the output or provide a fallback value when the agent’s response is missing or malformed. You can do this by supplying the `custom_output_extractor` argument to the `as_tool` method: @@ -311,6 +319,76 @@ json_tool = data_agent.as_tool( ) ``` +### Conditional tool enabling + +You can conditionally enable or disable agent tools at runtime using the `is_enabled` parameter. This allows you to dynamically filter which tools are available to the LLM based on context, user preferences, or runtime conditions. + +```python +import asyncio +from agents import Agent, AgentBase, Runner, RunContextWrapper +from pydantic import BaseModel + +class LanguageContext(BaseModel): + language_preference: str = "french_spanish" + +def french_enabled(ctx: RunContextWrapper[LanguageContext], agent: AgentBase) -> bool: + """Enable French for French+Spanish preference.""" + return ctx.context.language_preference == "french_spanish" + +# Create specialized agents +spanish_agent = Agent( + name="spanish_agent", + instructions="You respond in Spanish. Always reply to the user's question in Spanish.", +) + +french_agent = Agent( + name="french_agent", + instructions="You respond in French. Always reply to the user's question in French.", +) + +# Create orchestrator with conditional tools +orchestrator = Agent( + name="orchestrator", + instructions=( + "You are a multilingual assistant. You use the tools given to you to respond to users. " + "You must call ALL available tools to provide responses in different languages. " + "You never respond in languages yourself, you always use the provided tools." + ), + tools=[ + spanish_agent.as_tool( + tool_name="respond_spanish", + tool_description="Respond to the user's question in Spanish", + is_enabled=True, # Always enabled + ), + french_agent.as_tool( + tool_name="respond_french", + tool_description="Respond to the user's question in French", + is_enabled=french_enabled, + ), + ], +) + +async def main(): + context = RunContextWrapper(LanguageContext(language_preference="french_spanish")) + result = await Runner.run(orchestrator, "How are you?", context=context.context) + print(result.final_output) + +asyncio.run(main()) +``` + +The `is_enabled` parameter accepts: + +- **Boolean values**: `True` (always enabled) or `False` (always disabled) +- **Callable functions**: Functions that take `(context, agent)` and return a boolean +- **Async functions**: Async functions for complex conditional logic + +Disabled tools are completely hidden from the LLM at runtime, making this useful for: + +- Feature gating based on user permissions +- Environment-specific tool availability (dev vs prod) +- A/B testing different tool configurations +- Dynamic tool filtering based on runtime state + ## Handling errors in function tools When you create a function tool via `@function_tool`, you can pass a `failure_error_function`. This is a function that provides an error response to the LLM in case the tool call crashes. @@ -319,4 +397,25 @@ When you create a function tool via `@function_tool`, you can pass a `failure_er - If you pass your own error function, it runs that instead, and sends the response to the LLM. - If you explicitly pass `None`, then any tool call errors will be re-raised for you to handle. This could be a `ModelBehaviorError` if the model produced invalid JSON, or a `UserError` if your code crashed, etc. +```python +from agents import function_tool, RunContextWrapper +from typing import Any + +def my_custom_error_function(context: RunContextWrapper[Any], error: Exception) -> str: + """A custom function to provide a user-friendly error message.""" + print(f"A tool call failed with the following error: {error}") + return "An internal server error occurred. Please try again later." + +@function_tool(failure_error_function=my_custom_error_function) +def get_user_profile(user_id: str) -> str: + """Fetches a user profile from a mock API. + This function demonstrates a 'flaky' or failing API call. + """ + if user_id == "user_123": + return "User profile for user_123 successfully retrieved." + else: + raise ValueError(f"Could not retrieve profile for user_id: {user_id}. API returned an error.") + +``` + If you are manually creating a `FunctionTool` object, then you must handle errors inside the `on_invoke_tool` function. diff --git a/docs/tracing.md b/docs/tracing.md index c7776ad7b..8ba20e1f9 100644 --- a/docs/tracing.md +++ b/docs/tracing.md @@ -39,7 +39,7 @@ By default, the SDK traces the following: - Audio outputs (text-to-speech) are wrapped in a `speech_span()` - Related audio spans may be parented under a `speech_group_span()` -By default, the trace is named "Agent trace". You can set this name if you use `trace`, or you can can configure the name and other properties with the [`RunConfig`][agents.run.RunConfig]. +By default, the trace is named "Agent workflow". You can set this name if you use `trace`, or you can configure the name and other properties with the [`RunConfig`][agents.run.RunConfig]. In addition, you can set up [custom trace processors](#custom-tracing-processors) to push traces to other destinations (as a replacement, or secondary destination). @@ -97,13 +97,41 @@ To customize this default setup, to send traces to alternative or additional bac 1. [`add_trace_processor()`][agents.tracing.add_trace_processor] lets you add an **additional** trace processor that will receive traces and spans as they are ready. This lets you do your own processing in addition to sending traces to OpenAI's backend. 2. [`set_trace_processors()`][agents.tracing.set_trace_processors] lets you **replace** the default processors with your own trace processors. This means traces will not be sent to the OpenAI backend unless you include a `TracingProcessor` that does so. + +## Tracing with Non-OpenAI Models + +You can use an OpenAI API key with non-OpenAI Models to enable free tracing in the OpenAI Traces dashboard without needing to disable tracing. + +```python +import os +from agents import set_tracing_export_api_key, Agent, Runner +from agents.extensions.models.litellm_model import LitellmModel + +tracing_api_key = os.environ["OPENAI_API_KEY"] +set_tracing_export_api_key(tracing_api_key) + +model = LitellmModel( + model="your-model-name", + api_key="your-api-key", +) + +agent = Agent( + name="Assistant", + model=model, +) +``` + +## Notes +- View free traces at Openai Traces dashboard. + + ## External tracing processors list - [Weights & Biases](https://weave-docs.wandb.ai/guides/integrations/openai_agents) - [Arize-Phoenix](https://docs.arize.com/phoenix/tracing/integrations-tracing/openai-agents-sdk) - [Future AGI](https://docs.futureagi.com/future-agi/products/observability/auto-instrumentation/openai_agents) -- [MLflow (self-hosted/OSS](https://mlflow.org/docs/latest/tracing/integrations/openai-agent) -- [MLflow (Databricks hosted](https://docs.databricks.com/aws/en/mlflow/mlflow-tracing#-automatic-tracing) +- [MLflow (self-hosted/OSS)](https://mlflow.org/docs/latest/tracing/integrations/openai-agent) +- [MLflow (Databricks hosted)](https://docs.databricks.com/aws/en/mlflow/mlflow-tracing#-automatic-tracing) - [Braintrust](https://braintrust.dev/docs/guides/traces/integrations#openai-agents-sdk) - [Pydantic Logfire](https://logfire.pydantic.dev/docs/integrations/llms/openai/#openai-agents) - [AgentOps](https://docs.agentops.ai/v1/integrations/agentssdk) @@ -117,3 +145,6 @@ To customize this default setup, to send traces to alternative or additional bac - [Okahu-Monocle](https://github.com/monocle2ai/monocle) - [Galileo](https://v2docs.galileo.ai/integrations/openai-agent-integration#openai-agent-integration) - [Portkey AI](https://portkey.ai/docs/integrations/agents/openai-agents) +- [LangDB AI](https://docs.langdb.ai/getting-started/working-with-agent-frameworks/working-with-openai-agents-sdk) +- [Agenta](https://docs.agenta.ai/observability/integrations/openai-agents) + diff --git a/docs/usage.md b/docs/usage.md new file mode 100644 index 000000000..a18f86ae3 --- /dev/null +++ b/docs/usage.md @@ -0,0 +1,82 @@ +# Usage + +The Agents SDK automatically tracks token usage for every run. You can access it from the run context and use it to monitor costs, enforce limits, or record analytics. + +## What is tracked + +- **requests**: number of LLM API calls made +- **input_tokens**: total input tokens sent +- **output_tokens**: total output tokens received +- **total_tokens**: input + output +- **details**: + - `input_tokens_details.cached_tokens` + - `output_tokens_details.reasoning_tokens` + +## Accessing usage from a run + +After `Runner.run(...)`, access usage via `result.context_wrapper.usage`. + +```python +result = await Runner.run(agent, "What's the weather in Tokyo?") +usage = result.context_wrapper.usage + +print("Requests:", usage.requests) +print("Input tokens:", usage.input_tokens) +print("Output tokens:", usage.output_tokens) +print("Total tokens:", usage.total_tokens) +``` + +Usage is aggregated across all model calls during the run (including tool calls and handoffs). + +### Enabling usage with LiteLLM models + +LiteLLM providers do not report usage metrics by default. When you are using [`LitellmModel`](models/litellm.md), pass `ModelSettings(include_usage=True)` to your agent so that LiteLLM responses populate `result.context_wrapper.usage`. + +```python +from agents import Agent, ModelSettings, Runner +from agents.extensions.models.litellm_model import LitellmModel + +agent = Agent( + name="Assistant", + model=LitellmModel(model="your/model", api_key="..."), + model_settings=ModelSettings(include_usage=True), +) + +result = await Runner.run(agent, "What's the weather in Tokyo?") +print(result.context_wrapper.usage.total_tokens) +``` + +## Accessing usage with sessions + +When you use a `Session` (e.g., `SQLiteSession`), each call to `Runner.run(...)` returns usage for that specific run. Sessions maintain conversation history for context, but each run's usage is independent. + +```python +session = SQLiteSession("my_conversation") + +first = await Runner.run(agent, "Hi!", session=session) +print(first.context_wrapper.usage.total_tokens) # Usage for first run + +second = await Runner.run(agent, "Can you elaborate?", session=session) +print(second.context_wrapper.usage.total_tokens) # Usage for second run +``` + +Note that while sessions preserve conversation context between runs, the usage metrics returned by each `Runner.run()` call represent only that particular execution. In sessions, previous messages may be re-fed as input to each run, which affects the input token count in consequent turns. + +## Using usage in hooks + +If you're using `RunHooks`, the `context` object passed to each hook contains `usage`. This lets you log usage at key lifecycle moments. + +```python +class MyHooks(RunHooks): + async def on_agent_end(self, context: RunContextWrapper, agent: Agent, output: Any) -> None: + u = context.usage + print(f"{agent.name} → {u.requests} requests, {u.total_tokens} total tokens") +``` + +## API Reference + +For detailed API documentation, see: + +- [`Usage`][agents.usage.Usage] - Usage tracking data structure +- [`RunContextWrapper`][agents.run.RunContextWrapper] - Access usage from run context +- [`RunHooks`][agents.run.RunHooks] - Hook into usage tracking lifecycle \ No newline at end of file diff --git a/docs/visualization.md b/docs/visualization.md index 409803f76..d2784da14 100644 --- a/docs/visualization.md +++ b/docs/visualization.md @@ -15,13 +15,17 @@ pip install "openai-agents[viz]" You can generate an agent visualization using the `draw_graph` function. This function creates a directed graph where: - **Agents** are represented as yellow boxes. +- **MCP Servers** are represented as grey boxes. - **Tools** are represented as green ellipses. - **Handoffs** are directed edges from one agent to another. ### Example Usage ```python +import os + from agents import Agent, function_tool +from agents.mcp.server import MCPServerStdio from agents.extensions.visualization import draw_graph @function_tool @@ -38,11 +42,22 @@ english_agent = Agent( instructions="You only speak English", ) +current_dir = os.path.dirname(os.path.abspath(__file__)) +samples_dir = os.path.join(current_dir, "sample_files") +mcp_server = MCPServerStdio( + name="Filesystem Server, via npx", + params={ + "command": "npx", + "args": ["-y", "@modelcontextprotocol/server-filesystem", samples_dir], + }, +) + triage_agent = Agent( name="Triage agent", instructions="Handoff to the appropriate agent based on the language of the request.", handoffs=[spanish_agent, english_agent], tools=[get_weather], + mcp_servers=[mcp_server], ) draw_graph(triage_agent) @@ -60,11 +75,17 @@ The generated graph includes: - A **start node** (`__start__`) indicating the entry point. - Agents represented as **rectangles** with yellow fill. - Tools represented as **ellipses** with green fill. +- MCP Servers represented as **rectangles** with grey fill. - Directed edges indicating interactions: - **Solid arrows** for agent-to-agent handoffs. - **Dotted arrows** for tool invocations. + - **Dashed arrows** for MCP server invocations. - An **end node** (`__end__`) indicating where execution terminates. +**Note:** MCP servers are rendered in recent versions of the +`agents` package (verified in **v0.2.8**). If you don’t see MCP boxes +in your visualization, upgrade to the latest release. + ## Customizing the Graph ### Showing the Graph diff --git a/docs/voice/quickstart.md b/docs/voice/quickstart.md index 896ffe839..bb3a02be7 100644 --- a/docs/voice/quickstart.md +++ b/docs/voice/quickstart.md @@ -72,7 +72,7 @@ spanish_agent = Agent( instructions=prompt_with_handoff_instructions( "You're speaking to a human, so be polite and concise. Speak in Spanish.", ), - model="gpt-4o-mini", + model="gpt-4.1", ) agent = Agent( @@ -80,7 +80,7 @@ agent = Agent( instructions=prompt_with_handoff_instructions( "You're speaking to a human, so be polite and concise. If the user speaks in Spanish, handoff to the spanish agent.", ), - model="gpt-4o-mini", + model="gpt-4.1", handoffs=[spanish_agent], tools=[get_weather], ) @@ -156,7 +156,7 @@ spanish_agent = Agent( instructions=prompt_with_handoff_instructions( "You're speaking to a human, so be polite and concise. Speak in Spanish.", ), - model="gpt-4o-mini", + model="gpt-4.1", ) agent = Agent( @@ -164,7 +164,7 @@ agent = Agent( instructions=prompt_with_handoff_instructions( "You're speaking to a human, so be polite and concise. If the user speaks in Spanish, handoff to the spanish agent.", ), - model="gpt-4o-mini", + model="gpt-4.1", handoffs=[spanish_agent], tools=[get_weather], ) diff --git a/docs/zh/agents.md b/docs/zh/agents.md new file mode 100644 index 000000000..93b40cae2 --- /dev/null +++ b/docs/zh/agents.md @@ -0,0 +1,289 @@ +--- +search: + exclude: true +--- +# 智能体 + +智能体是你应用中的核心构建块。一个智能体是一个大型语言模型(LLM),并通过 instructions 和工具进行配置。 + +## 基础配置 + +你最常配置的智能体属性包括: + +- `name`: 标识你的智能体的必填字符串。 +- `instructions`: 也称为开发者消息或 system prompt。 +- `model`: 使用哪个 LLM,以及可选的 `model_settings` 来配置如 temperature、top_p 等模型调优参数。 +- `tools`: 智能体可用于完成任务的工具。 + +```python +from agents import Agent, ModelSettings, function_tool + +@function_tool +def get_weather(city: str) -> str: + """returns weather info for the specified city.""" + return f"The weather in {city} is sunny" + +agent = Agent( + name="Haiku agent", + instructions="Always respond in haiku form", + model="gpt-5-nano", + tools=[get_weather], +) +``` + +## 上下文 + +智能体在其 `context` 类型上是通用的。上下文是一个依赖注入工具:它是你创建并传递给 `Runner.run()` 的对象,会传递给每个智能体、工具、任务转移等,并作为一次智能体运行所需依赖与状态的集合。你可以提供任意 Python 对象作为上下文。 + +```python +@dataclass +class UserContext: + name: str + uid: str + is_pro_user: bool + + async def fetch_purchases() -> list[Purchase]: + return ... + +agent = Agent[UserContext]( + ..., +) +``` + +## 输出类型 + +默认情况下,智能体输出纯文本(即 `str`)。如果你希望智能体产出特定类型的输出,可以使用 `output_type` 参数。一个常见选择是使用 [Pydantic](https://docs.pydantic.dev/) 对象,但我们支持任何可以被 Pydantic [TypeAdapter](https://docs.pydantic.dev/latest/api/type_adapter/) 包装的类型——dataclasses、lists、TypedDict 等。 + +```python +from pydantic import BaseModel +from agents import Agent + + +class CalendarEvent(BaseModel): + name: str + date: str + participants: list[str] + +agent = Agent( + name="Calendar extractor", + instructions="Extract calendar events from text", + output_type=CalendarEvent, +) +``` + +!!! note + + 当你传入 `output_type` 时,这会告知模型使用 [structured outputs](https://platform.openai.com/docs/guides/structured-outputs) 而不是常规的纯文本响应。 + +## 多智能体系统设计模式 + +设计多智能体系统的方式很多,但我们常见到两种广泛适用的模式: + +1. 管理器(智能体作为工具):一个中心管理/编排器以工具的形式调用专业子智能体,并始终控制对话。 +2. 任务转移:对等智能体将控制权移交给一个专业智能体,由其接管对话。这是去中心化的。 + +更多详情参见[构建智能体的实用指南](https://cdn.openai.com/business-guides-and-resources/a-practical-guide-to-building-agents.pdf)。 + +### 管理器(智能体作为工具) + +`customer_facing_agent` 处理所有用户交互,并调用以工具形式暴露的专业子智能体。阅读[工具](tools.md#agents-as-tools)文档以了解更多。 + +```python +from agents import Agent + +booking_agent = Agent(...) +refund_agent = Agent(...) + +customer_facing_agent = Agent( + name="Customer-facing agent", + instructions=( + "Handle all direct user communication. " + "Call the relevant tools when specialized expertise is needed." + ), + tools=[ + booking_agent.as_tool( + tool_name="booking_expert", + tool_description="Handles booking questions and requests.", + ), + refund_agent.as_tool( + tool_name="refund_expert", + tool_description="Handles refund questions and requests.", + ) + ], +) +``` + +### 任务转移 + +任务转移是智能体可委托的子智能体。当发生任务转移时,被委托的智能体会接收对话历史并接管对话。该模式支持模块化、专精的智能体,在单一任务上表现卓越。更多内容参见[任务转移](handoffs.md)文档。 + +```python +from agents import Agent + +booking_agent = Agent(...) +refund_agent = Agent(...) + +triage_agent = Agent( + name="Triage agent", + instructions=( + "Help the user with their questions. " + "If they ask about booking, hand off to the booking agent. " + "If they ask about refunds, hand off to the refund agent." + ), + handoffs=[booking_agent, refund_agent], +) +``` + +## 动态 instructions + +在大多数情况下,你可以在创建智能体时提供 instructions。不过,你也可以通过函数提供动态 instructions。该函数会接收智能体和上下文,并且必须返回提示词。常规和 `async` 函数均可接受。 + +```python +def dynamic_instructions( + context: RunContextWrapper[UserContext], agent: Agent[UserContext] +) -> str: + return f"The user's name is {context.context.name}. Help them with their questions." + + +agent = Agent[UserContext]( + name="Triage agent", + instructions=dynamic_instructions, +) +``` + +## 生命周期事件(hooks) + +有时,你可能希望观察一个智能体的生命周期。例如,你可能希望记录事件,或在特定事件发生时预取数据。你可以通过 `hooks` 属性挂接到智能体生命周期。继承 [`AgentHooks`][agents.lifecycle.AgentHooks] 类,并重写你感兴趣的方法。 + +## 安全防护措施 + +安全防护措施允许你在智能体运行的同时对用户输入进行检查/校验,并在智能体产生输出后对其进行检查。例如,你可以对用户输入和智能体输出进行相关性筛查。更多内容参见[安全防护措施](guardrails.md)文档。 + +## 克隆/复制智能体 + +通过在智能体上使用 `clone()` 方法,你可以复制一个智能体,并可选地修改任何你想更改的属性。 + +```python +pirate_agent = Agent( + name="Pirate", + instructions="Write like a pirate", + model="gpt-4.1", +) + +robot_agent = pirate_agent.clone( + name="Robot", + instructions="Write like a robot", +) +``` + +## 强制使用工具 + +提供工具列表并不总意味着 LLM 一定会使用某个工具。你可以通过设置 [`ModelSettings.tool_choice`][agents.model_settings.ModelSettings.tool_choice] 来强制使用工具。可选值为: + +1. `auto`:允许 LLM 自行决定是否使用工具。 +2. `required`:要求 LLM 使用某个工具(但它可以智能选择哪个工具)。 +3. `none`:要求 LLM 不使用工具。 +4. 设置某个特定字符串,例如 `my_tool`,要求 LLM 使用该特定工具。 + +```python +from agents import Agent, Runner, function_tool, ModelSettings + +@function_tool +def get_weather(city: str) -> str: + """Returns weather info for the specified city.""" + return f"The weather in {city} is sunny" + +agent = Agent( + name="Weather Agent", + instructions="Retrieve weather details.", + tools=[get_weather], + model_settings=ModelSettings(tool_choice="get_weather") +) +``` + +## 工具使用行为 + +`Agent` 配置中的 `tool_use_behavior` 参数控制工具输出的处理方式: + +- `"run_llm_again"`:默认值。先运行工具,再由 LLM 处理结果以生成最终响应。 +- `"stop_on_first_tool"`:第一次工具调用的输出将作为最终响应,不再经由 LLM 进一步处理。 + +```python +from agents import Agent, Runner, function_tool, ModelSettings + +@function_tool +def get_weather(city: str) -> str: + """Returns weather info for the specified city.""" + return f"The weather in {city} is sunny" + +agent = Agent( + name="Weather Agent", + instructions="Retrieve weather details.", + tools=[get_weather], + tool_use_behavior="stop_on_first_tool" +) +``` + +- `StopAtTools(stop_at_tool_names=[...])`:如果调用了任一指定工具则停止,并使用其输出作为最终响应。 + +```python +from agents import Agent, Runner, function_tool +from agents.agent import StopAtTools + +@function_tool +def get_weather(city: str) -> str: + """Returns weather info for the specified city.""" + return f"The weather in {city} is sunny" + +@function_tool +def sum_numbers(a: int, b: int) -> int: + """Adds two numbers.""" + return a + b + +agent = Agent( + name="Stop At Stock Agent", + instructions="Get weather or sum numbers.", + tools=[get_weather, sum_numbers], + tool_use_behavior=StopAtTools(stop_at_tool_names=["get_weather"]) +) +``` + +- `ToolsToFinalOutputFunction`:自定义函数,用于处理工具结果并决定是停止还是继续交给 LLM。 + +```python +from agents import Agent, Runner, function_tool, FunctionToolResult, RunContextWrapper +from agents.agent import ToolsToFinalOutputResult +from typing import List, Any + +@function_tool +def get_weather(city: str) -> str: + """Returns weather info for the specified city.""" + return f"The weather in {city} is sunny" + +def custom_tool_handler( + context: RunContextWrapper[Any], + tool_results: List[FunctionToolResult] +) -> ToolsToFinalOutputResult: + """Processes tool results to decide final output.""" + for result in tool_results: + if result.output and "sunny" in result.output: + return ToolsToFinalOutputResult( + is_final_output=True, + final_output=f"Final weather: {result.output}" + ) + return ToolsToFinalOutputResult( + is_final_output=False, + final_output=None + ) + +agent = Agent( + name="Weather Agent", + instructions="Retrieve weather details.", + tools=[get_weather], + tool_use_behavior=custom_tool_handler +) +``` + +!!! note + + 为防止无限循环,框架会在一次工具调用后自动将 `tool_choice` 重置为 "auto"。此行为可通过 [`agent.reset_tool_choice`][agents.agent.Agent.reset_tool_choice] 配置。产生无限循环的原因在于工具结果会被发送给 LLM,而由于设置了 `tool_choice`,LLM 会再次生成工具调用,如此往复。 \ No newline at end of file diff --git a/docs/zh/config.md b/docs/zh/config.md new file mode 100644 index 000000000..4baee4d11 --- /dev/null +++ b/docs/zh/config.md @@ -0,0 +1,98 @@ +--- +search: + exclude: true +--- +# 配置 SDK + +## API 密钥与客户端 + +默认情况下,SDK 在被导入后会立即查找用于 LLM 请求和追踪的 `OPENAI_API_KEY` 环境变量。如果无法在应用启动前设置该环境变量,可以使用 [set_default_openai_key()][agents.set_default_openai_key] 函数来设置密钥。 + +```python +from agents import set_default_openai_key + +set_default_openai_key("sk-...") +``` + +或者,你也可以配置要使用的 OpenAI 客户端。默认情况下,SDK 会创建一个 `AsyncOpenAI` 实例,使用来自环境变量的 API 密钥或上面设置的默认密钥。你可以使用 [set_default_openai_client()][agents.set_default_openai_client] 函数进行更改。 + +```python +from openai import AsyncOpenAI +from agents import set_default_openai_client + +custom_client = AsyncOpenAI(base_url="...", api_key="...") +set_default_openai_client(custom_client) +``` + +最后,你还可以自定义要使用的 OpenAI API。默认情况下,我们使用 OpenAI Responses API。你可以使用 [set_default_openai_api()][agents.set_default_openai_api] 函数将其改为使用 Chat Completions API。 + +```python +from agents import set_default_openai_api + +set_default_openai_api("chat_completions") +``` + +## 追踪 + +追踪默认启用。它默认使用上述部分中的 OpenAI API 密钥(即环境变量或你设置的默认密钥)。你可以使用 [`set_tracing_export_api_key`][agents.set_tracing_export_api_key] 函数单独设置用于追踪的 API 密钥。 + +```python +from agents import set_tracing_export_api_key + +set_tracing_export_api_key("sk-...") +``` + +你也可以使用 [`set_tracing_disabled()`][agents.set_tracing_disabled] 函数完全禁用追踪。 + +```python +from agents import set_tracing_disabled + +set_tracing_disabled(True) +``` + +## 调试日志 + +SDK 有两个未设置任何处理器的 Python 日志记录器。默认情况下,这意味着警告和错误将发送到 `stdout`,但其他日志会被抑制。 + +要启用详细日志,使用 [`enable_verbose_stdout_logging()`][agents.enable_verbose_stdout_logging] 函数。 + +```python +from agents import enable_verbose_stdout_logging + +enable_verbose_stdout_logging() +``` + +或者,你可以通过添加处理器、过滤器、格式化器等来自定义日志。更多信息请参见 [Python logging guide](https://docs.python.org/3/howto/logging.html)。 + +```python +import logging + +logger = logging.getLogger("openai.agents") # or openai.agents.tracing for the Tracing logger + +# To make all logs show up +logger.setLevel(logging.DEBUG) +# To make info and above show up +logger.setLevel(logging.INFO) +# To make warning and above show up +logger.setLevel(logging.WARNING) +# etc + +# You can customize this as needed, but this will output to `stderr` by default +logger.addHandler(logging.StreamHandler()) +``` + +### 日志中的敏感数据 + +某些日志可能包含敏感数据(例如,用户数据)。如果你想禁用这些数据的记录,请设置以下环境变量。 + +要禁用记录 LLM 的输入与输出: + +```bash +export OPENAI_AGENTS_DONT_LOG_MODEL_DATA=1 +``` + +要禁用记录工具的输入与输出: + +```bash +export OPENAI_AGENTS_DONT_LOG_TOOL_DATA=1 +``` \ No newline at end of file diff --git a/docs/zh/context.md b/docs/zh/context.md new file mode 100644 index 000000000..222de068e --- /dev/null +++ b/docs/zh/context.md @@ -0,0 +1,127 @@ +--- +search: + exclude: true +--- +# 上下文管理 + +上下文是一个语义较多的术语。你可能关心的上下文主要有两类: + +1. 代码本地可用的上下文:这是在工具函数运行、`on_handoff` 等回调、生命周期钩子中可能需要的数据与依赖。 +2. LLM 可用的上下文:这是 LLM 在生成回复时能看到的数据。 + +## 本地上下文 + +这通过 [`RunContextWrapper`][agents.run_context.RunContextWrapper] 类及其中的 [`context`][agents.run_context.RunContextWrapper.context] 属性来表示。其工作方式如下: + +1. 你创建任意 Python 对象。常见做法是使用 dataclass 或 Pydantic 对象。 +2. 将该对象传给各种运行方法(例如 `Runner.run(..., **context=whatever**)`)。 +3. 所有工具调用、生命周期钩子等都会接收到一个包装对象 `RunContextWrapper[T]`,其中 `T` 表示你的上下文对象类型,你可以通过 `wrapper.context` 访问它。 + +需要注意的最重要一点:对于一次给定的智能体运行,所有智能体、工具函数、生命周期等必须使用相同类型的上下文。 + +你可以将上下文用于以下场景: + +- 运行时的上下文数据(例如用户名/uid 或关于用户的其他信息) +- 依赖(例如日志器对象、数据获取器等) +- 辅助函数 + +!!! danger "Note" + + 上下文对象**不会**被发送给 LLM。它是纯本地对象,你可以读取、写入并调用其方法。 + +```python +import asyncio +from dataclasses import dataclass + +from agents import Agent, RunContextWrapper, Runner, function_tool + +@dataclass +class UserInfo: # (1)! + name: str + uid: int + +@function_tool +async def fetch_user_age(wrapper: RunContextWrapper[UserInfo]) -> str: # (2)! + """Fetch the age of the user. Call this function to get user's age information.""" + return f"The user {wrapper.context.name} is 47 years old" + +async def main(): + user_info = UserInfo(name="John", uid=123) + + agent = Agent[UserInfo]( # (3)! + name="Assistant", + tools=[fetch_user_age], + ) + + result = await Runner.run( # (4)! + starting_agent=agent, + input="What is the age of the user?", + context=user_info, + ) + + print(result.final_output) # (5)! + # The user John is 47 years old. + +if __name__ == "__main__": + asyncio.run(main()) +``` + +1. 这是上下文对象。这里我们使用了 dataclass,但你也可以使用任意类型。 +2. 这是一个工具。你可以看到它接收 `RunContextWrapper[UserInfo]`。工具实现会从上下文中读取数据。 +3. 我们用泛型 `UserInfo` 标注智能体,以便类型检查器能捕获错误(例如我们尝试传入使用不同上下文类型的工具时)。 +4. 上下文被传递给 `run` 函数。 +5. 智能体正确调用工具并获得年龄。 + +--- + +### 进阶:`ToolContext` + +在某些情况下,你可能希望访问关于正在执行的工具的额外元数据——例如其名称、调用 ID 或原始参数字符串。 +为此,你可以使用继承自 `RunContextWrapper` 的 [`ToolContext`][agents.tool_context.ToolContext] 类。 + +```python +from typing import Annotated +from pydantic import BaseModel, Field +from agents import Agent, Runner, function_tool +from agents.tool_context import ToolContext + +class WeatherContext(BaseModel): + user_id: str + +class Weather(BaseModel): + city: str = Field(description="The city name") + temperature_range: str = Field(description="The temperature range in Celsius") + conditions: str = Field(description="The weather conditions") + +@function_tool +def get_weather(ctx: ToolContext[WeatherContext], city: Annotated[str, "The city to get the weather for"]) -> Weather: + print(f"[debug] Tool context: (name: {ctx.tool_name}, call_id: {ctx.tool_call_id}, args: {ctx.tool_arguments})") + return Weather(city=city, temperature_range="14-20C", conditions="Sunny with wind.") + +agent = Agent( + name="Weather Agent", + instructions="You are a helpful agent that can tell the weather of a given city.", + tools=[get_weather], +) +``` + +`ToolContext` 提供与 `RunContextWrapper` 相同的 `.context` 属性, +另含当前工具调用特有的字段: + +- `tool_name` – 被调用工具的名称 +- `tool_call_id` – 此次工具调用的唯一标识符 +- `tool_arguments` – 传递给工具的原始参数字符串 + +当你在执行期间需要工具级元数据时,请使用 `ToolContext`。 +对于智能体与工具之间的一般性上下文共享,`RunContextWrapper` 已经足够。 + +--- + +## 智能体/LLM 上下文 + +当调用 LLM 时,它能看到的**唯一**数据来自对话历史。这意味着如果你想让某些新数据对 LLM 可见,必须以让其出现在对话历史中的方式提供。可选方式包括: + +1. 将其添加到智能体的 `instructions`。这也被称为“系统提示词”(system prompt)或“开发者消息”。系统提示词可以是静态字符串,也可以是接收上下文并输出字符串的动态函数。这常用于始终有用的信息(例如用户名或当前日期)。 +2. 在调用 `Runner.run` 函数时,将其添加到 `input`。这与 `instructions` 的做法类似,但允许你提供在[指令链](https://cdn.openai.com/spec/model-spec-2024-05-08.html#follow-the-chain-of-command)中更靠后的消息。 +3. 通过工具调用(function tools)暴露。这适用于按需(on-demand)的上下文——LLM 决定何时需要某些数据,并可调用工具来获取该数据。 +4. 使用检索或网络检索(web search)。这些是能够从文件或数据库(检索)或网络(网络检索)中获取相关数据的特殊工具。这有助于用相关的上下文数据来“支撑”(ground)回复。 \ No newline at end of file diff --git a/docs/zh/examples.md b/docs/zh/examples.md new file mode 100644 index 000000000..3d5136bba --- /dev/null +++ b/docs/zh/examples.md @@ -0,0 +1,93 @@ +--- +search: + exclude: true +--- +# 代码示例 + +在[repo](https://github.com/openai/openai-agents-python/tree/main/examples) 的 examples 目录中查看该 SDK 的多种示例实现。这些代码示例按多个目录组织,展示不同的模式与能力。 + +## 目录 + +- **[agent_patterns](https://github.com/openai/openai-agents-python/tree/main/examples/agent_patterns):** + 本目录中的示例展示常见的智能体设计模式,例如: + + - 确定性工作流 + - 将智能体作为工具 + - 智能体并行执行 + - 有条件的工具使用 + - 输入/输出安全防护措施 + - 将 LLM 作为裁判 + - 路由 + - 流式传输安全防护措施 + +- **[basic](https://github.com/openai/openai-agents-python/tree/main/examples/basic):** + 这些示例展示 SDK 的基础能力,例如: + + - Hello World 代码示例(默认模型、GPT-5、开放权重模型) + - 智能体生命周期管理 + - 动态系统提示词 + - 流式传输输出(文本、条目、函数调用参数) + - 提示词模板 + - 文件处理(本地与远程、图像与 PDF) + - 使用跟踪 + - 非严格输出类型 + - 先前响应 ID 的使用 + +- **[customer_service](https://github.com/openai/openai-agents-python/tree/main/examples/customer_service):** + 航空公司的示例客服系统。 + +- **[financial_research_agent](https://github.com/openai/openai-agents-python/tree/main/examples/financial_research_agent):** + 一个金融研究智能体,演示使用智能体和工具进行金融数据分析的结构化研究工作流。 + +- **[handoffs](https://github.com/openai/openai-agents-python/tree/main/examples/handoffs):** + 查看带消息过滤的智能体任务转移的实用示例。 + +- **[hosted_mcp](https://github.com/openai/openai-agents-python/tree/main/examples/hosted_mcp):** + 展示如何使用托管的 MCP (Model Context Protocol) 连接器与审批的示例。 + +- **[mcp](https://github.com/openai/openai-agents-python/tree/main/examples/mcp):** + 学习如何使用 MCP (Model Context Protocol) 构建智能体,包括: + + - 文件系统代码示例 + - Git 代码示例 + - MCP 提示词服务代码示例 + - SSE(Server-Sent Events)代码示例 + - 可流式传输的 HTTP 代码示例 + +- **[memory](https://github.com/openai/openai-agents-python/tree/main/examples/memory):** + 智能体的不同内存实现示例,包括: + + - SQLite 会话存储 + - 高级 SQLite 会话存储 + - Redis 会话存储 + - SQLAlchemy 会话存储 + - 加密会话存储 + - OpenAI 会话存储 + +- **[model_providers](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers):** + 了解如何在该 SDK 中使用非 OpenAI 模型,包括自定义提供方与 LiteLLM 集成。 + +- **[realtime](https://github.com/openai/openai-agents-python/tree/main/examples/realtime):** + 展示如何使用该 SDK 构建实时体验的示例,包括: + + - Web 应用 + - 命令行界面 + - Twilio 集成 + +- **[reasoning_content](https://github.com/openai/openai-agents-python/tree/main/examples/reasoning_content):** + 展示如何处理推理内容与 structured outputs 的示例。 + +- **[research_bot](https://github.com/openai/openai-agents-python/tree/main/examples/research_bot):** + 简单的深度研究克隆,展示复杂的多智能体研究工作流。 + +- **[tools](https://github.com/openai/openai-agents-python/tree/main/examples/tools):** + 学习如何实现由OpenAI托管的工具,例如: + + - 网络检索与带筛选的网络检索 + - 文件检索 + - Code interpreter + - 计算机操作 + - 图像生成 + +- **[voice](https://github.com/openai/openai-agents-python/tree/main/examples/voice):** + 查看语音智能体示例,使用我们的 TTS 和 STT 模型,包括流式语音示例。 \ No newline at end of file diff --git a/docs/zh/guardrails.md b/docs/zh/guardrails.md new file mode 100644 index 000000000..31acfdbcd --- /dev/null +++ b/docs/zh/guardrails.md @@ -0,0 +1,158 @@ +--- +search: + exclude: true +--- +# 安全防护措施 + +安全防护措施与您的智能体并行运行,使您能够对用户输入进行检查和验证。举例来说,假设您有一个使用非常智能(因此也较慢/昂贵)的模型来处理客户请求的智能体。您不希望恶意用户让该模型帮助他们完成数学作业。因此,您可以使用一个快速/低成本的模型运行安全防护措施。如果安全防护措施检测到恶意使用,它可以立即抛出错误,从而阻止昂贵模型的运行,为您节省时间/金钱。 + +安全防护措施有两种类型: + +1. 输入安全防护措施运行在初始用户输入上 +2. 输出安全防护措施运行在最终智能体输出上 + +## 输入安全防护措施 + +输入安全防护措施分三步运行: + +1. 首先,安全防护措施接收与智能体相同的输入。 +2. 接着,安全防护措施函数运行以生成一个[`GuardrailFunctionOutput`][agents.guardrail.GuardrailFunctionOutput],随后被包装成[`InputGuardrailResult`][agents.guardrail.InputGuardrailResult] +3. 最后,我们检查[`.tripwire_triggered`][agents.guardrail.GuardrailFunctionOutput.tripwire_triggered]是否为 true。若为 true,则会抛出[`InputGuardrailTripwireTriggered`][agents.exceptions.InputGuardrailTripwireTriggered]异常,以便您对用户做出恰当响应或处理该异常。 + +!!! Note + + 输入安全防护措施旨在运行于用户输入上,因此只有当某个智能体是*第一个*智能体时,它的安全防护措施才会运行。您可能会疑惑,为什么 `guardrails` 属性在智能体上,而不是传给 `Runner.run`?这是因为安全防护措施通常与具体的智能体相关——不同的智能体会运行不同的安全防护措施,因此将代码就近放置更有利于可读性。 + +## 输出安全防护措施 + +输出安全防护措施分三步运行: + +1. 首先,安全防护措施接收由智能体产生的输出。 +2. 接着,安全防护措施函数运行以生成一个[`GuardrailFunctionOutput`][agents.guardrail.GuardrailFunctionOutput],随后被包装成[`OutputGuardrailResult`][agents.guardrail.OutputGuardrailResult] +3. 最后,我们检查[`.tripwire_triggered`][agents.guardrail.GuardrailFunctionOutput.tripwire_triggered]是否为 true。若为 true,则会抛出[`OutputGuardrailTripwireTriggered`][agents.exceptions.OutputGuardrailTripwireTriggered]异常,以便您对用户做出恰当响应或处理该异常。 + +!!! Note + + 输出安全防护措施旨在运行于最终的智能体输出上,因此只有当某个智能体是*最后一个*智能体时,它的安全防护措施才会运行。与输入安全防护措施类似,我们这样设计是因为安全防护措施通常与具体的智能体相关——不同的智能体会运行不同的安全防护措施,因此将代码就近放置更有利于可读性。 + +## 触发线 + +如果输入或输出未通过安全防护措施,安全防护措施可以通过触发线来发出信号。一旦我们发现某个安全防护措施触发了触发线,就会立即抛出 `{Input,Output}GuardrailTripwireTriggered` 异常并停止智能体执行。 + +## 实现安全防护措施 + +您需要提供一个接收输入并返回[`GuardrailFunctionOutput`][agents.guardrail.GuardrailFunctionOutput]的函数。此示例中,我们将通过在底层运行一个智能体来实现。 + +```python +from pydantic import BaseModel +from agents import ( + Agent, + GuardrailFunctionOutput, + InputGuardrailTripwireTriggered, + RunContextWrapper, + Runner, + TResponseInputItem, + input_guardrail, +) + +class MathHomeworkOutput(BaseModel): + is_math_homework: bool + reasoning: str + +guardrail_agent = Agent( # (1)! + name="Guardrail check", + instructions="Check if the user is asking you to do their math homework.", + output_type=MathHomeworkOutput, +) + + +@input_guardrail +async def math_guardrail( # (2)! + ctx: RunContextWrapper[None], agent: Agent, input: str | list[TResponseInputItem] +) -> GuardrailFunctionOutput: + result = await Runner.run(guardrail_agent, input, context=ctx.context) + + return GuardrailFunctionOutput( + output_info=result.final_output, # (3)! + tripwire_triggered=result.final_output.is_math_homework, + ) + + +agent = Agent( # (4)! + name="Customer support agent", + instructions="You are a customer support agent. You help customers with their questions.", + input_guardrails=[math_guardrail], +) + +async def main(): + # This should trip the guardrail + try: + await Runner.run(agent, "Hello, can you help me solve for x: 2x + 3 = 11?") + print("Guardrail didn't trip - this is unexpected") + + except InputGuardrailTripwireTriggered: + print("Math homework guardrail tripped") +``` + +1. 我们将在安全防护措施函数中使用此智能体。 +2. 这是接收智能体输入/上下文并返回结果的安全防护措施函数。 +3. 我们可以在安全防护措施结果中包含额外信息。 +4. 这是定义工作流的实际智能体。 + +输出安全防护措施与之类似。 + +```python +from pydantic import BaseModel +from agents import ( + Agent, + GuardrailFunctionOutput, + OutputGuardrailTripwireTriggered, + RunContextWrapper, + Runner, + output_guardrail, +) +class MessageOutput(BaseModel): # (1)! + response: str + +class MathOutput(BaseModel): # (2)! + reasoning: str + is_math: bool + +guardrail_agent = Agent( + name="Guardrail check", + instructions="Check if the output includes any math.", + output_type=MathOutput, +) + +@output_guardrail +async def math_guardrail( # (3)! + ctx: RunContextWrapper, agent: Agent, output: MessageOutput +) -> GuardrailFunctionOutput: + result = await Runner.run(guardrail_agent, output.response, context=ctx.context) + + return GuardrailFunctionOutput( + output_info=result.final_output, + tripwire_triggered=result.final_output.is_math, + ) + +agent = Agent( # (4)! + name="Customer support agent", + instructions="You are a customer support agent. You help customers with their questions.", + output_guardrails=[math_guardrail], + output_type=MessageOutput, +) + +async def main(): + # This should trip the guardrail + try: + await Runner.run(agent, "Hello, can you help me solve for x: 2x + 3 = 11?") + print("Guardrail didn't trip - this is unexpected") + + except OutputGuardrailTripwireTriggered: + print("Math output guardrail tripped") +``` + +1. 这是实际智能体的输出类型。 +2. 这是安全防护措施的输出类型。 +3. 这是接收智能体输出并返回结果的安全防护措施函数。 +4. 这是定义工作流的实际智能体。 \ No newline at end of file diff --git a/docs/zh/handoffs.md b/docs/zh/handoffs.md new file mode 100644 index 000000000..f81e0202d --- /dev/null +++ b/docs/zh/handoffs.md @@ -0,0 +1,118 @@ +--- +search: + exclude: true +--- +# 任务转移 + +任务转移允许一个智能体将任务委派给另一个智能体。这在不同智能体各自专精不同领域的场景中特别有用。例如,一个客户支持应用可能有各自专门处理订单状态、退款、常见问题(FAQ)等任务的智能体。 + +对 LLM 而言,任务转移被表示为工具。因此,如果要将任务转移给名为 `Refund Agent` 的智能体,则该工具会被命名为 `transfer_to_refund_agent`。 + +## 创建任务转移 + +所有智能体都有一个 [`handoffs`][agents.agent.Agent.handoffs] 参数,它既可以直接接收一个 `Agent`,也可以接收一个用于自定义任务转移的 `Handoff` 对象。 + +你可以使用 Agents SDK 提供的 [`handoff()`][agents.handoffs.handoff] 函数来创建任务转移。该函数允许你指定要移交到的智能体,并可选地提供覆盖项和输入过滤器。 + +### 基础用法 + +如下是如何创建一个简单的任务转移: + +```python +from agents import Agent, handoff + +billing_agent = Agent(name="Billing agent") +refund_agent = Agent(name="Refund agent") + +# (1)! +triage_agent = Agent(name="Triage agent", handoffs=[billing_agent, handoff(refund_agent)]) +``` + +1. 你可以直接使用智能体(如 `billing_agent`),也可以使用 `handoff()` 函数。 + +### 通过 `handoff()` 函数自定义任务转移 + +[`handoff()`][agents.handoffs.handoff] 函数允许你进行自定义。 + +- `agent`: 将要接手的智能体。 +- `tool_name_override`: 默认使用 `Handoff.default_tool_name()`,其解析为 `transfer_to_`。你可以覆盖它。 +- `tool_description_override`: 覆盖 `Handoff.default_tool_description()` 提供的默认工具描述。 +- `on_handoff`: 当任务转移被调用时执行的回调函数。这对于在你知道将要进行任务转移时立即启动某些数据获取等操作很有用。该函数接收智能体上下文,并且可选地接收 LLM 生成的输入。输入数据由 `input_type` 参数控制。 +- `input_type`: 任务转移期望的输入类型(可选)。 +- `input_filter`: 允许你过滤下一个智能体接收的输入。详见下文。 +- `is_enabled`: 是否启用该任务转移。可以是布尔值或返回布尔值的函数,从而允许你在运行时动态启用或禁用任务转移。 + +```python +from agents import Agent, handoff, RunContextWrapper + +def on_handoff(ctx: RunContextWrapper[None]): + print("Handoff called") + +agent = Agent(name="My agent") + +handoff_obj = handoff( + agent=agent, + on_handoff=on_handoff, + tool_name_override="custom_handoff_tool", + tool_description_override="Custom description", +) +``` + +## 任务转移输入 + +在某些情况下,你希望 LLM 在调用任务转移时提供一些数据。例如,设想将任务转移给“升级处理(Escalation)智能体”。你可能希望提供一个原因,以便进行日志记录。 + +```python +from pydantic import BaseModel + +from agents import Agent, handoff, RunContextWrapper + +class EscalationData(BaseModel): + reason: str + +async def on_handoff(ctx: RunContextWrapper[None], input_data: EscalationData): + print(f"Escalation agent called with reason: {input_data.reason}") + +agent = Agent(name="Escalation agent") + +handoff_obj = handoff( + agent=agent, + on_handoff=on_handoff, + input_type=EscalationData, +) +``` + +## 输入过滤器 + +当发生任务转移时,就好像新的智能体接管了对话,并能看到之前的整个对话历史。如果你想改变这一点,可以设置一个 [`input_filter`][agents.handoffs.Handoff.input_filter]。输入过滤器是一个函数,它通过 [`HandoffInputData`][agents.handoffs.HandoffInputData] 接收现有输入,并且必须返回一个新的 `HandoffInputData`。 + +有一些常见模式(例如从历史记录中移除所有工具调用),它们已在 [`agents.extensions.handoff_filters`][] 中为你实现。 + +```python +from agents import Agent, handoff +from agents.extensions import handoff_filters + +agent = Agent(name="FAQ agent") + +handoff_obj = handoff( + agent=agent, + input_filter=handoff_filters.remove_all_tools, # (1)! +) +``` + +1. 当调用 `FAQ agent` 时,这将自动从历史记录中移除所有工具。 + +## 推荐提示词 + +为确保 LLM 正确理解任务转移,我们建议在你的智能体中包含有关任务转移的信息。我们在 [`agents.extensions.handoff_prompt.RECOMMENDED_PROMPT_PREFIX`][] 中提供了建议的前缀,或者你也可以调用 [`agents.extensions.handoff_prompt.prompt_with_handoff_instructions`][] 将推荐数据自动添加到你的提示词中。 + +```python +from agents import Agent +from agents.extensions.handoff_prompt import RECOMMENDED_PROMPT_PREFIX + +billing_agent = Agent( + name="Billing agent", + instructions=f"""{RECOMMENDED_PROMPT_PREFIX} + .""", +) +``` \ No newline at end of file diff --git a/docs/zh/index.md b/docs/zh/index.md new file mode 100644 index 000000000..c3b94648b --- /dev/null +++ b/docs/zh/index.md @@ -0,0 +1,58 @@ +--- +search: + exclude: true +--- +# OpenAI Agents SDK + +[OpenAI Agents SDK](https://github.com/openai/openai-agents-python) 让你以轻量、易用且极少抽象的方式构建智能体式 AI 应用。它是我们此前面向智能体的试验项目 [Swarm](https://github.com/openai/swarm/tree/main) 的可用于生产的升级版。Agents SDK 仅包含一小组基本组件: + +- **智能体(Agents)**:配备了 instructions 和 tools 的 LLM +- **任务转移(Handoffs)**:允许智能体将特定任务委派给其他智能体 +- **安全防护措施(Guardrails)**:支持对智能体输入与输出进行校验 +- **会话(Sessions)**:在多次运行中自动维护对话历史 + +结合 Python,这些基本组件足以表达工具与智能体之间的复杂关系,让你无需陡峭的学习曲线即可构建真实应用。此外,SDK 自带 **追踪(tracing)**,可用于可视化和调试你的智能体流程,亦可进行评估,甚至为你的应用微调模型。 + +## 使用 Agents SDK 的理由 + +该 SDK 的两条核心设计原则: + +1. 功能足够有用,但基本组件足够少,便于快速上手。 +2. 开箱即用,同时你可以精确自定义行为。 + +主要特性包括: + +- 智能体循环:内置循环负责调用 tools、将结果反馈给 LLM,并在 LLM 完成前自动迭代。 +- Python 优先:使用语言自带能力编排与串联智能体,无需学习新的抽象。 +- 任务转移:强大的多智能体协作与委派能力。 +- 安全防护措施:与智能体并行执行输入校验与检查,失败即提前终止。 +- 会话:跨多次运行自动管理对话历史,免去手动状态处理。 +- 工具调用:将任意 Python 函数变为工具,自动生成 schema,并通过 Pydantic 驱动的校验。 +- 追踪:内置追踪用于可视化、调试与监控流程,并可使用 OpenAI 的评估、微调与蒸馏工具套件。 + +## 安装 + +```bash +pip install openai-agents +``` + +## Hello World 示例 + +```python +from agents import Agent, Runner + +agent = Agent(name="Assistant", instructions="You are a helpful assistant") + +result = Runner.run_sync(agent, "Write a haiku about recursion in programming.") +print(result.final_output) + +# Code within the code, +# Functions calling themselves, +# Infinite loop's dance. +``` + +(运行时,请确保已设置环境变量 `OPENAI_API_KEY`) + +```bash +export OPENAI_API_KEY=sk-... +``` \ No newline at end of file diff --git a/docs/zh/mcp.md b/docs/zh/mcp.md new file mode 100644 index 000000000..622133a40 --- /dev/null +++ b/docs/zh/mcp.md @@ -0,0 +1,324 @@ +--- +search: + exclude: true +--- +# Model context protocol (MCP) + +[Model context protocol](https://modelcontextprotocol.io/introduction)(MCP)标准化了应用如何向语言模型暴露工具和上下文。来自官方文档: + +> MCP is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI +> applications. Just as USB-C provides a standardized way to connect your devices to various peripherals and accessories, MCP +> provides a standardized way to connect AI models to different data sources and tools. + +Agents Python SDK 支持多种 MCP 传输方式。这让你可以复用现有的 MCP 服务,或自行构建以向智能体暴露文件系统、HTTP 或连接器支持的工具。 + +## Choosing an MCP integration + +在将 MCP 服务接入智能体之前,先决定工具调用应在何处执行,以及你能使用哪些传输方式。下表总结了 Python SDK 支持的选项。 + +| 你的需求 | 推荐选项 | +| ------------------------------------------------------------------------------------ | ----------------------------------------------------- | +| 让 OpenAI 的 Responses API 代表模型调用一个可公开访问的 MCP 服务 | **Hosted MCP server tools**,通过 [`HostedMCPTool`][agents.tool.HostedMCPTool] | +| 连接你本地或远程运行的可流式 HTTP 服务 | **Streamable HTTP MCP servers**,通过 [`MCPServerStreamableHttp`][agents.mcp.server.MCPServerStreamableHttp] | +| 与实现了带 Server-Sent Events 的 HTTP 的服务通信 | **HTTP with SSE MCP servers**,通过 [`MCPServerSse`][agents.mcp.server.MCPServerSse] | +| 启动本地进程并通过 stdin/stdout 通信 | **stdio MCP servers**,通过 [`MCPServerStdio`][agents.mcp.server.MCPServerStdio] | + +下文将依次介绍每个选项、如何配置,以及在何种情况下更倾向于使用哪种传输方式。 + +## 1. Hosted MCP server tools + +托管工具将整个工具的往返调用放到 OpenAI 的基础设施中。你的代码不再列出和调用工具,[`HostedMCPTool`][agents.tool.HostedMCPTool] 会将服务标签(以及可选的连接器元数据)转发给 Responses API。模型会列出远程服务的工具并直接调用它们,而无需回调到你的 Python 进程。托管工具目前适用于支持 Responses API 托管 MCP 集成的 OpenAI 模型。 + +### Basic hosted MCP tool + +在智能体的 `tools` 列表中添加一个 [`HostedMCPTool`][agents.tool.HostedMCPTool] 即可创建托管工具。`tool_config` 字典与发送到 REST API 的 JSON 相对应: + +```python +import asyncio + +from agents import Agent, HostedMCPTool, Runner + +async def main() -> None: + agent = Agent( + name="Assistant", + tools=[ + HostedMCPTool( + tool_config={ + "type": "mcp", + "server_label": "gitmcp", + "server_url": "https://gitmcp.io/openai/codex", + "require_approval": "never", + } + ) + ], + ) + + result = await Runner.run(agent, "Which language is this repository written in?") + print(result.final_output) + +asyncio.run(main()) +``` + +托管服务会自动暴露其工具;无需将其加入 `mcp_servers`。 + +### Streaming hosted MCP results + +托管工具以与工具调用完全相同的方式支持流式传输。向 `Runner.run_streamed` 传入 `stream=True`,即可在模型仍在运行时消费增量的 MCP 输出: + +```python +result = Runner.run_streamed(agent, "Summarise this repository's top languages") +async for event in result.stream_events(): + if event.type == "run_item_stream_event": + print(f"Received: {event.item}") +print(result.final_output) +``` + +### Optional approval flows + +如果某个服务可以执行敏感操作,你可以在每次工具执行前要求人工或程序化审批。在 `tool_config` 中配置 `require_approval`,可传入单一策略(`"always"`、`"never"`)或一个将工具名称映射到策略的字典。若要在 Python 内做出决策,提供一个 `on_approval_request` 回调即可。 + +```python +from agents import MCPToolApprovalFunctionResult, MCPToolApprovalRequest + +SAFE_TOOLS = {"read_project_metadata"} + +def approve_tool(request: MCPToolApprovalRequest) -> MCPToolApprovalFunctionResult: + if request.data.name in SAFE_TOOLS: + return {"approve": True} + return {"approve": False, "reason": "Escalate to a human reviewer"} + +agent = Agent( + name="Assistant", + tools=[ + HostedMCPTool( + tool_config={ + "type": "mcp", + "server_label": "gitmcp", + "server_url": "https://gitmcp.io/openai/codex", + "require_approval": "always", + }, + on_approval_request=approve_tool, + ) + ], +) +``` + +回调可以是同步或异步的,并会在模型需要审批数据以继续运行时被调用。 + +### Connector-backed hosted servers + +托管 MCP 也支持 OpenAI connectors。你可以不指定 `server_url`,而是提供 `connector_id` 和访问令牌。Responses API 负责认证,托管服务会暴露该连接器的工具。 + +```python +import os + +HostedMCPTool( + tool_config={ + "type": "mcp", + "server_label": "google_calendar", + "connector_id": "connector_googlecalendar", + "authorization": os.environ["GOOGLE_CALENDAR_AUTHORIZATION"], + "require_approval": "never", + } +) +``` + +完整可用的托管工具示例(包括流式传输、审批和连接器)位于 +[`examples/hosted_mcp`](https://github.com/openai/openai-agents-python/tree/main/examples/hosted_mcp)。 + +## 2. Streamable HTTP MCP servers + +当你希望自行管理网络连接时,使用 [`MCPServerStreamableHttp`][agents.mcp.server.MCPServerStreamableHttp]。当你可控传输层,或希望在自有基础设施中运行服务并保持低延迟时,可流式传输的 HTTP 服务是理想选择。 + +```python +import asyncio +import os + +from agents import Agent, Runner +from agents.mcp import MCPServerStreamableHttp +from agents.model_settings import ModelSettings + +async def main() -> None: + token = os.environ["MCP_SERVER_TOKEN"] + async with MCPServerStreamableHttp( + name="Streamable HTTP Python Server", + params={ + "url": "http://localhost:8000/mcp", + "headers": {"Authorization": f"Bearer {token}"}, + "timeout": 10, + }, + cache_tools_list=True, + max_retry_attempts=3, + ) as server: + agent = Agent( + name="Assistant", + instructions="Use the MCP tools to answer the questions.", + mcp_servers=[server], + model_settings=ModelSettings(tool_choice="required"), + ) + + result = await Runner.run(agent, "Add 7 and 22.") + print(result.final_output) + +asyncio.run(main()) +``` + +构造函数接受以下附加选项: + +- `client_session_timeout_seconds` 控制 HTTP 读取超时。 +- `use_structured_content` 切换是否优先使用 `tool_result.structured_content` 而非文本输出。 +- `max_retry_attempts` 和 `retry_backoff_seconds_base` 为 `list_tools()` 和 `call_tool()` 添加自动重试。 +- `tool_filter` 允许只暴露工具的子集(参见 [Tool filtering](#tool-filtering))。 + +## 3. HTTP with SSE MCP servers + +如果 MCP 服务实现了带 SSE 的 HTTP 传输,实例化 [`MCPServerSse`][agents.mcp.server.MCPServerSse]。除传输方式外,其 API 与可流式 HTTP 服务完全一致。 + +```python + +from agents import Agent, Runner +from agents.model_settings import ModelSettings +from agents.mcp import MCPServerSse + +workspace_id = "demo-workspace" + +async with MCPServerSse( + name="SSE Python Server", + params={ + "url": "http://localhost:8000/sse", + "headers": {"X-Workspace": workspace_id}, + }, + cache_tools_list=True, +) as server: + agent = Agent( + name="Assistant", + mcp_servers=[server], + model_settings=ModelSettings(tool_choice="required"), + ) + result = await Runner.run(agent, "What's the weather in Tokyo?") + print(result.final_output) +``` + +## 4. stdio MCP servers + +对于作为本地子进程运行的 MCP 服务,使用 [`MCPServerStdio`][agents.mcp.server.MCPServerStdio]。SDK 会启动进程、保持管道打开,并在上下文管理器退出时自动关闭。这一选项适合快速原型验证,或当服务仅暴露命令行入口时使用。 + +```python +from pathlib import Path +from agents import Agent, Runner +from agents.mcp import MCPServerStdio + +current_dir = Path(__file__).parent +samples_dir = current_dir / "sample_files" + +async with MCPServerStdio( + name="Filesystem Server via npx", + params={ + "command": "npx", + "args": ["-y", "@modelcontextprotocol/server-filesystem", str(samples_dir)], + }, +) as server: + agent = Agent( + name="Assistant", + instructions="Use the files in the sample directory to answer questions.", + mcp_servers=[server], + ) + result = await Runner.run(agent, "List the files available to you.") + print(result.final_output) +``` + +## Tool filtering + +每个 MCP 服务都支持工具过滤,以便你只暴露智能体所需的函数。过滤可以在构造时进行,也可以在每次运行时动态进行。 + +### Static tool filtering + +使用 [`create_static_tool_filter`][agents.mcp.create_static_tool_filter] 配置简单的允许/阻止列表: + +```python +from pathlib import Path + +from agents.mcp import MCPServerStdio, create_static_tool_filter + +samples_dir = Path("/path/to/files") + +filesystem_server = MCPServerStdio( + params={ + "command": "npx", + "args": ["-y", "@modelcontextprotocol/server-filesystem", str(samples_dir)], + }, + tool_filter=create_static_tool_filter(allowed_tool_names=["read_file", "write_file"]), +) +``` + +当同时提供 `allowed_tool_names` 和 `blocked_tool_names` 时,SDK 会先应用允许列表,然后从剩余集合中移除任何被阻止的工具。 + +### Dynamic tool filtering + +对于更复杂的逻辑,传入一个可调用对象,该对象接收 [`ToolFilterContext`][agents.mcp.ToolFilterContext]。该可调用对象可以是同步或异步的,返回 `True` 表示应暴露该工具。 + +```python +from pathlib import Path + +from agents.mcp import MCPServerStdio, ToolFilterContext + +samples_dir = Path("/path/to/files") + +async def context_aware_filter(context: ToolFilterContext, tool) -> bool: + if context.agent.name == "Code Reviewer" and tool.name.startswith("danger_"): + return False + return True + +async with MCPServerStdio( + params={ + "command": "npx", + "args": ["-y", "@modelcontextprotocol/server-filesystem", str(samples_dir)], + }, + tool_filter=context_aware_filter, +) as server: + ... +``` + +过滤上下文会暴露当前的 `run_context`、请求工具的 `agent`,以及 `server_name`。 + +## Prompts + +MCP 服务还可以提供动态生成智能体 instructions 的提示词。支持提示词的服务会暴露两个方法: + +- `list_prompts()` 枚举可用的提示模板。 +- `get_prompt(name, arguments)` 获取具体提示词,可选地携带参数。 + +```python +from agents import Agent + +prompt_result = await server.get_prompt( + "generate_code_review_instructions", + {"focus": "security vulnerabilities", "language": "python"}, +) +instructions = prompt_result.messages[0].content.text + +agent = Agent( + name="Code Reviewer", + instructions=instructions, + mcp_servers=[server], +) +``` + +## Caching + +每次智能体运行都会对每个 MCP 服务调用 `list_tools()`。远程服务可能会引入明显的延迟,因此所有 MCP 服务类都暴露了 `cache_tools_list` 选项。仅当你确信工具定义不经常变化时才将其设为 `True`。如需之后强制刷新列表,调用服务实例的 `invalidate_tools_cache()`。 + +## Tracing + +[Tracing](./tracing.md) 会自动捕获 MCP 活动,包括: + +1. 调用 MCP 服务以列出工具。 +2. 工具调用中的 MCP 相关信息。 + +![MCP Tracing Screenshot](../assets/images/mcp-tracing.jpg) + +## Further reading + +- [Model Context Protocol](https://modelcontextprotocol.io/) – 规范与设计指南。 +- [examples/mcp](https://github.com/openai/openai-agents-python/tree/main/examples/mcp) – 可运行的 stdio、SSE 和可流式 HTTP 示例。 +- [examples/hosted_mcp](https://github.com/openai/openai-agents-python/tree/main/examples/hosted_mcp) – 完整的托管 MCP 演示,包括审批与连接器。 \ No newline at end of file diff --git a/docs/zh/models/index.md b/docs/zh/models/index.md new file mode 100644 index 000000000..f97b1366c --- /dev/null +++ b/docs/zh/models/index.md @@ -0,0 +1,192 @@ +--- +search: + exclude: true +--- +# 模型 + +Agents SDK 开箱即用地支持两种 OpenAI 模型形态: + +- **推荐**:[`OpenAIResponsesModel`][agents.models.openai_responses.OpenAIResponsesModel],通过新的 [Responses API](https://platform.openai.com/docs/api-reference/responses) 调用 OpenAI 接口。 +- [`OpenAIChatCompletionsModel`][agents.models.openai_chatcompletions.OpenAIChatCompletionsModel],通过 [Chat Completions API](https://platform.openai.com/docs/api-reference/chat) 调用 OpenAI 接口。 + +## OpenAI 模型 + +当你在初始化 `Agent` 时未指定模型,将使用默认模型。当前默认是 [`gpt-4.1`](https://platform.openai.com/docs/models/gpt-4.1),在智能体工作流的可预测性与低延迟之间提供了良好平衡。 + +如果你希望切换到其他模型,如 [`gpt-5`](https://platform.openai.com/docs/models/gpt-5),请按照下一节的步骤操作。 + +### 默认 OpenAI 模型 + +如果你希望对所有未设置自定义模型的智能体始终使用某个特定模型,请在运行智能体前设置 `OPENAI_DEFAULT_MODEL` 环境变量。 + +```bash +export OPENAI_DEFAULT_MODEL=gpt-5 +python3 my_awesome_agent.py +``` + +#### GPT-5 模型 + +当你以这种方式使用任何 GPT-5 推理模型([`gpt-5`](https://platform.openai.com/docs/models/gpt-5)、[`gpt-5-mini`](https://platform.openai.com/docs/models/gpt-5-mini) 或 [`gpt-5-nano`](https://platform.openai.com/docs/models/gpt-5-nano))时,SDK 会默认应用合理的 `ModelSettings`。具体而言,它会将 `reasoning.effort` 和 `verbosity` 都设置为 `"low"`。如果你希望自行构建这些设置,请调用 `agents.models.get_default_model_settings("gpt-5")`。 + +如需更低延迟或满足特定需求,你可以选择不同的模型和设置。要为默认模型调整推理力度,请传入你自己的 `ModelSettings`: + +```python +from openai.types.shared import Reasoning +from agents import Agent, ModelSettings + +my_agent = Agent( + name="My Agent", + instructions="You're a helpful agent.", + model_settings=ModelSettings(reasoning=Reasoning(effort="minimal"), verbosity="low") + # If OPENAI_DEFAULT_MODEL=gpt-5 is set, passing only model_settings works. + # It's also fine to pass a GPT-5 model name explicitly: + # model="gpt-5", +) +``` + +如果专门追求更低延迟,使用 [`gpt-5-mini`](https://platform.openai.com/docs/models/gpt-5-mini) 或 [`gpt-5-nano`](https://platform.openai.com/docs/models/gpt-5-nano) 并设置 `reasoning.effort="minimal"`,通常会比默认设置更快返回结果。然而,Responses API 中的某些内置工具(例如 文件检索 与 图像生成)不支持 `"minimal"` 推理力度,这也是本 Agents SDK 默认为 `"low"` 的原因。 + +#### 非 GPT-5 模型 + +如果你传入非 GPT-5 的模型名称且未提供自定义 `model_settings`,SDK 会回退到对任意模型都兼容的通用 `ModelSettings`。 + +## 非 OpenAI 模型 + +你可以通过 [LiteLLM 集成](./litellm.md) 来使用大多数其他非 OpenAI 模型。首先,安装 litellm 依赖分组: + +```bash +pip install "openai-agents[litellm]" +``` + +然后,使用带有 `litellm/` 前缀的任一[受支持模型](https://docs.litellm.ai/docs/providers): + +```python +claude_agent = Agent(model="litellm/anthropic/claude-3-5-sonnet-20240620", ...) +gemini_agent = Agent(model="litellm/gemini/gemini-2.5-flash-preview-04-17", ...) +``` + +### 使用非 OpenAI 模型的其他方式 + +你还可以通过另外 3 种方式集成其他 LLM 提供方(示例见[此处](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers/)): + +1. [`set_default_openai_client`][agents.set_default_openai_client] 适用于你希望在全局使用一个 `AsyncOpenAI` 实例作为 LLM 客户端的情况。适合 LLM 提供方有 OpenAI 兼容的 API 端点,且你可以设置 `base_url` 和 `api_key`。可参见可配置示例:[examples/model_providers/custom_example_global.py](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers/custom_example_global.py)。 +2. [`ModelProvider`][agents.models.interface.ModelProvider] 位于 `Runner.run` 层级。它允许你指定“在本次运行中为所有智能体使用自定义模型提供方”。可参见可配置示例:[examples/model_providers/custom_example_provider.py](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers/custom_example_provider.py)。 +3. [`Agent.model`][agents.agent.Agent.model] 允许你在特定的 Agent 实例上指定模型。这样你可以为不同的智能体混用不同的提供方。一个简单的方法是通过 [LiteLLM 集成](./litellm.md) 来使用多数可用模型。 + +在你没有来自 `platform.openai.com` 的 API Key 时,建议通过 `set_tracing_disabled()` 来禁用追踪,或设置[不同的追踪进程](../tracing.md)。 + +!!! note + + 在这些示例中,我们使用 Chat Completions API/模型,因为大多数 LLM 提供方尚未支持 Responses API。如果你的 LLM 提供方支持,建议使用 Responses。 + +## 混合与匹配模型 + +在单个工作流中,你可能希望为每个智能体使用不同的模型。例如,你可以使用更小更快的模型进行初步分诊,而在复杂任务上使用更大更强的模型。在配置 [`Agent`][agents.Agent] 时,你可以通过以下方式选择特定模型: + +1. 直接传入模型名称。 +2. 传入任意模型名称 + 一个可以将该名称映射到 Model 实例的 [`ModelProvider`][agents.models.interface.ModelProvider]。 +3. 直接提供一个 [`Model`][agents.models.interface.Model] 的实现。 + +!!!note + + 虽然我们的 SDK 同时支持 [`OpenAIResponsesModel`][agents.models.openai_responses.OpenAIResponsesModel] 和 [`OpenAIChatCompletionsModel`][agents.models.openai_chatcompletions.OpenAIChatCompletionsModel] 两种形态,但我们建议在每个工作流中使用单一模型形态,因为这两种形态支持的功能和工具集不同。如果你的工作流确实需要混用不同的模型形态,请确保你使用的所有功能在两者上都可用。 + +```python +from agents import Agent, Runner, AsyncOpenAI, OpenAIChatCompletionsModel +import asyncio + +spanish_agent = Agent( + name="Spanish agent", + instructions="You only speak Spanish.", + model="gpt-5-mini", # (1)! +) + +english_agent = Agent( + name="English agent", + instructions="You only speak English", + model=OpenAIChatCompletionsModel( # (2)! + model="gpt-5-nano", + openai_client=AsyncOpenAI() + ), +) + +triage_agent = Agent( + name="Triage agent", + instructions="Handoff to the appropriate agent based on the language of the request.", + handoffs=[spanish_agent, english_agent], + model="gpt-5", +) + +async def main(): + result = await Runner.run(triage_agent, input="Hola, ¿cómo estás?") + print(result.final_output) +``` + +1. 直接设置 OpenAI 模型的名称。 +2. 提供一个 [`Model`][agents.models.interface.Model] 的实现。 + +当你需要进一步配置某个智能体所用的模型时,你可以传入 [`ModelSettings`][agents.models.interface.ModelSettings],它提供诸如 temperature 等可选的模型配置参数。 + +```python +from agents import Agent, ModelSettings + +english_agent = Agent( + name="English agent", + instructions="You only speak English", + model="gpt-4.1", + model_settings=ModelSettings(temperature=0.1), +) +``` + +此外,在使用 OpenAI 的 Responses API 时,[还有一些其他可选参数](https://platform.openai.com/docs/api-reference/responses/create)(例如 `user`、`service_tier` 等)。如果这些参数并未在顶层提供,你也可以通过 `extra_args` 传入。 + +```python +from agents import Agent, ModelSettings + +english_agent = Agent( + name="English agent", + instructions="You only speak English", + model="gpt-4.1", + model_settings=ModelSettings( + temperature=0.1, + extra_args={"service_tier": "flex", "user": "user_12345"}, + ), +) +``` + +## 使用其他 LLM 提供方的常见问题 + +### 追踪客户端报错 401 + +如果你遇到与追踪相关的错误,这是因为追踪数据会被上传到 OpenAI 服务,而你没有 OpenAI 的 API Key。你有三种解决方案: + +1. 完全禁用追踪:[`set_tracing_disabled(True)`][agents.set_tracing_disabled]。 +2. 设置用于追踪的 OpenAI Key:[`set_tracing_export_api_key(...)`][agents.set_tracing_export_api_key]。此 API Key 仅用于上传追踪数据,并且必须来自 [platform.openai.com](https://platform.openai.com/)。 +3. 使用非 OpenAI 的追踪进程。参见[追踪文档](../tracing.md#custom-tracing-processors)。 + +### Responses API 支持 + +SDK 默认使用 Responses API,但多数其他 LLM 提供方尚未支持。因此你可能会看到 404 或类似问题。为解决此问题,你有两种选择: + +1. 调用 [`set_default_openai_api("chat_completions")`][agents.set_default_openai_api]。当你通过环境变量设置了 `OPENAI_API_KEY` 和 `OPENAI_BASE_URL` 时适用。 +2. 使用 [`OpenAIChatCompletionsModel`][agents.models.openai_chatcompletions.OpenAIChatCompletionsModel]。示例见[此处](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers/)。 + +### structured outputs 支持 + +有些模型提供方不支持 [structured outputs](https://platform.openai.com/docs/guides/structured-outputs)。这有时会导致类似如下的错误: + +``` + +BadRequestError: Error code: 400 - {'error': {'message': "'response_format.type' : value is not one of the allowed values ['text','json_object']", 'type': 'invalid_request_error'}} + +``` + +这是某些模型提供方的不足之处——它们支持 JSON 输出,但不允许你指定用于输出的 `json_schema`。我们正在努力修复此问题,但建议优先使用支持 JSON schema 输出的提供方,否则你的应用可能会因为 JSON 格式错误而经常出错。 + +## 跨提供方混用模型 + +你需要注意不同模型提供方之间的功能差异,否则可能会遇到错误。例如,OpenAI 支持 structured outputs、多模态输入,以及由OpenAI托管的工具中的 文件检索 和 网络检索,但许多其他提供方不支持这些功能。请注意以下限制: + +- 不要向不支持的提供方发送其无法理解的 `tools` +- 在调用仅支持文本的模型前,过滤掉多模态输入 +- 注意不支持结构化 JSON 输出的提供方可能会偶尔产生无效 JSON \ No newline at end of file diff --git a/docs/zh/models/litellm.md b/docs/zh/models/litellm.md new file mode 100644 index 000000000..640f4186b --- /dev/null +++ b/docs/zh/models/litellm.md @@ -0,0 +1,94 @@ +--- +search: + exclude: true +--- +# 通过 LiteLLM 使用任意模型 + +!!! note + + LiteLLM 集成目前为测试版。你可能会在使用某些模型提供商时遇到问题,特别是较小的提供商。请通过 [GitHub 问题](https://github.com/openai/openai-agents-python/issues)反馈,我们会尽快修复。 + +[LiteLLM](https://docs.litellm.ai/docs/) 是一个库,允许你通过统一接口使用 100+ 个模型。我们已添加对 LiteLLM 的集成,以便你在 Agents SDK 中使用任意 AI 模型。 + +## 设置 + +你需要确保可用 `litellm`。你可以通过安装可选的 `litellm` 依赖组来实现: + +```bash +pip install "openai-agents[litellm]" +``` + +完成后,你可以在任意智能体中使用 [`LitellmModel`][agents.extensions.models.litellm_model.LitellmModel]。 + +## 示例 + +这是一个可直接运行的示例。运行后会提示输入模型名称和 API key。例如,你可以输入: + +- 模型使用 `openai/gpt-4.1`,并提供你的 OpenAI API key +- 模型使用 `anthropic/claude-3-5-sonnet-20240620`,并提供你的 Anthropic API key +- 等等 + +关于 LiteLLM 支持的完整模型列表,请参见 [litellm providers 文档](https://docs.litellm.ai/docs/providers)。 + +```python +from __future__ import annotations + +import asyncio + +from agents import Agent, Runner, function_tool, set_tracing_disabled +from agents.extensions.models.litellm_model import LitellmModel + +@function_tool +def get_weather(city: str): + print(f"[debug] getting weather for {city}") + return f"The weather in {city} is sunny." + + +async def main(model: str, api_key: str): + agent = Agent( + name="Assistant", + instructions="You only respond in haikus.", + model=LitellmModel(model=model, api_key=api_key), + tools=[get_weather], + ) + + result = await Runner.run(agent, "What's the weather in Tokyo?") + print(result.final_output) + + +if __name__ == "__main__": + # First try to get model/api key from args + import argparse + + parser = argparse.ArgumentParser() + parser.add_argument("--model", type=str, required=False) + parser.add_argument("--api-key", type=str, required=False) + args = parser.parse_args() + + model = args.model + if not model: + model = input("Enter a model name for Litellm: ") + + api_key = args.api_key + if not api_key: + api_key = input("Enter an API key for Litellm: ") + + asyncio.run(main(model, api_key)) +``` + +## 使用数据追踪 + +如果你希望 LiteLLM 的响应填充到 Agents SDK 的使用指标中,请在创建智能体时传入 `ModelSettings(include_usage=True)`。 + +```python +from agents import Agent, ModelSettings +from agents.extensions.models.litellm_model import LitellmModel + +agent = Agent( + name="Assistant", + model=LitellmModel(model="your/model", api_key="..."), + model_settings=ModelSettings(include_usage=True), +) +``` + +启用 `include_usage=True` 后,LiteLLM 请求将通过 `result.context_wrapper.usage` 报告 token 和请求计数,与内置的 OpenAI 模型一致。 \ No newline at end of file diff --git a/docs/zh/multi_agent.md b/docs/zh/multi_agent.md new file mode 100644 index 000000000..74b918dce --- /dev/null +++ b/docs/zh/multi_agent.md @@ -0,0 +1,41 @@ +--- +search: + exclude: true +--- +# 多智能体编排 + +编排指的是你在应用中组织智能体的流程:哪些智能体运行、以何种顺序运行、以及它们如何决定下一步。编排智能体主要有两种方式: + +1. 让 LLM 做决策:利用 LLM 的智能来规划、推理,并基于此决定采取的步骤。 +2. 通过代码进行编排:用你的代码决定智能体的执行流程。 + +你可以混合使用这些模式。每种方式都有权衡,详见下文。 + +## 通过 LLM 编排 + +一个智能体是配备了指令(instructions)、工具(tools)和任务转移(handoffs)的 LLM。这意味着对于一个开放式任务,LLM 可以自主规划解决方案,使用工具执行操作并获取数据,并通过任务转移将子任务委派给子智能体。比如,一个研究型智能体可以配备以下工具: + +- 网络检索以在线查找信息 +- 文件检索和读取以搜索专有数据和连接 +- 计算机操作以在计算机上执行动作 +- 代码执行以进行数据分析 +- 向擅长规划、报告撰写等的专业智能体进行任务转移 + +当任务是开放式并希望依赖 LLM 的智能时,这种模式非常适合。这里最重要的做法包括: + +1. 投入精力编写高质量提示词。明确可用工具、使用方式,以及必须遵循的参数范围。 +2. 监控并迭代你的应用。找出问题点,并迭代提示词。 +3. 允许智能体自省和改进。例如,在循环中运行它,让其自我批判;或提供错误信息并让其改进。 +4. 建立在单一任务上表现卓越的专业智能体,而不是期望一个通用智能体在所有方面都很强。 +5. 投入到[评测](https://platform.openai.com/docs/guides/evals)。这有助于训练你的智能体,以改进并在任务上表现更好。 + +## 通过代码编排 + +虽然通过 LLM 编排很强大,但通过代码编排能在速度、成本和性能方面使任务更具确定性与可预测性。常见模式包括: + +- 使用[structured outputs](https://platform.openai.com/docs/guides/structured-outputs)生成可由你的代码检查的格式良好的数据。例如,你可以让智能体将任务分类为几个目录,然后基于该目录选择下一个智能体。 +- 将多个智能体串联,把上一个的输出转换为下一个的输入。你可以将写博客这样的任务分解为一系列步骤——先做研究、写提纲、写正文、进行批判性审阅,然后再改进。 +- 将执行任务的智能体与一个负责评估并提供反馈的智能体一起在 `while` 循环中运行,直到评估者表示输出满足某些标准为止。 +- 并行运行多个智能体,例如通过 Python 基本组件如 `asyncio.gather`。当有多个彼此不依赖的任务时,这对提升速度很有用。 + +我们在[`examples/agent_patterns`](https://github.com/openai/openai-agents-python/tree/main/examples/agent_patterns)中提供了若干代码示例。 \ No newline at end of file diff --git a/docs/zh/quickstart.md b/docs/zh/quickstart.md new file mode 100644 index 000000000..ede0f47f0 --- /dev/null +++ b/docs/zh/quickstart.md @@ -0,0 +1,203 @@ +--- +search: + exclude: true +--- +# 快速开始 + +## 创建项目和虚拟环境 + +你只需执行一次。 + +```bash +mkdir my_project +cd my_project +python -m venv .venv +``` + +### 激活虚拟环境 + +每次开启新的终端会话都要执行。 + +```bash +source .venv/bin/activate +``` + +### 安装 Agents SDK + +```bash +pip install openai-agents # or `uv add openai-agents`, etc +``` + +### 设置 OpenAI API 密钥 + +如果你还没有,按照[这些说明](https://platform.openai.com/docs/quickstart#create-and-export-an-api-key)创建一个 OpenAI API key。 + +```bash +export OPENAI_API_KEY=sk-... +``` + +## 创建你的第一个智能体 + +智能体由 instructions、名称和可选配置(例如 `model_config`)定义。 + +```python +from agents import Agent + +agent = Agent( + name="Math Tutor", + instructions="You provide help with math problems. Explain your reasoning at each step and include examples", +) +``` + +## 再添加几个智能体 + +其他智能体可以用相同方式定义。`handoff_descriptions` 为确定任务转移路由提供额外上下文。 + +```python +from agents import Agent + +history_tutor_agent = Agent( + name="History Tutor", + handoff_description="Specialist agent for historical questions", + instructions="You provide assistance with historical queries. Explain important events and context clearly.", +) + +math_tutor_agent = Agent( + name="Math Tutor", + handoff_description="Specialist agent for math questions", + instructions="You provide help with math problems. Explain your reasoning at each step and include examples", +) +``` + +## 定义你的任务转移 + +在每个智能体上,你可以定义一个外发任务转移选项清单,供智能体选择以决定如何推进其任务。 + +```python +triage_agent = Agent( + name="Triage Agent", + instructions="You determine which agent to use based on the user's homework question", + handoffs=[history_tutor_agent, math_tutor_agent] +) +``` + +## 运行智能体编排 + +让我们检查工作流是否运行,以及分诊智能体是否在两个专家智能体之间正确路由。 + +```python +from agents import Runner + +async def main(): + result = await Runner.run(triage_agent, "What is the capital of France?") + print(result.final_output) +``` + +## 添加安全防护措施 + +你可以在输入或输出上定义自定义安全防护措施。 + +```python +from agents import GuardrailFunctionOutput, Agent, Runner +from pydantic import BaseModel + + +class HomeworkOutput(BaseModel): + is_homework: bool + reasoning: str + +guardrail_agent = Agent( + name="Guardrail check", + instructions="Check if the user is asking about homework.", + output_type=HomeworkOutput, +) + +async def homework_guardrail(ctx, agent, input_data): + result = await Runner.run(guardrail_agent, input_data, context=ctx.context) + final_output = result.final_output_as(HomeworkOutput) + return GuardrailFunctionOutput( + output_info=final_output, + tripwire_triggered=not final_output.is_homework, + ) +``` + +## 整合运行 + +让我们把这些组合起来,运行整个工作流,使用任务转移和输入安全防护措施。 + +```python +from agents import Agent, InputGuardrail, GuardrailFunctionOutput, Runner +from agents.exceptions import InputGuardrailTripwireTriggered +from pydantic import BaseModel +import asyncio + +class HomeworkOutput(BaseModel): + is_homework: bool + reasoning: str + +guardrail_agent = Agent( + name="Guardrail check", + instructions="Check if the user is asking about homework.", + output_type=HomeworkOutput, +) + +math_tutor_agent = Agent( + name="Math Tutor", + handoff_description="Specialist agent for math questions", + instructions="You provide help with math problems. Explain your reasoning at each step and include examples", +) + +history_tutor_agent = Agent( + name="History Tutor", + handoff_description="Specialist agent for historical questions", + instructions="You provide assistance with historical queries. Explain important events and context clearly.", +) + + +async def homework_guardrail(ctx, agent, input_data): + result = await Runner.run(guardrail_agent, input_data, context=ctx.context) + final_output = result.final_output_as(HomeworkOutput) + return GuardrailFunctionOutput( + output_info=final_output, + tripwire_triggered=not final_output.is_homework, + ) + +triage_agent = Agent( + name="Triage Agent", + instructions="You determine which agent to use based on the user's homework question", + handoffs=[history_tutor_agent, math_tutor_agent], + input_guardrails=[ + InputGuardrail(guardrail_function=homework_guardrail), + ], +) + +async def main(): + # Example 1: History question + try: + result = await Runner.run(triage_agent, "who was the first president of the united states?") + print(result.final_output) + except InputGuardrailTripwireTriggered as e: + print("Guardrail blocked this input:", e) + + # Example 2: General/philosophical question + try: + result = await Runner.run(triage_agent, "What is the meaning of life?") + print(result.final_output) + except InputGuardrailTripwireTriggered as e: + print("Guardrail blocked this input:", e) + +if __name__ == "__main__": + asyncio.run(main()) +``` + +## 查看追踪 + +要回顾智能体运行期间发生的事情,请前往 [OpenAI 控制台中的追踪查看器](https://platform.openai.com/traces)查看你的运行追踪。 + +## 后续步骤 + +了解如何构建更复杂的智能体流程: + +- 了解如何配置[智能体](agents.md)。 +- 了解[运行智能体](running_agents.md)。 +- 了解[工具](tools.md)、[安全防护措施](guardrails.md)和[模型](models/index.md)。 \ No newline at end of file diff --git a/docs/zh/realtime/guide.md b/docs/zh/realtime/guide.md new file mode 100644 index 000000000..3ced1edac --- /dev/null +++ b/docs/zh/realtime/guide.md @@ -0,0 +1,176 @@ +--- +search: + exclude: true +--- +# 指南 + +本指南深入介绍如何使用 OpenAI Agents SDK 的实时能力构建语音交互的 AI 智能体。 + +!!! warning "Beta feature" +实时智能体处于 Beta 阶段。随着实现不断改进,可能会有不兼容变更。 + +## 概览 + +实时智能体支持对话式流程,可实时处理音频与文本输入,并以实时音频作出响应。它们与 OpenAI 的 Realtime API 保持长连接,实现自然、低时延的语音对话,并能优雅地处理中断。 + +## 架构 + +### 核心组件 + +实时系统由以下关键组件构成: + +- **RealtimeAgent**: 一个智能体,配置了 instructions、tools 和 任务转移(handoffs)。 +- **RealtimeRunner**: 管理配置。可调用 `runner.run()` 获取会话。 +- **RealtimeSession**: 单次交互会话。通常在每次用户开启对话时创建,并保持存活直到对话结束。 +- **RealtimeModel**: 底层模型接口(通常是 OpenAI 的 WebSocket 实现) + +### 会话流程 + +典型的实时会话遵循如下流程: + +1. **创建 RealtimeAgent**,并配置 instructions、tools 和 任务转移(handoffs)。 +2. **设置 RealtimeRunner**,指定智能体和配置选项。 +3. **启动会话**,使用 `await runner.run()`,该方法返回一个 RealtimeSession。 +4. **向会话发送音频或文本消息**,使用 `send_audio()` 或 `send_message()`。 +5. **监听事件**,通过迭代会话对象来获取事件——包括音频输出、转写文本、工具调用、任务转移以及错误。 +6. **处理中断**,当用户打断智能体说话时,将自动停止当前音频生成。 + +会话会维护对话历史,并管理与实时模型的持久连接。 + +## 智能体配置 + +RealtimeAgent 的工作方式与常规 Agent 类似,但存在一些关键差异。完整 API 细节请参阅 [`RealtimeAgent`][agents.realtime.agent.RealtimeAgent] API 参考。 + +与常规智能体的主要差异: + +- 模型选择在会话级别配置,而不是智能体级别。 +- 不支持 structured output(不支持 `outputType`)。 +- 可为每个智能体配置语音,但在第一个智能体开始说话后便不可更改。 +- 其他特性(例如 tools、任务转移和 instructions)工作方式相同。 + +## 会话配置 + +### 模型设置 + +会话配置允许你控制底层实时模型的行为。你可以配置模型名称(例如 `gpt-realtime`)、语音选择(alloy、echo、fable、onyx、nova、shimmer)以及支持的模态(文本和/或音频)。音频格式可分别为输入与输出设置,默认是 PCM16。 + +### 音频配置 + +音频设置控制会话如何处理语音输入与输出。你可以使用如 Whisper 的模型进行输入音频转写、设定语言偏好,并提供转写提示以提升特定领域术语的准确性。轮次检测设置控制智能体何时开始和停止响应,可配置语音活动检测阈值、静音时长,以及在检测到语音前后的填充时间。 + +## 工具与函数 + +### 添加工具 + +与常规智能体相同,实时智能体支持在对话中执行的 工具调用(function tools): + +```python +from agents import function_tool + +@function_tool +def get_weather(city: str) -> str: + """Get current weather for a city.""" + # Your weather API logic here + return f"The weather in {city} is sunny, 72°F" + +@function_tool +def book_appointment(date: str, time: str, service: str) -> str: + """Book an appointment.""" + # Your booking logic here + return f"Appointment booked for {service} on {date} at {time}" + +agent = RealtimeAgent( + name="Assistant", + instructions="You can help with weather and appointments.", + tools=[get_weather, book_appointment], +) +``` + +## 任务转移 + +### 创建任务转移 + +任务转移允许在专门化智能体之间转移对话。 + +```python +from agents.realtime import realtime_handoff + +# Specialized agents +billing_agent = RealtimeAgent( + name="Billing Support", + instructions="You specialize in billing and payment issues.", +) + +technical_agent = RealtimeAgent( + name="Technical Support", + instructions="You handle technical troubleshooting.", +) + +# Main agent with handoffs +main_agent = RealtimeAgent( + name="Customer Service", + instructions="You are the main customer service agent. Hand off to specialists when needed.", + handoffs=[ + realtime_handoff(billing_agent, tool_description="Transfer to billing support"), + realtime_handoff(technical_agent, tool_description="Transfer to technical support"), + ] +) +``` + +## 事件处理 + +会话会以流的形式发送事件,你可以通过迭代会话对象来监听。事件包括音频输出分片、转写结果、工具执行开始与结束、智能体任务转移,以及错误。需要重点处理的事件包括: + +- **audio**: 智能体响应的原始音频数据 +- **audio_end**: 智能体结束讲话 +- **audio_interrupted**: 用户打断了智能体 +- **tool_start/tool_end**: 工具执行生命周期 +- **handoff**: 发生了智能体任务转移 +- **error**: 处理过程中发生错误 + +完整事件详情请参阅 [`RealtimeSessionEvent`][agents.realtime.events.RealtimeSessionEvent]。 + +## 安全防护措施 + +实时智能体仅支持输出安全防护措施。这些防护以防抖方式周期性运行(而非每个词都运行),以避免实时生成期间的性能问题。默认防抖长度为 100 个字符,可进行配置。 + +安全防护措施可以直接附加到 `RealtimeAgent`,或通过会话的 `run_config` 提供。两处配置的防护会共同生效。 + +```python +from agents.guardrail import GuardrailFunctionOutput, OutputGuardrail + +def sensitive_data_check(context, agent, output): + return GuardrailFunctionOutput( + tripwire_triggered="password" in output, + output_info=None, + ) + +agent = RealtimeAgent( + name="Assistant", + instructions="...", + output_guardrails=[OutputGuardrail(guardrail_function=sensitive_data_check)], +) +``` + +当安全防护被触发时,会生成一个 `guardrail_tripped` 事件,并可中断智能体当前的响应。防抖行为有助于在安全与实时性能需求之间取得平衡。与文本智能体不同,实时智能体在防护被触发时**不会**抛出 Exception。 + +## 音频处理 + +使用 [`session.send_audio(audio_bytes)`][agents.realtime.session.RealtimeSession.send_audio] 发送音频到会话,或使用 [`session.send_message()`][agents.realtime.session.RealtimeSession.send_message] 发送文本。 + +对于音频输出,监听 `audio` 事件,并通过你偏好的音频库播放音频数据。务必监听 `audio_interrupted` 事件,在用户打断智能体时立即停止播放并清空任何已排队的音频。 + +## 模型直接访问 + +你可以访问底层模型,以添加自定义监听器或执行高级操作: + +```python +# Add a custom listener to the model +session.model.add_listener(my_custom_listener) +``` + +这将为你提供对 [`RealtimeModel`][agents.realtime.model.RealtimeModel] 接口的直接访问,适用于需要对连接进行更底层控制的高级用例。 + +## 代码示例 + +完整可运行示例请查看 [examples/realtime 目录](https://github.com/openai/openai-agents-python/tree/main/examples/realtime),其中包含带 UI 和不带 UI 的演示。 \ No newline at end of file diff --git a/docs/zh/realtime/quickstart.md b/docs/zh/realtime/quickstart.md new file mode 100644 index 000000000..d2e0fdca7 --- /dev/null +++ b/docs/zh/realtime/quickstart.md @@ -0,0 +1,232 @@ +--- +search: + exclude: true +--- +# 快速入门 + +实时智能体通过 OpenAI 的 Realtime API 实现与你的 AI 智能体进行语音对话。本指南将带你创建第一个实时语音智能体。 + +!!! warning "测试版功能" +Realtime 智能体目前处于测试阶段。随着我们改进实现,可能会有不兼容的变更。 + +## 先决条件 + +- Python 3.9 或更高版本 +- OpenAI API key +- 对 OpenAI Agents SDK 的基本了解 + +## 安装 + +如果尚未安装,请先安装 OpenAI Agents SDK: + +```bash +pip install openai-agents +``` + +## 创建你的第一个实时智能体 + +### 1. 导入所需组件 + +```python +import asyncio +from agents.realtime import RealtimeAgent, RealtimeRunner +``` + +### 2. 创建实时智能体 + +```python +agent = RealtimeAgent( + name="Assistant", + instructions="You are a helpful voice assistant. Keep your responses conversational and friendly.", +) +``` + +### 3. 设置运行器 + +```python +runner = RealtimeRunner( + starting_agent=agent, + config={ + "model_settings": { + "model_name": "gpt-realtime", + "voice": "ash", + "modalities": ["audio"], + "input_audio_format": "pcm16", + "output_audio_format": "pcm16", + "input_audio_transcription": {"model": "gpt-4o-mini-transcribe"}, + "turn_detection": {"type": "semantic_vad", "interrupt_response": True}, + } + } +) +``` + +### 4. 启动会话 + +```python +# Start the session +session = await runner.run() + +async with session: + print("Session started! The agent will stream audio responses in real-time.") + # Process events + async for event in session: + try: + if event.type == "agent_start": + print(f"Agent started: {event.agent.name}") + elif event.type == "agent_end": + print(f"Agent ended: {event.agent.name}") + elif event.type == "handoff": + print(f"Handoff from {event.from_agent.name} to {event.to_agent.name}") + elif event.type == "tool_start": + print(f"Tool started: {event.tool.name}") + elif event.type == "tool_end": + print(f"Tool ended: {event.tool.name}; output: {event.output}") + elif event.type == "audio_end": + print("Audio ended") + elif event.type == "audio": + # Enqueue audio for callback-based playback with metadata + # Non-blocking put; queue is unbounded, so drops won’t occur. + pass + elif event.type == "audio_interrupted": + print("Audio interrupted") + # Begin graceful fade + flush in the audio callback and rebuild jitter buffer. + elif event.type == "error": + print(f"Error: {event.error}") + elif event.type == "history_updated": + pass # Skip these frequent events + elif event.type == "history_added": + pass # Skip these frequent events + elif event.type == "raw_model_event": + print(f"Raw model event: {_truncate_str(str(event.data), 200)}") + else: + print(f"Unknown event type: {event.type}") + except Exception as e: + print(f"Error processing event: {_truncate_str(str(e), 200)}") + +def _truncate_str(s: str, max_length: int) -> str: + if len(s) > max_length: + return s[:max_length] + "..." + return s +``` + +## 完整示例 + +下面是一个完整的可运行示例: + +```python +import asyncio +from agents.realtime import RealtimeAgent, RealtimeRunner + +async def main(): + # Create the agent + agent = RealtimeAgent( + name="Assistant", + instructions="You are a helpful voice assistant. Keep responses brief and conversational.", + ) + # Set up the runner with configuration + runner = RealtimeRunner( + starting_agent=agent, + config={ + "model_settings": { + "model_name": "gpt-realtime", + "voice": "ash", + "modalities": ["audio"], + "input_audio_format": "pcm16", + "output_audio_format": "pcm16", + "input_audio_transcription": {"model": "gpt-4o-mini-transcribe"}, + "turn_detection": {"type": "semantic_vad", "interrupt_response": True}, + } + }, + ) + # Start the session + session = await runner.run() + + async with session: + print("Session started! The agent will stream audio responses in real-time.") + # Process events + async for event in session: + try: + if event.type == "agent_start": + print(f"Agent started: {event.agent.name}") + elif event.type == "agent_end": + print(f"Agent ended: {event.agent.name}") + elif event.type == "handoff": + print(f"Handoff from {event.from_agent.name} to {event.to_agent.name}") + elif event.type == "tool_start": + print(f"Tool started: {event.tool.name}") + elif event.type == "tool_end": + print(f"Tool ended: {event.tool.name}; output: {event.output}") + elif event.type == "audio_end": + print("Audio ended") + elif event.type == "audio": + # Enqueue audio for callback-based playback with metadata + # Non-blocking put; queue is unbounded, so drops won’t occur. + pass + elif event.type == "audio_interrupted": + print("Audio interrupted") + # Begin graceful fade + flush in the audio callback and rebuild jitter buffer. + elif event.type == "error": + print(f"Error: {event.error}") + elif event.type == "history_updated": + pass # Skip these frequent events + elif event.type == "history_added": + pass # Skip these frequent events + elif event.type == "raw_model_event": + print(f"Raw model event: {_truncate_str(str(event.data), 200)}") + else: + print(f"Unknown event type: {event.type}") + except Exception as e: + print(f"Error processing event: {_truncate_str(str(e), 200)}") + +def _truncate_str(s: str, max_length: int) -> str: + if len(s) > max_length: + return s[:max_length] + "..." + return s + +if __name__ == "__main__": + # Run the session + asyncio.run(main()) +``` + +## 配置选项 + +### 模型设置 + +- `model_name`: 从可用的实时模型中选择(例如,`gpt-realtime`) +- `voice`: 选择语音(`alloy`、`echo`、`fable`、`onyx`、`nova`、`shimmer`) +- `modalities`: 启用文本或音频(`["text"]` 或 `["audio"]`) + +### 音频设置 + +- `input_audio_format`: 输入音频格式(`pcm16`、`g711_ulaw`、`g711_alaw`) +- `output_audio_format`: 输出音频格式 +- `input_audio_transcription`: 转写配置 + +### 发言轮次检测 + +- `type`: 检测方法(`server_vad`、`semantic_vad`) +- `threshold`: 语音活动阈值(0.0-1.0) +- `silence_duration_ms`: 用于检测轮次结束的静音时长 +- `prefix_padding_ms`: 语音前的音频填充 + +## 后续步骤 + +- [进一步了解实时智能体](guide.md) +- 查看 [examples/realtime](https://github.com/openai/openai-agents-python/tree/main/examples/realtime) 文件夹中的可运行的 code examples +- 为你的智能体添加工具 +- 实现智能体之间的任务转移 +- 设置安全防护措施以确保安全 + +## 身份验证 + +请确保你的 OpenAI API key 已在环境中设置: + +```bash +export OPENAI_API_KEY="your-api-key-here" +``` + +或在创建会话时直接传入: + +```python +session = await runner.run(model_config={"api_key": "your-api-key"}) +``` \ No newline at end of file diff --git a/docs/zh/release.md b/docs/zh/release.md new file mode 100644 index 000000000..4566a8b68 --- /dev/null +++ b/docs/zh/release.md @@ -0,0 +1,40 @@ +--- +search: + exclude: true +--- +# 发布流程/更新日志 + +本项目采用略经修改的语义化版本控制,形式为 `0.Y.Z`。前导的 `0` 表示该 SDK 仍在快速演进中。各部分递增规则如下: + +## 次要(`Y`)版本 + +对于未标记为 beta 的任何公共接口发生**重大变更**时,我们会提升次要版本 `Y`。例如,从 `0.0.x` 升级到 `0.1.x` 可能包含重大变更。 + +如果你不希望引入重大变更,我们建议在你的项目中固定到 `0.0.x` 版本。 + +## 修订(`Z`)版本 + +对于非破坏性变更,我们会递增 `Z`: + +- Bug 修复 +- 新功能 +- 对私有接口的更改 +- 对 beta 功能的更新 + +## 重大变更更新日志 + +### 0.4.0 + +在该版本中,[openai](https://pypi.org/project/openai/) 包的 v1.x 版本不再受支持。请将 openai 升级到 v2.x 并与本 SDK 一起使用。 + +### 0.3.0 + +在该版本中,Realtime API 的支持迁移到 gpt-realtime 模型及其 API 接口(GA 版本)。 + +### 0.2.0 + +在该版本中,原本接受 `Agent` 作为参数的若干位置,现在改为接受 `AgentBase` 作为参数。例如,MCP 服务中的 `list_tools()` 调用。这只是类型方面的更改,你仍将收到 `Agent` 对象。要更新的话,只需将类型中的 `Agent` 替换为 `AgentBase` 来修复类型错误。 + +### 0.1.0 + +在该版本中,[`MCPServer.list_tools()`][agents.mcp.server.MCPServer] 新增了两个参数:`run_context` 和 `agent`。你需要在任何继承自 `MCPServer` 的类中添加这些参数。 \ No newline at end of file diff --git a/docs/zh/repl.md b/docs/zh/repl.md new file mode 100644 index 000000000..79d6ed215 --- /dev/null +++ b/docs/zh/repl.md @@ -0,0 +1,23 @@ +--- +search: + exclude: true +--- +# REPL 实用工具 + +The SDK 提供了 `run_demo_loop`,可在终端中直接对智能体行为进行快速、交互式测试。 + +```python +import asyncio +from agents import Agent, run_demo_loop + +async def main() -> None: + agent = Agent(name="Assistant", instructions="You are a helpful assistant.") + await run_demo_loop(agent) + +if __name__ == "__main__": + asyncio.run(main()) +``` + +`run_demo_loop` 在循环中提示用户输入,并在回合之间保留对话历史。默认情况下,它会以生成时的方式对模型输出进行流式传输。运行上面的示例后,run_demo_loop 会启动一个交互式聊天会话。它会持续请求你的输入、在各回合之间记住完整的对话历史(因此你的智能体知道已讨论的内容),并在生成的同时将智能体的响应实时流式传输给你。 + +要结束此聊天会话,只需输入 `quit` 或 `exit`(并按下回车),或使用 `Ctrl-D` 键盘快捷键。 \ No newline at end of file diff --git a/docs/zh/results.md b/docs/zh/results.md new file mode 100644 index 000000000..0366637fc --- /dev/null +++ b/docs/zh/results.md @@ -0,0 +1,56 @@ +--- +search: + exclude: true +--- +# 结果 + +当你调用 `Runner.run` 方法时,你会得到: + +- [`RunResult`][agents.result.RunResult],如果你调用的是 `run` 或 `run_sync` +- [`RunResultStreaming`][agents.result.RunResultStreaming],如果你调用的是 `run_streamed` + +二者都继承自 [`RunResultBase`][agents.result.RunResultBase],大多数有用信息都在这里。 + +## 最终输出 + +[`final_output`][agents.result.RunResultBase.final_output] 属性包含最后一个运行的智能体的最终输出。它可能是: + +- 一个 `str`,如果最后一个智能体未定义 `output_type` +- 一个类型为 `last_agent.output_type` 的对象,如果该智能体定义了输出类型。 + +!!! note + + `final_output` 的类型是 `Any`。由于存在任务转移,我们无法进行静态类型标注。如果发生任务转移,意味着任意智能体都可能成为最后一个智能体,因此我们在静态上无法知道可能的输出类型集合。 + +## 下一轮输入 + +你可以使用 [`result.to_input_list()`][agents.result.RunResultBase.to_input_list] 将结果转换为一个输入列表,它会把你提供的原始输入与智能体运行期间生成的条目进行拼接。这样便于将一次智能体运行的输出传递到另一次运行中,或在循环中运行并每次追加新的用户输入。 + +## 最后的智能体 + +[`last_agent`][agents.result.RunResultBase.last_agent] 属性包含最后一个运行的智能体。根据你的应用场景,这对下一次用户输入通常很有用。例如,如果你有一个前线分诊智能体会进行任务转移到特定语言的智能体,你可以存储最后的智能体,并在用户下次向智能体发送消息时复用它。 + +## 新增条目 + +[`new_items`][agents.result.RunResultBase.new_items] 属性包含此次运行期间生成的新条目。每个条目都是一个 [`RunItem`][agents.items.RunItem]。运行条目会封装由 LLM 生成的原始条目。 + +- [`MessageOutputItem`][agents.items.MessageOutputItem] 表示来自 LLM 的消息。原始条目是生成的消息。 +- [`HandoffCallItem`][agents.items.HandoffCallItem] 表示 LLM 调用了任务转移工具。原始条目是来自 LLM 的工具调用条目。 +- [`HandoffOutputItem`][agents.items.HandoffOutputItem] 表示发生了一次任务转移。原始条目是对任务转移工具调用的工具响应。你还可以从条目中访问源/目标智能体。 +- [`ToolCallItem`][agents.items.ToolCallItem] 表示 LLM 调用了一个工具。 +- [`ToolCallOutputItem`][agents.items.ToolCallOutputItem] 表示一个工具被调用。原始条目是工具响应。你也可以从条目中访问工具输出。 +- [`ReasoningItem`][agents.items.ReasoningItem] 表示来自 LLM 的推理条目。原始条目是生成的推理。 + +## 其他信息 + +### 安全防护措施结果 + +[`input_guardrail_results`][agents.result.RunResultBase.input_guardrail_results] 和 [`output_guardrail_results`][agents.result.RunResultBase.output_guardrail_results] 属性包含安全防护措施的结果(如果有)。这些结果有时包含你可能想要记录或存储的有用信息,因此我们将其提供给你。 + +### 原始响应 + +[`raw_responses`][agents.result.RunResultBase.raw_responses] 属性包含由 LLM 生成的 [`ModelResponse`][agents.items.ModelResponse]。 + +### 原始输入 + +[`input`][agents.result.RunResultBase.input] 属性包含你提供给 `run` 方法的原始输入。大多数情况下你可能不需要它,但在需要时它是可用的。 \ No newline at end of file diff --git a/docs/zh/running_agents.md b/docs/zh/running_agents.md new file mode 100644 index 000000000..86bdc1bc6 --- /dev/null +++ b/docs/zh/running_agents.md @@ -0,0 +1,206 @@ +--- +search: + exclude: true +--- +# 运行智能体 + +你可以通过 [`Runner`][agents.run.Runner] 类来运行智能体。你有 3 个选项: + +1. [`Runner.run()`][agents.run.Runner.run]:异步运行并返回一个 [`RunResult`][agents.result.RunResult]。 +2. [`Runner.run_sync()`][agents.run.Runner.run_sync]:同步方法,内部调用 `.run()`。 +3. [`Runner.run_streamed()`][agents.run.Runner.run_streamed]:异步运行并返回一个 [`RunResultStreaming`][agents.result.RunResultStreaming]。它以流式方式调用 LLM,并在接收时将事件流式传输给你。 + +```python +from agents import Agent, Runner + +async def main(): + agent = Agent(name="Assistant", instructions="You are a helpful assistant") + + result = await Runner.run(agent, "Write a haiku about recursion in programming.") + print(result.final_output) + # Code within the code, + # Functions calling themselves, + # Infinite loop's dance +``` + +在[结果指南](results.md)中了解更多。 + +## 智能体循环 + +当你在 `Runner` 中使用 run 方法时,你需要传入一个起始智能体和输入。输入可以是字符串(视为用户消息),也可以是输入项列表——这些是 OpenAI Responses API 中的项。 + +runner 随后运行一个循环: + +1. 我们使用当前输入,为当前智能体调用 LLM。 +2. LLM 生成输出。 + 1. 如果 LLM 返回 `final_output`,循环结束并返回结果。 + 2. 如果 LLM 进行任务转移,我们会更新当前智能体和输入,并重新运行循环。 + 3. 如果 LLM 产生工具调用,我们会运行这些工具调用,追加结果,并重新运行循环。 +3. 如果超过传入的 `max_turns`,我们会抛出一个 [`MaxTurnsExceeded`][agents.exceptions.MaxTurnsExceeded] 异常。 + +!!! note + + 判断 LLM 输出是否为“最终输出”的规则是:它生成了所需类型的文本输出,且不存在工具调用。 + +## 流式传输 + +流式传输允许你在 LLM 运行时额外接收流事件。流结束后,[`RunResultStreaming`][agents.result.RunResultStreaming] 将包含关于这次运行的完整信息,包括所有新产生的输出。你可以调用 `.stream_events()` 获取流事件。详见[流式传输指南](streaming.md)。 + +## 运行配置 + +`run_config` 参数可让你为智能体运行配置一些全局设置: + +- [`model`][agents.run.RunConfig.model]:允许设置一个全局的 LLM 模型使用,而不受每个 Agent 的 `model` 限制。 +- [`model_provider`][agents.run.RunConfig.model_provider]:用于查找模型名称的模型提供方,默认是 OpenAI。 +- [`model_settings`][agents.run.RunConfig.model_settings]:覆盖智能体特定设置。例如,你可以设置全局的 `temperature` 或 `top_p`。 +- [`input_guardrails`][agents.run.RunConfig.input_guardrails]、[`output_guardrails`][agents.run.RunConfig.output_guardrails]:在所有运行中包含的输入或输出安全防护措施列表。 +- [`handoff_input_filter`][agents.run.RunConfig.handoff_input_filter]:应用于所有任务转移的全局输入过滤器(如果该任务转移尚未定义)。输入过滤器允许你编辑发送给新智能体的输入。详见 [`Handoff.input_filter`][agents.handoffs.Handoff.input_filter] 的文档。 +- [`tracing_disabled`][agents.run.RunConfig.tracing_disabled]:允许你为整个运行禁用[追踪](tracing.md)。 +- [`trace_include_sensitive_data`][agents.run.RunConfig.trace_include_sensitive_data]:配置追踪中是否包含潜在敏感数据,例如 LLM 和工具调用的输入/输出。 +- [`workflow_name`][agents.run.RunConfig.workflow_name]、[`trace_id`][agents.run.RunConfig.trace_id]、[`group_id`][agents.run.RunConfig.group_id]:为本次运行设置追踪的工作流名称、追踪 ID 和追踪分组 ID。我们建议至少设置 `workflow_name`。分组 ID 是可选字段,用于在多次运行之间关联追踪。 +- [`trace_metadata`][agents.run.RunConfig.trace_metadata]:要包含在所有追踪中的元数据。 + +## 会话/聊天线程 + +调用任一运行方法可能导致一个或多个智能体运行(因此可能有一次或多次 LLM 调用),但它代表一次聊天会话中的单个逻辑轮次。例如: + +1. 用户轮次:用户输入文本 +2. Runner 运行:第一个智能体调用 LLM、运行工具、进行一次任务转移到第二个智能体,第二个智能体运行更多工具,然后生成输出。 + +在智能体运行结束时,你可以选择展示给用户的内容。例如,你可以向用户展示由智能体生成的每个新条目,或仅展示最终输出。无论哪种方式,用户都可能提出后续问题,此时你可以再次调用 run 方法。 + +### 手动会话管理 + +你可以使用 [`RunResultBase.to_input_list()`][agents.result.RunResultBase.to_input_list] 方法手动管理会话历史,以获取下一轮的输入: + +```python +async def main(): + agent = Agent(name="Assistant", instructions="Reply very concisely.") + + thread_id = "thread_123" # Example thread ID + with trace(workflow_name="Conversation", group_id=thread_id): + # First turn + result = await Runner.run(agent, "What city is the Golden Gate Bridge in?") + print(result.final_output) + # San Francisco + + # Second turn + new_input = result.to_input_list() + [{"role": "user", "content": "What state is it in?"}] + result = await Runner.run(agent, new_input) + print(result.final_output) + # California +``` + +### 使用 Sessions 的自动会话管理 + +如果需要更简单的方式,你可以使用 [Sessions](sessions/index.md) 自动处理会话历史,而无需手动调用 `.to_input_list()`: + +```python +from agents import Agent, Runner, SQLiteSession + +async def main(): + agent = Agent(name="Assistant", instructions="Reply very concisely.") + + # Create session instance + session = SQLiteSession("conversation_123") + + thread_id = "thread_123" # Example thread ID + with trace(workflow_name="Conversation", group_id=thread_id): + # First turn + result = await Runner.run(agent, "What city is the Golden Gate Bridge in?", session=session) + print(result.final_output) + # San Francisco + + # Second turn - agent automatically remembers previous context + result = await Runner.run(agent, "What state is it in?", session=session) + print(result.final_output) + # California +``` + +Sessions 会自动: + +- 在每次运行前获取会话历史 +- 在每次运行后存储新消息 +- 为不同的会话 ID 维护独立的会话 + +更多详情见[Sessions 文档](sessions/index.md)。 + +### 由服务端管理的会话 + +你也可以让 OpenAI 的会话状态功能在服务端管理会话状态,而不是使用 `to_input_list()` 或 `Sessions` 在本地处理。这样可以在无需手动重发所有历史消息的情况下保留会话历史。更多详情见 [OpenAI Conversation state 指南](https://platform.openai.com/docs/guides/conversation-state?api-mode=responses)。 + +OpenAI 提供两种跨轮次跟踪状态的方法: + +#### 1. 使用 `conversation_id` + +你首先使用 OpenAI Conversations API 创建一个会话,然后在后续的每次调用中复用其 ID: + +```python +from agents import Agent, Runner +from openai import AsyncOpenAI + +client = AsyncOpenAI() + +async def main(): + # Create a server-managed conversation + conversation = await client.conversations.create() + conv_id = conversation.id + + agent = Agent(name="Assistant", instructions="Reply very concisely.") + + # First turn + result1 = await Runner.run(agent, "What city is the Golden Gate Bridge in?", conversation_id=conv_id) + print(result1.final_output) + # San Francisco + + # Second turn reuses the same conversation_id + result2 = await Runner.run( + agent, + "What state is it in?", + conversation_id=conv_id, + ) + print(result2.final_output) + # California +``` + +#### 2. 使用 `previous_response_id` + +另一种选择是**响应链(response chaining)**,其中每一轮显式链接到上一轮的响应 ID。 + +```python +from agents import Agent, Runner + +async def main(): + agent = Agent(name="Assistant", instructions="Reply very concisely.") + + # First turn + result1 = await Runner.run(agent, "What city is the Golden Gate Bridge in?") + print(result1.final_output) + # San Francisco + + # Second turn, chained to the previous response + result2 = await Runner.run( + agent, + "What state is it in?", + previous_response_id=result1.last_response_id, + ) + print(result2.final_output) + # California +``` + + +## 长运行智能体与人类参与 + +你可以使用 Agents SDK 的 [Temporal](https://temporal.io/) 集成来运行持久的、长时间运行的工作流,包括人类参与的任务。观看 Temporal 与 Agents SDK 协同完成长时任务的演示[视频](https://www.youtube.com/watch?v=fFBZqzT4DD8),并[查看文档](https://github.com/temporalio/sdk-python/tree/main/temporalio/contrib/openai_agents)。 + +## 异常 + +SDK 在某些情况下会抛出异常。完整列表见 [`agents.exceptions`][]。概览如下: + +- [`AgentsException`][agents.exceptions.AgentsException]:这是 SDK 内抛出的所有异常的基类。它作为通用类型,其他特定异常都从它派生。 +- [`MaxTurnsExceeded`][agents.exceptions.MaxTurnsExceeded]:当智能体运行超过传递给 `Runner.run`、`Runner.run_sync` 或 `Runner.run_streamed` 的 `max_turns` 限制时抛出该异常。它表示智能体无法在指定的交互轮次内完成任务。 +- [`ModelBehaviorError`][agents.exceptions.ModelBehaviorError]:当底层模型(LLM)产生意外或无效输出时发生。包括: + - JSON 结构不合法:当模型为工具调用或其直接输出提供了格式错误的 JSON,特别是在定义了特定 `output_type` 时。 + - 与工具相关的意外失败:当模型未按预期方式使用工具时 +- [`UserError`][agents.exceptions.UserError]:当你(使用该 SDK 编写代码的人)在使用 SDK 时出现错误会抛出此异常。通常由代码实现不正确、配置无效或误用 SDK 的 API 导致。 +- [`InputGuardrailTripwireTriggered`][agents.exceptions.InputGuardrailTripwireTriggered]、[`OutputGuardrailTripwireTriggered`][agents.exceptions.OutputGuardrailTripwireTriggered]:当输入安全防护措施或输出安全防护措施的条件被满足时分别抛出该异常。输入安全防护措施在处理前检查传入消息,而输出安全防护措施在交付前检查智能体的最终响应。 \ No newline at end of file diff --git a/docs/zh/sessions.md b/docs/zh/sessions.md new file mode 100644 index 000000000..7e43d8044 --- /dev/null +++ b/docs/zh/sessions.md @@ -0,0 +1,460 @@ +--- +search: + exclude: true +--- +# 会话 + +Agents SDK 提供内置的会话内存,可在多个智能体运行之间自动维护对话历史,无需在回合之间手动处理 `.to_input_list()`。 + +会话为特定会话存储对话历史,使智能体无需显式的手动内存管理即可保持上下文。这对于构建聊天应用或多轮对话尤为有用,你可以让智能体记住之前的交互。 + +## 快速开始 + +```python +from agents import Agent, Runner, SQLiteSession + +# Create agent +agent = Agent( + name="Assistant", + instructions="Reply very concisely.", +) + +# Create a session instance with a session ID +session = SQLiteSession("conversation_123") + +# First turn +result = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session +) +print(result.final_output) # "San Francisco" + +# Second turn - agent automatically remembers previous context +result = await Runner.run( + agent, + "What state is it in?", + session=session +) +print(result.final_output) # "California" + +# Also works with synchronous runner +result = Runner.run_sync( + agent, + "What's the population?", + session=session +) +print(result.final_output) # "Approximately 39 million" +``` + +## 工作原理 + +当启用会话内存时: + +1. **每次运行前**:运行器会自动检索该会话的对话历史,并将其预置到输入项之前。 +2. **每次运行后**:在运行期间生成的所有新条目(用户输入、助手响应、工具调用等)都会自动存储到会话中。 +3. **上下文保留**:使用相同会话的后续运行将包含完整对话历史,使智能体能够保持上下文。 + +这消除了在运行之间手动调用 `.to_input_list()` 并管理对话状态的需要。 + +## 内存操作 + +### 基础操作 + +会话支持多种用于管理对话历史的操作: + +```python +from agents import SQLiteSession + +session = SQLiteSession("user_123", "conversations.db") + +# Get all items in a session +items = await session.get_items() + +# Add new items to a session +new_items = [ + {"role": "user", "content": "Hello"}, + {"role": "assistant", "content": "Hi there!"} +] +await session.add_items(new_items) + +# Remove and return the most recent item +last_item = await session.pop_item() +print(last_item) # {"role": "assistant", "content": "Hi there!"} + +# Clear all items from a session +await session.clear_session() +``` + +### 使用 pop_item 进行更正 + +当你想要撤销或修改对话中的最后一个条目时,`pop_item` 方法特别有用: + +```python +from agents import Agent, Runner, SQLiteSession + +agent = Agent(name="Assistant") +session = SQLiteSession("correction_example") + +# Initial conversation +result = await Runner.run( + agent, + "What's 2 + 2?", + session=session +) +print(f"Agent: {result.final_output}") + +# User wants to correct their question +assistant_item = await session.pop_item() # Remove agent's response +user_item = await session.pop_item() # Remove user's question + +# Ask a corrected question +result = await Runner.run( + agent, + "What's 2 + 3?", + session=session +) +print(f"Agent: {result.final_output}") +``` + +## 内存选项 + +### 无内存(默认) + +```python +# Default behavior - no session memory +result = await Runner.run(agent, "Hello") +``` + +### OpenAI Conversations API 内存 + +使用 [OpenAI Conversations API](https://platform.openai.com/docs/api-reference/conversations/create) 来持久化 +[conversation state](https://platform.openai.com/docs/guides/conversation-state?api-mode=responses#using-the-conversations-api),无需管理你自己的数据库。当你已经依赖由 OpenAI 托管的基础设施来存储对话历史时,这将很有帮助。 + +```python +from agents import OpenAIConversationsSession + +session = OpenAIConversationsSession() + +# Optionally resume a previous conversation by passing a conversation ID +# session = OpenAIConversationsSession(conversation_id="conv_123") + +result = await Runner.run( + agent, + "Hello", + session=session, +) +``` + +### SQLite 内存 + +```python +from agents import SQLiteSession + +# In-memory database (lost when process ends) +session = SQLiteSession("user_123") + +# Persistent file-based database +session = SQLiteSession("user_123", "conversations.db") + +# Use the session +result = await Runner.run( + agent, + "Hello", + session=session +) +``` + +### 多会话 + +```python +from agents import Agent, Runner, SQLiteSession + +agent = Agent(name="Assistant") + +# Different sessions maintain separate conversation histories +session_1 = SQLiteSession("user_123", "conversations.db") +session_2 = SQLiteSession("user_456", "conversations.db") + +result1 = await Runner.run( + agent, + "Hello", + session=session_1 +) +result2 = await Runner.run( + agent, + "Hello", + session=session_2 +) +``` + +### 由 SQLAlchemy 驱动的会话 + +对于更高级的用例,你可以使用由 SQLAlchemy 驱动的会话后端。这样就可以使用任何 SQLAlchemy 支持的数据库(PostgreSQL、MySQL、SQLite 等)来进行会话存储。 + +**示例 1:使用 `from_url` 搭配内存型 SQLite** + +这是最简单的入门方式,适合开发和测试。 + +```python +import asyncio +from agents import Agent, Runner +from agents.extensions.memory.sqlalchemy_session import SQLAlchemySession + +async def main(): + agent = Agent("Assistant") + session = SQLAlchemySession.from_url( + "user-123", + url="sqlite+aiosqlite:///:memory:", + create_tables=True, # Auto-create tables for the demo + ) + + result = await Runner.run(agent, "Hello", session=session) + +if __name__ == "__main__": + asyncio.run(main()) +``` + +**示例 2:使用现有的 SQLAlchemy 引擎** + +在生产应用中,你很可能已经拥有一个 SQLAlchemy 的 `AsyncEngine` 实例。你可以将其直接传递给会话。 + +```python +import asyncio +from agents import Agent, Runner +from agents.extensions.memory.sqlalchemy_session import SQLAlchemySession +from sqlalchemy.ext.asyncio import create_async_engine + +async def main(): + # In your application, you would use your existing engine + engine = create_async_engine("sqlite+aiosqlite:///conversations.db") + + agent = Agent("Assistant") + session = SQLAlchemySession( + "user-456", + engine=engine, + create_tables=True, # Auto-create tables for the demo + ) + + result = await Runner.run(agent, "Hello", session=session) + print(result.final_output) + + await engine.dispose() + +if __name__ == "__main__": + asyncio.run(main()) +``` + +### 加密会话 + +对于需要对静态对话数据进行加密的应用,你可以使用 `EncryptedSession` 来包装任意会话后端,实现透明加密和基于 TTL 的自动过期。这需要 `encrypt` 可选依赖:`pip install openai-agents[encrypt]`。 + +`EncryptedSession` 使用基于每个会话的密钥派生(HKDF)的 Fernet 加密,并支持旧消息的自动过期。当条目超过 TTL 时,它们在检索期间会被静默跳过。 + +**示例:为 SQLAlchemy 会话数据加密** + +```python +import asyncio +from agents import Agent, Runner +from agents.extensions.memory import EncryptedSession, SQLAlchemySession + +async def main(): + # Create underlying session (works with any SessionABC implementation) + underlying_session = SQLAlchemySession.from_url( + session_id="user-123", + url="postgresql+asyncpg://app:secret@db.example.com/agents", + create_tables=True, + ) + + # Wrap with encryption and TTL-based expiration + session = EncryptedSession( + session_id="user-123", + underlying_session=underlying_session, + encryption_key="your-encryption-key", # Use a secure key from your secrets management + ttl=600, # 10 minutes - items older than this are silently skipped + ) + + agent = Agent("Assistant") + result = await Runner.run(agent, "Hello", session=session) + print(result.final_output) + +if __name__ == "__main__": + asyncio.run(main()) +``` + +**关键特性:** + +- **透明加密**:在存储前自动加密所有会话条目,并在检索时解密 +- **按会话派生密钥**:使用会话 ID 作为盐的 HKDF 来派生唯一加密密钥 +- **基于 TTL 的过期**:根据可配置的生存时间(默认:10 分钟)自动使旧消息过期 +- **灵活的密钥输入**:接受 Fernet 密钥或原始字符串作为加密密钥 +- **可包装任意会话**:适用于 SQLite、SQLAlchemy 或自定义会话实现 + +!!! warning "重要的安全注意事项" + + - 安全存储你的加密密钥(如环境变量、密钥管理服务) + - 过期令牌根据应用服务的系统时钟被拒绝——请确保所有服务均通过 NTP 同步时间,以避免因时钟漂移导致的误拒 + - 底层会话仍存储加密数据,因此你依然可以掌控你的数据库基础设施 + + +## 自定义内存实现 + +你可以通过创建遵循 [`Session`][agents.memory.session.Session] 协议的类来实现你自己的会话内存: + +```python +from agents.memory.session import SessionABC +from agents.items import TResponseInputItem +from typing import List + +class MyCustomSession(SessionABC): + """Custom session implementation following the Session protocol.""" + + def __init__(self, session_id: str): + self.session_id = session_id + # Your initialization here + + async def get_items(self, limit: int | None = None) -> List[TResponseInputItem]: + """Retrieve conversation history for this session.""" + # Your implementation here + pass + + async def add_items(self, items: List[TResponseInputItem]) -> None: + """Store new items for this session.""" + # Your implementation here + pass + + async def pop_item(self) -> TResponseInputItem | None: + """Remove and return the most recent item from this session.""" + # Your implementation here + pass + + async def clear_session(self) -> None: + """Clear all items for this session.""" + # Your implementation here + pass + +# Use your custom session +agent = Agent(name="Assistant") +result = await Runner.run( + agent, + "Hello", + session=MyCustomSession("my_session") +) +``` + +## 会话管理 + +### 会话 ID 命名 + +使用有意义的会话 ID 来帮助组织对话: + +- 基于用户:`"user_12345"` +- 基于线程:`"thread_abc123"` +- 基于上下文:`"support_ticket_456"` + +### 内存持久化 + +- 临时会话使用内存型 SQLite(`SQLiteSession("session_id")`) +- 持久化会话使用基于文件的 SQLite(`SQLiteSession("session_id", "path/to/db.sqlite")`) +- 生产系统且已有数据库时,使用由 SQLAlchemy 驱动的会话(`SQLAlchemySession("session_id", engine=engine, create_tables=True)`),支持 SQLAlchemy 支持的数据库 +- 当你希望将历史存储在 OpenAI Conversations API 中时,使用 OpenAI 托管的存储(`OpenAIConversationsSession()`) +- 使用加密会话(`EncryptedSession(session_id, underlying_session, encryption_key)`)为任意会话提供透明加密与基于 TTL 的过期 +- 针对其他生产系统(Redis、Django 等)考虑实现自定义会话后端,以满足更高级的用例 + +### 会话管理 + +```python +# Clear a session when conversation should start fresh +await session.clear_session() + +# Different agents can share the same session +support_agent = Agent(name="Support") +billing_agent = Agent(name="Billing") +session = SQLiteSession("user_123") + +# Both agents will see the same conversation history +result1 = await Runner.run( + support_agent, + "Help me with my account", + session=session +) +result2 = await Runner.run( + billing_agent, + "What are my charges?", + session=session +) +``` + +## 完整示例 + +以下是展示会话内存实际效果的完整示例: + +```python +import asyncio +from agents import Agent, Runner, SQLiteSession + + +async def main(): + # Create an agent + agent = Agent( + name="Assistant", + instructions="Reply very concisely.", + ) + + # Create a session instance that will persist across runs + session = SQLiteSession("conversation_123", "conversation_history.db") + + print("=== Sessions Example ===") + print("The agent will remember previous messages automatically.\n") + + # First turn + print("First turn:") + print("User: What city is the Golden Gate Bridge in?") + result = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session + ) + print(f"Assistant: {result.final_output}") + print() + + # Second turn - the agent will remember the previous conversation + print("Second turn:") + print("User: What state is it in?") + result = await Runner.run( + agent, + "What state is it in?", + session=session + ) + print(f"Assistant: {result.final_output}") + print() + + # Third turn - continuing the conversation + print("Third turn:") + print("User: What's the population of that state?") + result = await Runner.run( + agent, + "What's the population of that state?", + session=session + ) + print(f"Assistant: {result.final_output}") + print() + + print("=== Conversation Complete ===") + print("Notice how the agent remembered the context from previous turns!") + print("Sessions automatically handles conversation history.") + + +if __name__ == "__main__": + asyncio.run(main()) +``` + +## API 参考 + +详细的 API 文档请参阅: + +- [`Session`][agents.memory.Session] - 协议接口 +- [`SQLiteSession`][agents.memory.SQLiteSession] - SQLite 实现 +- [`OpenAIConversationsSession`](ref/memory/openai_conversations_session.md) - OpenAI Conversations API 实现 +- [`SQLAlchemySession`][agents.extensions.memory.sqlalchemy_session.SQLAlchemySession] - 由 SQLAlchemy 驱动的实现 +- [`EncryptedSession`][agents.extensions.memory.encrypt_session.EncryptedSession] - 具有 TTL 的加密会话封装器 \ No newline at end of file diff --git a/docs/zh/sessions/advanced_sqlite_session.md b/docs/zh/sessions/advanced_sqlite_session.md new file mode 100644 index 000000000..be10813e6 --- /dev/null +++ b/docs/zh/sessions/advanced_sqlite_session.md @@ -0,0 +1,307 @@ +--- +search: + exclude: true +--- +# 高级 SQLite 会话 + +`AdvancedSQLiteSession` 是基础 `SQLiteSession` 的增强版本,提供包括会话分支、详细用量分析和结构化会话查询在内的高级对话管理能力。 + +## 功能 + +- **会话分支**: 可从任意用户消息创建替代的对话路径 +- **用量追踪**: 每轮详细的 token 用量分析和完整的 JSON 明细 +- **结构化查询**: 按轮次获取会话、工具使用统计等 +- **分支管理**: 独立的分支切换与管理 +- **消息结构元数据**: 追踪消息类型、工具使用和会话流转 + +## 快速开始 + +```python +from agents import Agent, Runner +from agents.extensions.memory import AdvancedSQLiteSession + +# Create agent +agent = Agent( + name="Assistant", + instructions="Reply very concisely.", +) + +# Create an advanced session +session = AdvancedSQLiteSession( + session_id="conversation_123", + db_path="conversations.db", + create_tables=True +) + +# First conversation turn +result = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session +) +print(result.final_output) # "San Francisco" + +# IMPORTANT: Store usage data +await session.store_run_usage(result) + +# Continue conversation +result = await Runner.run( + agent, + "What state is it in?", + session=session +) +print(result.final_output) # "California" +await session.store_run_usage(result) +``` + +## 初始化 + +```python +from agents.extensions.memory import AdvancedSQLiteSession + +# Basic initialization +session = AdvancedSQLiteSession( + session_id="my_conversation", + create_tables=True # Auto-create advanced tables +) + +# With persistent storage +session = AdvancedSQLiteSession( + session_id="user_123", + db_path="path/to/conversations.db", + create_tables=True +) + +# With custom logger +import logging +logger = logging.getLogger("my_app") +session = AdvancedSQLiteSession( + session_id="session_456", + create_tables=True, + logger=logger +) +``` + +### 参数 + +- `session_id` (str): 会话会话的唯一标识符 +- `db_path` (str | Path): SQLite 数据库文件路径。默认使用 `:memory:` 进行内存存储 +- `create_tables` (bool): 是否自动创建高级表。默认为 `False` +- `logger` (logging.Logger | None): 会话的自定义日志记录器。默认使用模块日志记录器 + +## 用量追踪 + +AdvancedSQLiteSession 通过按对话轮次存储 token 用量数据提供详细的用量分析。**这完全依赖在每次智能体运行后调用 `store_run_usage` 方法。** + +### 存储用量数据 + +```python +# After each agent run, store the usage data +result = await Runner.run(agent, "Hello", session=session) +await session.store_run_usage(result) + +# This stores: +# - Total tokens used +# - Input/output token breakdown +# - Request count +# - Detailed JSON token information (if available) +``` + +### 获取用量统计 + +```python +# Get session-level usage (all branches) +session_usage = await session.get_session_usage() +if session_usage: + print(f"Total requests: {session_usage['requests']}") + print(f"Total tokens: {session_usage['total_tokens']}") + print(f"Input tokens: {session_usage['input_tokens']}") + print(f"Output tokens: {session_usage['output_tokens']}") + print(f"Total turns: {session_usage['total_turns']}") + +# Get usage for specific branch +branch_usage = await session.get_session_usage(branch_id="main") + +# Get usage by turn +turn_usage = await session.get_turn_usage() +for turn_data in turn_usage: + print(f"Turn {turn_data['user_turn_number']}: {turn_data['total_tokens']} tokens") + if turn_data['input_tokens_details']: + print(f" Input details: {turn_data['input_tokens_details']}") + if turn_data['output_tokens_details']: + print(f" Output details: {turn_data['output_tokens_details']}") + +# Get usage for specific turn +turn_2_usage = await session.get_turn_usage(user_turn_number=2) +``` + +## 会话分支 + +AdvancedSQLiteSession 的关键特性之一是能够从任意用户消息创建会话分支,使你可以探索替代的对话路径。 + +### 创建分支 + +```python +# Get available turns for branching +turns = await session.get_conversation_turns() +for turn in turns: + print(f"Turn {turn['turn']}: {turn['content']}") + print(f"Can branch: {turn['can_branch']}") + +# Create a branch from turn 2 +branch_id = await session.create_branch_from_turn(2) +print(f"Created branch: {branch_id}") + +# Create a branch with custom name +branch_id = await session.create_branch_from_turn( + 2, + branch_name="alternative_path" +) + +# Create branch by searching for content +branch_id = await session.create_branch_from_content( + "weather", + branch_name="weather_focus" +) +``` + +### 分支管理 + +```python +# List all branches +branches = await session.list_branches() +for branch in branches: + current = " (current)" if branch["is_current"] else "" + print(f"{branch['branch_id']}: {branch['user_turns']} turns, {branch['message_count']} messages{current}") + +# Switch between branches +await session.switch_to_branch("main") +await session.switch_to_branch(branch_id) + +# Delete a branch +await session.delete_branch(branch_id, force=True) # force=True allows deleting current branch +``` + +### 分支工作流示例 + +```python +# Original conversation +result = await Runner.run(agent, "What's the capital of France?", session=session) +await session.store_run_usage(result) + +result = await Runner.run(agent, "What's the weather like there?", session=session) +await session.store_run_usage(result) + +# Create branch from turn 2 (weather question) +branch_id = await session.create_branch_from_turn(2, "weather_focus") + +# Continue in new branch with different question +result = await Runner.run( + agent, + "What are the main tourist attractions in Paris?", + session=session +) +await session.store_run_usage(result) + +# Switch back to main branch +await session.switch_to_branch("main") + +# Continue original conversation +result = await Runner.run( + agent, + "How expensive is it to visit?", + session=session +) +await session.store_run_usage(result) +``` + +## 结构化查询 + +AdvancedSQLiteSession 提供多种方法来分析会话结构与内容。 + +### 会话分析 + +```python +# Get conversation organized by turns +conversation_by_turns = await session.get_conversation_by_turns() +for turn_num, items in conversation_by_turns.items(): + print(f"Turn {turn_num}: {len(items)} items") + for item in items: + if item["tool_name"]: + print(f" - {item['type']} (tool: {item['tool_name']})") + else: + print(f" - {item['type']}") + +# Get tool usage statistics +tool_usage = await session.get_tool_usage() +for tool_name, count, turn in tool_usage: + print(f"{tool_name}: used {count} times in turn {turn}") + +# Find turns by content +matching_turns = await session.find_turns_by_content("weather") +for turn in matching_turns: + print(f"Turn {turn['turn']}: {turn['content']}") +``` + +### 消息结构 + +会话会自动追踪以下消息结构信息: + +- 消息类型(user、assistant、tool_call 等) +- 工具调用的工具名称 +- 轮次编号与序列编号 +- 分支关联 +- 时间戳 + +## 数据库模式 + +AdvancedSQLiteSession 在基础的 SQLite 模式上扩展了两个附加表: + +### message_structure 表 + +```sql +CREATE TABLE message_structure ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + session_id TEXT NOT NULL, + message_id INTEGER NOT NULL, + branch_id TEXT NOT NULL DEFAULT 'main', + message_type TEXT NOT NULL, + sequence_number INTEGER NOT NULL, + user_turn_number INTEGER, + branch_turn_number INTEGER, + tool_name TEXT, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (session_id) REFERENCES agent_sessions(session_id) ON DELETE CASCADE, + FOREIGN KEY (message_id) REFERENCES agent_messages(id) ON DELETE CASCADE +); +``` + +### turn_usage 表 + +```sql +CREATE TABLE turn_usage ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + session_id TEXT NOT NULL, + branch_id TEXT NOT NULL DEFAULT 'main', + user_turn_number INTEGER NOT NULL, + requests INTEGER DEFAULT 0, + input_tokens INTEGER DEFAULT 0, + output_tokens INTEGER DEFAULT 0, + total_tokens INTEGER DEFAULT 0, + input_tokens_details JSON, + output_tokens_details JSON, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (session_id) REFERENCES agent_sessions(session_id) ON DELETE CASCADE, + UNIQUE(session_id, branch_id, user_turn_number) +); +``` + +## 完整示例 + +查看[完整示例](https://github.com/openai/openai-agents-python/tree/main/examples/memory/advanced_sqlite_session_example.py),了解所有功能的综合演示。 + + +## API 参考 + +- [`AdvancedSQLiteSession`][agents.extensions.memory.advanced_sqlite_session.AdvancedSQLiteSession] - 主类 +- [`Session`][agents.memory.session.Session] - 基础会话协议 \ No newline at end of file diff --git a/docs/zh/sessions/encrypted_session.md b/docs/zh/sessions/encrypted_session.md new file mode 100644 index 000000000..6774aee17 --- /dev/null +++ b/docs/zh/sessions/encrypted_session.md @@ -0,0 +1,179 @@ +--- +search: + exclude: true +--- +# 加密会话 + +`EncryptedSession` 为任意会话实现提供透明加密,通过自动过期机制在 TTL 到期时跳过旧的会话项,从而保护会话数据。 + +## 功能 + +- **透明加密**: 使用 Fernet 加密包装任意会话 +- **每会话密钥**: 使用 HKDF 密钥派生为每个会话生成唯一加密密钥 +- **自动过期**: 当 TTL 到期时,旧项会被静默跳过 +- **可直接替换**: 可与任何现有会话实现一起使用 + +## 安装 + +加密会话需要 `encrypt` 额外依赖: + +```bash +pip install openai-agents[encrypt] +``` + +## 快速开始 + +```python +import asyncio +from agents import Agent, Runner +from agents.extensions.memory import EncryptedSession, SQLAlchemySession + +async def main(): + agent = Agent("Assistant") + + # Create underlying session + underlying_session = SQLAlchemySession.from_url( + "user-123", + url="sqlite+aiosqlite:///:memory:", + create_tables=True + ) + + # Wrap with encryption + session = EncryptedSession( + session_id="user-123", + underlying_session=underlying_session, + encryption_key="your-secret-key-here", + ttl=600 # 10 minutes + ) + + result = await Runner.run(agent, "Hello", session=session) + print(result.final_output) + +if __name__ == "__main__": + asyncio.run(main()) +``` + +## 配置 + +### 加密密钥 + +加密密钥可以是 Fernet 密钥或任意字符串: + +```python +from agents.extensions.memory import EncryptedSession + +# Using a Fernet key (base64-encoded) +session = EncryptedSession( + session_id="user-123", + underlying_session=underlying_session, + encryption_key="your-fernet-key-here", + ttl=600 +) + +# Using a raw string (will be derived to a key) +session = EncryptedSession( + session_id="user-123", + underlying_session=underlying_session, + encryption_key="my-secret-password", + ttl=600 +) +``` + +### TTL(存活时间) + +设置加密项保持有效的时长: + +```python +# Items expire after 1 hour +session = EncryptedSession( + session_id="user-123", + underlying_session=underlying_session, + encryption_key="secret", + ttl=3600 # 1 hour in seconds +) + +# Items expire after 1 day +session = EncryptedSession( + session_id="user-123", + underlying_session=underlying_session, + encryption_key="secret", + ttl=86400 # 24 hours in seconds +) +``` + +## 在不同会话类型中的用法 + +### 使用 SQLite 会话 + +```python +from agents import SQLiteSession +from agents.extensions.memory import EncryptedSession + +# Create encrypted SQLite session +underlying = SQLiteSession("user-123", "conversations.db") + +session = EncryptedSession( + session_id="user-123", + underlying_session=underlying, + encryption_key="secret-key" +) +``` + +### 使用 SQLAlchemy 会话 + +```python +from agents.extensions.memory import EncryptedSession, SQLAlchemySession + +# Create encrypted SQLAlchemy session +underlying = SQLAlchemySession.from_url( + "user-123", + url="postgresql+asyncpg://user:pass@localhost/db", + create_tables=True +) + +session = EncryptedSession( + session_id="user-123", + underlying_session=underlying, + encryption_key="secret-key" +) +``` + +!!! warning "高级会话功能" + + 当将 `EncryptedSession` 与诸如 `AdvancedSQLiteSession` 等高级会话实现一起使用时,请注意: + + - 由于消息内容被加密,类似 `find_turns_by_content()` 的方法将难以有效工作 + - 基于内容的搜索会在密文上运行,效果受限 + + + +## 密钥派生 + +EncryptedSession 使用 HKDF(基于 HMAC 的密钥派生函数)为每个会话派生唯一的加密密钥: + +- **主密钥**: 你提供的加密密钥 +- **会话盐值**: 会话 ID +- **信息字符串**: `"agents.session-store.hkdf.v1"` +- **输出**: 32 字节的 Fernet 密钥 + +这确保: +- 每个会话都有唯一的加密密钥 +- 没有主密钥无法推导出各会话密钥 +- 不同会话之间的会话数据无法相互解密 + +## 自动过期 + +当项超过 TTL 时,在检索时会被自动跳过: + +```python +# Items older than TTL are silently ignored +items = await session.get_items() # Only returns non-expired items + +# Expired items don't affect session behavior +result = await Runner.run(agent, "Continue conversation", session=session) +``` + +## API 参考 + +- [`EncryptedSession`][agents.extensions.memory.encrypt_session.EncryptedSession] - 主类 +- [`Session`][agents.memory.session.Session] - 基础会话协议 \ No newline at end of file diff --git a/docs/zh/sessions/index.md b/docs/zh/sessions/index.md new file mode 100644 index 000000000..85fb5879b --- /dev/null +++ b/docs/zh/sessions/index.md @@ -0,0 +1,435 @@ +--- +search: + exclude: true +--- +# 会话 + +Agents SDK 提供内置会话记忆,用于在多个智能体运行之间自动维护对话历史,无需在轮次之间手动处理 `.to_input_list()`。 + +会话为特定会话存储对话历史,使智能体无需显式的手动内存管理即可保持上下文。这对构建聊天应用或多轮对话尤为有用,能让智能体记住之前的交互。 + +## 快速开始 + +```python +from agents import Agent, Runner, SQLiteSession + +# Create agent +agent = Agent( + name="Assistant", + instructions="Reply very concisely.", +) + +# Create a session instance with a session ID +session = SQLiteSession("conversation_123") + +# First turn +result = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session +) +print(result.final_output) # "San Francisco" + +# Second turn - agent automatically remembers previous context +result = await Runner.run( + agent, + "What state is it in?", + session=session +) +print(result.final_output) # "California" + +# Also works with synchronous runner +result = Runner.run_sync( + agent, + "What's the population?", + session=session +) +print(result.final_output) # "Approximately 39 million" +``` + +## 工作原理 + +当启用会话记忆时: + +1. **每次运行之前**:运行器会自动检索该会话的对话历史,并将其预置到输入项前。 +2. **每次运行之后**:在运行期间生成的所有新项(用户输入、助手回复、工具调用等)会自动存储到会话中。 +3. **上下文保留**:使用同一会话的每次后续运行都会包含完整的对话历史,使智能体能够保持上下文。 + +这免除了在轮次之间手动调用 `.to_input_list()` 并管理对话状态的需求。 + +## 内存操作 + +### 基本操作 + +会话支持多种用于管理对话历史的操作: + +```python +from agents import SQLiteSession + +session = SQLiteSession("user_123", "conversations.db") + +# Get all items in a session +items = await session.get_items() + +# Add new items to a session +new_items = [ + {"role": "user", "content": "Hello"}, + {"role": "assistant", "content": "Hi there!"} +] +await session.add_items(new_items) + +# Remove and return the most recent item +last_item = await session.pop_item() +print(last_item) # {"role": "assistant", "content": "Hi there!"} + +# Clear all items from a session +await session.clear_session() +``` + +### 使用 pop_item 进行纠正 + +当你希望撤销或修改对话中的最后一项时,`pop_item` 方法尤其有用: + +```python +from agents import Agent, Runner, SQLiteSession + +agent = Agent(name="Assistant") +session = SQLiteSession("correction_example") + +# Initial conversation +result = await Runner.run( + agent, + "What's 2 + 2?", + session=session +) +print(f"Agent: {result.final_output}") + +# User wants to correct their question +assistant_item = await session.pop_item() # Remove agent's response +user_item = await session.pop_item() # Remove user's question + +# Ask a corrected question +result = await Runner.run( + agent, + "What's 2 + 3?", + session=session +) +print(f"Agent: {result.final_output}") +``` + +## 会话类型 + +SDK 提供多种会话实现以适应不同用例: + +### OpenAI Conversations API 会话 + +通过 `OpenAIConversationsSession` 使用 [OpenAI 的 Conversations API](https://platform.openai.com/docs/api-reference/conversations)。 + +```python +from agents import Agent, Runner, OpenAIConversationsSession + +# Create agent +agent = Agent( + name="Assistant", + instructions="Reply very concisely.", +) + +# Create a new conversation +session = OpenAIConversationsSession() + +# Optionally resume a previous conversation by passing a conversation ID +# session = OpenAIConversationsSession(conversation_id="conv_123") + +# Start conversation +result = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session +) +print(result.final_output) # "San Francisco" + +# Continue the conversation +result = await Runner.run( + agent, + "What state is it in?", + session=session +) +print(result.final_output) # "California" +``` + +### SQLite 会话 + +使用 SQLite 的默认轻量级会话实现: + +```python +from agents import SQLiteSession + +# In-memory database (lost when process ends) +session = SQLiteSession("user_123") + +# Persistent file-based database +session = SQLiteSession("user_123", "conversations.db") + +# Use the session +result = await Runner.run( + agent, + "Hello", + session=session +) +``` + +### SQLAlchemy 会话 + +使用任意 SQLAlchemy 支持的数据库的生产级会话: + +```python +from agents.extensions.memory import SQLAlchemySession + +# Using database URL +session = SQLAlchemySession.from_url( + "user_123", + url="postgresql+asyncpg://user:pass@localhost/db", + create_tables=True +) + +# Using existing engine +from sqlalchemy.ext.asyncio import create_async_engine +engine = create_async_engine("postgresql+asyncpg://user:pass@localhost/db") +session = SQLAlchemySession("user_123", engine=engine, create_tables=True) +``` + +参见 [SQLAlchemy 会话](sqlalchemy_session.md) 获取详细文档。 + +### 高级 SQLite 会话 + +增强的 SQLite 会话,支持会话分支、使用分析和结构化查询: + +```python +from agents.extensions.memory import AdvancedSQLiteSession + +# Create with advanced features +session = AdvancedSQLiteSession( + session_id="user_123", + db_path="conversations.db", + create_tables=True +) + +# Automatic usage tracking +result = await Runner.run(agent, "Hello", session=session) +await session.store_run_usage(result) # Track token usage + +# Conversation branching +await session.create_branch_from_turn(2) # Branch from turn 2 +``` + +参见 [高级 SQLite 会话](advanced_sqlite_session.md) 获取详细文档。 + +### 加密会话 + +针对任意会话实现的透明加密包装器: + +```python +from agents.extensions.memory import EncryptedSession, SQLAlchemySession + +# Create underlying session +underlying_session = SQLAlchemySession.from_url( + "user_123", + url="sqlite+aiosqlite:///conversations.db", + create_tables=True +) + +# Wrap with encryption and TTL +session = EncryptedSession( + session_id="user_123", + underlying_session=underlying_session, + encryption_key="your-secret-key", + ttl=600 # 10 minutes +) + +result = await Runner.run(agent, "Hello", session=session) +``` + +参见 [加密会话](encrypted_session.md) 获取详细文档。 + +## 会话管理 + +### 会话 ID 命名 + +使用有意义的会话 ID 来帮助组织对话: + +- 用户维度:`"user_12345"` +- 线程维度:`"thread_abc123"` +- 场景维度:`"support_ticket_456"` + +### 内存持久化 + +- 使用内存型 SQLite(`SQLiteSession("session_id")`)进行临时对话 +- 使用文件型 SQLite(`SQLiteSession("session_id", "path/to/db.sqlite")`)进行持久化对话 +- 使用由 SQLAlchemy 驱动的会话(`SQLAlchemySession("session_id", engine=engine, create_tables=True)`)以在 SQLAlchemy 支持的现有数据库之上构建生产系统 +- 当你希望将历史存储在 OpenAI Conversations API 中时,使用 OpenAI 托管的存储(`OpenAIConversationsSession()`) +- 使用加密会话(`EncryptedSession(session_id, underlying_session, encryption_key)`)为任意会话提供透明加密与基于 TTL 的过期 +- 针对更高级的用例,考虑为其他生产系统(Redis、Django 等)实现自定义会话后端 + +### 多个会话 + +```python +from agents import Agent, Runner, SQLiteSession + +agent = Agent(name="Assistant") + +# Different sessions maintain separate conversation histories +session_1 = SQLiteSession("user_123", "conversations.db") +session_2 = SQLiteSession("user_456", "conversations.db") + +result1 = await Runner.run( + agent, + "Help me with my account", + session=session_1 +) +result2 = await Runner.run( + agent, + "What are my charges?", + session=session_2 +) +``` + +### 会话共享 + +```python +# Different agents can share the same session +support_agent = Agent(name="Support") +billing_agent = Agent(name="Billing") +session = SQLiteSession("user_123") + +# Both agents will see the same conversation history +result1 = await Runner.run( + support_agent, + "Help me with my account", + session=session +) +result2 = await Runner.run( + billing_agent, + "What are my charges?", + session=session +) +``` + +## 完整示例 + +下面是一个展示会话记忆效果的完整示例: + +```python +import asyncio +from agents import Agent, Runner, SQLiteSession + + +async def main(): + # Create an agent + agent = Agent( + name="Assistant", + instructions="Reply very concisely.", + ) + + # Create a session instance that will persist across runs + session = SQLiteSession("conversation_123", "conversation_history.db") + + print("=== Sessions Example ===") + print("The agent will remember previous messages automatically.\n") + + # First turn + print("First turn:") + print("User: What city is the Golden Gate Bridge in?") + result = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session + ) + print(f"Assistant: {result.final_output}") + print() + + # Second turn - the agent will remember the previous conversation + print("Second turn:") + print("User: What state is it in?") + result = await Runner.run( + agent, + "What state is it in?", + session=session + ) + print(f"Assistant: {result.final_output}") + print() + + # Third turn - continuing the conversation + print("Third turn:") + print("User: What's the population of that state?") + result = await Runner.run( + agent, + "What's the population of that state?", + session=session + ) + print(f"Assistant: {result.final_output}") + print() + + print("=== Conversation Complete ===") + print("Notice how the agent remembered the context from previous turns!") + print("Sessions automatically handles conversation history.") + + +if __name__ == "__main__": + asyncio.run(main()) +``` + +## 自定义会话实现 + +你可以通过创建一个遵循 [`Session`][agents.memory.session.Session] 协议的类来实现自定义会话记忆: + +```python +from agents.memory.session import SessionABC +from agents.items import TResponseInputItem +from typing import List + +class MyCustomSession(SessionABC): + """Custom session implementation following the Session protocol.""" + + def __init__(self, session_id: str): + self.session_id = session_id + # Your initialization here + + async def get_items(self, limit: int | None = None) -> List[TResponseInputItem]: + """Retrieve conversation history for this session.""" + # Your implementation here + pass + + async def add_items(self, items: List[TResponseInputItem]) -> None: + """Store new items for this session.""" + # Your implementation here + pass + + async def pop_item(self) -> TResponseInputItem | None: + """Remove and return the most recent item from this session.""" + # Your implementation here + pass + + async def clear_session(self) -> None: + """Clear all items for this session.""" + # Your implementation here + pass + +# Use your custom session +agent = Agent(name="Assistant") +result = await Runner.run( + agent, + "Hello", + session=MyCustomSession("my_session") +) +``` + +## API 参考 + +详细 API 文档请参见: + +- [`Session`][agents.memory.session.Session] - 协议接口 +- [`OpenAIConversationsSession`][agents.memory.OpenAIConversationsSession] - OpenAI Conversations API 实现 +- [`SQLiteSession`][agents.memory.sqlite_session.SQLiteSession] - 基本 SQLite 实现 +- [`SQLAlchemySession`][agents.extensions.memory.sqlalchemy_session.SQLAlchemySession] - 由 SQLAlchemy 驱动的实现 +- [`AdvancedSQLiteSession`][agents.extensions.memory.advanced_sqlite_session.AdvancedSQLiteSession] - 具备分支与分析的增强型 SQLite +- [`EncryptedSession`][agents.extensions.memory.encrypt_session.EncryptedSession] - 适用于任意会话的加密包装器 \ No newline at end of file diff --git a/docs/zh/sessions/sqlalchemy_session.md b/docs/zh/sessions/sqlalchemy_session.md new file mode 100644 index 000000000..bf070985c --- /dev/null +++ b/docs/zh/sessions/sqlalchemy_session.md @@ -0,0 +1,80 @@ +--- +search: + exclude: true +--- +# SQLAlchemy 会话 + +`SQLAlchemySession` 使用 SQLAlchemy 提供可用于生产的会话实现,允许你将 SQLAlchemy 支持的任何数据库(PostgreSQL、MySQL、SQLite 等)用于会话存储。 + +## 安装 + +SQLAlchemy 会话需要安装 `sqlalchemy` 扩展: + +```bash +pip install openai-agents[sqlalchemy] +``` + +## 快速入门 + +### 使用数据库 URL + +最简单的用法: + +```python +import asyncio +from agents import Agent, Runner +from agents.extensions.memory import SQLAlchemySession + +async def main(): + agent = Agent("Assistant") + + # Create session using database URL + session = SQLAlchemySession.from_url( + "user-123", + url="sqlite+aiosqlite:///:memory:", + create_tables=True + ) + + result = await Runner.run(agent, "Hello", session=session) + print(result.final_output) + +if __name__ == "__main__": + asyncio.run(main()) +``` + +### 使用现有引擎 + +适用于已有 SQLAlchemy 引擎的应用: + +```python +import asyncio +from agents import Agent, Runner +from agents.extensions.memory import SQLAlchemySession +from sqlalchemy.ext.asyncio import create_async_engine + +async def main(): + # Create your database engine + engine = create_async_engine("postgresql+asyncpg://user:pass@localhost/db") + + agent = Agent("Assistant") + session = SQLAlchemySession( + "user-456", + engine=engine, + create_tables=True + ) + + result = await Runner.run(agent, "Hello", session=session) + print(result.final_output) + + # Clean up + await engine.dispose() + +if __name__ == "__main__": + asyncio.run(main()) +``` + + +## API 参考 + +- [`SQLAlchemySession`][agents.extensions.memory.sqlalchemy_session.SQLAlchemySession] - 主类 +- [`Session`][agents.memory.session.Session] - 基础会话协议 \ No newline at end of file diff --git a/docs/zh/streaming.md b/docs/zh/streaming.md new file mode 100644 index 000000000..95526de31 --- /dev/null +++ b/docs/zh/streaming.md @@ -0,0 +1,91 @@ +--- +search: + exclude: true +--- +# 流式传输 + +流式传输允许你在智能体运行过程中订阅其更新。这有助于向终端用户展示进度更新和部分响应。 + +要进行流式传输,你可以调用 [`Runner.run_streamed()`][agents.run.Runner.run_streamed],它会返回一个 [`RunResultStreaming`][agents.result.RunResultStreaming]。调用 `result.stream_events()` 会提供一个异步的 [`StreamEvent`][agents.stream_events.StreamEvent] 对象流,详见下文。 + +## 原始响应事件 + +[`RawResponsesStreamEvent`][agents.stream_events.RawResponsesStreamEvent] 是直接从 LLM 传递的原始事件。它们采用 OpenAI Responses API 格式,这意味着每个事件都有一个类型(如 `response.created`、`response.output_text.delta` 等)和数据。如果你希望在消息生成时立刻将响应流式传递给用户,这些事件很有用。 + +例如,下面的内容会逐 token 输出由 LLM 生成的文本。 + +```python +import asyncio +from openai.types.responses import ResponseTextDeltaEvent +from agents import Agent, Runner + +async def main(): + agent = Agent( + name="Joker", + instructions="You are a helpful assistant.", + ) + + result = Runner.run_streamed(agent, input="Please tell me 5 jokes.") + async for event in result.stream_events(): + if event.type == "raw_response_event" and isinstance(event.data, ResponseTextDeltaEvent): + print(event.data.delta, end="", flush=True) + + +if __name__ == "__main__": + asyncio.run(main()) +``` + +## 运行项事件与智能体事件 + +[`RunItemStreamEvent`][agents.stream_events.RunItemStreamEvent] 属于更高层级的事件。它们会在某个项完全生成时通知你。这样你就可以在“消息已生成”“工具已运行”等层级推送进度更新,而不是在每个 token 层级。类似地,[`AgentUpdatedStreamEvent`][agents.stream_events.AgentUpdatedStreamEvent] 会在当前智能体发生变化时(例如由于一次 任务转移)为你提供更新。 + +例如,下面的内容会忽略原始事件,并向用户流式传输更新。 + +```python +import asyncio +import random +from agents import Agent, ItemHelpers, Runner, function_tool + +@function_tool +def how_many_jokes() -> int: + return random.randint(1, 10) + + +async def main(): + agent = Agent( + name="Joker", + instructions="First call the `how_many_jokes` tool, then tell that many jokes.", + tools=[how_many_jokes], + ) + + result = Runner.run_streamed( + agent, + input="Hello", + ) + print("=== Run starting ===") + + async for event in result.stream_events(): + # We'll ignore the raw responses event deltas + if event.type == "raw_response_event": + continue + # When the agent updates, print that + elif event.type == "agent_updated_stream_event": + print(f"Agent updated: {event.new_agent.name}") + continue + # When items are generated, print them + elif event.type == "run_item_stream_event": + if event.item.type == "tool_call_item": + print("-- Tool was called") + elif event.item.type == "tool_call_output_item": + print(f"-- Tool output: {event.item.output}") + elif event.item.type == "message_output_item": + print(f"-- Message output:\n {ItemHelpers.text_message_output(event.item)}") + else: + pass # Ignore other event types + + print("=== Run complete ===") + + +if __name__ == "__main__": + asyncio.run(main()) +``` \ No newline at end of file diff --git a/docs/zh/tools.md b/docs/zh/tools.md new file mode 100644 index 000000000..f25c2dce2 --- /dev/null +++ b/docs/zh/tools.md @@ -0,0 +1,425 @@ +--- +search: + exclude: true +--- +# 工具 + +工具让智能体能够采取行动:如获取数据、运行代码、调用外部 API,甚至进行计算机操作。在 Agents SDK 中有三类工具: + +- 托管工具:这些工具与 AI 模型一同运行在 LLM 服务上。OpenAI 提供检索、网络检索和计算机操作等托管工具。 +- Function Calling:它允许你将任意 Python 函数用作工具。 +- 智能体即工具:允许你将一个智能体作为工具使用,使智能体在不进行任务转移的情况下调用其他智能体。 + +## 托管工具 + +在使用 [`OpenAIResponsesModel`][agents.models.openai_responses.OpenAIResponsesModel] 时,OpenAI 提供了一些内置工具: + +- [`WebSearchTool`][agents.tool.WebSearchTool] 让智能体进行网络检索。 +- [`FileSearchTool`][agents.tool.FileSearchTool] 允许从你的 OpenAI 向量存储中检索信息。 +- [`ComputerTool`][agents.tool.ComputerTool] 允许自动化计算机操作任务。 +- [`CodeInterpreterTool`][agents.tool.CodeInterpreterTool] 让 LLM 在沙箱环境中执行代码。 +- [`HostedMCPTool`][agents.tool.HostedMCPTool] 将远程 MCP 服务的工具暴露给模型。 +- [`ImageGenerationTool`][agents.tool.ImageGenerationTool] 根据提示生成图像。 +- [`LocalShellTool`][agents.tool.LocalShellTool] 在你的机器上运行 shell 命令。 + +```python +from agents import Agent, FileSearchTool, Runner, WebSearchTool + +agent = Agent( + name="Assistant", + tools=[ + WebSearchTool(), + FileSearchTool( + max_num_results=3, + vector_store_ids=["VECTOR_STORE_ID"], + ), + ], +) + +async def main(): + result = await Runner.run(agent, "Which coffee shop should I go to, taking into account my preferences and the weather today in SF?") + print(result.final_output) +``` + +## 工具调用 + +你可以将任意 Python 函数作为工具使用。Agents SDK 会自动完成工具的设置: + +- 工具名称将是该 Python 函数的名称(也可自定义名称) +- 工具描述将取自函数的 docstring(也可自定义描述) +- 函数输入的 schema 会根据函数参数自动创建 +- 各输入项的描述默认取自函数的 docstring(可禁用) + +我们使用 Python 的 `inspect` 模块提取函数签名,配合 [`griffe`](https://mkdocstrings.github.io/griffe/) 解析 docstring,并使用 `pydantic` 创建 schema。 + +```python +import json + +from typing_extensions import TypedDict, Any + +from agents import Agent, FunctionTool, RunContextWrapper, function_tool + + +class Location(TypedDict): + lat: float + long: float + +@function_tool # (1)! +async def fetch_weather(location: Location) -> str: + # (2)! + """Fetch the weather for a given location. + + Args: + location: The location to fetch the weather for. + """ + # In real life, we'd fetch the weather from a weather API + return "sunny" + + +@function_tool(name_override="fetch_data") # (3)! +def read_file(ctx: RunContextWrapper[Any], path: str, directory: str | None = None) -> str: + """Read the contents of a file. + + Args: + path: The path to the file to read. + directory: The directory to read the file from. + """ + # In real life, we'd read the file from the file system + return "" + + +agent = Agent( + name="Assistant", + tools=[fetch_weather, read_file], # (4)! +) + +for tool in agent.tools: + if isinstance(tool, FunctionTool): + print(tool.name) + print(tool.description) + print(json.dumps(tool.params_json_schema, indent=2)) + print() + +``` + +1. 你可以使用任意 Python 类型作为函数的参数,函数可以是同步或异步。 +2. 如果存在 docstring,会用于捕获描述和参数说明。 +3. 函数可以选择性地接收 `context`(必须是第一个参数)。你也可以设置覆盖项,例如工具名称、描述、docstring 风格等。 +4. 你可以将装饰后的函数传递给工具列表。 + +??? note "展开以查看输出" + + ``` + fetch_weather + Fetch the weather for a given location. + { + "$defs": { + "Location": { + "properties": { + "lat": { + "title": "Lat", + "type": "number" + }, + "long": { + "title": "Long", + "type": "number" + } + }, + "required": [ + "lat", + "long" + ], + "title": "Location", + "type": "object" + } + }, + "properties": { + "location": { + "$ref": "#/$defs/Location", + "description": "The location to fetch the weather for." + } + }, + "required": [ + "location" + ], + "title": "fetch_weather_args", + "type": "object" + } + + fetch_data + Read the contents of a file. + { + "properties": { + "path": { + "description": "The path to the file to read.", + "title": "Path", + "type": "string" + }, + "directory": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The directory to read the file from.", + "title": "Directory" + } + }, + "required": [ + "path" + ], + "title": "fetch_data_args", + "type": "object" + } + ``` + +### 从工具调用返回图像或文件 + +除了返回文本输出,你还可以将一张或多张图像或文件作为工具调用的输出。为此,你可以返回以下任意类型: + +- 图像:[`ToolOutputImage`][agents.tool.ToolOutputImage](或 TypedDict 版本,[`ToolOutputImageDict`][agents.tool.ToolOutputImageDict]) +- 文件:[`ToolOutputFileContent`][agents.tool.ToolOutputFileContent](或 TypedDict 版本,[`ToolOutputFileContentDict`][agents.tool.ToolOutputFileContentDict]) +- 文本:字符串或可转为字符串的对象,或 [`ToolOutputText`][agents.tool.ToolOutputText](或 TypedDict 版本,[`ToolOutputTextDict`][agents.tool.ToolOutputTextDict]) + +### 自定义函数工具 + +有时,你可能不想使用 Python 函数作为工具。如果需要,你可以直接创建一个 [`FunctionTool`][agents.tool.FunctionTool]。你需要提供: + +- `name` +- `description` +- `params_json_schema`,即参数的 JSON schema +- `on_invoke_tool`,这是一个异步函数,接收 [`ToolContext`][agents.tool_context.ToolContext] 和作为 JSON 字符串的参数,并且必须返回字符串形式的工具输出。 + +```python +from typing import Any + +from pydantic import BaseModel + +from agents import RunContextWrapper, FunctionTool + + + +def do_some_work(data: str) -> str: + return "done" + + +class FunctionArgs(BaseModel): + username: str + age: int + + +async def run_function(ctx: RunContextWrapper[Any], args: str) -> str: + parsed = FunctionArgs.model_validate_json(args) + return do_some_work(data=f"{parsed.username} is {parsed.age} years old") + + +tool = FunctionTool( + name="process_user", + description="Processes extracted user data", + params_json_schema=FunctionArgs.model_json_schema(), + on_invoke_tool=run_function, +) +``` + +### 自动参数与 docstring 解析 + +如前所述,我们会自动解析函数签名以提取工具的 schema,并解析 docstring 以提取工具及各参数的描述。注意事项: + +1. 使用 `inspect` 模块进行签名解析。我们使用类型注解理解参数类型,并动态构建一个 Pydantic 模型来表示整体 schema。它支持大多数类型,包括 Python 基础类型、Pydantic 模型、TypedDict 等。 +2. 我们使用 `griffe` 解析 docstring。支持的 docstring 格式有 `google`、`sphinx` 和 `numpy`。我们会尝试自动检测 docstring 格式,但这只是尽力而为,你也可以在调用 `function_tool` 时显式设置。还可以通过将 `use_docstring_info` 设为 `False` 来禁用 docstring 解析。 + +用于 schema 提取的代码位于 [`agents.function_schema`][]。 + +## 智能体即工具 + +在某些工作流中,你可能希望由一个中心智能体编排一组专业化智能体,而不是移交控制。你可以通过将智能体建模为工具来实现这一点。 + +```python +from agents import Agent, Runner +import asyncio + +spanish_agent = Agent( + name="Spanish agent", + instructions="You translate the user's message to Spanish", +) + +french_agent = Agent( + name="French agent", + instructions="You translate the user's message to French", +) + +orchestrator_agent = Agent( + name="orchestrator_agent", + instructions=( + "You are a translation agent. You use the tools given to you to translate." + "If asked for multiple translations, you call the relevant tools." + ), + tools=[ + spanish_agent.as_tool( + tool_name="translate_to_spanish", + tool_description="Translate the user's message to Spanish", + ), + french_agent.as_tool( + tool_name="translate_to_french", + tool_description="Translate the user's message to French", + ), + ], +) + +async def main(): + result = await Runner.run(orchestrator_agent, input="Say 'Hello, how are you?' in Spanish.") + print(result.final_output) +``` + +### 自定义工具化智能体 + +`agent.as_tool` 函数是一个便捷方法,可将智能体轻松转换为工具。但它并不支持所有配置;例如,你无法设置 `max_turns`。对于高级用例,请在你的工具实现中直接使用 `Runner.run`: + +```python +@function_tool +async def run_my_agent() -> str: + """A tool that runs the agent with custom configs""" + + agent = Agent(name="My agent", instructions="...") + + result = await Runner.run( + agent, + input="...", + max_turns=5, + run_config=... + ) + + return str(result.final_output) +``` + +### 自定义输出提取 + +在某些情况下,你可能希望在将工具化智能体的输出返回给中心智能体之前对其进行修改。如果你希望: + +- 从子智能体的对话历史中提取某段特定信息(例如一个 JSON 负载)。 +- 转换或重新格式化智能体的最终答案(例如将 Markdown 转为纯文本或 CSV)。 +- 验证输出,或在智能体响应缺失或格式不正确时提供回退值。 + +你可以通过向 `as_tool` 方法提供 `custom_output_extractor` 参数来实现: + +```python +async def extract_json_payload(run_result: RunResult) -> str: + # Scan the agent’s outputs in reverse order until we find a JSON-like message from a tool call. + for item in reversed(run_result.new_items): + if isinstance(item, ToolCallOutputItem) and item.output.strip().startswith("{"): + return item.output.strip() + # Fallback to an empty JSON object if nothing was found + return "{}" + + +json_tool = data_agent.as_tool( + tool_name="get_data_json", + tool_description="Run the data agent and return only its JSON payload", + custom_output_extractor=extract_json_payload, +) +``` + +### 条件启用工具 + +你可以在运行时使用 `is_enabled` 参数有条件地启用或禁用智能体工具。这允许你根据上下文、用户偏好或运行时条件动态筛选 LLM 可用的工具。 + +```python +import asyncio +from agents import Agent, AgentBase, Runner, RunContextWrapper +from pydantic import BaseModel + +class LanguageContext(BaseModel): + language_preference: str = "french_spanish" + +def french_enabled(ctx: RunContextWrapper[LanguageContext], agent: AgentBase) -> bool: + """Enable French for French+Spanish preference.""" + return ctx.context.language_preference == "french_spanish" + +# Create specialized agents +spanish_agent = Agent( + name="spanish_agent", + instructions="You respond in Spanish. Always reply to the user's question in Spanish.", +) + +french_agent = Agent( + name="french_agent", + instructions="You respond in French. Always reply to the user's question in French.", +) + +# Create orchestrator with conditional tools +orchestrator = Agent( + name="orchestrator", + instructions=( + "You are a multilingual assistant. You use the tools given to you to respond to users. " + "You must call ALL available tools to provide responses in different languages. " + "You never respond in languages yourself, you always use the provided tools." + ), + tools=[ + spanish_agent.as_tool( + tool_name="respond_spanish", + tool_description="Respond to the user's question in Spanish", + is_enabled=True, # Always enabled + ), + french_agent.as_tool( + tool_name="respond_french", + tool_description="Respond to the user's question in French", + is_enabled=french_enabled, + ), + ], +) + +async def main(): + context = RunContextWrapper(LanguageContext(language_preference="french_spanish")) + result = await Runner.run(orchestrator, "How are you?", context=context.context) + print(result.final_output) + +asyncio.run(main()) +``` + +`is_enabled` 参数可接受: + +- **布尔值**:`True`(始终启用)或 `False`(始终禁用) +- **可调用函数**:接收 `(context, agent)` 并返回布尔值的函数 +- **异步函数**:用于复杂条件逻辑的异步函数 + +被禁用的工具在运行时会对 LLM 完全隐藏,适用于: + +- 基于用户权限的功能门控 +- 环境特定的工具可用性(开发 vs 生产) +- 不同工具配置的 A/B 测试 +- 基于运行时状态的动态工具筛选 + +## 在工具调用中处理错误 + +当你通过 `@function_tool` 创建函数工具时,你可以传入 `failure_error_function`。这是一个在工具调用崩溃时向 LLM 提供错误响应的函数。 + +- 默认情况下(即未传入任何内容),会运行 `default_tool_error_function`,它会告知 LLM 发生了错误。 +- 如果传入你自己的错误函数,则会运行该函数,并将其响应发送给 LLM。 +- 如果显式传入 `None`,那么任何工具调用错误都会被重新抛出供你处理。如果模型生成了无效 JSON,可能会是 `ModelBehaviorError`;如果你的代码崩溃,可能会是 `UserError`,等等。 + +```python +from agents import function_tool, RunContextWrapper +from typing import Any + +def my_custom_error_function(context: RunContextWrapper[Any], error: Exception) -> str: + """A custom function to provide a user-friendly error message.""" + print(f"A tool call failed with the following error: {error}") + return "An internal server error occurred. Please try again later." + +@function_tool(failure_error_function=my_custom_error_function) +def get_user_profile(user_id: str) -> str: + """Fetches a user profile from a mock API. + This function demonstrates a 'flaky' or failing API call. + """ + if user_id == "user_123": + return "User profile for user_123 successfully retrieved." + else: + raise ValueError(f"Could not retrieve profile for user_id: {user_id}. API returned an error.") + +``` + +如果你手动创建一个 `FunctionTool` 对象,那么你必须在 `on_invoke_tool` 函数内部处理错误。 \ No newline at end of file diff --git a/docs/zh/tracing.md b/docs/zh/tracing.md new file mode 100644 index 000000000..b88666ee3 --- /dev/null +++ b/docs/zh/tracing.md @@ -0,0 +1,151 @@ +--- +search: + exclude: true +--- +# 追踪 + +Agents SDK 内置了追踪功能,会在一次智能体运行期间收集完整的事件记录:LLM 生成、工具调用、任务转移、安全防护措施,甚至自定义事件。借助 [Traces 仪表板](https://platform.openai.com/traces),你可以在开发和生产环境中调试、可视化并监控工作流。 + +!!!note + + 追踪默认启用。可以通过两种方式禁用追踪: + + 1. 通过设置环境变量 `OPENAI_AGENTS_DISABLE_TRACING=1` 全局禁用追踪 + 2. 通过将 [`agents.run.RunConfig.tracing_disabled`][] 设为 `True`,仅对单次运行禁用追踪 + +***对于使用 OpenAI API 并遵循 Zero Data Retention (ZDR) 策略的组织,追踪不可用。*** + +## 追踪与 Span + +- **追踪(Traces)** 表示一次“工作流”的端到端操作。Trace 由多个 Span 组成。Trace 具有以下属性: + - `workflow_name`:逻辑上的工作流或应用。例如 “Code generation” 或 “Customer service”。 + - `trace_id`:该追踪的唯一 ID。如果未传入将自动生成。格式必须为 `trace_<32_alphanumeric>`。 + - `group_id`:可选的分组 ID,用于将同一次对话中的多个追踪关联起来。例如你可以使用聊天线程 ID。 + - `disabled`:若为 True,则不会记录该追踪。 + - `metadata`:该追踪的可选元数据。 +- **Span** 表示具有开始和结束时间的操作。Span 包含: + - `started_at` 和 `ended_at` 时间戳。 + - `trace_id`,指示其所属的追踪 + - `parent_id`,指向该 Span 的父级 Span(如有) + - `span_data`,关于该 Span 的信息。例如,`AgentSpanData` 包含关于智能体的信息,`GenerationSpanData` 包含关于 LLM 生成的信息,等等。 + +## 默认追踪 + +默认情况下,SDK 会追踪以下内容: + +- 整个 `Runner.{run, run_sync, run_streamed}()` 都包裹在 `trace()` 中。 +- 每次智能体运行,都会包裹在 `agent_span()` 中 +- LLM 生成会包裹在 `generation_span()` 中 +- 工具调用会分别包裹在 `function_span()` 中 +- 安全防护措施会包裹在 `guardrail_span()` 中 +- 任务转移会包裹在 `handoff_span()` 中 +- 音频输入(语音转文本)会包裹在 `transcription_span()` 中 +- 音频输出(文本转语音)会包裹在 `speech_span()` 中 +- 相关音频 span 可能会作为子级归于 `speech_group_span()` 下 + +默认情况下,追踪名称为 “Agent workflow”。如果你使用 `trace`,可以设置该名称;也可以通过 [`RunConfig`][agents.run.RunConfig] 配置名称和其他属性。 + +此外,你可以设置[自定义追踪进程](#custom-tracing-processors),将追踪推送到其它目的地(作为替代或附加目的地)。 + +## 更高层级的追踪 + +有时,你可能希望多次调用 `run()` 都属于同一个追踪。你可以通过将整个代码包裹在 `trace()` 中来实现。 + +```python +from agents import Agent, Runner, trace + +async def main(): + agent = Agent(name="Joke generator", instructions="Tell funny jokes.") + + with trace("Joke workflow"): # (1)! + first_result = await Runner.run(agent, "Tell me a joke") + second_result = await Runner.run(agent, f"Rate this joke: {first_result.final_output}") + print(f"Joke: {first_result.final_output}") + print(f"Rating: {second_result.final_output}") +``` + +1. 因为两次对 `Runner.run` 的调用都包裹在 `with trace()` 中,单次运行会成为整体追踪的一部分,而不是创建两个追踪。 + +## 创建追踪 + +你可以使用 [`trace()`][agents.tracing.trace] 函数创建追踪。追踪需要显式开始和结束。你有两种方式: + +1. 推荐:将 trace 作为上下文管理器使用,即 `with trace(...) as my_trace`。这会在合适的时机自动开始与结束追踪。 +2. 也可以手动调用 [`trace.start()`][agents.tracing.Trace.start] 和 [`trace.finish()`][agents.tracing.Trace.finish]。 + +当前追踪通过 Python 的 [`contextvar`](https://docs.python.org/3/library/contextvars.html) 进行跟踪。这意味着它可自动适配并发场景。如果你手动开始/结束追踪,需要在 `start()`/`finish()` 中传入 `mark_as_current` 和 `reset_current` 来更新当前追踪。 + +## 创建 spans + +你可以使用各种 [`*_span()`][agents.tracing.create] 方法创建 span。通常无需手动创建 span。可使用 [`custom_span()`][agents.tracing.custom_span] 来追踪自定义 span 信息。 + +Span 会自动隶属于当前追踪,并嵌套在最近的当前 span 下,其跟踪同样通过 Python 的 [`contextvar`](https://docs.python.org/3/library/contextvars.html) 实现。 + +## 敏感数据 + +某些 span 可能会捕获潜在的敏感数据。 + +`generation_span()` 会存储 LLM 生成的输入/输出,`function_span()` 会存储工具调用的输入/输出。这些可能包含敏感数据,你可以通过 [`RunConfig.trace_include_sensitive_data`][agents.run.RunConfig.trace_include_sensitive_data] 禁用这些数据的捕获。 + +同样地,音频相关的 span 默认会包含输入与输出音频的 base64 编码 PCM 数据。你可以通过配置 [`VoicePipelineConfig.trace_include_sensitive_audio_data`][agents.voice.pipeline_config.VoicePipelineConfig.trace_include_sensitive_audio_data] 禁用音频数据的捕获。 + +## 自定义追踪进程 + +追踪的高层架构如下: + +- 在初始化时,我们会创建全局的 [`TraceProvider`][agents.tracing.setup.TraceProvider],它负责创建追踪。 +- 我们为 `TraceProvider` 配置 [`BatchTraceProcessor`][agents.tracing.processors.BatchTraceProcessor],它会将追踪/span 批量发送给 [`BackendSpanExporter`][agents.tracing.processors.BackendSpanExporter],后者会将 span 和追踪批量导出到 OpenAI 的后端。 + +若要自定义这一默认设置,将追踪发送到替代或附加的后端,或修改导出器行为,你有两种选择: + +1. [`add_trace_processor()`][agents.tracing.add_trace_processor] 允许你添加一个额外的追踪进程,该进程会在追踪和 span 就绪时接收它们。这样你可以在将追踪发送到 OpenAI 后端之外执行自定义处理。 +2. [`set_trace_processors()`][agents.tracing.set_trace_processors] 允许你用自己的追踪进程替换默认进程。这意味着除非你包含一个将数据发送到 OpenAI 后端的 `TracingProcessor`,否则追踪将不会发送到 OpenAI 后端。 + +## 与非 OpenAI 模型的追踪 + +你可以使用 OpenAI API key 配合非 OpenAI 模型,在无需禁用追踪的情况下,在 OpenAI Traces 仪表板中启用免费的追踪。 + +```python +import os +from agents import set_tracing_export_api_key, Agent, Runner +from agents.extensions.models.litellm_model import LitellmModel + +tracing_api_key = os.environ["OPENAI_API_KEY"] +set_tracing_export_api_key(tracing_api_key) + +model = LitellmModel( + model="your-model-name", + api_key="your-api-key", +) + +agent = Agent( + name="Assistant", + model=model, +) +``` + +## 备注 +- 在 Openai Traces 仪表板查看免费追踪。 + +## 外部追踪进程列表 + +- [Weights & Biases](https://weave-docs.wandb.ai/guides/integrations/openai_agents) +- [Arize-Phoenix](https://docs.arize.com/phoenix/tracing/integrations-tracing/openai-agents-sdk) +- [Future AGI](https://docs.futureagi.com/future-agi/products/observability/auto-instrumentation/openai_agents) +- [MLflow (self-hosted/OSS)](https://mlflow.org/docs/latest/tracing/integrations/openai-agent) +- [MLflow (Databricks hosted)](https://docs.databricks.com/aws/en/mlflow/mlflow-tracing#-automatic-tracing) +- [Braintrust](https://braintrust.dev/docs/guides/traces/integrations#openai-agents-sdk) +- [Pydantic Logfire](https://logfire.pydantic.dev/docs/integrations/llms/openai/#openai-agents) +- [AgentOps](https://docs.agentops.ai/v1/integrations/agentssdk) +- [Scorecard](https://docs.scorecard.io/docs/documentation/features/tracing#openai-agents-sdk-integration) +- [Keywords AI](https://docs.keywordsai.co/integration/development-frameworks/openai-agent) +- [LangSmith](https://docs.smith.langchain.com/observability/how_to_guides/trace_with_openai_agents_sdk) +- [Maxim AI](https://www.getmaxim.ai/docs/observe/integrations/openai-agents-sdk) +- [Comet Opik](https://www.comet.com/docs/opik/tracing/integrations/openai_agents) +- [Langfuse](https://langfuse.com/docs/integrations/openaiagentssdk/openai-agents) +- [Langtrace](https://docs.langtrace.ai/supported-integrations/llm-frameworks/openai-agents-sdk) +- [Okahu-Monocle](https://github.com/monocle2ai/monocle) +- [Galileo](https://v2docs.galileo.ai/integrations/openai-agent-integration#openai-agent-integration) +- [Portkey AI](https://portkey.ai/docs/integrations/agents/openai-agents) +- [LangDB AI](https://docs.langdb.ai/getting-started/working-with-agent-frameworks/working-with-openai-agents-sdk) +- [Agenta](https://docs.agenta.ai/observability/integrations/openai-agents) \ No newline at end of file diff --git a/docs/zh/usage.md b/docs/zh/usage.md new file mode 100644 index 000000000..7a591fe15 --- /dev/null +++ b/docs/zh/usage.md @@ -0,0 +1,86 @@ +--- +search: + exclude: true +--- +# 用量 + +Agents SDK 会自动跟踪每次运行的 token 用量。你可以从运行上下文中访问它,用于监控成本、实施限制或记录分析数据。 + +## 跟踪项 + +- **requests**: 发起的 LLM API 调用次数 +- **input_tokens**: 发送的输入 token 总数 +- **output_tokens**: 接收的输出 token 总数 +- **total_tokens**: 输入 + 输出 +- **details**: + - `input_tokens_details.cached_tokens` + - `output_tokens_details.reasoning_tokens` + +## 运行用量访问 + +在执行 `Runner.run(...)` 后,可通过 `result.context_wrapper.usage` 访问用量数据。 + +```python +result = await Runner.run(agent, "What's the weather in Tokyo?") +usage = result.context_wrapper.usage + +print("Requests:", usage.requests) +print("Input tokens:", usage.input_tokens) +print("Output tokens:", usage.output_tokens) +print("Total tokens:", usage.total_tokens) +``` + +用量会在运行期间聚合所有模型调用(包括工具调用与任务转移)。 + +### LiteLLM 模型的用量启用 + +LiteLLM 提供方默认不报告用量指标。使用 [`LitellmModel`](models/litellm.md) 时,向你的智能体传入 `ModelSettings(include_usage=True)`,以便 LiteLLM 的响应填充 `result.context_wrapper.usage`。 + +```python +from agents import Agent, ModelSettings, Runner +from agents.extensions.models.litellm_model import LitellmModel + +agent = Agent( + name="Assistant", + model=LitellmModel(model="your/model", api_key="..."), + model_settings=ModelSettings(include_usage=True), +) + +result = await Runner.run(agent, "What's the weather in Tokyo?") +print(result.context_wrapper.usage.total_tokens) +``` + +## 会话中的用量访问 + +当你使用 `Session`(例如 `SQLiteSession`)时,每次调用 `Runner.run(...)` 都会返回该次运行的用量。会话会为上下文保留对话历史,但每次运行的用量彼此独立。 + +```python +session = SQLiteSession("my_conversation") + +first = await Runner.run(agent, "Hi!", session=session) +print(first.context_wrapper.usage.total_tokens) # Usage for first run + +second = await Runner.run(agent, "Can you elaborate?", session=session) +print(second.context_wrapper.usage.total_tokens) # Usage for second run +``` + +请注意,尽管会话在多次运行之间保留对话上下文,但每次 `Runner.run()` 返回的用量指标仅代表该次执行。在会话中,先前消息可能会在每次运行时被重新作为输入提供,这会影响后续轮次的输入 token 计数。 + +## 钩子中的用量 + +如果你使用 `RunHooks`,传递给每个钩子的 `context` 对象包含 `usage`。这使你能够在关键生命周期时刻记录用量。 + +```python +class MyHooks(RunHooks): + async def on_agent_end(self, context: RunContextWrapper, agent: Agent, output: Any) -> None: + u = context.usage + print(f"{agent.name} → {u.requests} requests, {u.total_tokens} total tokens") +``` + +## API 参考 + +有关详细的 API 文档,请参阅: + +- [`Usage`][agents.usage.Usage] - 用量跟踪数据结构 +- [`RunContextWrapper`][agents.run.RunContextWrapper] - 从运行上下文访问用量 +- [`RunHooks`][agents.run.RunHooks] - 接入用量跟踪生命周期 \ No newline at end of file diff --git a/docs/zh/visualization.md b/docs/zh/visualization.md new file mode 100644 index 000000000..2074ea1a8 --- /dev/null +++ b/docs/zh/visualization.md @@ -0,0 +1,108 @@ +--- +search: + exclude: true +--- +# 智能体可视化 + +智能体可视化允许你使用 **Graphviz** 生成智能体及其关系的结构化图形表示。这有助于理解在应用中智能体、工具与任务转移如何交互。 + +## 安装 + +安装可选的 `viz` 依赖组: + +```bash +pip install "openai-agents[viz]" +``` + +## 生成图形 + +你可以使用 `draw_graph` 函数生成智能体可视化。该函数会创建一个有向图,其中: + +- **智能体** 用黄色方框表示。 +- **MCP Servers** 用灰色方框表示。 +- **工具** 用绿色椭圆表示。 +- **任务转移** 是从一个智能体指向另一个智能体的有向边。 + +### 示例用法 + +```python +import os + +from agents import Agent, function_tool +from agents.mcp.server import MCPServerStdio +from agents.extensions.visualization import draw_graph + +@function_tool +def get_weather(city: str) -> str: + return f"The weather in {city} is sunny." + +spanish_agent = Agent( + name="Spanish agent", + instructions="You only speak Spanish.", +) + +english_agent = Agent( + name="English agent", + instructions="You only speak English", +) + +current_dir = os.path.dirname(os.path.abspath(__file__)) +samples_dir = os.path.join(current_dir, "sample_files") +mcp_server = MCPServerStdio( + name="Filesystem Server, via npx", + params={ + "command": "npx", + "args": ["-y", "@modelcontextprotocol/server-filesystem", samples_dir], + }, +) + +triage_agent = Agent( + name="Triage agent", + instructions="Handoff to the appropriate agent based on the language of the request.", + handoffs=[spanish_agent, english_agent], + tools=[get_weather], + mcp_servers=[mcp_server], +) + +draw_graph(triage_agent) +``` + +![Agent Graph](../assets/images/graph.png) + +这将生成一个图形,直观展示了**分诊智能体**及其与子智能体和工具的连接结构。 + + +## 理解可视化 + +生成的图形包含: + +- 一个表示入口的**起始节点**(`__start__`)。 +- 用**矩形**且填充黄色表示的智能体。 +- 用**椭圆**且填充绿色表示的工具。 +- 用**矩形**且填充灰色表示的 MCP Servers。 +- 表示交互的有向边: + - **实线箭头** 表示智能体之间的任务转移。 + - **虚线点状箭头** 表示工具调用。 + - **虚线箭头** 表示 MCP 服务调用。 +- 一个表示执行终止位置的**结束节点**(`__end__`)。 + +**注意:** 在较新的 +`agents` 包版本(已在 **v0.2.8** 验证)中会渲染 MCP servers。若你的可视化中未显示 MCP 方框,请升级到最新版本。 + +## 自定义图形 + +### 显示图形 +默认情况下,`draw_graph` 会内联展示图形。若要在单独窗口中显示,请编写如下代码: + +```python +draw_graph(triage_agent).view() +``` + +### 保存图形 +默认情况下,`draw_graph` 会内联展示图形。若要将其保存为文件,请指定文件名: + +```python +draw_graph(triage_agent, filename="agent_graph") +``` + +这将在工作目录中生成 `agent_graph.png`。 \ No newline at end of file diff --git a/docs/zh/voice/pipeline.md b/docs/zh/voice/pipeline.md new file mode 100644 index 000000000..0f45fb848 --- /dev/null +++ b/docs/zh/voice/pipeline.md @@ -0,0 +1,79 @@ +--- +search: + exclude: true +--- +# 流水线与工作流 + +[`VoicePipeline`][agents.voice.pipeline.VoicePipeline] 是一个类,可轻松将你的智能体工作流变成语音应用。你传入一个要运行的工作流,流水线会负责转写输入音频、检测音频结束时间、在正确时机调用你的工作流,并将工作流输出重新转换为音频。 + +```mermaid +graph LR + %% Input + A["🎤 Audio Input"] + + %% Voice Pipeline + subgraph Voice_Pipeline [Voice Pipeline] + direction TB + B["Transcribe (speech-to-text)"] + C["Your Code"]:::highlight + D["Text-to-speech"] + B --> C --> D + end + + %% Output + E["🎧 Audio Output"] + + %% Flow + A --> Voice_Pipeline + Voice_Pipeline --> E + + %% Custom styling + classDef highlight fill:#ffcc66,stroke:#333,stroke-width:1px,font-weight:700; + +``` + +## 配置流水线 + +创建流水线时,你可以设置以下内容: + +1. [`workflow`][agents.voice.workflow.VoiceWorkflowBase],即每次有新音频被转写时运行的代码。 +2. 所使用的 [`speech-to-text`][agents.voice.model.STTModel] 和 [`text-to-speech`][agents.voice.model.TTSModel] 模型 +3. [`config`][agents.voice.pipeline_config.VoicePipelineConfig],用于配置以下内容: + - 模型提供方,可将模型名称映射到具体模型 + - 追踪,包括是否禁用追踪、是否上传音频文件、工作流名称、追踪 ID 等 + - TTS 和 STT 模型的设置,例如使用的 prompt、语言和数据类型 + +## 运行流水线 + +你可以通过 [`run()`][agents.voice.pipeline.VoicePipeline.run] 方法运行流水线,并以两种形式传入音频输入: + +1. 当你已有完整的音频转写,只想为其生成结果时,使用 [`AudioInput`][agents.voice.input.AudioInput]。这在无需检测说话者何时结束的场景中很有用;例如,使用预录音频,或在按键说话应用中,用户结束说话的时机是明确的。 +2. 当你可能需要检测用户何时结束说话时,使用 [`StreamedAudioInput`][agents.voice.input.StreamedAudioInput]。它允许你在检测到时持续推送音频块,语音流水线会通过称为“语音活动检测(activity detection)”的过程,在正确时机自动运行智能体工作流。 + +## 结果 + +语音流水线运行的结果为 [`StreamedAudioResult`][agents.voice.result.StreamedAudioResult]。该对象允许你在事件发生时进行流式接收。[`VoiceStreamEvent`][agents.voice.events.VoiceStreamEvent] 有几种类型,包括: + +1. [`VoiceStreamEventAudio`][agents.voice.events.VoiceStreamEventAudio],包含一段音频片段。 +2. [`VoiceStreamEventLifecycle`][agents.voice.events.VoiceStreamEventLifecycle],用于告知诸如轮次开始或结束等生命周期事件。 +3. [`VoiceStreamEventError`][agents.voice.events.VoiceStreamEventError],表示错误事件。 + +```python + +result = await pipeline.run(input) + +async for event in result.stream(): + if event.type == "voice_stream_event_audio": + # play audio + elif event.type == "voice_stream_event_lifecycle": + # lifecycle + elif event.type == "voice_stream_event_error" + # error + ... +``` + +## 最佳实践 + +### 打断 + +Agents SDK 目前不对 [`StreamedAudioInput`][agents.voice.input.StreamedAudioInput] 提供任何内建的打断支持。相反,对于每个检测到的轮次,它都会触发对你的工作流的单独运行。如果你想在应用内部处理打断,可以监听 [`VoiceStreamEventLifecycle`][agents.voice.events.VoiceStreamEventLifecycle] 事件。`turn_started` 表示新的轮次已被转写并开始处理。`turn_ended` 会在相应轮次的所有音频均已分发之后触发。你可以利用这些事件在模型开始一个轮次时将说话者的麦克风静音,并在你清空某个轮次的所有相关音频后再取消静音。 \ No newline at end of file diff --git a/docs/zh/voice/quickstart.md b/docs/zh/voice/quickstart.md new file mode 100644 index 000000000..49f2d6d03 --- /dev/null +++ b/docs/zh/voice/quickstart.md @@ -0,0 +1,198 @@ +--- +search: + exclude: true +--- +# 快速入门 + +## 前提条件 + +请确保你已经按照 Agents SDK 的基础[快速入门指南](../quickstart.md)完成设置,并创建了虚拟环境。然后,从 SDK 安装可选的语音依赖: + +```bash +pip install 'openai-agents[voice]' +``` + +## 概念 + +这里的核心概念是一个 [`VoicePipeline`][agents.voice.pipeline.VoicePipeline],它是一个 3 步流程: + +1. 运行语音转文本模型,将音频转换为文本。 +2. 运行你的代码(通常是一个智能体工作流)以生成结果。 +3. 运行文本转语音模型,将结果文本转回音频。 + +```mermaid +graph LR + %% Input + A["🎤 Audio Input"] + + %% Voice Pipeline + subgraph Voice_Pipeline [Voice Pipeline] + direction TB + B["Transcribe (speech-to-text)"] + C["Your Code"]:::highlight + D["Text-to-speech"] + B --> C --> D + end + + %% Output + E["🎧 Audio Output"] + + %% Flow + A --> Voice_Pipeline + Voice_Pipeline --> E + + %% Custom styling + classDef highlight fill:#ffcc66,stroke:#333,stroke-width:1px,font-weight:700; + +``` + +## 智能体 + +首先,让我们设置一些智能体。如果你使用过此 SDK 构建过智能体,这应该会让你感到熟悉。我们将创建几个智能体、一个任务转移,以及一个工具。 + +```python +import asyncio +import random + +from agents import ( + Agent, + function_tool, +) +from agents.extensions.handoff_prompt import prompt_with_handoff_instructions + + + +@function_tool +def get_weather(city: str) -> str: + """Get the weather for a given city.""" + print(f"[debug] get_weather called with city: {city}") + choices = ["sunny", "cloudy", "rainy", "snowy"] + return f"The weather in {city} is {random.choice(choices)}." + + +spanish_agent = Agent( + name="Spanish", + handoff_description="A spanish speaking agent.", + instructions=prompt_with_handoff_instructions( + "You're speaking to a human, so be polite and concise. Speak in Spanish.", + ), + model="gpt-4.1", +) + +agent = Agent( + name="Assistant", + instructions=prompt_with_handoff_instructions( + "You're speaking to a human, so be polite and concise. If the user speaks in Spanish, handoff to the spanish agent.", + ), + model="gpt-4.1", + handoffs=[spanish_agent], + tools=[get_weather], +) +``` + +## 语音流水线 + +我们将使用 [`SingleAgentVoiceWorkflow`][agents.voice.workflow.SingleAgentVoiceWorkflow] 作为工作流,来设置一个简单的语音流水线。 + +```python +from agents.voice import SingleAgentVoiceWorkflow, VoicePipeline +pipeline = VoicePipeline(workflow=SingleAgentVoiceWorkflow(agent)) +``` + +## 运行流水线 + +```python +import numpy as np +import sounddevice as sd +from agents.voice import AudioInput + +# For simplicity, we'll just create 3 seconds of silence +# In reality, you'd get microphone data +buffer = np.zeros(24000 * 3, dtype=np.int16) +audio_input = AudioInput(buffer=buffer) + +result = await pipeline.run(audio_input) + +# Create an audio player using `sounddevice` +player = sd.OutputStream(samplerate=24000, channels=1, dtype=np.int16) +player.start() + +# Play the audio stream as it comes in +async for event in result.stream(): + if event.type == "voice_stream_event_audio": + player.write(event.data) + +``` + +## 整合运行 + +```python +import asyncio +import random + +import numpy as np +import sounddevice as sd + +from agents import ( + Agent, + function_tool, + set_tracing_disabled, +) +from agents.voice import ( + AudioInput, + SingleAgentVoiceWorkflow, + VoicePipeline, +) +from agents.extensions.handoff_prompt import prompt_with_handoff_instructions + + +@function_tool +def get_weather(city: str) -> str: + """Get the weather for a given city.""" + print(f"[debug] get_weather called with city: {city}") + choices = ["sunny", "cloudy", "rainy", "snowy"] + return f"The weather in {city} is {random.choice(choices)}." + + +spanish_agent = Agent( + name="Spanish", + handoff_description="A spanish speaking agent.", + instructions=prompt_with_handoff_instructions( + "You're speaking to a human, so be polite and concise. Speak in Spanish.", + ), + model="gpt-4.1", +) + +agent = Agent( + name="Assistant", + instructions=prompt_with_handoff_instructions( + "You're speaking to a human, so be polite and concise. If the user speaks in Spanish, handoff to the spanish agent.", + ), + model="gpt-4.1", + handoffs=[spanish_agent], + tools=[get_weather], +) + + +async def main(): + pipeline = VoicePipeline(workflow=SingleAgentVoiceWorkflow(agent)) + buffer = np.zeros(24000 * 3, dtype=np.int16) + audio_input = AudioInput(buffer=buffer) + + result = await pipeline.run(audio_input) + + # Create an audio player using `sounddevice` + player = sd.OutputStream(samplerate=24000, channels=1, dtype=np.int16) + player.start() + + # Play the audio stream as it comes in + async for event in result.stream(): + if event.type == "voice_stream_event_audio": + player.write(event.data) + + +if __name__ == "__main__": + asyncio.run(main()) +``` + +如果你运行这个示例,智能体会和你对话!前往[examples/voice/static](https://github.com/openai/openai-agents-python/tree/main/examples/voice/static)查看一个你可以亲自与智能体对话的演示。 \ No newline at end of file diff --git a/docs/zh/voice/tracing.md b/docs/zh/voice/tracing.md new file mode 100644 index 000000000..3f4ff1686 --- /dev/null +++ b/docs/zh/voice/tracing.md @@ -0,0 +1,18 @@ +--- +search: + exclude: true +--- +# 追踪 + +与[智能体的追踪方式](../tracing.md)相同,语音流水线也会被自动追踪。 + +你可以参考上面的追踪文档了解基本信息,此外还可以通过 [`VoicePipelineConfig`][agents.voice.pipeline_config.VoicePipelineConfig] 配置流水线的追踪。 + +与追踪相关的关键字段包括: + +- [`tracing_disabled`][agents.voice.pipeline_config.VoicePipelineConfig.tracing_disabled]: 控制是否禁用追踪。默认启用追踪。 +- [`trace_include_sensitive_data`][agents.voice.pipeline_config.VoicePipelineConfig.trace_include_sensitive_data]: 控制追踪是否包含可能敏感的数据,例如音频转写。此设置仅适用于语音流水线,不涉及你的 Workflow 内部发生的任何内容。 +- [`trace_include_sensitive_audio_data`][agents.voice.pipeline_config.VoicePipelineConfig.trace_include_sensitive_audio_data]: 控制追踪是否包含音频数据。 +- [`workflow_name`][agents.voice.pipeline_config.VoicePipelineConfig.workflow_name]: 追踪工作流的名称。 +- [`group_id`][agents.voice.pipeline_config.VoicePipelineConfig.group_id]: 追踪的 `group_id`,可用于关联多个追踪。 +- [`trace_metadata`][agents.voice.pipeline_config.VoicePipelineConfig.tracing_disabled]: 随追踪一并包含的附加元数据。 \ No newline at end of file diff --git a/examples/agent_patterns/agents_as_tools_conditional.py b/examples/agent_patterns/agents_as_tools_conditional.py new file mode 100644 index 000000000..e00f56d5e --- /dev/null +++ b/examples/agent_patterns/agents_as_tools_conditional.py @@ -0,0 +1,113 @@ +import asyncio + +from pydantic import BaseModel + +from agents import Agent, AgentBase, RunContextWrapper, Runner, trace + +""" +This example demonstrates the agents-as-tools pattern with conditional tool enabling. +Agent tools are dynamically enabled/disabled based on user access levels using the +is_enabled parameter. +""" + + +class AppContext(BaseModel): + language_preference: str = "spanish_only" # "spanish_only", "french_spanish", "european" + + +def french_spanish_enabled(ctx: RunContextWrapper[AppContext], agent: AgentBase) -> bool: + """Enable for French+Spanish and European preferences.""" + return ctx.context.language_preference in ["french_spanish", "european"] + + +def european_enabled(ctx: RunContextWrapper[AppContext], agent: AgentBase) -> bool: + """Only enable for European preference.""" + return ctx.context.language_preference == "european" + + +# Create specialized agents +spanish_agent = Agent( + name="spanish_agent", + instructions="You respond in Spanish. Always reply to the user's question in Spanish.", +) + +french_agent = Agent( + name="french_agent", + instructions="You respond in French. Always reply to the user's question in French.", +) + +italian_agent = Agent( + name="italian_agent", + instructions="You respond in Italian. Always reply to the user's question in Italian.", +) + +# Create orchestrator with conditional tools +orchestrator = Agent( + name="orchestrator", + instructions=( + "You are a multilingual assistant. You use the tools given to you to respond to users. " + "You must call ALL available tools to provide responses in different languages. " + "You never respond in languages yourself, you always use the provided tools." + ), + tools=[ + spanish_agent.as_tool( + tool_name="respond_spanish", + tool_description="Respond to the user's question in Spanish", + is_enabled=True, # Always enabled + ), + french_agent.as_tool( + tool_name="respond_french", + tool_description="Respond to the user's question in French", + is_enabled=french_spanish_enabled, + ), + italian_agent.as_tool( + tool_name="respond_italian", + tool_description="Respond to the user's question in Italian", + is_enabled=european_enabled, + ), + ], +) + + +async def main(): + """Interactive demo with LLM interaction.""" + print("Agents-as-Tools with Conditional Enabling\n") + print( + "This demonstrates how language response tools are dynamically enabled based on user preferences.\n" + ) + + print("Choose language preference:") + print("1. Spanish only (1 tool)") + print("2. French and Spanish (2 tools)") + print("3. European languages (3 tools)") + + choice = input("\nSelect option (1-3): ").strip() + preference_map = {"1": "spanish_only", "2": "french_spanish", "3": "european"} + language_preference = preference_map.get(choice, "spanish_only") + + # Create context and show available tools + context = RunContextWrapper(AppContext(language_preference=language_preference)) + available_tools = await orchestrator.get_all_tools(context) + tool_names = [tool.name for tool in available_tools] + + print(f"\nLanguage preference: {language_preference}") + print(f"Available tools: {', '.join(tool_names)}") + print(f"The LLM will only see and can use these {len(available_tools)} tools\n") + + # Get user request + user_request = input("Ask a question and see responses in available languages:\n") + + # Run with LLM interaction + print("\nProcessing request...") + with trace("Conditional tool access"): + result = await Runner.run( + starting_agent=orchestrator, + input=user_request, + context=context.context, + ) + + print(f"\nResponse:\n{result.final_output}") + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/agent_patterns/llm_as_a_judge.py b/examples/agent_patterns/llm_as_a_judge.py index 81dec7501..39a55c463 100644 --- a/examples/agent_patterns/llm_as_a_judge.py +++ b/examples/agent_patterns/llm_as_a_judge.py @@ -15,7 +15,7 @@ story_outline_generator = Agent( name="story_outline_generator", instructions=( - "You generate a very short story outline based on the user's input." + "You generate a very short story outline based on the user's input. " "If there is any feedback provided, use it to improve the outline." ), ) @@ -30,9 +30,9 @@ class EvaluationFeedback: evaluator = Agent[None]( name="evaluator", instructions=( - "You evaluate a story outline and decide if it's good enough." - "If it's not good enough, you provide feedback on what needs to be improved." - "Never give it a pass on the first try. After 5 attempts, you can give it a pass if story outline is good enough - do not go for perfection" + "You evaluate a story outline and decide if it's good enough. " + "If it's not good enough, you provide feedback on what needs to be improved. " + "Never give it a pass on the first try. After 5 attempts, you can give it a pass if the story outline is good enough - do not go for perfection" ), output_type=EvaluationFeedback, ) diff --git a/examples/basic/agent_lifecycle_example.py b/examples/basic/agent_lifecycle_example.py index b4334a83b..032851188 100644 --- a/examples/basic/agent_lifecycle_example.py +++ b/examples/basic/agent_lifecycle_example.py @@ -49,7 +49,7 @@ async def on_tool_end( @function_tool def random_number(max: int) -> int: """ - Generate a random number up to the provided maximum. + Generate a random number from 0 to max (inclusive). """ return random.randint(0, max) @@ -84,10 +84,15 @@ class FinalResult(BaseModel): async def main() -> None: user_input = input("Enter a max number: ") - await Runner.run( - start_agent, - input=f"Generate a random number between 0 and {user_input}.", - ) + try: + max_number = int(user_input) + await Runner.run( + start_agent, + input=f"Generate a random number between 0 and {max_number}.", + ) + except ValueError: + print("Please enter a valid integer.") + return print("Done!") diff --git a/examples/basic/dynamic_system_prompt.py b/examples/basic/dynamic_system_prompt.py index 7bcf90c0c..d9a99bd37 100644 --- a/examples/basic/dynamic_system_prompt.py +++ b/examples/basic/dynamic_system_prompt.py @@ -1,13 +1,14 @@ import asyncio import random +from dataclasses import dataclass from typing import Literal from agents import Agent, RunContextWrapper, Runner +@dataclass class CustomContext: - def __init__(self, style: Literal["haiku", "pirate", "robot"]): - self.style = style + style: Literal["haiku", "pirate", "robot"] def custom_instructions( @@ -29,9 +30,8 @@ def custom_instructions( async def main(): - choice: Literal["haiku", "pirate", "robot"] = random.choice(["haiku", "pirate", "robot"]) - context = CustomContext(style=choice) - print(f"Using style: {choice}\n") + context = CustomContext(style=random.choice(["haiku", "pirate", "robot"])) + print(f"Using style: {context.style}\n") user_message = "Tell me a joke." print(f"User: {user_message}") @@ -43,6 +43,7 @@ async def main(): if __name__ == "__main__": asyncio.run(main()) + """ $ python examples/basic/dynamic_system_prompt.py diff --git a/examples/basic/hello_world_gpt_5.py b/examples/basic/hello_world_gpt_5.py new file mode 100644 index 000000000..0bf4b4dc8 --- /dev/null +++ b/examples/basic/hello_world_gpt_5.py @@ -0,0 +1,30 @@ +import asyncio + +from openai.types.shared import Reasoning + +from agents import Agent, ModelSettings, Runner + +# If you have a certain reason to use Chat Completions, you can configure the model this way, +# and then you can pass the chat_completions_model to the Agent constructor. +# from openai import AsyncOpenAI +# client = AsyncOpenAI() +# from agents import OpenAIChatCompletionsModel +# chat_completions_model = OpenAIChatCompletionsModel(model="gpt-5", openai_client=client) + + +async def main(): + agent = Agent( + name="Knowledgable GPT-5 Assistant", + instructions="You're a knowledgable assistant. You always provide an interesting answer.", + model="gpt-5", + model_settings=ModelSettings( + reasoning=Reasoning(effort="minimal"), # "minimal", "low", "medium", "high" + verbosity="low", # "low", "medium", "high" + ), + ) + result = await Runner.run(agent, "Tell me something about recursion in programming.") + print(result.final_output) + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/basic/hello_world_gpt_oss.py b/examples/basic/hello_world_gpt_oss.py new file mode 100644 index 000000000..66c617f5b --- /dev/null +++ b/examples/basic/hello_world_gpt_oss.py @@ -0,0 +1,38 @@ +import asyncio +import logging + +from openai import AsyncOpenAI + +from agents import Agent, OpenAIChatCompletionsModel, Runner, set_tracing_disabled + +set_tracing_disabled(True) +logging.basicConfig(level=logging.DEBUG) + +# This is an example of how to use gpt-oss with Ollama. +# Refer to https://cookbook.openai.com/articles/gpt-oss/run-locally-ollama for more details. +# If you prefer using LM Studio, refer to https://cookbook.openai.com/articles/gpt-oss/run-locally-lmstudio +gpt_oss_model = OpenAIChatCompletionsModel( + model="gpt-oss:20b", + openai_client=AsyncOpenAI( + base_url="http://localhost:11434/v1", + api_key="ollama", + ), +) + + +async def main(): + # Note that using a custom outputType for an agent may not work well with gpt-oss models. + # Consider going with the default "text" outputType. + # See also: https://github.com/openai/openai-agents-python/issues/1414 + agent = Agent( + name="Assistant", + instructions="You're a helpful assistant. You provide a concise answer to the user's question.", + model=gpt_oss_model, + ) + + result = await Runner.run(agent, "Tell me about recursion in programming.") + print(result.final_output) + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/basic/image_tool_output.py b/examples/basic/image_tool_output.py new file mode 100644 index 000000000..741f07e3b --- /dev/null +++ b/examples/basic/image_tool_output.py @@ -0,0 +1,43 @@ +import asyncio + +from agents import Agent, Runner, ToolOutputImage, ToolOutputImageDict, function_tool + +return_typed_dict = True + + +@function_tool +def fetch_random_image() -> ToolOutputImage | ToolOutputImageDict: + """Fetch a random image.""" + + print("Image tool called") + if return_typed_dict: + return { + "type": "image", + "image_url": "https://upload.wikimedia.org/wikipedia/commons/0/0c/GoldenGateBridge-001.jpg", + "detail": "auto", + } + + return ToolOutputImage( + image_url="https://upload.wikimedia.org/wikipedia/commons/0/0c/GoldenGateBridge-001.jpg", + detail="auto", + ) + + +async def main(): + agent = Agent( + name="Assistant", + instructions="You are a helpful assistant.", + tools=[fetch_random_image], + ) + + result = await Runner.run( + agent, + input="Fetch an image using the random_image tool, then describe it", + ) + print(result.final_output) + """The image shows the iconic Golden Gate Bridge, a large suspension bridge painted in a + bright reddish-orange color...""" + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/basic/lifecycle_example.py b/examples/basic/lifecycle_example.py index 02ce449f4..874ff629b 100644 --- a/examples/basic/lifecycle_example.py +++ b/examples/basic/lifecycle_example.py @@ -1,10 +1,37 @@ import asyncio import random -from typing import Any +from typing import Any, Optional from pydantic import BaseModel -from agents import Agent, RunContextWrapper, RunHooks, Runner, Tool, Usage, function_tool +from agents import ( + Agent, + AgentHooks, + RunContextWrapper, + RunHooks, + Runner, + Tool, + Usage, + function_tool, +) +from agents.items import ModelResponse, TResponseInputItem + + +class LoggingHooks(AgentHooks[Any]): + async def on_start( + self, + context: RunContextWrapper[Any], + agent: Agent[Any], + ) -> None: + print(f"#### {agent.name} is starting.") + + async def on_end( + self, + context: RunContextWrapper[Any], + agent: Agent[Any], + output: Any, + ) -> None: + print(f"#### {agent.name} produced output: {output}.") class ExampleHooks(RunHooks): @@ -20,6 +47,22 @@ async def on_agent_start(self, context: RunContextWrapper, agent: Agent) -> None f"### {self.event_counter}: Agent {agent.name} started. Usage: {self._usage_to_str(context.usage)}" ) + async def on_llm_start( + self, + context: RunContextWrapper, + agent: Agent, + system_prompt: Optional[str], + input_items: list[TResponseInputItem], + ) -> None: + self.event_counter += 1 + print(f"### {self.event_counter}: LLM started. Usage: {self._usage_to_str(context.usage)}") + + async def on_llm_end( + self, context: RunContextWrapper, agent: Agent, response: ModelResponse + ) -> None: + self.event_counter += 1 + print(f"### {self.event_counter}: LLM ended. Usage: {self._usage_to_str(context.usage)}") + async def on_agent_end(self, context: RunContextWrapper, agent: Agent, output: Any) -> None: self.event_counter += 1 print( @@ -29,7 +72,7 @@ async def on_agent_end(self, context: RunContextWrapper, agent: Agent, output: A async def on_tool_start(self, context: RunContextWrapper, agent: Agent, tool: Tool) -> None: self.event_counter += 1 print( - f"### {self.event_counter}: Tool {tool.name} started. Usage: {self._usage_to_str(context.usage)}" + f"### {self.event_counter}: Tool {tool.name} started. name={context.tool_name}, call_id={context.tool_call_id}, args={context.tool_arguments}. Usage: {self._usage_to_str(context.usage)}" # type: ignore[attr-defined] ) async def on_tool_end( @@ -37,7 +80,7 @@ async def on_tool_end( ) -> None: self.event_counter += 1 print( - f"### {self.event_counter}: Tool {tool.name} ended with result {result}. Usage: {self._usage_to_str(context.usage)}" + f"### {self.event_counter}: Tool {tool.name} finished. result={result}, name={context.tool_name}, call_id={context.tool_call_id}, args={context.tool_arguments}. Usage: {self._usage_to_str(context.usage)}" # type: ignore[attr-defined] ) async def on_handoff( @@ -56,7 +99,7 @@ async def on_handoff( @function_tool def random_number(max: int) -> int: - """Generate a random number up to the provided max.""" + """Generate a random number from 0 to max (inclusive).""" return random.randint(0, max) @@ -75,6 +118,7 @@ class FinalResult(BaseModel): instructions="Multiply the number by 2 and then return the final result.", tools=[multiply_by_two], output_type=FinalResult, + hooks=LoggingHooks(), ) start_agent = Agent( @@ -83,16 +127,22 @@ class FinalResult(BaseModel): tools=[random_number], output_type=FinalResult, handoffs=[multiply_agent], + hooks=LoggingHooks(), ) async def main() -> None: user_input = input("Enter a max number: ") - await Runner.run( - start_agent, - hooks=hooks, - input=f"Generate a random number between 0 and {user_input}.", - ) + try: + max_number = int(user_input) + await Runner.run( + start_agent, + hooks=hooks, + input=f"Generate a random number between 0 and {max_number}.", + ) + except ValueError: + print("Please enter a valid integer.") + return print("Done!") @@ -104,13 +154,21 @@ async def main() -> None: Enter a max number: 250 ### 1: Agent Start Agent started. Usage: 0 requests, 0 input tokens, 0 output tokens, 0 total tokens -### 2: Tool random_number started. Usage: 1 requests, 148 input tokens, 15 output tokens, 163 total tokens -### 3: Tool random_number ended with result 101. Usage: 1 requests, 148 input tokens, 15 output tokens, 163 total token -### 4: Handoff from Start Agent to Multiply Agent. Usage: 2 requests, 323 input tokens, 30 output tokens, 353 total tokens -### 5: Agent Multiply Agent started. Usage: 2 requests, 323 input tokens, 30 output tokens, 353 total tokens -### 6: Tool multiply_by_two started. Usage: 3 requests, 504 input tokens, 46 output tokens, 550 total tokens -### 7: Tool multiply_by_two ended with result 202. Usage: 3 requests, 504 input tokens, 46 output tokens, 550 total tokens -### 8: Agent Multiply Agent ended with output number=202. Usage: 4 requests, 714 input tokens, 63 output tokens, 777 total tokens +### 2: LLM started. Usage: 0 requests, 0 input tokens, 0 output tokens, 0 total tokens +### 3: LLM ended. Usage: 1 requests, 143 input tokens, 15 output tokens, 158 total tokens +### 4: Tool random_number started. name=random_number, call_id=call_IujmDZYiM800H0hy7v17VTS0, args={"max":250}. Usage: 1 requests, 143 input tokens, 15 output tokens, 158 total tokens +### 5: Tool random_number finished. result=107, name=random_number, call_id=call_IujmDZYiM800H0hy7v17VTS0, args={"max":250}. Usage: 1 requests, 143 input tokens, 15 output tokens, 158 total tokens +### 6: LLM started. Usage: 1 requests, 143 input tokens, 15 output tokens, 158 total tokens +### 7: LLM ended. Usage: 2 requests, 310 input tokens, 29 output tokens, 339 total tokens +### 8: Handoff from Start Agent to Multiply Agent. Usage: 2 requests, 310 input tokens, 29 output tokens, 339 total tokens +### 9: Agent Multiply Agent started. Usage: 2 requests, 310 input tokens, 29 output tokens, 339 total tokens +### 10: LLM started. Usage: 2 requests, 310 input tokens, 29 output tokens, 339 total tokens +### 11: LLM ended. Usage: 3 requests, 472 input tokens, 45 output tokens, 517 total tokens +### 12: Tool multiply_by_two started. name=multiply_by_two, call_id=call_KhHvTfsgaosZsfi741QvzgYw, args={"x":107}. Usage: 3 requests, 472 input tokens, 45 output tokens, 517 total tokens +### 13: Tool multiply_by_two finished. result=214, name=multiply_by_two, call_id=call_KhHvTfsgaosZsfi741QvzgYw, args={"x":107}. Usage: 3 requests, 472 input tokens, 45 output tokens, 517 total tokens +### 14: LLM started. Usage: 3 requests, 472 input tokens, 45 output tokens, 517 total tokens +### 15: LLM ended. Usage: 4 requests, 660 input tokens, 56 output tokens, 716 total tokens +### 16: Agent Multiply Agent ended with output number=214. Usage: 4 requests, 660 input tokens, 56 output tokens, 716 total tokens Done! """ diff --git a/examples/basic/local_file.py b/examples/basic/local_file.py new file mode 100644 index 000000000..a261ff5c8 --- /dev/null +++ b/examples/basic/local_file.py @@ -0,0 +1,45 @@ +import asyncio +import base64 +import os + +from agents import Agent, Runner + +FILEPATH = os.path.join(os.path.dirname(__file__), "media/partial_o3-and-o4-mini-system-card.pdf") + + +def file_to_base64(file_path: str) -> str: + with open(file_path, "rb") as f: + return base64.b64encode(f.read()).decode("utf-8") + + +async def main(): + agent = Agent( + name="Assistant", + instructions="You are a helpful assistant.", + ) + + b64_file = file_to_base64(FILEPATH) + result = await Runner.run( + agent, + [ + { + "role": "user", + "content": [ + { + "type": "input_file", + "file_data": f"data:application/pdf;base64,{b64_file}", + "filename": "partial_o3-and-o4-mini-system-card.pdf", + } + ], + }, + { + "role": "user", + "content": "What is the first sentence of the introduction?", + }, + ], + ) + print(result.final_output) + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/basic/media/partial_o3-and-o4-mini-system-card.pdf b/examples/basic/media/partial_o3-and-o4-mini-system-card.pdf new file mode 100644 index 000000000..e4e0feaa0 Binary files /dev/null and b/examples/basic/media/partial_o3-and-o4-mini-system-card.pdf differ diff --git a/examples/basic/remote_pdf.py b/examples/basic/remote_pdf.py new file mode 100644 index 000000000..da425faa0 --- /dev/null +++ b/examples/basic/remote_pdf.py @@ -0,0 +1,31 @@ +import asyncio + +from agents import Agent, Runner + +URL = "https://www.berkshirehathaway.com/letters/2024ltr.pdf" + + +async def main(): + agent = Agent( + name="Assistant", + instructions="You are a helpful assistant.", + ) + + result = await Runner.run( + agent, + [ + { + "role": "user", + "content": [{"type": "input_file", "file_url": URL}], + }, + { + "role": "user", + "content": "Can you summarize the letter?", + }, + ], + ) + print(result.final_output) + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/basic/stream_function_call_args.py b/examples/basic/stream_function_call_args.py new file mode 100644 index 000000000..e04806169 --- /dev/null +++ b/examples/basic/stream_function_call_args.py @@ -0,0 +1,87 @@ +import asyncio +from typing import Annotated, Any, Optional + +from openai.types.responses import ResponseFunctionCallArgumentsDeltaEvent + +from agents import Agent, Runner, function_tool + + +@function_tool +def write_file(filename: Annotated[str, "Name of the file"], content: str) -> str: + """Write content to a file.""" + return f"File {filename} written successfully" + + +@function_tool +def create_config( + project_name: Annotated[str, "Project name"], + version: Annotated[str, "Project version"], + dependencies: Annotated[Optional[list[str]], "Dependencies (list of packages)"], +) -> str: + """Generate a project configuration file.""" + return f"Config for {project_name} v{version} created" + + +async def main(): + """ + Demonstrates real-time streaming of function call arguments. + + Function arguments are streamed incrementally as they are generated, + providing immediate feedback during parameter generation. + """ + agent = Agent( + name="CodeGenerator", + instructions="You are a helpful coding assistant. Use the provided tools to create files and configurations.", + tools=[write_file, create_config], + ) + + print("🚀 Function Call Arguments Streaming Demo") + + result = Runner.run_streamed( + agent, + input="Create a Python web project called 'my-app' with FastAPI. Version 1.0.0, dependencies: fastapi, uvicorn", + ) + + # Track function calls for detailed output + function_calls: dict[Any, dict[str, Any]] = {} # call_id -> {name, arguments} + current_active_call_id = None + + async for event in result.stream_events(): + if event.type == "raw_response_event": + # Function call started + if event.data.type == "response.output_item.added": + if getattr(event.data.item, "type", None) == "function_call": + function_name = getattr(event.data.item, "name", "unknown") + call_id = getattr(event.data.item, "call_id", "unknown") + + function_calls[call_id] = {"name": function_name, "arguments": ""} + current_active_call_id = call_id + print(f"\n📞 Function call streaming started: {function_name}()") + print("📝 Arguments building...") + + # Real-time argument streaming + elif isinstance(event.data, ResponseFunctionCallArgumentsDeltaEvent): + if current_active_call_id and current_active_call_id in function_calls: + function_calls[current_active_call_id]["arguments"] += event.data.delta + print(event.data.delta, end="", flush=True) + + # Function call completed + elif event.data.type == "response.output_item.done": + if hasattr(event.data.item, "call_id"): + call_id = getattr(event.data.item, "call_id", "unknown") + if call_id in function_calls: + function_info = function_calls[call_id] + print(f"\n✅ Function call streaming completed: {function_info['name']}") + print() + if current_active_call_id == call_id: + current_active_call_id = None + + print("Summary of all function calls:") + for call_id, info in function_calls.items(): + print(f" - #{call_id}: {info['name']}({info['arguments']})") + + print(f"\nResult: {result.final_output}") + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/basic/stream_items.py b/examples/basic/stream_items.py index c1f2257a5..9ba01accf 100644 --- a/examples/basic/stream_items.py +++ b/examples/basic/stream_items.py @@ -6,6 +6,7 @@ @function_tool def how_many_jokes() -> int: + """Return a random integer of jokes to tell between 1 and 10 (inclusive).""" return random.randint(1, 10) diff --git a/examples/basic/tool_guardrails.py b/examples/basic/tool_guardrails.py new file mode 100644 index 000000000..661d66b71 --- /dev/null +++ b/examples/basic/tool_guardrails.py @@ -0,0 +1,171 @@ +import asyncio +import json + +from agents import ( + Agent, + Runner, + ToolGuardrailFunctionOutput, + ToolInputGuardrailData, + ToolOutputGuardrailData, + ToolOutputGuardrailTripwireTriggered, + function_tool, + tool_input_guardrail, + tool_output_guardrail, +) + + +@function_tool +def send_email(to: str, subject: str, body: str) -> str: + """Send an email to the specified recipient.""" + return f"Email sent to {to} with subject '{subject}'" + + +@function_tool +def get_user_data(user_id: str) -> dict[str, str]: + """Get user data by ID.""" + # Simulate returning sensitive data + return { + "user_id": user_id, + "name": "John Doe", + "email": "john@example.com", + "ssn": "123-45-6789", # Sensitive data that should be blocked! + "phone": "555-1234", + } + + +@function_tool +def get_contact_info(user_id: str) -> dict[str, str]: + """Get contact info by ID.""" + return { + "user_id": user_id, + "name": "Jane Smith", + "email": "jane@example.com", + "phone": "555-1234", + } + + +@tool_input_guardrail +def reject_sensitive_words(data: ToolInputGuardrailData) -> ToolGuardrailFunctionOutput: + """Reject tool calls that contain sensitive words in arguments.""" + try: + args = json.loads(data.context.tool_arguments) if data.context.tool_arguments else {} + except json.JSONDecodeError: + return ToolGuardrailFunctionOutput(output_info="Invalid JSON arguments") + + # Check for suspicious content + sensitive_words = [ + "password", + "hack", + "exploit", + "malware", + "ACME", + ] + for key, value in args.items(): + value_str = str(value).lower() + for word in sensitive_words: + if word.lower() in value_str: + # Reject tool call and inform the model the function was not called + return ToolGuardrailFunctionOutput.reject_content( + message=f"🚨 Tool call blocked: contains '{word}'", + output_info={"blocked_word": word, "argument": key}, + ) + + return ToolGuardrailFunctionOutput(output_info="Input validated") + + +@tool_output_guardrail +def block_sensitive_output(data: ToolOutputGuardrailData) -> ToolGuardrailFunctionOutput: + """Block tool outputs that contain sensitive data.""" + output_str = str(data.output).lower() + + # Check for sensitive data patterns + if "ssn" in output_str or "123-45-6789" in output_str: + # Use raise_exception to halt execution completely for sensitive data + return ToolGuardrailFunctionOutput.raise_exception( + output_info={"blocked_pattern": "SSN", "tool": data.context.tool_name}, + ) + + return ToolGuardrailFunctionOutput(output_info="Output validated") + + +@tool_output_guardrail +def reject_phone_numbers(data: ToolOutputGuardrailData) -> ToolGuardrailFunctionOutput: + """Reject function output containing phone numbers.""" + output_str = str(data.output) + if "555-1234" in output_str: + return ToolGuardrailFunctionOutput.reject_content( + message="User data not retrieved as it contains a phone number which is restricted.", + output_info={"redacted": "phone_number"}, + ) + return ToolGuardrailFunctionOutput(output_info="Phone number check passed") + + +# Apply guardrails to tools +send_email.tool_input_guardrails = [reject_sensitive_words] +get_user_data.tool_output_guardrails = [block_sensitive_output] +get_contact_info.tool_output_guardrails = [reject_phone_numbers] + +agent = Agent( + name="Secure Assistant", + instructions="You are a helpful assistant with access to email and user data tools.", + tools=[send_email, get_user_data, get_contact_info], +) + + +async def main(): + print("=== Tool Guardrails Example ===\n") + + try: + # Example 1: Normal operation - should work fine + print("1. Normal email sending:") + result = await Runner.run(agent, "Send a welcome email to john@example.com") + print(f"✅ Successful tool execution: {result.final_output}\n") + + # Example 2: Input guardrail triggers - function tool call is rejected but execution continues + print("2. Attempting to send email with suspicious content:") + result = await Runner.run( + agent, "Send an email to john@example.com introducing the company ACME corp." + ) + print(f"❌ Guardrail rejected function tool call: {result.final_output}\n") + except Exception as e: + print(f"Error: {e}\n") + + try: + # Example 3: Output guardrail triggers - should raise exception for sensitive data + print("3. Attempting to get user data (contains SSN). Execution blocked:") + result = await Runner.run(agent, "Get the data for user ID user123") + print(f"✅ Successful tool execution: {result.final_output}\n") + except ToolOutputGuardrailTripwireTriggered as e: + print("🚨 Output guardrail triggered: Execution halted for sensitive data") + print(f"Details: {e.output.output_info}\n") + + try: + # Example 4: Output guardrail triggers - reject returning function tool output but continue execution + print("4. Rejecting function tool output containing phone numbers:") + result = await Runner.run(agent, "Get contact info for user456") + print(f"❌ Guardrail rejected function tool output: {result.final_output}\n") + except Exception as e: + print(f"Error: {e}\n") + + +if __name__ == "__main__": + asyncio.run(main()) + +""" +Example output: + +=== Tool Guardrails Example === + +1. Normal email sending: +✅ Successful tool execution: I've sent a welcome email to john@example.com with an appropriate subject and greeting message. + +2. Attempting to send email with suspicious content: +❌ Guardrail rejected function tool call: I'm unable to send the email as mentioning ACME Corp. is restricted. + +3. Attempting to get user data (contains SSN). Execution blocked: +🚨 Output guardrail triggered: Execution halted for sensitive data + Details: {'blocked_pattern': 'SSN', 'tool': 'get_user_data'} + +4. Rejecting function tool output containing sensitive data: +❌ Guardrail rejected function tool output: I'm unable to retrieve the contact info for user456 because it contains restricted information. +""" diff --git a/examples/basic/tools.py b/examples/basic/tools.py index 8936065a5..2052d9427 100644 --- a/examples/basic/tools.py +++ b/examples/basic/tools.py @@ -1,18 +1,20 @@ import asyncio +from typing import Annotated -from pydantic import BaseModel +from pydantic import BaseModel, Field from agents import Agent, Runner, function_tool class Weather(BaseModel): - city: str - temperature_range: str - conditions: str + city: str = Field(description="The city name") + temperature_range: str = Field(description="The temperature range in Celsius") + conditions: str = Field(description="The weather conditions") @function_tool -def get_weather(city: str) -> Weather: +def get_weather(city: Annotated[str, "The city to get the weather for"]) -> Weather: + """Get the current weather information for a specified city.""" print("[debug] get_weather called") return Weather(city=city, temperature_range="14-20C", conditions="Sunny with wind.") diff --git a/examples/basic/usage_tracking.py b/examples/basic/usage_tracking.py new file mode 100644 index 000000000..fd5a717c2 --- /dev/null +++ b/examples/basic/usage_tracking.py @@ -0,0 +1,45 @@ +import asyncio + +from pydantic import BaseModel + +from agents import Agent, Runner, Usage, function_tool + + +class Weather(BaseModel): + city: str + temperature_range: str + conditions: str + + +@function_tool +def get_weather(city: str) -> Weather: + """Get the current weather information for a specified city.""" + return Weather(city=city, temperature_range="14-20C", conditions="Sunny with wind.") + + +def print_usage(usage: Usage) -> None: + print("\n=== Usage ===") + print(f"Requests: {usage.requests}") + print(f"Input tokens: {usage.input_tokens}") + print(f"Output tokens: {usage.output_tokens}") + print(f"Total tokens: {usage.total_tokens}") + + +async def main() -> None: + agent = Agent( + name="Usage Demo", + instructions="You are a concise assistant. Use tools if needed.", + tools=[get_weather], + ) + + result = await Runner.run(agent, "What's the weather in Tokyo?") + + print("\nFinal output:") + print(result.final_output) + + # Access usage from the run context + print_usage(result.context_wrapper.usage) + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/customer_service/main.py b/examples/customer_service/main.py index bd802e228..266a7e611 100644 --- a/examples/customer_service/main.py +++ b/examples/customer_service/main.py @@ -39,21 +39,28 @@ class AirlineAgentContext(BaseModel): name_override="faq_lookup_tool", description_override="Lookup frequently asked questions." ) async def faq_lookup_tool(question: str) -> str: - if "bag" in question or "baggage" in question: + question_lower = question.lower() + if any( + keyword in question_lower + for keyword in ["bag", "baggage", "luggage", "carry-on", "hand luggage", "hand carry"] + ): return ( "You are allowed to bring one bag on the plane. " "It must be under 50 pounds and 22 inches x 14 inches x 9 inches." ) - elif "seats" in question or "plane" in question: + elif any(keyword in question_lower for keyword in ["seat", "seats", "seating", "plane"]): return ( "There are 120 seats on the plane. " "There are 22 business class seats and 98 economy seats. " "Exit rows are rows 4 and 16. " "Rows 5-8 are Economy Plus, with extra legroom. " ) - elif "wifi" in question: + elif any( + keyword in question_lower + for keyword in ["wifi", "internet", "wireless", "connectivity", "network", "online"] + ): return "We have free wifi on the plane, join Airline-Wifi" - return "I'm sorry, I don't know the answer to that question." + return "I'm sorry, I don't know the answer to that question." @function_tool diff --git a/examples/financial_research_agent/agents/search_agent.py b/examples/financial_research_agent/agents/search_agent.py index 4ef2522da..6e7c0b054 100644 --- a/examples/financial_research_agent/agents/search_agent.py +++ b/examples/financial_research_agent/agents/search_agent.py @@ -12,6 +12,7 @@ search_agent = Agent( name="FinancialSearchAgent", + model="gpt-4.1", instructions=INSTRUCTIONS, tools=[WebSearchTool()], model_settings=ModelSettings(tool_choice="required"), diff --git a/examples/financial_research_agent/agents/writer_agent.py b/examples/financial_research_agent/agents/writer_agent.py index 0f561006d..cc6bd3c31 100644 --- a/examples/financial_research_agent/agents/writer_agent.py +++ b/examples/financial_research_agent/agents/writer_agent.py @@ -29,6 +29,6 @@ class FinancialReportData(BaseModel): writer_agent = Agent( name="FinancialWriterAgent", instructions=WRITER_PROMPT, - model="gpt-4.5-preview-2025-02-27", + model="gpt-4.1", output_type=FinancialReportData, ) diff --git a/examples/handoffs/message_filter.py b/examples/handoffs/message_filter.py index b7fed6c17..20460d3ac 100644 --- a/examples/handoffs/message_filter.py +++ b/examples/handoffs/message_filter.py @@ -5,6 +5,7 @@ from agents import Agent, HandoffInputData, Runner, function_tool, handoff, trace from agents.extensions import handoff_filters +from agents.models import is_gpt_5_default @function_tool @@ -14,6 +15,15 @@ def random_number_tool(max: int) -> int: def spanish_handoff_message_filter(handoff_message_data: HandoffInputData) -> HandoffInputData: + if is_gpt_5_default(): + print("gpt-5 is enabled, so we're not filtering the input history") + # when using gpt-5, removing some of the items could break things, so we do this filtering only for other models + return HandoffInputData( + input_history=handoff_message_data.input_history, + pre_handoff_items=tuple(handoff_message_data.pre_handoff_items), + new_items=tuple(handoff_message_data.new_items), + ) + # First, we'll remove any tool-related messages from the message history handoff_message_data = handoff_filters.remove_all_tools(handoff_message_data) @@ -24,6 +34,7 @@ def spanish_handoff_message_filter(handoff_message_data: HandoffInputData) -> Ha else handoff_message_data.input_history ) + # or, you can use the HandoffInputData.clone(kwargs) method return HandoffInputData( input_history=history, pre_handoff_items=tuple(handoff_message_data.pre_handoff_items), diff --git a/examples/handoffs/message_filter_streaming.py b/examples/handoffs/message_filter_streaming.py index 63cb1de34..604c5d1d6 100644 --- a/examples/handoffs/message_filter_streaming.py +++ b/examples/handoffs/message_filter_streaming.py @@ -5,6 +5,7 @@ from agents import Agent, HandoffInputData, Runner, function_tool, handoff, trace from agents.extensions import handoff_filters +from agents.models import is_gpt_5_default @function_tool @@ -14,6 +15,15 @@ def random_number_tool(max: int) -> int: def spanish_handoff_message_filter(handoff_message_data: HandoffInputData) -> HandoffInputData: + if is_gpt_5_default(): + print("gpt-5 is enabled, so we're not filtering the input history") + # when using gpt-5, removing some of the items could break things, so we do this filtering only for other models + return HandoffInputData( + input_history=handoff_message_data.input_history, + pre_handoff_items=tuple(handoff_message_data.pre_handoff_items), + new_items=tuple(handoff_message_data.new_items), + ) + # First, we'll remove any tool-related messages from the message history handoff_message_data = handoff_filters.remove_all_tools(handoff_message_data) @@ -24,6 +34,7 @@ def spanish_handoff_message_filter(handoff_message_data: HandoffInputData) -> Ha else handoff_message_data.input_history ) + # or, you can use the HandoffInputData.clone(kwargs) method return HandoffInputData( input_history=history, pre_handoff_items=tuple(handoff_message_data.pre_handoff_items), diff --git a/examples/hosted_mcp/approvals.py b/examples/hosted_mcp/approvals.py index 3080a1d63..c3de0db44 100644 --- a/examples/hosted_mcp/approvals.py +++ b/examples/hosted_mcp/approvals.py @@ -44,7 +44,10 @@ async def main(verbose: bool, stream: bool): print(f"Got event of type {event.item.__class__.__name__}") print(f"Done streaming; final result: {result.final_output}") else: - res = await Runner.run(agent, "Which language is this repo written in?") + res = await Runner.run( + agent, + "Which language is this repo written in? Your MCP server should know what the repo is.", + ) print(res.final_output) if verbose: diff --git a/examples/hosted_mcp/connectors.py b/examples/hosted_mcp/connectors.py new file mode 100644 index 000000000..e86cfd8e3 --- /dev/null +++ b/examples/hosted_mcp/connectors.py @@ -0,0 +1,62 @@ +import argparse +import asyncio +import json +import os +from datetime import datetime + +from agents import Agent, HostedMCPTool, Runner + +# import logging +# logging.basicConfig(level=logging.DEBUG) + + +async def main(verbose: bool, stream: bool): + # 1. Visit https://developers.google.com/oauthplayground/ + # 2. Input https://www.googleapis.com/auth/calendar.events as the required scope + # 3. Grab the access token starting with "ya29." + authorization = os.environ["GOOGLE_CALENDAR_AUTHORIZATION"] + agent = Agent( + name="Assistant", + instructions="You are a helpful assistant that can help a user with their calendar.", + tools=[ + HostedMCPTool( + tool_config={ + "type": "mcp", + "server_label": "google_calendar", + # see https://platform.openai.com/docs/guides/tools-connectors-mcp#connectors + "connector_id": "connector_googlecalendar", + "authorization": authorization, + "require_approval": "never", + } + ) + ], + ) + + today = datetime.now().strftime("%Y-%m-%d") + if stream: + result = Runner.run_streamed(agent, f"What is my schedule for {today}?") + async for event in result.stream_events(): + if event.type == "raw_response_event": + if event.data.type.startswith("response.output_item"): + print(json.dumps(event.data.to_dict(), indent=2)) + if event.data.type.startswith("response.mcp"): + print(json.dumps(event.data.to_dict(), indent=2)) + if event.data.type == "response.output_text.delta": + print(event.data.delta, end="", flush=True) + print() + else: + res = await Runner.run(agent, f"What is my schedule for {today}?") + print(res.final_output) + + if verbose: + for item in res.new_items: + print(item) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--verbose", action="https://github.com/store_true", default=False) + parser.add_argument("--stream", action="https://github.com/store_true", default=False) + args = parser.parse_args() + + asyncio.run(main(args.verbose, args.stream)) diff --git a/examples/hosted_mcp/simple.py b/examples/hosted_mcp/simple.py index 895fdfbe0..5de78648c 100644 --- a/examples/hosted_mcp/simple.py +++ b/examples/hosted_mcp/simple.py @@ -29,7 +29,10 @@ async def main(verbose: bool, stream: bool): print(f"Got event of type {event.item.__class__.__name__}") print(f"Done streaming; final result: {result.final_output}") else: - res = await Runner.run(agent, "Which language is this repo written in?") + res = await Runner.run( + agent, + "Which language is this repo written in? Your MCP server should know what the repo is.", + ) print(res.final_output) # The repository is primarily written in multiple languages, including Rust and TypeScript... diff --git a/examples/mcp/streamablehttp_custom_client_example/README.md b/examples/mcp/streamablehttp_custom_client_example/README.md new file mode 100644 index 000000000..1569b3c28 --- /dev/null +++ b/examples/mcp/streamablehttp_custom_client_example/README.md @@ -0,0 +1,62 @@ +# Custom HTTP Client Factory Example + +This example demonstrates how to use the new `httpx_client_factory` parameter in `MCPServerStreamableHttp` to configure custom HTTP client behavior for MCP StreamableHTTP connections. + +## Features Demonstrated + +- **Custom SSL Configuration**: Configure SSL certificates and verification settings +- **Custom Headers**: Add custom headers to all HTTP requests +- **Custom Timeouts**: Set custom timeout values for requests +- **Proxy Configuration**: Configure HTTP proxy settings +- **Custom Retry Logic**: Set up custom retry behavior (through httpx configuration) + +## Running the Example + +1. Make sure you have `uv` installed: https://docs.astral.sh/uv/getting-started/installation/ + +2. Run the example: + ```bash + cd examples/mcp/streamablehttp_custom_client_example + uv run main.py + ``` + +## Code Examples + +### Basic Custom Client + +```python +import httpx +from agents.mcp import MCPServerStreamableHttp + +def create_custom_http_client() -> httpx.AsyncClient: + return httpx.AsyncClient( + verify=False, # Disable SSL verification for testing + timeout=httpx.Timeout(60.0, read=120.0), + headers={"X-Custom-Client": "my-app"}, + ) + +async with MCPServerStreamableHttp( + name="Custom Client Server", + params={ + "url": "http://localhost:8000/mcp", + "httpx_client_factory": create_custom_http_client, + }, +) as server: + # Use the server... +``` + +## Use Cases + +- **Corporate Networks**: Configure proxy settings for corporate environments +- **SSL/TLS Requirements**: Use custom SSL certificates for secure connections +- **Custom Authentication**: Add custom headers for API authentication +- **Network Optimization**: Configure timeouts and connection pooling +- **Debugging**: Disable SSL verification for development environments + +## Benefits + +- **Flexibility**: Configure HTTP client behavior to match your network requirements +- **Security**: Use custom SSL certificates and authentication methods +- **Performance**: Optimize timeouts and connection settings for your use case +- **Compatibility**: Work with corporate proxies and network restrictions + diff --git a/examples/mcp/streamablehttp_custom_client_example/main.py b/examples/mcp/streamablehttp_custom_client_example/main.py new file mode 100644 index 000000000..41e26ec35 --- /dev/null +++ b/examples/mcp/streamablehttp_custom_client_example/main.py @@ -0,0 +1,116 @@ +"""Example demonstrating custom httpx_client_factory for MCPServerStreamableHttp. + +This example shows how to configure custom HTTP client behavior for MCP StreamableHTTP +connections, including SSL certificates, proxy settings, and custom timeouts. +""" + +import asyncio +import os +import shutil +import subprocess +import time +from typing import Any + +import httpx + +from agents import Agent, Runner, gen_trace_id, trace +from agents.mcp import MCPServer, MCPServerStreamableHttp +from agents.model_settings import ModelSettings + + +def create_custom_http_client( + headers: dict[str, str] | None = None, + timeout: httpx.Timeout | None = None, + auth: httpx.Auth | None = None, +) -> httpx.AsyncClient: + """Create a custom HTTP client with specific configurations. + + This function demonstrates how to configure: + - Custom SSL verification settings + - Custom timeouts + - Custom headers + - Proxy settings (commented out) + """ + if headers is None: + headers = { + "X-Custom-Client": "agents-mcp-example", + "User-Agent": "OpenAI-Agents-MCP/1.0", + } + if timeout is None: + timeout = httpx.Timeout(60.0, read=120.0) + if auth is None: + auth = None + return httpx.AsyncClient( + # Disable SSL verification for testing (not recommended for production) + verify=False, + # Set custom timeout + timeout=httpx.Timeout(60.0, read=120.0), + # Add custom headers that will be sent with every request + headers=headers, + ) + + +async def run_with_custom_client(mcp_server: MCPServer): + """Run the agent with a custom HTTP client configuration.""" + agent = Agent( + name="Assistant", + instructions="Use the tools to answer the questions.", + mcp_servers=[mcp_server], + model_settings=ModelSettings(tool_choice="required"), + ) + + # Use the `add` tool to add two numbers + message = "Add these numbers: 7 and 22." + print(f"Running: {message}") + result = await Runner.run(starting_agent=agent, input=message) + print(result.final_output) + + +async def main(): + """Main function demonstrating different HTTP client configurations.""" + + print("=== Example: Custom HTTP Client with SSL disabled and custom headers ===") + async with MCPServerStreamableHttp( + name="Streamable HTTP with Custom Client", + params={ + "url": "http://localhost:8000/mcp", + "httpx_client_factory": create_custom_http_client, + }, + ) as server: + trace_id = gen_trace_id() + with trace(workflow_name="Custom HTTP Client Example", trace_id=trace_id): + print(f"View trace: https://platform.openai.com/logs/trace?trace_id={trace_id}\n") + await run_with_custom_client(server) + + +if __name__ == "__main__": + # Let's make sure the user has uv installed + if not shutil.which("uv"): + raise RuntimeError( + "uv is not installed. Please install it: https://docs.astral.sh/uv/getting-started/installation/" + ) + + # We'll run the Streamable HTTP server in a subprocess. Usually this would be a remote server, but for this + # demo, we'll run it locally at http://localhost:8000/mcp + process: subprocess.Popen[Any] | None = None + try: + this_dir = os.path.dirname(os.path.abspath(__file__)) + server_file = os.path.join(this_dir, "server.py") + + print("Starting Streamable HTTP server at http://localhost:8000/mcp ...") + + # Run `uv run server.py` to start the Streamable HTTP server + process = subprocess.Popen(["uv", "run", server_file]) + # Give it 3 seconds to start + time.sleep(3) + + print("Streamable HTTP server started. Running example...\n\n") + except Exception as e: + print(f"Error starting Streamable HTTP server: {e}") + exit(1) + + try: + asyncio.run(main()) + finally: + if process: + process.terminate() diff --git a/examples/mcp/streamablehttp_custom_client_example/server.py b/examples/mcp/streamablehttp_custom_client_example/server.py new file mode 100644 index 000000000..a078ee00f --- /dev/null +++ b/examples/mcp/streamablehttp_custom_client_example/server.py @@ -0,0 +1,23 @@ +import random + +from mcp.server.fastmcp import FastMCP + +# Create server +mcp = FastMCP("Echo Server") + + +@mcp.tool() +def add(a: int, b: int) -> int: + """Add two numbers""" + print(f"[debug-server] add({a}, {b})") + return a + b + + +@mcp.tool() +def get_secret_word() -> str: + print("[debug-server] get_secret_word()") + return random.choice(["apple", "banana", "cherry"]) + + +if __name__ == "__main__": + mcp.run(transport="streamable-http") diff --git a/examples/memory/advanced_sqlite_session_example.py b/examples/memory/advanced_sqlite_session_example.py new file mode 100644 index 000000000..fe9d3aab4 --- /dev/null +++ b/examples/memory/advanced_sqlite_session_example.py @@ -0,0 +1,278 @@ +""" +Comprehensive example demonstrating AdvancedSQLiteSession functionality. + +This example shows both basic session memory features and advanced conversation +branching capabilities, including usage statistics, turn-based organization, +and multi-timeline conversation management. +""" + +import asyncio + +from agents import Agent, Runner, function_tool +from agents.extensions.memory import AdvancedSQLiteSession + + +@function_tool +async def get_weather(city: str) -> str: + if city.strip().lower() == "new york": + return f"The weather in {city} is cloudy." + return f"The weather in {city} is sunny." + + +async def main(): + # Create an agent + agent = Agent( + name="Assistant", + instructions="Reply very concisely.", + tools=[get_weather], + ) + + # Create an advanced session instance + session = AdvancedSQLiteSession( + session_id="conversation_comprehensive", + create_tables=True, + ) + + print("=== AdvancedSQLiteSession Comprehensive Example ===") + print("This example demonstrates both basic and advanced session features.\n") + + # === PART 1: Basic Session Functionality === + print("=== PART 1: Basic Session Memory ===") + print("The agent will remember previous messages with structured tracking.\n") + + # First turn + print("First turn:") + print("User: What city is the Golden Gate Bridge in?") + result = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session, + ) + print(f"Assistant: {result.final_output}") + print(f"Usage: {result.context_wrapper.usage.total_tokens} tokens") + + # Store usage data automatically + await session.store_run_usage(result) + print() + + # Second turn - continuing the conversation + print("Second turn:") + print("User: What's the weather in that city?") + result = await Runner.run( + agent, + "What's the weather in that city?", + session=session, + ) + print(f"Assistant: {result.final_output}") + print(f"Usage: {result.context_wrapper.usage.total_tokens} tokens") + + # Store usage data automatically + await session.store_run_usage(result) + print() + + # Third turn + print("Third turn:") + print("User: What's the population of that city?") + result = await Runner.run( + agent, + "What's the population of that city?", + session=session, + ) + print(f"Assistant: {result.final_output}") + print(f"Usage: {result.context_wrapper.usage.total_tokens} tokens") + + # Store usage data automatically + await session.store_run_usage(result) + print() + + # === PART 2: Usage Tracking and Analytics === + print("=== PART 2: Usage Tracking and Analytics ===") + session_usage = await session.get_session_usage() + if session_usage: + print("Session Usage (aggregated from turns):") + print(f" Total requests: {session_usage['requests']}") + print(f" Total tokens: {session_usage['total_tokens']}") + print(f" Input tokens: {session_usage['input_tokens']}") + print(f" Output tokens: {session_usage['output_tokens']}") + print(f" Total turns: {session_usage['total_turns']}") + + # Show usage by turn + turn_usage_list = await session.get_turn_usage() + if turn_usage_list and isinstance(turn_usage_list, list): + print("\nUsage by turn:") + for turn_data in turn_usage_list: + turn_num = turn_data["user_turn_number"] + tokens = turn_data["total_tokens"] + print(f" Turn {turn_num}: {tokens} tokens") + else: + print("No usage data found.") + + print("\n=== Structured Query Demo ===") + conversation_turns = await session.get_conversation_by_turns() + print("Conversation by turns:") + for turn_num, items in conversation_turns.items(): + print(f" Turn {turn_num}: {len(items)} items") + for item in items: + if item["tool_name"]: + print(f" - {item['type']} (tool: {item['tool_name']})") + else: + print(f" - {item['type']}") + + # Show tool usage + tool_usage = await session.get_tool_usage() + if tool_usage: + print("\nTool usage:") + for tool_name, count, turn in tool_usage: + print(f" {tool_name}: used {count} times in turn {turn}") + else: + print("\nNo tool usage found.") + + print("\n=== Original Conversation Complete ===") + + # Show current conversation + print("Current conversation:") + current_items = await session.get_items() + for i, item in enumerate(current_items, 1): + role = str(item.get("role", item.get("type", "unknown"))) + if item.get("type") == "function_call": + content = f"{item.get('name', 'unknown')}({item.get('arguments', '{}')})" + elif item.get("type") == "function_call_output": + content = str(item.get("output", "")) + else: + content = str(item.get("content", item.get("output", ""))) + print(f" {i}. {role}: {content}") + + print(f"\nTotal items: {len(current_items)}") + + # === PART 3: Conversation Branching === + print("\n=== PART 3: Conversation Branching ===") + print("Let's explore a different path from turn 2...") + + # Show available turns for branching + print("\nAvailable turns for branching:") + turns = await session.get_conversation_turns() + for turn in turns: + print(f" Turn {turn['turn']}: {turn['content']}") + + # Create a branch from turn 2 + print("\nCreating new branch from turn 2...") + branch_id = await session.create_branch_from_turn(2) + print(f"Created branch: {branch_id}") + + # Show what's in the new branch (should have conversation up to turn 2) + branch_items = await session.get_items() + print(f"Items copied to new branch: {len(branch_items)}") + print("New branch contains:") + for i, item in enumerate(branch_items, 1): + role = str(item.get("role", item.get("type", "unknown"))) + if item.get("type") == "function_call": + content = f"{item.get('name', 'unknown')}({item.get('arguments', '{}')})" + elif item.get("type") == "function_call_output": + content = str(item.get("output", "")) + else: + content = str(item.get("content", item.get("output", ""))) + print(f" {i}. {role}: {content}") + + # Continue conversation in new branch + print("\nContinuing conversation in new branch...") + print("Turn 2 (new branch): User asks about New York instead") + result = await Runner.run( + agent, + "Actually, what's the weather in New York instead?", + session=session, + ) + print(f"Assistant: {result.final_output}") + await session.store_run_usage(result) + + # Continue the new branch + print("Turn 3 (new branch): User asks about NYC attractions") + result = await Runner.run( + agent, + "What are some famous attractions in New York?", + session=session, + ) + print(f"Assistant: {result.final_output}") + await session.store_run_usage(result) + + # Show the new conversation + print("\n=== New Conversation Branch ===") + new_conversation = await session.get_items() + print("New conversation with branch:") + for i, item in enumerate(new_conversation, 1): + role = str(item.get("role", item.get("type", "unknown"))) + if item.get("type") == "function_call": + content = f"{item.get('name', 'unknown')}({item.get('arguments', '{}')})" + elif item.get("type") == "function_call_output": + content = str(item.get("output", "")) + else: + content = str(item.get("content", item.get("output", ""))) + print(f" {i}. {role}: {content}") + + print(f"\nTotal items in new branch: {len(new_conversation)}") + + # === PART 4: Branch Management === + print("\n=== PART 4: Branch Management ===") + # Show all branches + branches = await session.list_branches() + print("All branches in this session:") + for branch in branches: + current = " (current)" if branch["is_current"] else "" + print( + f" {branch['branch_id']}: {branch['user_turns']} user turns, {branch['message_count']} total messages{current}" + ) + + # Show conversation turns in current branch + print("\nConversation turns in current branch:") + current_turns = await session.get_conversation_turns() + for turn in current_turns: + print(f" Turn {turn['turn']}: {turn['content']}") + + print("\n=== Branch Switching Demo ===") + print("We can switch back to the main branch...") + + # Switch back to main branch + await session.switch_to_branch("main") + print("Switched to main branch") + + # Show what's in main branch + main_items = await session.get_items() + print(f"Items in main branch: {len(main_items)}") + + # Switch back to new branch + await session.switch_to_branch(branch_id) + branch_items = await session.get_items() + print(f"Items in new branch: {len(branch_items)}") + + print("\n=== Final Summary ===") + await session.switch_to_branch("main") + main_final = len(await session.get_items()) + await session.switch_to_branch(branch_id) + branch_final = len(await session.get_items()) + + print(f"Main branch items: {main_final}") + print(f"New branch items: {branch_final}") + + # Show that branches are completely independent + print("\nBranches are completely independent:") + print("- Main branch has full original conversation") + print("- New branch has turn 1 + new conversation path") + print("- No interference between branches!") + + print("\n=== Comprehensive Example Complete ===") + print("This demonstrates the full AdvancedSQLiteSession capabilities!") + print("Key features:") + print("- Structured conversation tracking with usage analytics") + print("- Turn-based organization and querying") + print("- Create branches from any user message") + print("- Branches inherit conversation history up to the branch point") + print("- Complete branch isolation - no interference between branches") + print("- Easy branch switching and management") + print("- No complex soft deletion - clean branch-based architecture") + print("- Perfect for building AI systems with conversation editing capabilities!") + + # Cleanup + session.close() + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/memory/encrypted_session_example.py b/examples/memory/encrypted_session_example.py new file mode 100644 index 000000000..d3d9a9e74 --- /dev/null +++ b/examples/memory/encrypted_session_example.py @@ -0,0 +1,109 @@ +""" +Example demonstrating encrypted session memory functionality. + +This example shows how to use encrypted session memory to maintain conversation history +across multiple agent runs with automatic encryption and TTL-based expiration. +The EncryptedSession wrapper provides transparent encryption over any underlying session. +""" + +import asyncio +from typing import cast + +from agents import Agent, Runner, SQLiteSession +from agents.extensions.memory import EncryptedSession +from agents.extensions.memory.encrypt_session import EncryptedEnvelope + + +async def main(): + # Create an agent + agent = Agent( + name="Assistant", + instructions="Reply very concisely.", + ) + + # Create an underlying session (SQLiteSession in this example) + session_id = "conversation_123" + underlying_session = SQLiteSession(session_id) + + # Wrap with encrypted session for automatic encryption and TTL + session = EncryptedSession( + session_id=session_id, + underlying_session=underlying_session, + encryption_key="my-secret-encryption-key", + ttl=3600, # 1 hour TTL for messages + ) + + print("=== Encrypted Session Example ===") + print("The agent will remember previous messages automatically with encryption.\n") + + # First turn + print("First turn:") + print("User: What city is the Golden Gate Bridge in?") + result = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session, + ) + print(f"Assistant: {result.final_output}") + print() + + # Second turn - the agent will remember the previous conversation + print("Second turn:") + print("User: What state is it in?") + result = await Runner.run(agent, "What state is it in?", session=session) + print(f"Assistant: {result.final_output}") + print() + + # Third turn - continuing the conversation + print("Third turn:") + print("User: What's the population of that state?") + result = await Runner.run( + agent, + "What's the population of that state?", + session=session, + ) + print(f"Assistant: {result.final_output}") + print() + + print("=== Conversation Complete ===") + print("Notice how the agent remembered the context from previous turns!") + print("All conversation history was automatically encrypted and stored securely.") + + # Demonstrate the limit parameter - get only the latest 2 items + print("\n=== Latest Items Demo ===") + latest_items = await session.get_items(limit=2) + print("Latest 2 items (automatically decrypted):") + for i, msg in enumerate(latest_items, 1): + role = msg.get("role", "unknown") + content = msg.get("content", "") + print(f" {i}. {role}: {content}") + + print(f"\nFetched {len(latest_items)} out of total conversation history.") + + # Get all items to show the difference + all_items = await session.get_items() + print(f"Total items in session: {len(all_items)}") + + # Show that underlying storage is encrypted + print("\n=== Encryption Demo ===") + print("Checking underlying storage to verify encryption...") + raw_items = await underlying_session.get_items() + print("Raw encrypted items in underlying storage:") + for i, item in enumerate(raw_items, 1): + if isinstance(item, dict) and item.get("__enc__") == 1: + enc_item = cast(EncryptedEnvelope, item) + print( + f" {i}. Encrypted envelope: __enc__={enc_item['__enc__']}, " + f"payload length={len(enc_item['payload'])}" + ) + else: + print(f" {i}. Unencrypted item: {item}") + + print(f"\nAll {len(raw_items)} items are stored encrypted with TTL-based expiration.") + + # Clean up + underlying_session.close() + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/memory/openai_session_example.py b/examples/memory/openai_session_example.py new file mode 100644 index 000000000..9254195b3 --- /dev/null +++ b/examples/memory/openai_session_example.py @@ -0,0 +1,78 @@ +""" +Example demonstrating session memory functionality. + +This example shows how to use session memory to maintain conversation history +across multiple agent runs without manually handling .to_input_list(). +""" + +import asyncio + +from agents import Agent, OpenAIConversationsSession, Runner + + +async def main(): + # Create an agent + agent = Agent( + name="Assistant", + instructions="Reply very concisely.", + ) + + # Create a session instance that will persist across runs + session = OpenAIConversationsSession() + + print("=== Session Example ===") + print("The agent will remember previous messages automatically.\n") + + # First turn + print("First turn:") + print("User: What city is the Golden Gate Bridge in?") + result = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session, + ) + print(f"Assistant: {result.final_output}") + print() + + # Second turn - the agent will remember the previous conversation + print("Second turn:") + print("User: What state is it in?") + result = await Runner.run(agent, "What state is it in?", session=session) + print(f"Assistant: {result.final_output}") + print() + + # Third turn - continuing the conversation + print("Third turn:") + print("User: What's the population of that state?") + result = await Runner.run( + agent, + "What's the population of that state?", + session=session, + ) + print(f"Assistant: {result.final_output}") + print() + + print("=== Conversation Complete ===") + print("Notice how the agent remembered the context from previous turns!") + print("Sessions automatically handles conversation history.") + + # Demonstrate the limit parameter - get only the latest 2 items + print("\n=== Latest Items Demo ===") + latest_items = await session.get_items(limit=2) + # print(latest_items) + print("Latest 2 items:") + for i, msg in enumerate(latest_items, 1): + role = msg.get("role", "unknown") + content = msg.get("content", "") + print(f" {i}. {role}: {content}") + + print(f"\nFetched {len(latest_items)} out of total conversation history.") + + # Get all items to show the difference + all_items = await session.get_items() + # print(all_items) + print(f"Total items in session: {len(all_items)}") + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/memory/redis_session_example.py b/examples/memory/redis_session_example.py new file mode 100644 index 000000000..248598902 --- /dev/null +++ b/examples/memory/redis_session_example.py @@ -0,0 +1,177 @@ +""" +Example demonstrating Redis session memory functionality. + +This example shows how to use Redis-backed session memory to maintain conversation +history across multiple agent runs with persistence and scalability. + +Note: This example clears the session at the start to ensure a clean demonstration. +In production, you may want to preserve existing conversation history. +""" + +import asyncio + +from agents import Agent, Runner +from agents.extensions.memory import RedisSession + + +async def main(): + # Create an agent + agent = Agent( + name="Assistant", + instructions="Reply very concisely.", + ) + + print("=== Redis Session Example ===") + print("This example requires Redis to be running on localhost:6379") + print("Start Redis with: redis-server") + print() + + # Create a Redis session instance + session_id = "redis_conversation_123" + try: + session = RedisSession.from_url( + session_id, + url="redis://localhost:6379/0", # Use database 0 + ) + + # Test Redis connectivity + if not await session.ping(): + print("Redis server is not available!") + print("Please start Redis server and try again.") + return + + print("Connected to Redis successfully!") + print(f"Session ID: {session_id}") + + # Clear any existing session data for a clean start + await session.clear_session() + print("Session cleared for clean demonstration.") + print("The agent will remember previous messages automatically.\n") + + # First turn + print("First turn:") + print("User: What city is the Golden Gate Bridge in?") + result = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session, + ) + print(f"Assistant: {result.final_output}") + print() + + # Second turn - the agent will remember the previous conversation + print("Second turn:") + print("User: What state is it in?") + result = await Runner.run(agent, "What state is it in?", session=session) + print(f"Assistant: {result.final_output}") + print() + + # Third turn - continuing the conversation + print("Third turn:") + print("User: What's the population of that state?") + result = await Runner.run( + agent, + "What's the population of that state?", + session=session, + ) + print(f"Assistant: {result.final_output}") + print() + + print("=== Conversation Complete ===") + print("Notice how the agent remembered the context from previous turns!") + print("Redis session automatically handles conversation history with persistence.") + + # Demonstrate session persistence + print("\n=== Session Persistence Demo ===") + all_items = await session.get_items() + print(f"Total messages stored in Redis: {len(all_items)}") + + # Demonstrate the limit parameter + print("\n=== Latest Items Demo ===") + latest_items = await session.get_items(limit=2) + print("Latest 2 items:") + for i, msg in enumerate(latest_items, 1): + role = msg.get("role", "unknown") + content = msg.get("content", "") + print(f" {i}. {role}: {content}") + + # Demonstrate session isolation with a new session + print("\n=== Session Isolation Demo ===") + new_session = RedisSession.from_url( + "different_conversation_456", + url="redis://localhost:6379/0", + ) + + print("Creating a new session with different ID...") + result = await Runner.run( + agent, + "Hello, this is a new conversation!", + session=new_session, + ) + print(f"New session response: {result.final_output}") + + # Show that sessions are isolated + original_items = await session.get_items() + new_items = await new_session.get_items() + print(f"Original session has {len(original_items)} items") + print(f"New session has {len(new_items)} items") + print("Sessions are completely isolated!") + + # Clean up the new session + await new_session.clear_session() + await new_session.close() + + # Optional: Demonstrate TTL (time-to-live) functionality + print("\n=== TTL Demo ===") + ttl_session = RedisSession.from_url( + "ttl_demo_session", + url="redis://localhost:6379/0", + ttl=3600, # 1 hour TTL + ) + + await Runner.run( + agent, + "This message will expire in 1 hour", + session=ttl_session, + ) + print("Created session with 1-hour TTL - messages will auto-expire") + + await ttl_session.close() + + # Close the main session + await session.close() + + except Exception as e: + print(f"Error: {e}") + print("Make sure Redis is running on localhost:6379") + + +async def demonstrate_advanced_features(): + """Demonstrate advanced Redis session features.""" + print("\n=== Advanced Features Demo ===") + + # Custom key prefix for multi-tenancy + tenant_session = RedisSession.from_url( + "user_123", + url="redis://localhost:6379/0", + key_prefix="tenant_abc:sessions", # Custom prefix for isolation + ) + + try: + if await tenant_session.ping(): + print("Custom key prefix demo:") + await Runner.run( + Agent(name="Support", instructions="Be helpful"), + "Hello from tenant ABC", + session=tenant_session, + ) + print("Session with custom key prefix created successfully") + + await tenant_session.close() + except Exception as e: + print(f"Advanced features error: {e}") + + +if __name__ == "__main__": + asyncio.run(main()) + asyncio.run(demonstrate_advanced_features()) diff --git a/examples/memory/sqlalchemy_session_example.py b/examples/memory/sqlalchemy_session_example.py new file mode 100644 index 000000000..84a6c754f --- /dev/null +++ b/examples/memory/sqlalchemy_session_example.py @@ -0,0 +1,78 @@ +import asyncio + +from agents import Agent, Runner +from agents.extensions.memory.sqlalchemy_session import SQLAlchemySession + + +async def main(): + # Create an agent + agent = Agent( + name="Assistant", + instructions="Reply very concisely.", + ) + + # Create a session instance with a session ID. + # This example uses an in-memory SQLite database. + # The `create_tables=True` flag is useful for development and testing. + session = SQLAlchemySession.from_url( + "conversation_123", + url="sqlite+aiosqlite:///:memory:", + create_tables=True, + ) + + print("=== Session Example ===") + print("The agent will remember previous messages automatically.\n") + + # First turn + print("First turn:") + print("User: What city is the Golden Gate Bridge in?") + result = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session, + ) + print(f"Assistant: {result.final_output}") + print() + + # Second turn - the agent will remember the previous conversation + print("Second turn:") + print("User: What state is it in?") + result = await Runner.run(agent, "What state is it in?", session=session) + print(f"Assistant: {result.final_output}") + print() + + # Third turn - continuing the conversation + print("Third turn:") + print("User: What's the population of that state?") + result = await Runner.run( + agent, + "What's the population of that state?", + session=session, + ) + print(f"Assistant: {result.final_output}") + print() + + print("=== Conversation Complete ===") + print("Notice how the agent remembered the context from previous turns!") + print("Sessions automatically handles conversation history.") + + # Demonstrate the limit parameter - get only the latest 2 items + print("\n=== Latest Items Demo ===") + latest_items = await session.get_items(limit=2) + print("Latest 2 items:") + for i, msg in enumerate(latest_items, 1): + role = msg.get("role", "unknown") + content = msg.get("content", "") + print(f" {i}. {role}: {content}") + + print(f"\nFetched {len(latest_items)} out of total conversation history.") + + # Get all items to show the difference + all_items = await session.get_items() + print(f"Total items in session: {len(all_items)}") + + +if __name__ == "__main__": + # To run this example, you need to install the sqlalchemy extras: + # pip install "agents[sqlalchemy]" + asyncio.run(main()) diff --git a/examples/basic/session_example.py b/examples/memory/sqlite_session_example.py similarity index 100% rename from examples/basic/session_example.py rename to examples/memory/sqlite_session_example.py diff --git a/examples/model_providers/litellm_auto.py b/examples/model_providers/litellm_auto.py index 12b1e8914..c9ab359d3 100644 --- a/examples/model_providers/litellm_auto.py +++ b/examples/model_providers/litellm_auto.py @@ -2,7 +2,9 @@ import asyncio -from agents import Agent, Runner, function_tool, set_tracing_disabled +from pydantic import BaseModel + +from agents import Agent, ModelSettings, Runner, function_tool, set_tracing_disabled """This example uses the built-in support for LiteLLM. To use this, ensure you have the ANTHROPIC_API_KEY environment variable set. @@ -10,6 +12,9 @@ set_tracing_disabled(disabled=True) +# import logging +# logging.basicConfig(level=logging.DEBUG) + @function_tool def get_weather(city: str): @@ -17,6 +22,11 @@ def get_weather(city: str): return f"The weather in {city} is sunny." +class Result(BaseModel): + output_text: str + tool_results: list[str] + + async def main(): agent = Agent( name="Assistant", @@ -24,6 +34,8 @@ async def main(): # We prefix with litellm/ to tell the Runner to use the LitellmModel model="litellm/anthropic/claude-3-5-sonnet-20240620", tools=[get_weather], + model_settings=ModelSettings(tool_choice="required"), + output_type=Result, ) result = await Runner.run(agent, "What's the weather in Tokyo?") diff --git a/examples/realtime/app/README.md b/examples/realtime/app/README.md new file mode 100644 index 000000000..420134bba --- /dev/null +++ b/examples/realtime/app/README.md @@ -0,0 +1,49 @@ +# Realtime Demo App + +A web-based realtime voice assistant demo with a FastAPI backend and HTML/JS frontend. + +## Installation + +Install the required dependencies: + +```bash +uv add fastapi uvicorn websockets +``` + +## Usage + +Start the application with a single command: + +```bash +cd examples/realtime/app && uv run python server.py +``` + +Then open your browser to: http://localhost:8000 + +## Customization + +To use the same UI with your own agents, edit `agent.py` and ensure get_starting_agent() returns the right starting agent for your use case. + +## How to Use + +1. Click **Connect** to establish a realtime session +2. Audio capture starts automatically - just speak naturally +3. Click the **Mic On/Off** button to mute/unmute your microphone +4. To send an image, enter an optional prompt and click **🖼️ Send Image** (select a file) +5. Watch the conversation unfold in the left pane (image thumbnails are shown) +6. Monitor raw events in the right pane (click to expand/collapse) +7. Click **Disconnect** when done + +## Architecture + +- **Backend**: FastAPI server with WebSocket connections for real-time communication +- **Session Management**: Each connection gets a unique session with the OpenAI Realtime API +- **Image Inputs**: The UI uploads images and the server forwards a + `conversation.item.create` event with `input_image` (plus optional `input_text`), + followed by `response.create` to start the model response. The messages pane + renders image bubbles for `input_image` content. +- **Audio Processing**: 24kHz mono audio capture and playback +- **Event Handling**: Full event stream processing with transcript generation +- **Frontend**: Vanilla JavaScript with clean, responsive CSS + +The demo showcases the core patterns for building realtime voice applications with the OpenAI Agents SDK. diff --git a/examples/realtime/app/agent.py b/examples/realtime/app/agent.py new file mode 100644 index 000000000..ee906dbb8 --- /dev/null +++ b/examples/realtime/app/agent.py @@ -0,0 +1,101 @@ +import asyncio + +from agents import function_tool +from agents.extensions.handoff_prompt import RECOMMENDED_PROMPT_PREFIX +from agents.realtime import RealtimeAgent, realtime_handoff + +""" +When running the UI example locally, you can edit this file to change the setup. THe server +will use the agent returned from get_starting_agent() as the starting agent.""" + +### TOOLS + + +@function_tool( + name_override="faq_lookup_tool", description_override="Lookup frequently asked questions." +) +async def faq_lookup_tool(question: str) -> str: + print("faq_lookup_tool called with question:", question) + + # Simulate a slow API call + await asyncio.sleep(3) + + q = question.lower() + if "wifi" in q or "wi-fi" in q: + return "We have free wifi on the plane, join Airline-Wifi" + elif "bag" in q or "baggage" in q: + return ( + "You are allowed to bring one bag on the plane. " + "It must be under 50 pounds and 22 inches x 14 inches x 9 inches." + ) + elif "seats" in q or "plane" in q: + return ( + "There are 120 seats on the plane. " + "There are 22 business class seats and 98 economy seats. " + "Exit rows are rows 4 and 16. " + "Rows 5-8 are Economy Plus, with extra legroom. " + ) + return "I'm sorry, I don't know the answer to that question." + + +@function_tool +async def update_seat(confirmation_number: str, new_seat: str) -> str: + """ + Update the seat for a given confirmation number. + + Args: + confirmation_number: The confirmation number for the flight. + new_seat: The new seat to update to. + """ + return f"Updated seat to {new_seat} for confirmation number {confirmation_number}" + + +@function_tool +def get_weather(city: str) -> str: + """Get the weather in a city.""" + return f"The weather in {city} is sunny." + + +faq_agent = RealtimeAgent( + name="FAQ Agent", + handoff_description="A helpful agent that can answer questions about the airline.", + instructions=f"""{RECOMMENDED_PROMPT_PREFIX} + You are an FAQ agent. If you are speaking to a customer, you probably were transferred to from the triage agent. + Use the following routine to support the customer. + # Routine + 1. Identify the last question asked by the customer. + 2. Use the faq lookup tool to answer the question. Do not rely on your own knowledge. + 3. If you cannot answer the question, transfer back to the triage agent.""", + tools=[faq_lookup_tool], +) + +seat_booking_agent = RealtimeAgent( + name="Seat Booking Agent", + handoff_description="A helpful agent that can update a seat on a flight.", + instructions=f"""{RECOMMENDED_PROMPT_PREFIX} + You are a seat booking agent. If you are speaking to a customer, you probably were transferred to from the triage agent. + Use the following routine to support the customer. + # Routine + 1. Ask for their confirmation number. + 2. Ask the customer what their desired seat number is. + 3. Use the update seat tool to update the seat on the flight. + If the customer asks a question that is not related to the routine, transfer back to the triage agent. """, + tools=[update_seat], +) + +triage_agent = RealtimeAgent( + name="Triage Agent", + handoff_description="A triage agent that can delegate a customer's request to the appropriate agent.", + instructions=( + f"{RECOMMENDED_PROMPT_PREFIX} " + "You are a helpful triaging agent. You can use your tools to delegate questions to other appropriate agents." + ), + handoffs=[faq_agent, realtime_handoff(seat_booking_agent)], +) + +faq_agent.handoffs.append(triage_agent) +seat_booking_agent.handoffs.append(triage_agent) + + +def get_starting_agent() -> RealtimeAgent: + return triage_agent diff --git a/examples/realtime/app/server.py b/examples/realtime/app/server.py new file mode 100644 index 000000000..6082fe8d2 --- /dev/null +++ b/examples/realtime/app/server.py @@ -0,0 +1,358 @@ +import asyncio +import base64 +import json +import logging +import struct +from contextlib import asynccontextmanager +from typing import TYPE_CHECKING, Any + +from fastapi import FastAPI, WebSocket, WebSocketDisconnect +from fastapi.responses import FileResponse +from fastapi.staticfiles import StaticFiles +from typing_extensions import assert_never + +from agents.realtime import RealtimeRunner, RealtimeSession, RealtimeSessionEvent +from agents.realtime.config import RealtimeUserInputMessage +from agents.realtime.items import RealtimeItem +from agents.realtime.model import RealtimeModelConfig +from agents.realtime.model_inputs import RealtimeModelSendRawMessage + +# Import TwilioHandler class - handle both module and package use cases +if TYPE_CHECKING: + # For type checking, use the relative import + from .agent import get_starting_agent +else: + # At runtime, try both import styles + try: + # Try relative import first (when used as a package) + from .agent import get_starting_agent + except ImportError: + # Fall back to direct import (when run as a script) + from agent import get_starting_agent + + +logging.basicConfig(level=logging.INFO) +logger = logging.getLogger(__name__) + + +class RealtimeWebSocketManager: + def __init__(self): + self.active_sessions: dict[str, RealtimeSession] = {} + self.session_contexts: dict[str, Any] = {} + self.websockets: dict[str, WebSocket] = {} + + async def connect(self, websocket: WebSocket, session_id: str): + await websocket.accept() + self.websockets[session_id] = websocket + + agent = get_starting_agent() + runner = RealtimeRunner(agent) + # If you want to customize the runner behavior, you can pass options: + # runner_config = RealtimeRunConfig(async_tool_calls=False) + # runner = RealtimeRunner(agent, config=runner_config) + model_config: RealtimeModelConfig = { + "initial_model_settings": { + "turn_detection": { + "type": "server_vad", + "prefix_padding_ms": 300, + "silence_duration_ms": 500, + "interrupt_response": True, + "create_response": True, + }, + }, + } + session_context = await runner.run(model_config=model_config) + session = await session_context.__aenter__() + self.active_sessions[session_id] = session + self.session_contexts[session_id] = session_context + + # Start event processing task + asyncio.create_task(self._process_events(session_id)) + + async def disconnect(self, session_id: str): + if session_id in self.session_contexts: + await self.session_contexts[session_id].__aexit__(None, None, None) + del self.session_contexts[session_id] + if session_id in self.active_sessions: + del self.active_sessions[session_id] + if session_id in self.websockets: + del self.websockets[session_id] + + async def send_audio(self, session_id: str, audio_bytes: bytes): + if session_id in self.active_sessions: + await self.active_sessions[session_id].send_audio(audio_bytes) + + async def send_client_event(self, session_id: str, event: dict[str, Any]): + """Send a raw client event to the underlying realtime model.""" + session = self.active_sessions.get(session_id) + if not session: + return + await session.model.send_event( + RealtimeModelSendRawMessage( + message={ + "type": event["type"], + "other_data": {k: v for k, v in event.items() if k != "type"}, + } + ) + ) + + async def send_user_message(self, session_id: str, message: RealtimeUserInputMessage): + """Send a structured user message via the higher-level API (supports input_image).""" + session = self.active_sessions.get(session_id) + if not session: + return + await session.send_message(message) # delegates to RealtimeModelSendUserInput path + + async def interrupt(self, session_id: str) -> None: + """Interrupt current model playback/response for a session.""" + session = self.active_sessions.get(session_id) + if not session: + return + await session.interrupt() + + async def _process_events(self, session_id: str): + try: + session = self.active_sessions[session_id] + websocket = self.websockets[session_id] + + async for event in session: + event_data = await self._serialize_event(event) + await websocket.send_text(json.dumps(event_data)) + except Exception as e: + print(e) + logger.error(f"Error processing events for session {session_id}: {e}") + + def _sanitize_history_item(self, item: RealtimeItem) -> dict[str, Any]: + """Remove large binary payloads from history items while keeping transcripts.""" + item_dict = item.model_dump() + content = item_dict.get("content") + if isinstance(content, list): + sanitized_content: list[Any] = [] + for part in content: + if isinstance(part, dict): + sanitized_part = part.copy() + if sanitized_part.get("type") in {"audio", "input_audio"}: + sanitized_part.pop("audio", None) + sanitized_content.append(sanitized_part) + else: + sanitized_content.append(part) + item_dict["content"] = sanitized_content + return item_dict + + async def _serialize_event(self, event: RealtimeSessionEvent) -> dict[str, Any]: + base_event: dict[str, Any] = { + "type": event.type, + } + + if event.type == "agent_start": + base_event["agent"] = event.agent.name + elif event.type == "agent_end": + base_event["agent"] = event.agent.name + elif event.type == "handoff": + base_event["from"] = event.from_agent.name + base_event["to"] = event.to_agent.name + elif event.type == "tool_start": + base_event["tool"] = event.tool.name + elif event.type == "tool_end": + base_event["tool"] = event.tool.name + base_event["output"] = str(event.output) + elif event.type == "audio": + base_event["audio"] = base64.b64encode(event.audio.data).decode("utf-8") + elif event.type == "audio_interrupted": + pass + elif event.type == "audio_end": + pass + elif event.type == "history_updated": + base_event["history"] = [self._sanitize_history_item(item) for item in event.history] + elif event.type == "history_added": + # Provide the added item so the UI can render incrementally. + try: + base_event["item"] = self._sanitize_history_item(event.item) + except Exception: + base_event["item"] = None + elif event.type == "guardrail_tripped": + base_event["guardrail_results"] = [ + {"name": result.guardrail.name} for result in event.guardrail_results + ] + elif event.type == "raw_model_event": + base_event["raw_model_event"] = { + "type": event.data.type, + } + elif event.type == "error": + base_event["error"] = str(event.error) if hasattr(event, "error") else "Unknown error" + elif event.type == "input_audio_timeout_triggered": + pass + else: + assert_never(event) + + return base_event + + +manager = RealtimeWebSocketManager() + + +@asynccontextmanager +async def lifespan(app: FastAPI): + yield + + +app = FastAPI(lifespan=lifespan) + + +@app.websocket("/ws/{session_id}") +async def websocket_endpoint(websocket: WebSocket, session_id: str): + await manager.connect(websocket, session_id) + image_buffers: dict[str, dict[str, Any]] = {} + try: + while True: + data = await websocket.receive_text() + message = json.loads(data) + + if message["type"] == "audio": + # Convert int16 array to bytes + int16_data = message["data"] + audio_bytes = struct.pack(f"{len(int16_data)}h", *int16_data) + await manager.send_audio(session_id, audio_bytes) + elif message["type"] == "image": + logger.info("Received image message from client (session %s).", session_id) + # Build a conversation.item.create with input_image (and optional input_text) + data_url = message.get("data_url") + prompt_text = message.get("text") or "Please describe this image." + if data_url: + logger.info( + "Forwarding image (structured message) to Realtime API (len=%d).", + len(data_url), + ) + user_msg: RealtimeUserInputMessage = { + "type": "message", + "role": "user", + "content": ( + [ + {"type": "input_image", "image_url": data_url, "detail": "high"}, + {"type": "input_text", "text": prompt_text}, + ] + if prompt_text + else [{"type": "input_image", "image_url": data_url, "detail": "high"}] + ), + } + await manager.send_user_message(session_id, user_msg) + # Acknowledge to client UI + await websocket.send_text( + json.dumps( + { + "type": "client_info", + "info": "image_enqueued", + "size": len(data_url), + } + ) + ) + else: + await websocket.send_text( + json.dumps( + { + "type": "error", + "error": "No data_url for image message.", + } + ) + ) + elif message["type"] == "commit_audio": + # Force close the current input audio turn + await manager.send_client_event(session_id, {"type": "input_audio_buffer.commit"}) + elif message["type"] == "image_start": + img_id = str(message.get("id")) + image_buffers[img_id] = { + "text": message.get("text") or "Please describe this image.", + "chunks": [], + } + await websocket.send_text( + json.dumps({"type": "client_info", "info": "image_start_ack", "id": img_id}) + ) + elif message["type"] == "image_chunk": + img_id = str(message.get("id")) + chunk = message.get("chunk", "") + if img_id in image_buffers: + image_buffers[img_id]["chunks"].append(chunk) + if len(image_buffers[img_id]["chunks"]) % 10 == 0: + await websocket.send_text( + json.dumps( + { + "type": "client_info", + "info": "image_chunk_ack", + "id": img_id, + "count": len(image_buffers[img_id]["chunks"]), + } + ) + ) + elif message["type"] == "image_end": + img_id = str(message.get("id")) + buf = image_buffers.pop(img_id, None) + if buf is None: + await websocket.send_text( + json.dumps({"type": "error", "error": "Unknown image id for image_end."}) + ) + else: + data_url = "".join(buf["chunks"]) if buf["chunks"] else None + prompt_text = buf["text"] + if data_url: + logger.info( + "Forwarding chunked image (structured message) to Realtime API (len=%d).", + len(data_url), + ) + user_msg2: RealtimeUserInputMessage = { + "type": "message", + "role": "user", + "content": ( + [ + { + "type": "input_image", + "image_url": data_url, + "detail": "high", + }, + {"type": "input_text", "text": prompt_text}, + ] + if prompt_text + else [ + {"type": "input_image", "image_url": data_url, "detail": "high"} + ] + ), + } + await manager.send_user_message(session_id, user_msg2) + await websocket.send_text( + json.dumps( + { + "type": "client_info", + "info": "image_enqueued", + "id": img_id, + "size": len(data_url), + } + ) + ) + else: + await websocket.send_text( + json.dumps({"type": "error", "error": "Empty image."}) + ) + elif message["type"] == "interrupt": + await manager.interrupt(session_id) + + except WebSocketDisconnect: + await manager.disconnect(session_id) + + +app.mount("/", StaticFiles(directory="static", html=True), name="static") + + +@app.get("/") +async def read_index(): + return FileResponse("static/index.html") + + +if __name__ == "__main__": + import uvicorn + + uvicorn.run( + app, + host="0.0.0.0", + port=8000, + # Increased WebSocket frame size to comfortably handle image data URLs. + ws_max_size=16 * 1024 * 1024, + ) diff --git a/examples/realtime/app/static/app.js b/examples/realtime/app/static/app.js new file mode 100644 index 000000000..0724cf4b1 --- /dev/null +++ b/examples/realtime/app/static/app.js @@ -0,0 +1,682 @@ +class RealtimeDemo { + constructor() { + this.ws = null; + this.isConnected = false; + this.isMuted = false; + this.isCapturing = false; + this.audioContext = null; + this.captureSource = null; + this.captureNode = null; + this.stream = null; + this.sessionId = this.generateSessionId(); + + this.isPlayingAudio = false; + this.playbackAudioContext = null; + this.playbackNode = null; + this.playbackInitPromise = null; + this.pendingPlaybackChunks = []; + this.playbackFadeSec = 0.02; // ~20ms fade to reduce clicks + this.messageNodes = new Map(); // item_id -> DOM node + this.seenItemIds = new Set(); // item_id set for append-only syncing + + this.initializeElements(); + this.setupEventListeners(); + } + + initializeElements() { + this.connectBtn = document.getElementById('connectBtn'); + this.muteBtn = document.getElementById('muteBtn'); + this.imageBtn = document.getElementById('imageBtn'); + this.imageInput = document.getElementById('imageInput'); + this.imagePrompt = document.getElementById('imagePrompt'); + this.status = document.getElementById('status'); + this.messagesContent = document.getElementById('messagesContent'); + this.eventsContent = document.getElementById('eventsContent'); + this.toolsContent = document.getElementById('toolsContent'); + } + + setupEventListeners() { + this.connectBtn.addEventListener('click', () => { + if (this.isConnected) { + this.disconnect(); + } else { + this.connect(); + } + }); + + this.muteBtn.addEventListener('click', () => { + this.toggleMute(); + }); + + // Image upload + this.imageBtn.addEventListener('click', (e) => { + e.preventDefault(); + e.stopPropagation(); + console.log('Send Image clicked'); + // Programmatically open the hidden file input + this.imageInput.click(); + }); + + this.imageInput.addEventListener('change', async (e) => { + console.log('Image input change fired'); + const file = e.target.files && e.target.files[0]; + if (!file) return; + await this._handlePickedFile(file); + this.imageInput.value = ''; + }); + + this._handlePickedFile = async (file) => { + try { + const dataUrl = await this.prepareDataURL(file); + const promptText = (this.imagePrompt && this.imagePrompt.value) || ''; + // Send to server; server forwards to Realtime API. + // Use chunked frames to avoid WS frame limits. + if (this.ws && this.ws.readyState === WebSocket.OPEN) { + console.log('Interrupting and sending image (chunked) to server WebSocket'); + // Stop any current audio locally and tell model to interrupt + this.stopAudioPlayback(); + this.ws.send(JSON.stringify({ type: 'interrupt' })); + const id = 'img_' + Math.random().toString(36).slice(2); + const CHUNK = 60_000; // ~60KB per frame + this.ws.send(JSON.stringify({ type: 'image_start', id, text: promptText })); + for (let i = 0; i < dataUrl.length; i += CHUNK) { + const chunk = dataUrl.slice(i, i + CHUNK); + this.ws.send(JSON.stringify({ type: 'image_chunk', id, chunk })); + } + this.ws.send(JSON.stringify({ type: 'image_end', id })); + } else { + console.warn('Not connected; image will not be sent. Click Connect first.'); + } + // Add to UI immediately for better feedback + console.log('Adding local user image bubble'); + this.addUserImageMessage(dataUrl, promptText); + } catch (err) { + console.error('Failed to process image:', err); + } + }; + } + + generateSessionId() { + return 'session_' + Math.random().toString(36).substr(2, 9); + } + + async connect() { + try { + this.ws = new WebSocket(`ws://localhost:8000/ws/${this.sessionId}`); + + this.ws.onopen = () => { + this.isConnected = true; + this.updateConnectionUI(); + this.startContinuousCapture(); + }; + + this.ws.onmessage = (event) => { + const data = JSON.parse(event.data); + this.handleRealtimeEvent(data); + }; + + this.ws.onclose = () => { + this.isConnected = false; + this.updateConnectionUI(); + }; + + this.ws.onerror = (error) => { + console.error('WebSocket error:', error); + }; + + } catch (error) { + console.error('Failed to connect:', error); + } + } + + disconnect() { + if (this.ws) { + this.ws.close(); + } + this.stopContinuousCapture(); + } + + updateConnectionUI() { + if (this.isConnected) { + this.connectBtn.textContent = 'Disconnect'; + this.connectBtn.className = 'connect-btn connected'; + this.status.textContent = 'Connected'; + this.status.className = 'status connected'; + this.muteBtn.disabled = false; + } else { + this.connectBtn.textContent = 'Connect'; + this.connectBtn.className = 'connect-btn disconnected'; + this.status.textContent = 'Disconnected'; + this.status.className = 'status disconnected'; + this.muteBtn.disabled = true; + } + } + + toggleMute() { + this.isMuted = !this.isMuted; + this.updateMuteUI(); + } + + updateMuteUI() { + if (this.isMuted) { + this.muteBtn.textContent = '🔇 Mic Off'; + this.muteBtn.className = 'mute-btn muted'; + } else { + this.muteBtn.textContent = '🎤 Mic On'; + this.muteBtn.className = 'mute-btn unmuted'; + if (this.isCapturing) { + this.muteBtn.classList.add('active'); + } + } + } + + readFileAsDataURL(file) { + return new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.onload = () => resolve(reader.result); + reader.onerror = reject; + reader.readAsDataURL(file); + }); + } + + async prepareDataURL(file) { + const original = await this.readFileAsDataURL(file); + try { + const img = new Image(); + img.decoding = 'async'; + const loaded = new Promise((res, rej) => { + img.onload = () => res(); + img.onerror = rej; + }); + img.src = original; + await loaded; + + const maxDim = 1024; + const maxSide = Math.max(img.width, img.height); + const scale = maxSide > maxDim ? (maxDim / maxSide) : 1; + const w = Math.max(1, Math.round(img.width * scale)); + const h = Math.max(1, Math.round(img.height * scale)); + + const canvas = document.createElement('canvas'); + canvas.width = w; canvas.height = h; + const ctx = canvas.getContext('2d'); + ctx.drawImage(img, 0, 0, w, h); + return canvas.toDataURL('image/jpeg', 0.85); + } catch (e) { + console.warn('Image resize failed; sending original', e); + return original; + } + } + + async startContinuousCapture() { + if (!this.isConnected || this.isCapturing) return; + + // Check if getUserMedia is available + if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) { + throw new Error('getUserMedia not available. Please use HTTPS or localhost.'); + } + + try { + this.stream = await navigator.mediaDevices.getUserMedia({ + audio: { + sampleRate: 24000, + channelCount: 1, + echoCancellation: true, + noiseSuppression: true + } + }); + + this.audioContext = new AudioContext({ sampleRate: 24000, latencyHint: 'interactive' }); + if (this.audioContext.state === 'suspended') { + try { await this.audioContext.resume(); } catch {} + } + + if (!this.audioContext.audioWorklet) { + throw new Error('AudioWorklet API not supported in this browser.'); + } + + await this.audioContext.audioWorklet.addModule('audio-recorder.worklet.js'); + + this.captureSource = this.audioContext.createMediaStreamSource(this.stream); + this.captureNode = new AudioWorkletNode(this.audioContext, 'pcm-recorder'); + + this.captureNode.port.onmessage = (event) => { + if (this.isMuted) return; + if (!this.ws || this.ws.readyState !== WebSocket.OPEN) return; + + const chunk = event.data instanceof ArrayBuffer ? new Int16Array(event.data) : event.data; + if (!chunk || !(chunk instanceof Int16Array) || chunk.length === 0) return; + + this.ws.send(JSON.stringify({ + type: 'audio', + data: Array.from(chunk) + })); + }; + + this.captureSource.connect(this.captureNode); + this.captureNode.connect(this.audioContext.destination); + + this.isCapturing = true; + this.updateMuteUI(); + + } catch (error) { + console.error('Failed to start audio capture:', error); + } + } + + stopContinuousCapture() { + if (!this.isCapturing) return; + + this.isCapturing = false; + + if (this.captureSource) { + try { this.captureSource.disconnect(); } catch {} + this.captureSource = null; + } + + if (this.captureNode) { + this.captureNode.port.onmessage = null; + try { this.captureNode.disconnect(); } catch {} + this.captureNode = null; + } + + if (this.audioContext) { + this.audioContext.close(); + this.audioContext = null; + } + + if (this.stream) { + this.stream.getTracks().forEach(track => track.stop()); + this.stream = null; + } + + this.updateMuteUI(); + } + + handleRealtimeEvent(event) { + // Add to raw events pane + this.addRawEvent(event); + + // Add to tools panel if it's a tool or handoff event + if (event.type === 'tool_start' || event.type === 'tool_end' || event.type === 'handoff') { + this.addToolEvent(event); + } + + // Handle specific event types + switch (event.type) { + case 'audio': + this.playAudio(event.audio); + break; + case 'audio_interrupted': + this.stopAudioPlayback(); + break; + case 'input_audio_timeout_triggered': + // Ask server to commit the input buffer to expedite model response + if (this.ws && this.ws.readyState === WebSocket.OPEN) { + this.ws.send(JSON.stringify({ type: 'commit_audio' })); + } + break; + case 'history_updated': + this.syncMissingFromHistory(event.history); + this.updateLastMessageFromHistory(event.history); + break; + case 'history_added': + // Append just the new item without clearing the thread. + if (event.item) { + this.addMessageFromItem(event.item); + } + break; + } + } + updateLastMessageFromHistory(history) { + if (!history || !Array.isArray(history) || history.length === 0) return; + // Find the last message item in history + let last = null; + for (let i = history.length - 1; i >= 0; i--) { + const it = history[i]; + if (it && it.type === 'message') { last = it; break; } + } + if (!last) return; + const itemId = last.item_id; + + // Extract a text representation (for assistant transcript updates) + let text = ''; + if (Array.isArray(last.content)) { + for (const part of last.content) { + if (!part || typeof part !== 'object') continue; + if (part.type === 'text' && part.text) text += part.text; + else if (part.type === 'input_text' && part.text) text += part.text; + else if ((part.type === 'input_audio' || part.type === 'audio') && part.transcript) text += part.transcript; + } + } + + const node = this.messageNodes.get(itemId); + if (!node) { + // If we haven't rendered this item yet, append it now. + this.addMessageFromItem(last); + return; + } + + // Update only the text content of the bubble, preserving any images already present. + const bubble = node.querySelector('.message-bubble'); + if (bubble && text && text.trim()) { + // If there's an , keep it and only update the trailing caption/text node. + const hasImg = !!bubble.querySelector('img'); + if (hasImg) { + // Ensure there is a caption div after the image + let cap = bubble.querySelector('.image-caption'); + if (!cap) { + cap = document.createElement('div'); + cap.className = 'image-caption'; + cap.style.marginTop = '0.5rem'; + bubble.appendChild(cap); + } + cap.textContent = text.trim(); + } else { + bubble.textContent = text.trim(); + } + this.scrollToBottom(); + } + } + + syncMissingFromHistory(history) { + if (!history || !Array.isArray(history)) return; + for (const item of history) { + if (!item || item.type !== 'message') continue; + const id = item.item_id; + if (!id) continue; + if (!this.seenItemIds.has(id)) { + this.addMessageFromItem(item); + } + } + } + + addMessageFromItem(item) { + try { + if (!item || item.type !== 'message') return; + const role = item.role; + let content = ''; + let imageUrls = []; + + if (Array.isArray(item.content)) { + for (const contentPart of item.content) { + if (!contentPart || typeof contentPart !== 'object') continue; + if (contentPart.type === 'text' && contentPart.text) { + content += contentPart.text; + } else if (contentPart.type === 'input_text' && contentPart.text) { + content += contentPart.text; + } else if (contentPart.type === 'input_audio' && contentPart.transcript) { + content += contentPart.transcript; + } else if (contentPart.type === 'audio' && contentPart.transcript) { + content += contentPart.transcript; + } else if (contentPart.type === 'input_image') { + const url = contentPart.image_url || contentPart.url; + if (typeof url === 'string' && url) imageUrls.push(url); + } + } + } + + let node = null; + if (imageUrls.length > 0) { + for (const url of imageUrls) { + node = this.addImageMessage(role, url, content.trim()); + } + } else if (content && content.trim()) { + node = this.addMessage(role, content.trim()); + } + if (node && item.item_id) { + this.messageNodes.set(item.item_id, node); + this.seenItemIds.add(item.item_id); + } + } catch (e) { + console.error('Failed to add message from item:', e, item); + } + } + + addMessage(type, content) { + const messageDiv = document.createElement('div'); + messageDiv.className = `message ${type}`; + + const bubbleDiv = document.createElement('div'); + bubbleDiv.className = 'message-bubble'; + bubbleDiv.textContent = content; + + messageDiv.appendChild(bubbleDiv); + this.messagesContent.appendChild(messageDiv); + this.scrollToBottom(); + + return messageDiv; + } + + addImageMessage(role, imageUrl, caption = '') { + const messageDiv = document.createElement('div'); + messageDiv.className = `message ${role}`; + + const bubbleDiv = document.createElement('div'); + bubbleDiv.className = 'message-bubble'; + + const img = document.createElement('img'); + img.src = imageUrl; + img.alt = 'Uploaded image'; + img.style.maxWidth = '220px'; + img.style.borderRadius = '8px'; + img.style.display = 'block'; + + bubbleDiv.appendChild(img); + if (caption) { + const cap = document.createElement('div'); + cap.textContent = caption; + cap.style.marginTop = '0.5rem'; + bubbleDiv.appendChild(cap); + } + + messageDiv.appendChild(bubbleDiv); + this.messagesContent.appendChild(messageDiv); + this.scrollToBottom(); + + return messageDiv; + } + + addUserImageMessage(imageUrl, caption = '') { + return this.addImageMessage('user', imageUrl, caption); + } + + addRawEvent(event) { + const eventDiv = document.createElement('div'); + eventDiv.className = 'event'; + + const headerDiv = document.createElement('div'); + headerDiv.className = 'event-header'; + headerDiv.innerHTML = ` + ${event.type} + + `; + + const contentDiv = document.createElement('div'); + contentDiv.className = 'event-content collapsed'; + contentDiv.textContent = JSON.stringify(event, null, 2); + + headerDiv.addEventListener('click', () => { + const isCollapsed = contentDiv.classList.contains('collapsed'); + contentDiv.classList.toggle('collapsed'); + headerDiv.querySelector('span:last-child').textContent = isCollapsed ? '▲' : '▼'; + }); + + eventDiv.appendChild(headerDiv); + eventDiv.appendChild(contentDiv); + this.eventsContent.appendChild(eventDiv); + + // Auto-scroll events pane + this.eventsContent.scrollTop = this.eventsContent.scrollHeight; + } + + addToolEvent(event) { + const eventDiv = document.createElement('div'); + eventDiv.className = 'event'; + + let title = ''; + let description = ''; + let eventClass = ''; + + if (event.type === 'handoff') { + title = `🔄 Handoff`; + description = `From ${event.from} to ${event.to}`; + eventClass = 'handoff'; + } else if (event.type === 'tool_start') { + title = `🔧 Tool Started`; + description = `Running ${event.tool}`; + eventClass = 'tool'; + } else if (event.type === 'tool_end') { + title = `✅ Tool Completed`; + description = `${event.tool}: ${event.output || 'No output'}`; + eventClass = 'tool'; + } + + eventDiv.innerHTML = ` +
+
+
${title}
+
${description}
+
+ ${new Date().toLocaleTimeString()} +
+ `; + + this.toolsContent.appendChild(eventDiv); + + // Auto-scroll tools pane + this.toolsContent.scrollTop = this.toolsContent.scrollHeight; + } + + async playAudio(audioBase64) { + try { + if (!audioBase64 || audioBase64.length === 0) { + console.warn('Received empty audio data, skipping playback'); + return; + } + + const int16Array = this.decodeBase64ToInt16(audioBase64); + if (!int16Array || int16Array.length === 0) { + console.warn('Audio chunk has no samples, skipping'); + return; + } + + this.pendingPlaybackChunks.push(int16Array); + await this.ensurePlaybackNode(); + this.flushPendingPlaybackChunks(); + + } catch (error) { + console.error('Failed to play audio:', error); + this.pendingPlaybackChunks = []; + } + } + + async ensurePlaybackNode() { + if (this.playbackNode) { + return; + } + + if (!this.playbackInitPromise) { + this.playbackInitPromise = (async () => { + if (!this.playbackAudioContext) { + this.playbackAudioContext = new AudioContext({ sampleRate: 24000, latencyHint: 'interactive' }); + } + + if (this.playbackAudioContext.state === 'suspended') { + try { await this.playbackAudioContext.resume(); } catch {} + } + + if (!this.playbackAudioContext.audioWorklet) { + throw new Error('AudioWorklet API not supported in this browser.'); + } + + await this.playbackAudioContext.audioWorklet.addModule('audio-playback.worklet.js'); + + this.playbackNode = new AudioWorkletNode(this.playbackAudioContext, 'pcm-playback', { outputChannelCount: [1] }); + this.playbackNode.port.onmessage = (event) => { + const message = event.data; + if (!message || typeof message !== 'object') return; + if (message.type === 'drained') { + this.isPlayingAudio = false; + } + }; + + // Provide initial configuration for fades. + const fadeSamples = Math.floor(this.playbackAudioContext.sampleRate * this.playbackFadeSec); + this.playbackNode.port.postMessage({ type: 'config', fadeSamples }); + + this.playbackNode.connect(this.playbackAudioContext.destination); + })().catch((error) => { + this.playbackInitPromise = null; + throw error; + }); + } + + await this.playbackInitPromise; + } + + flushPendingPlaybackChunks() { + if (!this.playbackNode) { + return; + } + + while (this.pendingPlaybackChunks.length > 0) { + const chunk = this.pendingPlaybackChunks.shift(); + if (!chunk || !(chunk instanceof Int16Array) || chunk.length === 0) { + continue; + } + + try { + this.playbackNode.port.postMessage( + { type: 'chunk', payload: chunk.buffer }, + [chunk.buffer] + ); + this.isPlayingAudio = true; + } catch (error) { + console.error('Failed to enqueue audio chunk to worklet:', error); + } + } + } + + decodeBase64ToInt16(audioBase64) { + try { + const binaryString = atob(audioBase64); + const length = binaryString.length; + const bytes = new Uint8Array(length); + for (let i = 0; i < length; i++) { + bytes[i] = binaryString.charCodeAt(i); + } + return new Int16Array(bytes.buffer); + } catch (error) { + console.error('Failed to decode audio chunk:', error); + return null; + } + } + + stopAudioPlayback() { + console.log('Stopping audio playback due to interruption'); + + this.pendingPlaybackChunks = []; + + if (this.playbackNode) { + try { + this.playbackNode.port.postMessage({ type: 'stop' }); + } catch (error) { + console.error('Failed to notify playback worklet to stop:', error); + } + } + + this.isPlayingAudio = false; + + console.log('Audio playback stopped and queue cleared'); + } + + scrollToBottom() { + this.messagesContent.scrollTop = this.messagesContent.scrollHeight; + } +} + +// Initialize the demo when the page loads +document.addEventListener('DOMContentLoaded', () => { + new RealtimeDemo(); +}); diff --git a/examples/realtime/app/static/audio-playback.worklet.js b/examples/realtime/app/static/audio-playback.worklet.js new file mode 100644 index 000000000..63735f828 --- /dev/null +++ b/examples/realtime/app/static/audio-playback.worklet.js @@ -0,0 +1,120 @@ +class PCMPlaybackProcessor extends AudioWorkletProcessor { + constructor() { + super(); + + this.buffers = []; + this.currentBuffer = null; + this.currentIndex = 0; + this.isCurrentlyPlaying = false; + this.fadeSamples = Math.round(sampleRate * 0.02); + + this.port.onmessage = (event) => { + const message = event.data; + if (!message || typeof message !== 'object') return; + + if (message.type === 'chunk') { + const payload = message.payload; + if (!(payload instanceof ArrayBuffer)) { + return; + } + + const int16Data = new Int16Array(payload); + if (int16Data.length === 0) { + return; + } + + const scale = 1 / 32768; + const floatData = new Float32Array(int16Data.length); + for (let i = 0; i < int16Data.length; i++) { + floatData[i] = Math.max(-1, Math.min(1, int16Data[i] * scale)); + } + + if (!this.hasPendingAudio()) { + const fadeSamples = Math.min(this.fadeSamples, floatData.length); + for (let i = 0; i < fadeSamples; i++) { + const gain = fadeSamples <= 1 ? 1 : (i / fadeSamples); + floatData[i] *= gain; + } + } + + this.buffers.push(floatData); + + } else if (message.type === 'stop') { + this.reset(); + this.port.postMessage({ type: 'drained' }); + + } else if (message.type === 'config') { + const fadeSamples = message.fadeSamples; + if (Number.isFinite(fadeSamples) && fadeSamples >= 0) { + this.fadeSamples = fadeSamples >>> 0; + } + } + }; + } + + reset() { + this.buffers = []; + this.currentBuffer = null; + this.currentIndex = 0; + this.isCurrentlyPlaying = false; + } + + hasPendingAudio() { + if (this.currentBuffer && this.currentIndex < this.currentBuffer.length) { + return true; + } + return this.buffers.length > 0; + } + + pullSample() { + if (this.currentBuffer && this.currentIndex < this.currentBuffer.length) { + return this.currentBuffer[this.currentIndex++]; + } + + if (this.currentBuffer && this.currentIndex >= this.currentBuffer.length) { + this.currentBuffer = null; + this.currentIndex = 0; + } + + while (this.buffers.length > 0) { + this.currentBuffer = this.buffers.shift(); + this.currentIndex = 0; + if (this.currentBuffer && this.currentBuffer.length > 0) { + return this.currentBuffer[this.currentIndex++]; + } + } + + this.currentBuffer = null; + this.currentIndex = 0; + return 0; + } + + process(inputs, outputs) { + const output = outputs[0]; + if (!output || output.length === 0) { + return true; + } + + const channel = output[0]; + let wroteSamples = false; + + for (let i = 0; i < channel.length; i++) { + const sample = this.pullSample(); + channel[i] = sample; + if (sample !== 0) { + wroteSamples = true; + } + } + + if (this.hasPendingAudio()) { + this.isCurrentlyPlaying = true; + } else if (!wroteSamples && this.isCurrentlyPlaying) { + this.isCurrentlyPlaying = false; + this.port.postMessage({ type: 'drained' }); + } + + return true; + } +} + +registerProcessor('pcm-playback', PCMPlaybackProcessor); diff --git a/examples/realtime/app/static/audio-recorder.worklet.js b/examples/realtime/app/static/audio-recorder.worklet.js new file mode 100644 index 000000000..ccd6e6b13 --- /dev/null +++ b/examples/realtime/app/static/audio-recorder.worklet.js @@ -0,0 +1,56 @@ +class PCMRecorderProcessor extends AudioWorkletProcessor { + constructor() { + super(); + this.chunkSize = 4096; + this.buffer = new Int16Array(this.chunkSize); + this.offset = 0; + this.pendingFrames = 0; + this.maxPendingFrames = 10; + } + + flushBuffer() { + if (this.offset === 0) { + return; + } + + const chunk = new Int16Array(this.offset); + chunk.set(this.buffer.subarray(0, this.offset)); + this.port.postMessage(chunk, [chunk.buffer]); + + this.offset = 0; + this.pendingFrames = 0; + } + + process(inputs) { + const input = inputs[0]; + if (!input || input.length === 0) { + return true; + } + + const channel = input[0]; + if (!channel || channel.length === 0) { + return true; + } + + for (let i = 0; i < channel.length; i++) { + let sample = channel[i]; + sample = Math.max(-1, Math.min(1, sample)); + this.buffer[this.offset++] = sample < 0 ? sample * 0x8000 : sample * 0x7fff; + + if (this.offset === this.chunkSize) { + this.flushBuffer(); + } + } + + if (this.offset > 0) { + this.pendingFrames += 1; + if (this.pendingFrames >= this.maxPendingFrames) { + this.flushBuffer(); + } + } + + return true; + } +} + +registerProcessor('pcm-recorder', PCMRecorderProcessor); diff --git a/examples/realtime/app/static/favicon.ico b/examples/realtime/app/static/favicon.ico new file mode 100644 index 000000000..e69de29bb diff --git a/examples/realtime/app/static/index.html b/examples/realtime/app/static/index.html new file mode 100644 index 000000000..aacefbffb --- /dev/null +++ b/examples/realtime/app/static/index.html @@ -0,0 +1,299 @@ + + + + + + Realtime Demo + + + +
+

Realtime Demo

+ +
+ +
+
+
+ Conversation +
+
+ +
+
+ + + + + Disconnected +
+
+ +
+
+
+ Event stream +
+
+ +
+
+ +
+
+ Tools & Handoffs +
+
+ +
+
+
+
+ + + + diff --git a/examples/realtime/cli/demo.py b/examples/realtime/cli/demo.py new file mode 100644 index 000000000..4dfaf2c5a --- /dev/null +++ b/examples/realtime/cli/demo.py @@ -0,0 +1,366 @@ +import asyncio +import queue +import sys +import threading +from typing import Any + +import numpy as np +import sounddevice as sd + +from agents import function_tool +from agents.realtime import ( + RealtimeAgent, + RealtimePlaybackTracker, + RealtimeRunner, + RealtimeSession, + RealtimeSessionEvent, +) +from agents.realtime.model import RealtimeModelConfig + +# Audio configuration +CHUNK_LENGTH_S = 0.04 # 40ms aligns with realtime defaults +SAMPLE_RATE = 24000 +FORMAT = np.int16 +CHANNELS = 1 +ENERGY_THRESHOLD = 0.015 # RMS threshold for barge‑in while assistant is speaking +PREBUFFER_CHUNKS = 3 # initial jitter buffer (~120ms with 40ms chunks) +FADE_OUT_MS = 12 # short fade to avoid clicks when interrupting + +# Set up logging for OpenAI agents SDK +# logging.basicConfig( +# level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s" +# ) +# logger.logger.setLevel(logging.ERROR) + + +@function_tool +def get_weather(city: str) -> str: + """Get the weather in a city.""" + return f"The weather in {city} is sunny." + + +agent = RealtimeAgent( + name="Assistant", + instructions="You always greet the user with 'Top of the morning to you'.", + tools=[get_weather], +) + + +def _truncate_str(s: str, max_length: int) -> str: + if len(s) > max_length: + return s[:max_length] + "..." + return s + + +class NoUIDemo: + def __init__(self) -> None: + self.session: RealtimeSession | None = None + self.audio_stream: sd.InputStream | None = None + self.audio_player: sd.OutputStream | None = None + self.recording = False + + # Playback tracker lets the model know our real playback progress + self.playback_tracker = RealtimePlaybackTracker() + + # Audio output state for callback system + # Store tuples: (samples_np, item_id, content_index) + # Use an unbounded queue to avoid drops that sound like skipped words. + self.output_queue: queue.Queue[Any] = queue.Queue(maxsize=0) + self.interrupt_event = threading.Event() + self.current_audio_chunk: tuple[np.ndarray[Any, np.dtype[Any]], str, int] | None = None + self.chunk_position = 0 + self.bytes_per_sample = np.dtype(FORMAT).itemsize + + # Jitter buffer and fade-out state + self.prebuffering = True + self.prebuffer_target_chunks = PREBUFFER_CHUNKS + self.fading = False + self.fade_total_samples = 0 + self.fade_done_samples = 0 + self.fade_samples = int(SAMPLE_RATE * (FADE_OUT_MS / 1000.0)) + + def _output_callback(self, outdata, frames: int, time, status) -> None: + """Callback for audio output - handles continuous audio stream from server.""" + if status: + print(f"Output callback status: {status}") + + # Handle interruption with a short fade-out to prevent clicks. + if self.interrupt_event.is_set(): + outdata.fill(0) + if self.current_audio_chunk is None: + # Nothing to fade, just flush everything and reset. + while not self.output_queue.empty(): + try: + self.output_queue.get_nowait() + except queue.Empty: + break + self.prebuffering = True + self.interrupt_event.clear() + return + + # Prepare fade parameters + if not self.fading: + self.fading = True + self.fade_done_samples = 0 + # Remaining samples in the current chunk + remaining_in_chunk = len(self.current_audio_chunk[0]) - self.chunk_position + self.fade_total_samples = min(self.fade_samples, max(0, remaining_in_chunk)) + + samples, item_id, content_index = self.current_audio_chunk + samples_filled = 0 + while ( + samples_filled < len(outdata) and self.fade_done_samples < self.fade_total_samples + ): + remaining_output = len(outdata) - samples_filled + remaining_fade = self.fade_total_samples - self.fade_done_samples + n = min(remaining_output, remaining_fade) + + src = samples[self.chunk_position : self.chunk_position + n].astype(np.float32) + # Linear ramp from current level down to 0 across remaining fade samples + idx = np.arange( + self.fade_done_samples, self.fade_done_samples + n, dtype=np.float32 + ) + gain = 1.0 - (idx / float(self.fade_total_samples)) + ramped = np.clip(src * gain, -32768.0, 32767.0).astype(np.int16) + outdata[samples_filled : samples_filled + n, 0] = ramped + + # Optionally report played bytes (ramped) to playback tracker + try: + self.playback_tracker.on_play_bytes( + item_id=item_id, item_content_index=content_index, bytes=ramped.tobytes() + ) + except Exception: + pass + + samples_filled += n + self.chunk_position += n + self.fade_done_samples += n + + # If fade completed, flush the remaining audio and reset state + if self.fade_done_samples >= self.fade_total_samples: + self.current_audio_chunk = None + self.chunk_position = 0 + while not self.output_queue.empty(): + try: + self.output_queue.get_nowait() + except queue.Empty: + break + self.fading = False + self.prebuffering = True + self.interrupt_event.clear() + return + + # Fill output buffer from queue and current chunk + outdata.fill(0) # Start with silence + samples_filled = 0 + + while samples_filled < len(outdata): + # If we don't have a current chunk, try to get one from queue + if self.current_audio_chunk is None: + try: + # Respect a small jitter buffer before starting playback + if ( + self.prebuffering + and self.output_queue.qsize() < self.prebuffer_target_chunks + ): + break + self.prebuffering = False + self.current_audio_chunk = self.output_queue.get_nowait() + self.chunk_position = 0 + except queue.Empty: + # No more audio data available - this causes choppiness + # Uncomment next line to debug underruns: + # print(f"Audio underrun: {samples_filled}/{len(outdata)} samples filled") + break + + # Copy data from current chunk to output buffer + remaining_output = len(outdata) - samples_filled + samples, item_id, content_index = self.current_audio_chunk + remaining_chunk = len(samples) - self.chunk_position + samples_to_copy = min(remaining_output, remaining_chunk) + + if samples_to_copy > 0: + chunk_data = samples[self.chunk_position : self.chunk_position + samples_to_copy] + # More efficient: direct assignment for mono audio instead of reshape + outdata[samples_filled : samples_filled + samples_to_copy, 0] = chunk_data + samples_filled += samples_to_copy + self.chunk_position += samples_to_copy + + # Inform playback tracker about played bytes + try: + self.playback_tracker.on_play_bytes( + item_id=item_id, + item_content_index=content_index, + bytes=chunk_data.tobytes(), + ) + except Exception: + pass + + # If we've used up the entire chunk, reset for next iteration + if self.chunk_position >= len(samples): + self.current_audio_chunk = None + self.chunk_position = 0 + + async def run(self) -> None: + print("Connecting, may take a few seconds...") + + # Initialize audio player with callback + chunk_size = int(SAMPLE_RATE * CHUNK_LENGTH_S) + self.audio_player = sd.OutputStream( + channels=CHANNELS, + samplerate=SAMPLE_RATE, + dtype=FORMAT, + callback=self._output_callback, + blocksize=chunk_size, # Match our chunk timing for better alignment + ) + self.audio_player.start() + + try: + runner = RealtimeRunner(agent) + # Attach playback tracker and enable server‑side interruptions + auto response. + model_config: RealtimeModelConfig = { + "playback_tracker": self.playback_tracker, + "initial_model_settings": { + "turn_detection": { + "type": "semantic_vad", + "interrupt_response": True, + "create_response": True, + }, + }, + } + async with await runner.run(model_config=model_config) as session: + self.session = session + print("Connected. Starting audio recording...") + + # Start audio recording + await self.start_audio_recording() + print("Audio recording started. You can start speaking - expect lots of logs!") + + # Process session events + async for event in session: + await self._on_event(event) + + finally: + # Clean up audio player + if self.audio_player and self.audio_player.active: + self.audio_player.stop() + if self.audio_player: + self.audio_player.close() + + print("Session ended") + + async def start_audio_recording(self) -> None: + """Start recording audio from the microphone.""" + # Set up audio input stream + self.audio_stream = sd.InputStream( + channels=CHANNELS, + samplerate=SAMPLE_RATE, + dtype=FORMAT, + ) + + self.audio_stream.start() + self.recording = True + + # Start audio capture task + asyncio.create_task(self.capture_audio()) + + async def capture_audio(self) -> None: + """Capture audio from the microphone and send to the session.""" + if not self.audio_stream or not self.session: + return + + # Buffer size in samples + read_size = int(SAMPLE_RATE * CHUNK_LENGTH_S) + + try: + # Simple energy-based barge-in: if user speaks while audio is playing, interrupt. + def rms_energy(samples: np.ndarray[Any, np.dtype[Any]]) -> float: + if samples.size == 0: + return 0.0 + # Normalize int16 to [-1, 1] + x = samples.astype(np.float32) / 32768.0 + return float(np.sqrt(np.mean(x * x))) + + while self.recording: + # Check if there's enough data to read + if self.audio_stream.read_available < read_size: + await asyncio.sleep(0.01) + continue + + # Read audio data + data, _ = self.audio_stream.read(read_size) + + # Convert numpy array to bytes + audio_bytes = data.tobytes() + + # Smart barge‑in: if assistant audio is playing, send only if mic has speech. + assistant_playing = ( + self.current_audio_chunk is not None or not self.output_queue.empty() + ) + if assistant_playing: + # Compute RMS energy to detect speech while assistant is talking + samples = data.reshape(-1) + if rms_energy(samples) >= ENERGY_THRESHOLD: + # Locally flush queued assistant audio for snappier interruption. + self.interrupt_event.set() + await self.session.send_audio(audio_bytes) + else: + await self.session.send_audio(audio_bytes) + + # Yield control back to event loop + await asyncio.sleep(0) + + except Exception as e: + print(f"Audio capture error: {e}") + finally: + if self.audio_stream and self.audio_stream.active: + self.audio_stream.stop() + if self.audio_stream: + self.audio_stream.close() + + async def _on_event(self, event: RealtimeSessionEvent) -> None: + """Handle session events.""" + try: + if event.type == "agent_start": + print(f"Agent started: {event.agent.name}") + elif event.type == "agent_end": + print(f"Agent ended: {event.agent.name}") + elif event.type == "handoff": + print(f"Handoff from {event.from_agent.name} to {event.to_agent.name}") + elif event.type == "tool_start": + print(f"Tool started: {event.tool.name}") + elif event.type == "tool_end": + print(f"Tool ended: {event.tool.name}; output: {event.output}") + elif event.type == "audio_end": + print("Audio ended") + elif event.type == "audio": + # Enqueue audio for callback-based playback with metadata + np_audio = np.frombuffer(event.audio.data, dtype=np.int16) + # Non-blocking put; queue is unbounded, so drops won’t occur. + self.output_queue.put_nowait((np_audio, event.item_id, event.content_index)) + elif event.type == "audio_interrupted": + print("Audio interrupted") + # Begin graceful fade + flush in the audio callback and rebuild jitter buffer. + self.prebuffering = True + self.interrupt_event.set() + elif event.type == "error": + print(f"Error: {event.error}") + elif event.type == "history_updated": + pass # Skip these frequent events + elif event.type == "history_added": + pass # Skip these frequent events + elif event.type == "raw_model_event": + print(f"Raw model event: {_truncate_str(str(event.data), 200)}") + else: + print(f"Unknown event type: {event.type}") + except Exception as e: + print(f"Error processing event: {_truncate_str(str(e), 200)}") + + +if __name__ == "__main__": + demo = NoUIDemo() + try: + asyncio.run(demo.run()) + except KeyboardInterrupt: + print("\nExiting...") + sys.exit(0) diff --git a/examples/realtime/demo.py b/examples/realtime/demo.py deleted file mode 100644 index 3db051963..000000000 --- a/examples/realtime/demo.py +++ /dev/null @@ -1,115 +0,0 @@ -import asyncio -import os -import sys -from typing import TYPE_CHECKING - -import numpy as np - -from agents.realtime import RealtimeSession - -# Add the current directory to path so we can import ui -sys.path.append(os.path.dirname(os.path.abspath(__file__))) - -from agents import function_tool -from agents.realtime import RealtimeAgent, RealtimeRunner, RealtimeSessionEvent - -if TYPE_CHECKING: - from .ui import AppUI -else: - # Try both import styles - try: - # Try relative import first (when used as a package) - from .ui import AppUI - except ImportError: - # Fall back to direct import (when run as a script) - from ui import AppUI - - -@function_tool -def get_weather(city: str) -> str: - """Get the weather in a city.""" - return f"The weather in {city} is sunny." - - -agent = RealtimeAgent( - name="Assistant", - instructions="You always greet the user with 'Top of the morning to you'.", - tools=[get_weather], -) - - -def _truncate_str(s: str, max_length: int) -> str: - if len(s) > max_length: - return s[:max_length] + "..." - return s - - -class Example: - def __init__(self) -> None: - self.ui = AppUI() - self.ui.connected = asyncio.Event() - self.ui.last_audio_item_id = None - # Set the audio callback - self.ui.set_audio_callback(self.on_audio_recorded) - - self.session: RealtimeSession | None = None - - async def run(self) -> None: - # Start UI in a separate task instead of waiting for it to complete - ui_task = asyncio.create_task(self.ui.run_async()) - - # Set up session immediately without waiting for UI to finish - runner = RealtimeRunner(agent) - async with await runner.run() as session: - self.session = session - self.ui.set_is_connected(True) - async for event in session: - await self._on_event(event) - print("done") - - # Wait for UI task to complete when session ends - await ui_task - - async def on_audio_recorded(self, audio_bytes: bytes) -> None: - # Send the audio to the session - assert self.session is not None - await self.session.send_audio(audio_bytes) - - async def _on_event(self, event: RealtimeSessionEvent) -> None: - try: - if event.type == "agent_start": - self.ui.add_transcript(f"Agent started: {event.agent.name}") - elif event.type == "agent_end": - self.ui.add_transcript(f"Agent ended: {event.agent.name}") - elif event.type == "handoff": - self.ui.add_transcript( - f"Handoff from {event.from_agent.name} to {event.to_agent.name}" - ) - elif event.type == "tool_start": - self.ui.add_transcript(f"Tool started: {event.tool.name}") - elif event.type == "tool_end": - self.ui.add_transcript(f"Tool ended: {event.tool.name}; output: {event.output}") - elif event.type == "audio_end": - self.ui.add_transcript("Audio ended") - elif event.type == "audio": - np_audio = np.frombuffer(event.audio.data, dtype=np.int16) - self.ui.play_audio(np_audio) - elif event.type == "audio_interrupted": - self.ui.add_transcript("Audio interrupted") - elif event.type == "error": - pass - elif event.type == "history_updated": - pass - elif event.type == "history_added": - pass - elif event.type == "raw_model_event": - self.ui.log_message(f"Raw model event: {_truncate_str(str(event.data), 50)}") - else: - self.ui.log_message(f"Unknown event type: {event.type}") - except Exception as e: - self.ui.log_message(f"Error processing event: {_truncate_str(str(e), 50)}") - - -if __name__ == "__main__": - example = Example() - asyncio.run(example.run()) diff --git a/examples/realtime/twilio/README.md b/examples/realtime/twilio/README.md new file mode 100644 index 000000000..e92f0681a --- /dev/null +++ b/examples/realtime/twilio/README.md @@ -0,0 +1,86 @@ +# Realtime Twilio Integration + +This example demonstrates how to connect the OpenAI Realtime API to a phone call using Twilio's Media Streams. The server handles incoming phone calls and streams audio between Twilio and the OpenAI Realtime API, enabling real-time voice conversations with an AI agent over the phone. + +## Prerequisites + +- Python 3.9+ +- OpenAI API key with [Realtime API](https://platform.openai.com/docs/guides/realtime) access +- [Twilio](https://www.twilio.com/docs/voice) account with a phone number +- A tunneling service like [ngrok](https://ngrok.com/) to expose your local server + +## Setup + +1. **Start the server:** + + ```bash + uv run server.py + ``` + + The server will start on port 8000 by default. + +2. **Expose the server publicly, e.g. via ngrok:** + + ```bash + ngrok http 8000 + ``` + + Note the public URL (e.g., `https://abc123.ngrok.io`) + +3. **Configure your Twilio phone number:** + - Log into your Twilio Console + - Select your phone number + - Set the webhook URL for incoming calls to: `https://your-ngrok-url.ngrok.io/incoming-call` + - Set the HTTP method to POST + +## Usage + +1. Call your Twilio phone number +2. You'll hear: "Hello! You're now connected to an AI assistant. You can start talking!" +3. Start speaking - the AI will respond in real-time +4. The assistant has access to tools like weather information and current time + +## How It Works + +1. **Incoming Call**: When someone calls your Twilio number, Twilio makes a request to `/incoming-call` +2. **TwiML Response**: The server returns TwiML that: + - Plays a greeting message + - Connects the call to a WebSocket stream at `/media-stream` +3. **WebSocket Connection**: Twilio establishes a WebSocket connection for bidirectional audio streaming +4. **Transport Layer**: The `TwilioRealtimeTransportLayer` class owns the WebSocket message handling: + - Takes ownership of the Twilio WebSocket after initial handshake + - Runs its own message loop to process all Twilio messages + - Handles protocol differences between Twilio and OpenAI + - Automatically sets G.711 μ-law audio format for Twilio compatibility + - Manages audio chunk tracking for interruption support + - Wraps the OpenAI realtime model instead of subclassing it +5. **Audio Processing**: + - Audio from the caller is base64 decoded and sent to OpenAI Realtime API + - Audio responses from OpenAI are base64 encoded and sent back to Twilio + - Twilio plays the audio to the caller + +## Configuration + +- **Port**: Set `PORT` environment variable (default: 8000) +- **OpenAI API Key**: Set `OPENAI_API_KEY` environment variable +- **Agent Instructions**: Modify the `RealtimeAgent` configuration in `server.py` +- **Tools**: Add or modify function tools in `server.py` + +## Troubleshooting + +- **WebSocket connection issues**: Ensure your ngrok URL is correct and publicly accessible +- **Audio quality**: Twilio streams audio in mulaw format at 8kHz, which may affect quality +- **Latency**: Network latency between Twilio, your server, and OpenAI affects response time +- **Logs**: Check the console output for detailed connection and error logs + +## Architecture + +``` +Phone Call → Twilio → WebSocket → TwilioRealtimeTransportLayer → OpenAI Realtime API + ↓ + RealtimeAgent with Tools + ↓ + Audio Response → Twilio → Phone Call +``` + +The `TwilioRealtimeTransportLayer` acts as a bridge between Twilio's Media Streams and OpenAI's Realtime API, handling the protocol differences and audio format conversions. It wraps the OpenAI realtime model to provide a clean interface for Twilio integration. diff --git a/examples/realtime/twilio/__init__.py b/examples/realtime/twilio/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/examples/realtime/twilio/requirements.txt b/examples/realtime/twilio/requirements.txt new file mode 100644 index 000000000..3fcc0b0fe --- /dev/null +++ b/examples/realtime/twilio/requirements.txt @@ -0,0 +1,5 @@ +openai-agents +fastapi +uvicorn[standard] +websockets +python-dotenv \ No newline at end of file diff --git a/examples/realtime/twilio/server.py b/examples/realtime/twilio/server.py new file mode 100644 index 000000000..8a753f789 --- /dev/null +++ b/examples/realtime/twilio/server.py @@ -0,0 +1,80 @@ +import os +from typing import TYPE_CHECKING + +from fastapi import FastAPI, Request, WebSocket, WebSocketDisconnect +from fastapi.responses import PlainTextResponse + +# Import TwilioHandler class - handle both module and package use cases +if TYPE_CHECKING: + # For type checking, use the relative import + from .twilio_handler import TwilioHandler +else: + # At runtime, try both import styles + try: + # Try relative import first (when used as a package) + from .twilio_handler import TwilioHandler + except ImportError: + # Fall back to direct import (when run as a script) + from twilio_handler import TwilioHandler + + +class TwilioWebSocketManager: + def __init__(self): + self.active_handlers: dict[str, TwilioHandler] = {} + + async def new_session(self, websocket: WebSocket) -> TwilioHandler: + """Create and configure a new session.""" + print("Creating twilio handler") + + handler = TwilioHandler(websocket) + return handler + + # In a real app, you'd also want to clean up/close the handler when the call ends + + +manager = TwilioWebSocketManager() +app = FastAPI() + + +@app.get("/") +async def root(): + return {"message": "Twilio Media Stream Server is running!"} + + +@app.post("/incoming-call") +@app.get("/incoming-call") +async def incoming_call(request: Request): + """Handle incoming Twilio phone calls""" + host = request.headers.get("Host") + + twiml_response = f""" + + Hello! You're now connected to an AI assistant. You can start talking! + + + +""" + return PlainTextResponse(content=twiml_response, media_type="text/xml") + + +@app.websocket("/media-stream") +async def media_stream_endpoint(websocket: WebSocket): + """WebSocket endpoint for Twilio Media Streams""" + + try: + handler = await manager.new_session(websocket) + await handler.start() + + await handler.wait_until_done() + + except WebSocketDisconnect: + print("WebSocket disconnected") + except Exception as e: + print(f"WebSocket error: {e}") + + +if __name__ == "__main__": + import uvicorn + + port = int(os.getenv("PORT", 8000)) + uvicorn.run(app, host="0.0.0.0", port=port) diff --git a/examples/realtime/twilio/twilio_handler.py b/examples/realtime/twilio/twilio_handler.py new file mode 100644 index 000000000..567015dfc --- /dev/null +++ b/examples/realtime/twilio/twilio_handler.py @@ -0,0 +1,264 @@ +from __future__ import annotations + +import asyncio +import base64 +import json +import os +import time +from datetime import datetime +from typing import Any + +from fastapi import WebSocket + +from agents import function_tool +from agents.realtime import ( + RealtimeAgent, + RealtimePlaybackTracker, + RealtimeRunner, + RealtimeSession, + RealtimeSessionEvent, +) + + +@function_tool +def get_weather(city: str) -> str: + """Get the weather in a city.""" + return f"The weather in {city} is sunny." + + +@function_tool +def get_current_time() -> str: + """Get the current time.""" + return f"The current time is {datetime.now().strftime('%H:%M:%S')}" + + +agent = RealtimeAgent( + name="Twilio Assistant", + instructions="You are a helpful assistant that starts every conversation with a creative greeting. Keep responses concise and friendly since this is a phone conversation.", + tools=[get_weather, get_current_time], +) + + +class TwilioHandler: + def __init__(self, twilio_websocket: WebSocket): + self.twilio_websocket = twilio_websocket + self._message_loop_task: asyncio.Task[None] | None = None + self.session: RealtimeSession | None = None + self.playback_tracker = RealtimePlaybackTracker() + + # Audio buffering configuration (matching CLI demo) + self.CHUNK_LENGTH_S = 0.05 # 50ms chunks like CLI demo + self.SAMPLE_RATE = 8000 # Twilio uses 8kHz for g711_ulaw + self.BUFFER_SIZE_BYTES = int(self.SAMPLE_RATE * self.CHUNK_LENGTH_S) # 50ms worth of audio + + self._stream_sid: str | None = None + self._audio_buffer: bytearray = bytearray() + self._last_buffer_send_time = time.time() + + # Mark event tracking for playback + self._mark_counter = 0 + self._mark_data: dict[ + str, tuple[str, int, int] + ] = {} # mark_id -> (item_id, content_index, byte_count) + + async def start(self) -> None: + """Start the session.""" + runner = RealtimeRunner(agent) + api_key = os.getenv("OPENAI_API_KEY") + if not api_key: + raise ValueError("OPENAI_API_KEY environment variable is required") + + self.session = await runner.run( + model_config={ + "api_key": api_key, + "initial_model_settings": { + "input_audio_format": "g711_ulaw", + "output_audio_format": "g711_ulaw", + "turn_detection": { + "type": "semantic_vad", + "interrupt_response": True, + "create_response": True, + }, + }, + "playback_tracker": self.playback_tracker, + } + ) + + await self.session.enter() + + await self.twilio_websocket.accept() + print("Twilio WebSocket connection accepted") + + self._realtime_session_task = asyncio.create_task(self._realtime_session_loop()) + self._message_loop_task = asyncio.create_task(self._twilio_message_loop()) + self._buffer_flush_task = asyncio.create_task(self._buffer_flush_loop()) + + async def wait_until_done(self) -> None: + """Wait until the session is done.""" + assert self._message_loop_task is not None + await self._message_loop_task + + async def _realtime_session_loop(self) -> None: + """Listen for events from the realtime session.""" + assert self.session is not None + try: + async for event in self.session: + await self._handle_realtime_event(event) + except Exception as e: + print(f"Error in realtime session loop: {e}") + + async def _twilio_message_loop(self) -> None: + """Listen for messages from Twilio WebSocket and handle them.""" + try: + while True: + message_text = await self.twilio_websocket.receive_text() + message = json.loads(message_text) + await self._handle_twilio_message(message) + except json.JSONDecodeError as e: + print(f"Failed to parse Twilio message as JSON: {e}") + except Exception as e: + print(f"Error in Twilio message loop: {e}") + + async def _handle_realtime_event(self, event: RealtimeSessionEvent) -> None: + """Handle events from the realtime session.""" + if event.type == "audio": + base64_audio = base64.b64encode(event.audio.data).decode("utf-8") + await self.twilio_websocket.send_text( + json.dumps( + { + "event": "media", + "streamSid": self._stream_sid, + "media": {"payload": base64_audio}, + } + ) + ) + + # Send mark event for playback tracking + self._mark_counter += 1 + mark_id = str(self._mark_counter) + self._mark_data[mark_id] = ( + event.audio.item_id, + event.audio.content_index, + len(event.audio.data), + ) + + await self.twilio_websocket.send_text( + json.dumps( + { + "event": "mark", + "streamSid": self._stream_sid, + "mark": {"name": mark_id}, + } + ) + ) + + elif event.type == "audio_interrupted": + print("Sending audio interrupted to Twilio") + await self.twilio_websocket.send_text( + json.dumps({"event": "clear", "streamSid": self._stream_sid}) + ) + elif event.type == "audio_end": + print("Audio end") + elif event.type == "raw_model_event": + pass + else: + pass + + async def _handle_twilio_message(self, message: dict[str, Any]) -> None: + """Handle incoming messages from Twilio Media Stream.""" + try: + event = message.get("event") + + if event == "connected": + print("Twilio media stream connected") + elif event == "start": + start_data = message.get("start", {}) + self._stream_sid = start_data.get("streamSid") + print(f"Media stream started with SID: {self._stream_sid}") + elif event == "media": + await self._handle_media_event(message) + elif event == "mark": + await self._handle_mark_event(message) + elif event == "stop": + print("Media stream stopped") + except Exception as e: + print(f"Error handling Twilio message: {e}") + + async def _handle_media_event(self, message: dict[str, Any]) -> None: + """Handle audio data from Twilio - buffer it before sending to OpenAI.""" + media = message.get("media", {}) + payload = media.get("payload", "") + + if payload: + try: + # Decode base64 audio from Twilio (µ-law format) + ulaw_bytes = base64.b64decode(payload) + + # Add original µ-law to buffer for OpenAI (they expect µ-law) + self._audio_buffer.extend(ulaw_bytes) + + # Send buffered audio if we have enough data + if len(self._audio_buffer) >= self.BUFFER_SIZE_BYTES: + await self._flush_audio_buffer() + + except Exception as e: + print(f"Error processing audio from Twilio: {e}") + + async def _handle_mark_event(self, message: dict[str, Any]) -> None: + """Handle mark events from Twilio to update playback tracker.""" + try: + mark_data = message.get("mark", {}) + mark_id = mark_data.get("name", "") + + # Look up stored data for this mark ID + if mark_id in self._mark_data: + item_id, item_content_index, byte_count = self._mark_data[mark_id] + + # Convert byte count back to bytes for playback tracker + audio_bytes = b"\x00" * byte_count # Placeholder bytes + + # Update playback tracker + self.playback_tracker.on_play_bytes(item_id, item_content_index, audio_bytes) + print( + f"Playback tracker updated: {item_id}, index {item_content_index}, {byte_count} bytes" + ) + + # Clean up the stored data + del self._mark_data[mark_id] + + except Exception as e: + print(f"Error handling mark event: {e}") + + async def _flush_audio_buffer(self) -> None: + """Send buffered audio to OpenAI.""" + if not self._audio_buffer or not self.session: + return + + try: + # Send the buffered audio + buffer_data = bytes(self._audio_buffer) + await self.session.send_audio(buffer_data) + + # Clear the buffer + self._audio_buffer.clear() + self._last_buffer_send_time = time.time() + + except Exception as e: + print(f"Error sending buffered audio to OpenAI: {e}") + + async def _buffer_flush_loop(self) -> None: + """Periodically flush audio buffer to prevent stale data.""" + try: + while True: + await asyncio.sleep(self.CHUNK_LENGTH_S) # Check every 50ms + + # If buffer has data and it's been too long since last send, flush it + current_time = time.time() + if ( + self._audio_buffer + and current_time - self._last_buffer_send_time > self.CHUNK_LENGTH_S * 2 + ): + await self._flush_audio_buffer() + + except Exception as e: + print(f"Error in buffer flush loop: {e}") diff --git a/examples/realtime/ui.py b/examples/realtime/ui.py deleted file mode 100644 index 51a1fed41..000000000 --- a/examples/realtime/ui.py +++ /dev/null @@ -1,268 +0,0 @@ -from __future__ import annotations - -import asyncio -from collections.abc import Coroutine -from typing import Any, Callable - -import numpy as np -import numpy.typing as npt -import sounddevice as sd -from textual import events -from textual.app import App, ComposeResult -from textual.containers import Container, Horizontal -from textual.reactive import reactive -from textual.widgets import RichLog, Static -from typing_extensions import override - -CHUNK_LENGTH_S = 0.05 # 50ms -SAMPLE_RATE = 24000 -FORMAT = np.int16 -CHANNELS = 1 - - -class Header(Static): - """A header widget.""" - - @override - def render(self) -> str: - return "Realtime Demo" - - -class AudioStatusIndicator(Static): - """A widget that shows the current audio recording status.""" - - is_recording = reactive(False) - - @override - def render(self) -> str: - status = ( - "🔴 Conversation started." - if self.is_recording - else "⚪ Press SPACE to start the conversation (q to quit)" - ) - return status - - -class AppUI(App[None]): - CSS = """ - Screen { - background: #1a1b26; /* Dark blue-grey background */ - } - - Container { - border: double rgb(91, 164, 91); - } - - #input-container { - height: 5; /* Explicit height for input container */ - margin: 1 1; - padding: 1 2; - } - - #bottom-pane { - width: 100%; - height: 82%; /* Reduced to make room for session display */ - border: round rgb(205, 133, 63); - } - - #status-indicator { - height: 3; - content-align: center middle; - background: #2a2b36; - border: solid rgb(91, 164, 91); - margin: 1 1; - } - - #session-display { - height: 3; - content-align: center middle; - background: #2a2b36; - border: solid rgb(91, 164, 91); - margin: 1 1; - } - - #transcripts { - width: 50%; - height: 100%; - border-right: solid rgb(91, 164, 91); - } - - #transcripts-header { - height: 2; - background: #2a2b36; - content-align: center middle; - border-bottom: solid rgb(91, 164, 91); - } - - #transcripts-content { - height: 100%; - } - - #event-log { - width: 50%; - height: 100%; - } - - #event-log-header { - height: 2; - background: #2a2b36; - content-align: center middle; - border-bottom: solid rgb(91, 164, 91); - } - - #event-log-content { - height: 100%; - } - - Static { - color: white; - } - """ - - should_send_audio: asyncio.Event - connected: asyncio.Event - last_audio_item_id: str | None - audio_callback: Callable[[bytes], Coroutine[Any, Any, None]] | None - - def __init__(self) -> None: - super().__init__() - self.audio_player = sd.OutputStream( - samplerate=SAMPLE_RATE, - channels=CHANNELS, - dtype=FORMAT, - ) - self.should_send_audio = asyncio.Event() - self.connected = asyncio.Event() - self.audio_callback = None - - @override - def compose(self) -> ComposeResult: - """Create child widgets for the app.""" - with Container(): - yield Header(id="session-display") - yield AudioStatusIndicator(id="status-indicator") - with Container(id="bottom-pane"): - with Horizontal(): - with Container(id="transcripts"): - yield Static("Conversation transcript", id="transcripts-header") - yield RichLog( - id="transcripts-content", wrap=True, highlight=True, markup=True - ) - with Container(id="event-log"): - yield Static("Raw event log", id="event-log-header") - yield RichLog( - id="event-log-content", wrap=True, highlight=True, markup=True - ) - - def set_is_connected(self, is_connected: bool) -> None: - self.connected.set() if is_connected else self.connected.clear() - - def set_audio_callback(self, callback: Callable[[bytes], Coroutine[Any, Any, None]]) -> None: - """Set a callback function to be called when audio is recorded.""" - self.audio_callback = callback - - # High-level methods for UI operations - def set_header_text(self, text: str) -> None: - """Update the header text.""" - header = self.query_one("#session-display", Header) - header.update(text) - - def set_recording_status(self, is_recording: bool) -> None: - """Set the recording status indicator.""" - status_indicator = self.query_one(AudioStatusIndicator) - status_indicator.is_recording = is_recording - - def log_message(self, message: str) -> None: - """Add a message to the event log.""" - try: - log_pane = self.query_one("#event-log-content", RichLog) - log_pane.write(message) - except Exception: - # Handle the case where the widget might not be available - pass - - def add_transcript(self, message: str) -> None: - """Add a transcript message to the transcripts panel.""" - try: - transcript_pane = self.query_one("#transcripts-content", RichLog) - transcript_pane.write(message) - except Exception: - # Handle the case where the widget might not be available - pass - - def play_audio(self, audio_data: npt.NDArray[np.int16]) -> None: - """Play audio data through the audio player.""" - try: - self.audio_player.write(audio_data) - except Exception as e: - self.log_message(f"Audio play error: {e}") - - async def on_mount(self) -> None: - """Set up audio player and start the audio capture worker.""" - self.audio_player.start() - self.run_worker(self.capture_audio()) - - async def capture_audio(self) -> None: - """Capture audio from the microphone and send to the session.""" - # Wait for connection to be established - await self.connected.wait() - - # Set up audio input stream - stream = sd.InputStream( - channels=CHANNELS, - samplerate=SAMPLE_RATE, - dtype=FORMAT, - ) - - try: - # Wait for user to press spacebar to start - await self.should_send_audio.wait() - - stream.start() - self.set_recording_status(True) - self.log_message("Recording started - speak to the agent") - - # Buffer size in samples - read_size = int(SAMPLE_RATE * CHUNK_LENGTH_S) - - while True: - # Check if there's enough data to read - if stream.read_available < read_size: - await asyncio.sleep(0.01) # Small sleep to avoid CPU hogging - continue - - # Read audio data - data, _ = stream.read(read_size) - - # Convert numpy array to bytes - audio_bytes = data.tobytes() - - # Call audio callback if set - if self.audio_callback: - await self.audio_callback(audio_bytes) - - # Yield control back to event loop - await asyncio.sleep(0) - - except Exception as e: - self.log_message(f"Audio capture error: {e}") - finally: - if stream.active: - stream.stop() - stream.close() - - async def on_key(self, event: events.Key) -> None: - """Handle key press events.""" - # add the keypress to the log - self.log_message(f"Key pressed: {event.key}") - - if event.key == "q": - self.audio_player.stop() - self.audio_player.close() - self.exit() - return - - if event.key == "space": # Spacebar - if not self.should_send_audio.is_set(): - self.should_send_audio.set() - self.set_recording_status(True) diff --git a/examples/reasoning_content/gpt_oss_stream.py b/examples/reasoning_content/gpt_oss_stream.py new file mode 100644 index 000000000..963f5ebe4 --- /dev/null +++ b/examples/reasoning_content/gpt_oss_stream.py @@ -0,0 +1,54 @@ +import asyncio +import os + +from openai import AsyncOpenAI +from openai.types.shared import Reasoning + +from agents import ( + Agent, + ModelSettings, + OpenAIChatCompletionsModel, + Runner, + set_tracing_disabled, +) + +set_tracing_disabled(True) + +# import logging +# logging.basicConfig(level=logging.DEBUG) + +gpt_oss_model = OpenAIChatCompletionsModel( + model="openai/gpt-oss-20b", + openai_client=AsyncOpenAI( + base_url="https://openrouter.ai/api/v1", + api_key=os.getenv("OPENROUTER_API_KEY"), + ), +) + + +async def main(): + agent = Agent( + name="Assistant", + instructions="You're a helpful assistant. You provide a concise answer to the user's question.", + model=gpt_oss_model, + model_settings=ModelSettings( + reasoning=Reasoning(effort="high", summary="detailed"), + ), + ) + + result = Runner.run_streamed(agent, "Tell me about recursion in programming.") + print("=== Run starting ===") + print("\n") + async for event in result.stream_events(): + if event.type == "raw_response_event": + if event.data.type == "response.reasoning_text.delta": + print(f"\033[33m{event.data.delta}\033[0m", end="", flush=True) + elif event.data.type == "response.output_text.delta": + print(f"\033[32m{event.data.delta}\033[0m", end="", flush=True) + + print("\n") + print("=== Run complete ===") + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/reasoning_content/main.py b/examples/reasoning_content/main.py index c23b04254..e83c0d4d4 100644 --- a/examples/reasoning_content/main.py +++ b/examples/reasoning_content/main.py @@ -1,24 +1,26 @@ """ Example demonstrating how to use the reasoning content feature with models that support it. -Some models, like deepseek-reasoner, provide a reasoning_content field in addition to the regular content. +Some models, like gpt-5, provide a reasoning_content field in addition to the regular content. This example shows how to access and use this reasoning content from both streaming and non-streaming responses. To run this example, you need to: 1. Set your OPENAI_API_KEY environment variable -2. Use a model that supports reasoning content (e.g., deepseek-reasoner) +2. Use a model that supports reasoning content (e.g., gpt-5) """ import asyncio import os from typing import Any, cast +from openai.types.responses import ResponseOutputRefusal, ResponseOutputText +from openai.types.shared.reasoning import Reasoning + from agents import ModelSettings from agents.models.interface import ModelTracing from agents.models.openai_provider import OpenAIProvider -from agents.types import ResponseOutputRefusal, ResponseOutputText # type: ignore -MODEL_NAME = os.getenv("EXAMPLE_MODEL_NAME") or "deepseek-reasoner" +MODEL_NAME = os.getenv("EXAMPLE_MODEL_NAME") or "gpt-5" async def stream_with_reasoning_content(): @@ -35,30 +37,30 @@ async def stream_with_reasoning_content(): reasoning_content = "" regular_content = "" + output_text_already_started = False async for event in model.stream_response( system_instructions="You are a helpful assistant that writes creative content.", input="Write a haiku about recursion in programming", - model_settings=ModelSettings(), + model_settings=ModelSettings(reasoning=Reasoning(effort="medium", summary="detailed")), tools=[], output_schema=None, handoffs=[], tracing=ModelTracing.DISABLED, previous_response_id=None, + conversation_id=None, prompt=None, ): if event.type == "response.reasoning_summary_text.delta": - print( - f"\033[33m{event.delta}\033[0m", end="", flush=True - ) # Yellow for reasoning content + # Yellow for reasoning content + print(f"\033[33m{event.delta}\033[0m", end="", flush=True) reasoning_content += event.delta elif event.type == "response.output_text.delta": - print(f"\033[32m{event.delta}\033[0m", end="", flush=True) # Green for regular content + if not output_text_already_started: + print("\n") + output_text_already_started = True + # Green for regular content + print(f"\033[32m{event.delta}\033[0m", end="", flush=True) regular_content += event.delta - - print("\n\nReasoning Content:") - print(reasoning_content) - print("\nRegular Content:") - print(regular_content) print("\n") @@ -76,12 +78,13 @@ async def get_response_with_reasoning_content(): response = await model.get_response( system_instructions="You are a helpful assistant that explains technical concepts clearly.", input="Explain the concept of recursion in programming", - model_settings=ModelSettings(), + model_settings=ModelSettings(reasoning=Reasoning(effort="medium", summary="detailed")), tools=[], output_schema=None, handoffs=[], tracing=ModelTracing.DISABLED, previous_response_id=None, + conversation_id=None, prompt=None, ) @@ -101,12 +104,10 @@ async def get_response_with_reasoning_content(): refusal_item = cast(Any, content_item) regular_content = refusal_item.refusal - print("\nReasoning Content:") + print("\n\n### Reasoning Content:") print(reasoning_content or "No reasoning content provided") - - print("\nRegular Content:") + print("\n\n### Regular Content:") print(regular_content or "No regular content provided") - print("\n") @@ -117,7 +118,7 @@ async def main(): except Exception as e: print(f"Error: {e}") print("\nNote: This example requires a model that supports reasoning content.") - print("You may need to use a specific model like deepseek-reasoner or similar.") + print("You may need to use a specific model like gpt-5 or similar.") if __name__ == "__main__": diff --git a/examples/reasoning_content/runner_example.py b/examples/reasoning_content/runner_example.py index e51f85799..579e7e1e6 100644 --- a/examples/reasoning_content/runner_example.py +++ b/examples/reasoning_content/runner_example.py @@ -6,17 +6,18 @@ To run this example, you need to: 1. Set your OPENAI_API_KEY environment variable -2. Use a model that supports reasoning content (e.g., deepseek-reasoner) +2. Use a model that supports reasoning content (e.g., gpt-5) """ import asyncio import os -from typing import Any -from agents import Agent, Runner, trace +from openai.types.shared.reasoning import Reasoning + +from agents import Agent, ModelSettings, Runner, trace from agents.items import ReasoningItem -MODEL_NAME = os.getenv("EXAMPLE_MODEL_NAME") or "deepseek-reasoner" +MODEL_NAME = os.getenv("EXAMPLE_MODEL_NAME") or "gpt-5" async def main(): @@ -27,6 +28,7 @@ async def main(): name="Reasoning Agent", instructions="You are a helpful assistant that explains your reasoning step by step.", model=MODEL_NAME, + model_settings=ModelSettings(reasoning=Reasoning(effort="medium", summary="detailed")), ) # Example 1: Non-streaming response @@ -35,53 +37,34 @@ async def main(): result = await Runner.run( agent, "What is the square root of 841? Please explain your reasoning." ) - # Extract reasoning content from the result items reasoning_content = None - # RunResult has 'response' attribute which has 'output' attribute - for item in result.response.output: # type: ignore - if isinstance(item, ReasoningItem): - reasoning_content = item.summary[0].text # type: ignore + for item in result.new_items: + if isinstance(item, ReasoningItem) and len(item.raw_item.summary) > 0: + reasoning_content = item.raw_item.summary[0].text break - print("\nReasoning Content:") + print("\n### Reasoning Content:") print(reasoning_content or "No reasoning content provided") - - print("\nFinal Output:") + print("\n### Final Output:") print(result.final_output) # Example 2: Streaming response with trace("Reasoning Content - Streaming"): print("\n=== Example 2: Streaming response ===") - print("\nStreaming response:") - - # Buffers to collect reasoning and regular content - reasoning_buffer = "" - content_buffer = "" - - # RunResultStreaming is async iterable stream = Runner.run_streamed(agent, "What is 15 x 27? Please explain your reasoning.") - - async for event in stream: # type: ignore - if isinstance(event, ReasoningItem): - # This is reasoning content - reasoning_item: Any = event - reasoning_buffer += reasoning_item.summary[0].text - print( - f"\033[33m{reasoning_item.summary[0].text}\033[0m", end="", flush=True - ) # Yellow for reasoning - elif hasattr(event, "text"): - # This is regular content - content_buffer += event.text - print( - f"\033[32m{event.text}\033[0m", end="", flush=True - ) # Green for regular content - - print("\n\nCollected Reasoning Content:") - print(reasoning_buffer) - - print("\nCollected Final Answer:") - print(content_buffer) + output_text_already_started = False + async for event in stream.stream_events(): + if event.type == "raw_response_event": + if event.data.type == "response.reasoning_summary_text.delta": + print(f"\033[33m{event.data.delta}\033[0m", end="", flush=True) + elif event.data.type == "response.output_text.delta": + if not output_text_already_started: + print("\n") + output_text_already_started = True + print(f"\033[32m{event.data.delta}\033[0m", end="", flush=True) + + print("\n") if __name__ == "__main__": diff --git a/examples/research_bot/agents/planner_agent.py b/examples/research_bot/agents/planner_agent.py index e80a8e656..cf8fe91cb 100644 --- a/examples/research_bot/agents/planner_agent.py +++ b/examples/research_bot/agents/planner_agent.py @@ -1,6 +1,7 @@ +from openai.types.shared.reasoning import Reasoning from pydantic import BaseModel -from agents import Agent +from agents import Agent, ModelSettings PROMPT = ( "You are a helpful research assistant. Given a query, come up with a set of web searches " @@ -24,6 +25,7 @@ class WebSearchPlan(BaseModel): planner_agent = Agent( name="PlannerAgent", instructions=PROMPT, - model="gpt-4o", + model="gpt-5", + model_settings=ModelSettings(reasoning=Reasoning(effort="medium")), output_type=WebSearchPlan, ) diff --git a/examples/research_bot/agents/search_agent.py b/examples/research_bot/agents/search_agent.py index 61f91701f..ab54d94db 100644 --- a/examples/research_bot/agents/search_agent.py +++ b/examples/research_bot/agents/search_agent.py @@ -12,7 +12,10 @@ search_agent = Agent( name="Search agent", + model="gpt-4.1", instructions=INSTRUCTIONS, tools=[WebSearchTool()], + # Note that gpt-5 model does not support tool_choice="required", + # so if you want to migrate to gpt-5, you'll need to use "auto" instead model_settings=ModelSettings(tool_choice="required"), ) diff --git a/examples/research_bot/agents/writer_agent.py b/examples/research_bot/agents/writer_agent.py index 7b7d01a27..f29d4873f 100644 --- a/examples/research_bot/agents/writer_agent.py +++ b/examples/research_bot/agents/writer_agent.py @@ -1,7 +1,8 @@ # Agent used to synthesize a final report from the individual summaries. +from openai.types.shared.reasoning import Reasoning from pydantic import BaseModel -from agents import Agent +from agents import Agent, ModelSettings PROMPT = ( "You are a senior researcher tasked with writing a cohesive report for a research query. " @@ -28,6 +29,7 @@ class ReportData(BaseModel): writer_agent = Agent( name="WriterAgent", instructions=PROMPT, - model="o3-mini", + model="gpt-5-mini", + model_settings=ModelSettings(reasoning=Reasoning(effort="medium")), output_type=ReportData, ) diff --git a/examples/tools/code_interpreter.py b/examples/tools/code_interpreter.py index a5843ce3f..406e570e7 100644 --- a/examples/tools/code_interpreter.py +++ b/examples/tools/code_interpreter.py @@ -6,6 +6,9 @@ async def main(): agent = Agent( name="Code interpreter", + # Note that using gpt-5 model with streaming for this tool requires org verification + # Also, code interpreter tool does not support gpt-5's minimal reasoning effort + model="gpt-4.1", instructions="You love doing math.", tools=[ CodeInterpreterTool( diff --git a/examples/tools/file_search.py b/examples/tools/file_search.py index 2a3d4cf12..cd5332718 100644 --- a/examples/tools/file_search.py +++ b/examples/tools/file_search.py @@ -1,16 +1,42 @@ import asyncio +from openai import OpenAI + from agents import Agent, FileSearchTool, Runner, trace async def main(): + vector_store_id: str | None = None + + if vector_store_id is None: + print("### Preparing vector store:\n") + # Create a new vector store and index a file + client = OpenAI() + text = "Arrakis, the desert planet in Frank Herbert's 'Dune,' was inspired by the scarcity of water as a metaphor for oil and other finite resources." + file_upload = client.files.create( + file=("example.txt", text.encode("utf-8")), + purpose="assistants", + ) + print(f"File uploaded: {file_upload.to_dict()}") + + vector_store = client.vector_stores.create(name="example-vector-store") + print(f"Vector store created: {vector_store.to_dict()}") + + indexed = client.vector_stores.files.create_and_poll( + vector_store_id=vector_store.id, + file_id=file_upload.id, + ) + print(f"Stored files in vector store: {indexed.to_dict()}") + vector_store_id = vector_store.id + + # Create an agent that can search the vector store agent = Agent( name="File searcher", - instructions="You are a helpful agent.", + instructions="You are a helpful agent. You answer only based on the information in the vector store.", tools=[ FileSearchTool( max_num_results=3, - vector_store_ids=["vs_67bf88953f748191be42b462090e53e7"], + vector_store_ids=[vector_store_id], include_search_results=True, ) ], @@ -20,13 +46,16 @@ async def main(): result = await Runner.run( agent, "Be concise, and tell me 1 sentence about Arrakis I might not know." ) + + print("\n### Final output:\n") print(result.final_output) """ Arrakis, the desert planet in Frank Herbert's "Dune," was inspired by the scarcity of water as a metaphor for oil and other finite resources. """ - print("\n".join([str(out) for out in result.new_items])) + print("\n### Output items:\n") + print("\n".join([str(out.raw_item) + "\n" for out in result.new_items])) """ {"id":"...", "queries":["Arrakis"], "results":[...]} """ diff --git a/examples/tools/image_generator.py b/examples/tools/image_generator.py index fd6fcc6ba..747b9ce92 100644 --- a/examples/tools/image_generator.py +++ b/examples/tools/image_generator.py @@ -12,7 +12,7 @@ def open_file(path: str) -> None: if sys.platform.startswith("darwin"): subprocess.run(["open", path], check=False) # macOS elif os.name == "nt": # Windows - os.astartfile(path) # type: ignore + os.startfile(path) # type: ignore elif os.name == "posix": subprocess.run(["xdg-open", path], check=False) # Linux/Unix else: diff --git a/examples/tools/local_shell.py b/examples/tools/local_shell.py new file mode 100644 index 000000000..0c63fad6e --- /dev/null +++ b/examples/tools/local_shell.py @@ -0,0 +1,45 @@ +import asyncio +import os +import subprocess + +from agents import Agent, LocalShellCommandRequest, LocalShellTool, Runner, trace + + +def shell_executor(request: LocalShellCommandRequest) -> str: + args = request.data.action + + try: + completed = subprocess.run( + args.command, + cwd=args.working_directory or os.getcwd(), + env={**os.environ, **args.env} if args.env else os.environ, + capture_output=True, + text=True, + timeout=(args.timeout_ms / 1000) if args.timeout_ms else None, + ) + return completed.stdout + completed.stderr + + except subprocess.TimeoutExpired: + return "Command execution timed out" + except Exception as e: + return f"Error executing command: {str(e)}" + + +async def main(): + agent = Agent( + name="Shell Assistant", + instructions="You are a helpful assistant that can execute shell commands.", + model="codex-mini-latest", # Local shell tool requires a compatible model + tools=[LocalShellTool(executor=shell_executor)], + ) + + with trace("Local shell example"): + result = await Runner.run( + agent, + "List the files in the current directory and tell me how many there are.", + ) + print(result.final_output) + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/tools/web_search_filters.py b/examples/tools/web_search_filters.py new file mode 100644 index 000000000..6be30b169 --- /dev/null +++ b/examples/tools/web_search_filters.py @@ -0,0 +1,60 @@ +import asyncio +from datetime import datetime + +from openai.types.responses.web_search_tool import Filters +from openai.types.shared.reasoning import Reasoning + +from agents import Agent, ModelSettings, Runner, WebSearchTool, trace + +# import logging +# logging.basicConfig(level=logging.DEBUG) + + +async def main(): + agent = Agent( + name="WebOAI website searcher", + model="gpt-5-nano", + instructions="You are a helpful agent that can search openai.com resources.", + tools=[ + WebSearchTool( + # https://platform.openai.com/docs/guides/tools-web-search?api-mode=responses#domain-filtering + filters=Filters( + allowed_domains=[ + "openai.com", + "developer.openai.com", + "platform.openai.com", + "help.openai.com", + ], + ), + search_context_size="medium", + ) + ], + model_settings=ModelSettings( + reasoning=Reasoning(effort="low"), + verbosity="low", + # https://platform.openai.com/docs/guides/tools-web-search?api-mode=responses#sources + response_include=["web_search_call.action.sources"], + ), + ) + + with trace("Web search example"): + today = datetime.now().strftime("%Y-%m-%d") + query = f"Write a summary of the latest OpenAI Platform updates for developers in the last few weeks (today is {today})." + result = await Runner.run(agent, query) + + print() + print("### Sources ###") + print() + for item in result.new_items: + if item.type == "tool_call_item": + if item.raw_item.type == "web_search_call": + for source in item.raw_item.action.sources: # type: ignore [union-attr] + print(f"- {source.url}") + print() + print("### Final output ###") + print() + print(result.final_output) + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/voice/static/main.py b/examples/voice/static/main.py index 1b9e20243..69297e3e8 100644 --- a/examples/voice/static/main.py +++ b/examples/voice/static/main.py @@ -44,7 +44,7 @@ def get_weather(city: str) -> str: instructions=prompt_with_handoff_instructions( "You're speaking to a human, so be polite and concise. Speak in Spanish.", ), - model="gpt-4o-mini", + model="gpt-5-mini", ) agent = Agent( @@ -52,7 +52,7 @@ def get_weather(city: str) -> str: instructions=prompt_with_handoff_instructions( "You're speaking to a human, so be polite and concise. If the user speaks in Spanish, handoff to the spanish agent.", ), - model="gpt-4o-mini", + model="gpt-5-mini", handoffs=[spanish_agent], tools=[get_weather], ) diff --git a/examples/voice/streamed/my_workflow.py b/examples/voice/streamed/my_workflow.py index 3cb804b0c..076abd2a3 100644 --- a/examples/voice/streamed/my_workflow.py +++ b/examples/voice/streamed/my_workflow.py @@ -21,7 +21,7 @@ def get_weather(city: str) -> str: instructions=prompt_with_handoff_instructions( "You're speaking to a human, so be polite and concise. Speak in Spanish.", ), - model="gpt-4o-mini", + model="gpt-4.1", ) agent = Agent( @@ -29,7 +29,7 @@ def get_weather(city: str) -> str: instructions=prompt_with_handoff_instructions( "You're speaking to a human, so be polite and concise. If the user speaks in Spanish, handoff to the spanish agent.", ), - model="gpt-4o-mini", + model="gpt-4.1", handoffs=[spanish_agent], tools=[get_weather], ) diff --git a/mkdocs.yml b/mkdocs.yml index 19529bf30..a1ed06d31 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -57,7 +57,11 @@ plugins: - Documentation: - agents.md - running_agents.md - - sessions.md + - Sessions: + - sessions/index.md + - sessions/sqlalchemy_session.md + - sessions/advanced_sqlite_session.md + - sessions/encrypted_session.md - results.md - streaming.md - repl.md @@ -68,6 +72,7 @@ plugins: - context.md - guardrails.md - multi_agent.md + - usage.md - Models: - models/index.md - models/litellm.md @@ -78,6 +83,9 @@ plugins: - voice/quickstart.md - voice/pipeline.md - voice/tracing.md + - Realtime agents: + - realtime/quickstart.md + - realtime/guide.md - API Reference: - Agents: - ref/index.md @@ -86,6 +94,7 @@ plugins: - ref/memory.md - ref/repl.md - ref/tool.md + - ref/tool_context.md - ref/result.md - ref/stream_events.md - ref/handoffs.md @@ -115,6 +124,13 @@ plugins: - ref/tracing/setup.md - ref/tracing/span_data.md - ref/tracing/util.md + - Realtime: + - ref/realtime/agent.md + - ref/realtime/runner.md + - ref/realtime/session.md + - ref/realtime/events.md + - ref/realtime/config.md + - ref/realtime/model.md - Voice: - ref/voice/pipeline.md - ref/voice/workflow.md @@ -132,7 +148,9 @@ plugins: - ref/extensions/handoff_filters.md - ref/extensions/handoff_prompt.md - ref/extensions/litellm.md - + - ref/extensions/memory/sqlalchemy_session.md + - ref/extensions/memory/encrypt_session.md + - ref/extensions/memory/advanced_sqlite_session.md - locale: ja name: 日本語 build: true @@ -143,7 +161,11 @@ plugins: - ドキュメント: - agents.md - running_agents.md - - sessions.md + - セッション: + - sessions/index.md + - sessions/sqlalchemy_session.md + - sessions/advanced_sqlite_session.md + - sessions/encrypted_session.md - results.md - streaming.md - repl.md @@ -154,15 +176,99 @@ plugins: - context.md - guardrails.md - multi_agent.md + - usage.md - モデル: - models/index.md - models/litellm.md - config.md - visualization.md + - release.md - 音声エージェント: - voice/quickstart.md - voice/pipeline.md - voice/tracing.md + - リアルタイムエージェント: + - realtime/quickstart.md + - realtime/guide.md + + - locale: ko + name: 한국어 + build: true + nav: + - 소개: index.md + - 빠른 시작: quickstart.md + - 코드 예제: examples.md + - 문서: + - agents.md + - running_agents.md + - 세션: + - sessions/index.md + - sessions/sqlalchemy_session.md + - sessions/advanced_sqlite_session.md + - sessions/encrypted_session.md + - results.md + - streaming.md + - repl.md + - tools.md + - mcp.md + - handoffs.md + - tracing.md + - context.md + - guardrails.md + - multi_agent.md + - usage.md + - 모델: + - models/index.md + - models/litellm.md + - config.md + - visualization.md + - release.md + - 음성 에이전트: + - voice/quickstart.md + - voice/pipeline.md + - voice/tracing.md + - 실시간 에이전트: + - realtime/quickstart.md + - realtime/guide.md + - locale: zh + name: 简体中文 + build: true + nav: + - 介绍: index.md + - 快速开始: quickstart.md + - 示例: examples.md + - 文档: + - agents.md + - running_agents.md + - 会话: + - sessions/index.md + - sessions/sqlalchemy_session.md + - sessions/advanced_sqlite_session.md + - sessions/encrypted_session.md + - results.md + - streaming.md + - repl.md + - tools.md + - mcp.md + - handoffs.md + - tracing.md + - context.md + - guardrails.md + - multi_agent.md + - usage.md + - 模型: + - models/index.md + - models/litellm.md + - config.md + - visualization.md + - release.md + - 语音智能体: + - voice/quickstart.md + - voice/pipeline.md + - voice/tracing.md + - 实时智能体: + - realtime/quickstart.md + - realtime/guide.md extra: # Remove material generation message in footer @@ -175,6 +281,12 @@ extra: - name: 日本語 link: /openai-agents-python/ja/ lang: ja + - name: 한국어 + link: /openai-agents-python/ko/ + lang: ko + - name: 简体中文 + link: /openai-agents-python/zh/ + lang: zh markdown_extensions: - pymdownx.superfences: diff --git a/pyproject.toml b/pyproject.toml index 0f9b70852..466db88e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,19 +1,19 @@ [project] name = "openai-agents" -version = "0.2.0" +version = "0.4.2" description = "OpenAI Agents SDK" readme = "README.md" requires-python = ">=3.9" license = "MIT" authors = [{ name = "OpenAI", email = "support@openai.com" }] dependencies = [ - "openai>=1.93.1, <2", + "openai>=2.2,<3", "pydantic>=2.10, <3", "griffe>=1.5.6, <2", "typing-extensions>=4.12.2, <5", "requests>=2.0, <3", "types-requests>=2.0, <3", - "mcp>=1.9.4, <2; python_version >= '3.10'", + "mcp>=1.11.0, <2; python_version >= '3.10'", ] classifiers = [ "Typing :: Typed", @@ -38,6 +38,9 @@ voice = ["numpy>=2.2.0, <3; python_version>='3.10'", "websockets>=15.0, <16"] viz = ["graphviz>=0.17"] litellm = ["litellm>=1.67.4.post1, <2"] realtime = ["websockets>=15.0, <16"] +sqlalchemy = ["SQLAlchemy>=2.0", "asyncpg>=0.29.0"] +encrypt = ["cryptography>=45.0, <46"] +redis = ["redis>=6.4.0"] [dependency-groups] dev = [ @@ -63,6 +66,9 @@ dev = [ "mkdocs-static-i18n>=1.3.0", "eval-type-backport>=0.2.2", "fastapi >= 0.110.0, <1", + "aiosqlite>=0.21.0", + "cryptography>=45.0, <46", + "fakeredis>=2.31.3", ] [tool.uv.workspace] diff --git a/src/agents/__init__.py b/src/agents/__init__.py index 7de17efdb..b285d6f8c 100644 --- a/src/agents/__init__.py +++ b/src/agents/__init__.py @@ -5,7 +5,13 @@ from openai import AsyncOpenAI from . import _config -from .agent import Agent, AgentBase, ToolsToFinalOutputFunction, ToolsToFinalOutputResult +from .agent import ( + Agent, + AgentBase, + StopAtTools, + ToolsToFinalOutputFunction, + ToolsToFinalOutputResult, +) from .agent_output import AgentOutputSchema, AgentOutputSchemaBase from .computer import AsyncComputer, Button, Computer, Environment from .exceptions import ( @@ -15,6 +21,8 @@ ModelBehaviorError, OutputGuardrailTripwireTriggered, RunErrorDetails, + ToolInputGuardrailTripwireTriggered, + ToolOutputGuardrailTripwireTriggered, UserError, ) from .guardrail import ( @@ -40,9 +48,10 @@ TResponseInputItem, ) from .lifecycle import AgentHooks, RunHooks -from .memory import Session, SQLiteSession +from .memory import OpenAIConversationsSession, Session, SessionABC, SQLiteSession from .model_settings import ModelSettings from .models.interface import Model, ModelProvider, ModelTracing +from .models.multi_provider import MultiProvider from .models.openai_chatcompletions import OpenAIChatCompletionsModel from .models.openai_provider import OpenAIProvider from .models.openai_responses import OpenAIResponsesModel @@ -72,10 +81,27 @@ MCPToolApprovalFunctionResult, MCPToolApprovalRequest, Tool, + ToolOutputFileContent, + ToolOutputFileContentDict, + ToolOutputImage, + ToolOutputImageDict, + ToolOutputText, + ToolOutputTextDict, WebSearchTool, default_tool_error_function, function_tool, ) +from .tool_guardrails import ( + ToolGuardrailFunctionOutput, + ToolInputGuardrail, + ToolInputGuardrailData, + ToolInputGuardrailResult, + ToolOutputGuardrail, + ToolOutputGuardrailData, + ToolOutputGuardrailResult, + tool_input_guardrail, + tool_output_guardrail, +) from .tracing import ( AgentSpanData, CustomSpanData, @@ -118,7 +144,7 @@ def set_default_openai_key(key: str, use_for_tracing: bool = True) -> None: - """Set the default OpenAI API key to use for LLM requests (and optionally tracing(). This is + """Set the default OpenAI API key to use for LLM requests (and optionally tracing()). This is only necessary if the OPENAI_API_KEY environment variable is not already set. If provided, this key will be used instead of the OPENAI_API_KEY environment variable. @@ -162,6 +188,7 @@ def enable_verbose_stdout_logging(): __all__ = [ "Agent", "AgentBase", + "StopAtTools", "ToolsToFinalOutputFunction", "ToolsToFinalOutputResult", "Runner", @@ -171,6 +198,7 @@ def enable_verbose_stdout_logging(): "ModelTracing", "ModelSettings", "OpenAIChatCompletionsModel", + "MultiProvider", "OpenAIProvider", "OpenAIResponsesModel", "AgentOutputSchema", @@ -182,6 +210,8 @@ def enable_verbose_stdout_logging(): "AgentsException", "InputGuardrailTripwireTriggered", "OutputGuardrailTripwireTriggered", + "ToolInputGuardrailTripwireTriggered", + "ToolOutputGuardrailTripwireTriggered", "DynamicPromptFunction", "GenerateDynamicPromptData", "Prompt", @@ -195,6 +225,15 @@ def enable_verbose_stdout_logging(): "GuardrailFunctionOutput", "input_guardrail", "output_guardrail", + "ToolInputGuardrail", + "ToolOutputGuardrail", + "ToolGuardrailFunctionOutput", + "ToolInputGuardrailData", + "ToolInputGuardrailResult", + "ToolOutputGuardrailData", + "ToolOutputGuardrailResult", + "tool_input_guardrail", + "tool_output_guardrail", "handoff", "Handoff", "HandoffInputData", @@ -212,7 +251,9 @@ def enable_verbose_stdout_logging(): "RunHooks", "AgentHooks", "Session", + "SessionABC", "SQLiteSession", + "OpenAIConversationsSession", "RunContextWrapper", "TContext", "RunErrorDetails", @@ -238,6 +279,12 @@ def enable_verbose_stdout_logging(): "MCPToolApprovalFunction", "MCPToolApprovalRequest", "MCPToolApprovalFunctionResult", + "ToolOutputText", + "ToolOutputTextDict", + "ToolOutputImage", + "ToolOutputImageDict", + "ToolOutputFileContent", + "ToolOutputFileContentDict", "function_tool", "Usage", "add_trace_processor", diff --git a/src/agents/_debug.py b/src/agents/_debug.py index 4da91be48..963c296b8 100644 --- a/src/agents/_debug.py +++ b/src/agents/_debug.py @@ -1,17 +1,28 @@ import os -def _debug_flag_enabled(flag: str) -> bool: +def _debug_flag_enabled(flag: str, default: bool = False) -> bool: flag_value = os.getenv(flag) - return flag_value is not None and (flag_value == "1" or flag_value.lower() == "true") + if flag_value is None: + return default + else: + return flag_value == "1" or flag_value.lower() == "true" -DONT_LOG_MODEL_DATA = _debug_flag_enabled("OPENAI_AGENTS_DONT_LOG_MODEL_DATA") +def _load_dont_log_model_data() -> bool: + return _debug_flag_enabled("OPENAI_AGENTS_DONT_LOG_MODEL_DATA", default=True) + + +def _load_dont_log_tool_data() -> bool: + return _debug_flag_enabled("OPENAI_AGENTS_DONT_LOG_TOOL_DATA", default=True) + + +DONT_LOG_MODEL_DATA = _load_dont_log_model_data() """By default we don't log LLM inputs/outputs, to prevent exposing sensitive information. Set this flag to enable logging them. """ -DONT_LOG_TOOL_DATA = _debug_flag_enabled("OPENAI_AGENTS_DONT_LOG_TOOL_DATA") +DONT_LOG_TOOL_DATA = _load_dont_log_tool_data() """By default we don't log tool call inputs/outputs, to prevent exposing sensitive information. Set this flag to enable logging them. """ diff --git a/src/agents/_run_impl.py b/src/agents/_run_impl.py index a83af62a1..88a770a56 100644 --- a/src/agents/_run_impl.py +++ b/src/agents/_run_impl.py @@ -44,7 +44,13 @@ from .agent import Agent, ToolsToFinalOutputResult from .agent_output import AgentOutputSchemaBase from .computer import AsyncComputer, Computer -from .exceptions import AgentsException, ModelBehaviorError, UserError +from .exceptions import ( + AgentsException, + ModelBehaviorError, + ToolInputGuardrailTripwireTriggered, + ToolOutputGuardrailTripwireTriggered, + UserError, +) from .guardrail import InputGuardrail, InputGuardrailResult, OutputGuardrail, OutputGuardrailResult from .handoffs import Handoff, HandoffInputData from .items import ( @@ -80,6 +86,12 @@ Tool, ) from .tool_context import ToolContext +from .tool_guardrails import ( + ToolInputGuardrailData, + ToolInputGuardrailResult, + ToolOutputGuardrailData, + ToolOutputGuardrailResult, +) from .tracing import ( SpanError, Trace, @@ -208,6 +220,12 @@ class SingleStepResult: next_step: NextStepHandoff | NextStepFinalOutput | NextStepRunAgain """The next step to take.""" + tool_input_guardrail_results: list[ToolInputGuardrailResult] + """Tool input guardrail results from this step.""" + + tool_output_guardrail_results: list[ToolOutputGuardrailResult] + """Tool output guardrail results from this step.""" + @property def generated_items(self) -> list[RunItem]: """Items generated during the agent run (i.e. everything generated after @@ -249,8 +267,12 @@ async def execute_tools_and_side_effects( new_step_items: list[RunItem] = [] new_step_items.extend(processed_response.new_items) - # First, lets run the tool calls - function tools and computer actions - function_results, computer_results = await asyncio.gather( + # First, lets run the tool calls - function tools, computer actions, and local shell calls + ( + (function_results, tool_input_guardrail_results, tool_output_guardrail_results), + computer_results, + local_shell_results, + ) = await asyncio.gather( cls.execute_function_tool_calls( agent=agent, tool_runs=processed_response.functions, @@ -265,9 +287,17 @@ async def execute_tools_and_side_effects( context_wrapper=context_wrapper, config=run_config, ), + cls.execute_local_shell_calls( + agent=agent, + calls=processed_response.local_shell_calls, + hooks=hooks, + context_wrapper=context_wrapper, + config=run_config, + ), ) new_step_items.extend([result.run_item for result in function_results]) new_step_items.extend(computer_results) + new_step_items.extend(local_shell_results) # Next, run the MCP approval requests if processed_response.mcp_approval_requests: @@ -320,6 +350,8 @@ async def execute_tools_and_side_effects( final_output=check_tool_use.final_output, hooks=hooks, context_wrapper=context_wrapper, + tool_input_guardrail_results=tool_input_guardrail_results, + tool_output_guardrail_results=tool_output_guardrail_results, ) # Now we can check if the model also produced a final output @@ -330,43 +362,46 @@ async def execute_tools_and_side_effects( ItemHelpers.extract_last_text(message_items[-1].raw_item) if message_items else None ) - # There are two possibilities that lead to a final output: - # 1. Structured output schema => always leads to a final output - # 2. Plain text output schema => only leads to a final output if there are no tool calls - if output_schema and not output_schema.is_plain_text() and potential_final_output_text: - final_output = output_schema.validate_json(potential_final_output_text) - return await cls.execute_final_output( - agent=agent, - original_input=original_input, - new_response=new_response, - pre_step_items=pre_step_items, - new_step_items=new_step_items, - final_output=final_output, - hooks=hooks, - context_wrapper=context_wrapper, - ) - elif ( - not output_schema or output_schema.is_plain_text() - ) and not processed_response.has_tools_or_approvals_to_run(): - return await cls.execute_final_output( - agent=agent, - original_input=original_input, - new_response=new_response, - pre_step_items=pre_step_items, - new_step_items=new_step_items, - final_output=potential_final_output_text or "", - hooks=hooks, - context_wrapper=context_wrapper, - ) - else: - # If there's no final output, we can just run again - return SingleStepResult( - original_input=original_input, - model_response=new_response, - pre_step_items=pre_step_items, - new_step_items=new_step_items, - next_step=NextStepRunAgain(), - ) + # Generate final output only when there are no pending tool calls or approval requests. + if not processed_response.has_tools_or_approvals_to_run(): + if output_schema and not output_schema.is_plain_text() and potential_final_output_text: + final_output = output_schema.validate_json(potential_final_output_text) + return await cls.execute_final_output( + agent=agent, + original_input=original_input, + new_response=new_response, + pre_step_items=pre_step_items, + new_step_items=new_step_items, + final_output=final_output, + hooks=hooks, + context_wrapper=context_wrapper, + tool_input_guardrail_results=tool_input_guardrail_results, + tool_output_guardrail_results=tool_output_guardrail_results, + ) + elif not output_schema or output_schema.is_plain_text(): + return await cls.execute_final_output( + agent=agent, + original_input=original_input, + new_response=new_response, + pre_step_items=pre_step_items, + new_step_items=new_step_items, + final_output=potential_final_output_text or "", + hooks=hooks, + context_wrapper=context_wrapper, + tool_input_guardrail_results=tool_input_guardrail_results, + tool_output_guardrail_results=tool_output_guardrail_results, + ) + + # If there's no final output, we can just run again + return SingleStepResult( + original_input=original_input, + model_response=new_response, + pre_step_items=pre_step_items, + new_step_items=new_step_items, + next_step=NextStepRunAgain(), + tool_input_guardrail_results=tool_input_guardrail_results, + tool_output_guardrail_results=tool_output_guardrail_results, + ) @classmethod def maybe_reset_tool_choice( @@ -509,13 +544,29 @@ def process_model_response( # Regular function tool call else: if output.name not in function_map: - _error_tracing.attach_error_to_current_span( - SpanError( - message="Tool not found", - data={"tool_name": output.name}, + if output_schema is not None and output.name == "json_tool_call": + # LiteLLM could generate non-existent tool calls for structured outputs + items.append(ToolCallItem(raw_item=output, agent=agent)) + functions.append( + ToolRunFunction( + tool_call=output, + # this tool does not exist in function_map, so generate ad-hoc one, + # which just parses the input if it's a string, and returns the + # value otherwise + function_tool=_build_litellm_json_tool_call(output), + ) ) - ) - raise ModelBehaviorError(f"Tool {output.name} not found in agent {agent.name}") + continue + else: + _error_tracing.attach_error_to_current_span( + SpanError( + message="Tool not found", + data={"tool_name": output.name}, + ) + ) + error = f"Tool {output.name} not found in agent {agent.name}" + raise ModelBehaviorError(error) + items.append(ToolCallItem(raw_item=output, agent=agent)) functions.append( ToolRunFunction( @@ -534,6 +585,155 @@ def process_model_response( mcp_approval_requests=mcp_approval_requests, ) + @classmethod + async def _execute_input_guardrails( + cls, + *, + func_tool: FunctionTool, + tool_context: ToolContext[TContext], + agent: Agent[TContext], + tool_input_guardrail_results: list[ToolInputGuardrailResult], + ) -> str | None: + """Execute input guardrails for a tool. + + Args: + func_tool: The function tool being executed. + tool_context: The tool execution context. + agent: The agent executing the tool. + tool_input_guardrail_results: List to append guardrail results to. + + Returns: + None if tool execution should proceed, or a message string if execution should be + skipped. + + Raises: + ToolInputGuardrailTripwireTriggered: If a guardrail triggers an exception. + """ + if not func_tool.tool_input_guardrails: + return None + + for guardrail in func_tool.tool_input_guardrails: + gr_out = await guardrail.run( + ToolInputGuardrailData( + context=tool_context, + agent=agent, + ) + ) + + # Store the guardrail result + tool_input_guardrail_results.append( + ToolInputGuardrailResult( + guardrail=guardrail, + output=gr_out, + ) + ) + + # Handle different behavior types + if gr_out.behavior["type"] == "raise_exception": + raise ToolInputGuardrailTripwireTriggered(guardrail=guardrail, output=gr_out) + elif gr_out.behavior["type"] == "reject_content": + # Set final_result to the message and skip tool execution + return gr_out.behavior["message"] + elif gr_out.behavior["type"] == "allow": + # Continue to next guardrail or tool execution + continue + + return None + + @classmethod + async def _execute_output_guardrails( + cls, + *, + func_tool: FunctionTool, + tool_context: ToolContext[TContext], + agent: Agent[TContext], + real_result: Any, + tool_output_guardrail_results: list[ToolOutputGuardrailResult], + ) -> Any: + """Execute output guardrails for a tool. + + Args: + func_tool: The function tool being executed. + tool_context: The tool execution context. + agent: The agent executing the tool. + real_result: The actual result from the tool execution. + tool_output_guardrail_results: List to append guardrail results to. + + Returns: + The final result after guardrail processing (may be modified). + + Raises: + ToolOutputGuardrailTripwireTriggered: If a guardrail triggers an exception. + """ + if not func_tool.tool_output_guardrails: + return real_result + + final_result = real_result + for output_guardrail in func_tool.tool_output_guardrails: + gr_out = await output_guardrail.run( + ToolOutputGuardrailData( + context=tool_context, + agent=agent, + output=real_result, + ) + ) + + # Store the guardrail result + tool_output_guardrail_results.append( + ToolOutputGuardrailResult( + guardrail=output_guardrail, + output=gr_out, + ) + ) + + # Handle different behavior types + if gr_out.behavior["type"] == "raise_exception": + raise ToolOutputGuardrailTripwireTriggered( + guardrail=output_guardrail, output=gr_out + ) + elif gr_out.behavior["type"] == "reject_content": + # Override the result with the guardrail message + final_result = gr_out.behavior["message"] + break + elif gr_out.behavior["type"] == "allow": + # Continue to next guardrail + continue + + return final_result + + @classmethod + async def _execute_tool_with_hooks( + cls, + *, + func_tool: FunctionTool, + tool_context: ToolContext[TContext], + agent: Agent[TContext], + hooks: RunHooks[TContext], + tool_call: ResponseFunctionToolCall, + ) -> Any: + """Execute the core tool function with before/after hooks. + + Args: + func_tool: The function tool being executed. + tool_context: The tool execution context. + agent: The agent executing the tool. + hooks: The run hooks to execute. + tool_call: The tool call details. + + Returns: + The result from the tool execution. + """ + await asyncio.gather( + hooks.on_tool_start(tool_context, agent, func_tool), + ( + agent.hooks.on_tool_start(tool_context, agent, func_tool) + if agent.hooks + else _coro.noop_coroutine() + ), + ) + + return await func_tool.on_invoke_tool(tool_context, tool_call.arguments) + @classmethod async def execute_function_tool_calls( cls, @@ -543,7 +743,13 @@ async def execute_function_tool_calls( hooks: RunHooks[TContext], context_wrapper: RunContextWrapper[TContext], config: RunConfig, - ) -> list[FunctionToolResult]: + ) -> tuple[ + list[FunctionToolResult], list[ToolInputGuardrailResult], list[ToolOutputGuardrailResult] + ]: + # Collect guardrail results + tool_input_guardrail_results: list[ToolInputGuardrailResult] = [] + tool_output_guardrail_results: list[ToolOutputGuardrailResult] = [] + async def run_single_tool( func_tool: FunctionTool, tool_call: ResponseFunctionToolCall ) -> Any: @@ -556,24 +762,48 @@ async def run_single_tool( if config.trace_include_sensitive_data: span_fn.span_data.input = tool_call.arguments try: - _, _, result = await asyncio.gather( - hooks.on_tool_start(tool_context, agent, func_tool), - ( - agent.hooks.on_tool_start(tool_context, agent, func_tool) - if agent.hooks - else _coro.noop_coroutine() - ), - func_tool.on_invoke_tool(tool_context, tool_call.arguments), + # 1) Run input tool guardrails, if any + rejected_message = await cls._execute_input_guardrails( + func_tool=func_tool, + tool_context=tool_context, + agent=agent, + tool_input_guardrail_results=tool_input_guardrail_results, ) - await asyncio.gather( - hooks.on_tool_end(tool_context, agent, func_tool, result), - ( - agent.hooks.on_tool_end(tool_context, agent, func_tool, result) - if agent.hooks - else _coro.noop_coroutine() - ), - ) + if rejected_message is not None: + # Input guardrail rejected the tool call + final_result = rejected_message + else: + # 2) Actually run the tool + real_result = await cls._execute_tool_with_hooks( + func_tool=func_tool, + tool_context=tool_context, + agent=agent, + hooks=hooks, + tool_call=tool_call, + ) + + # 3) Run output tool guardrails, if any + final_result = await cls._execute_output_guardrails( + func_tool=func_tool, + tool_context=tool_context, + agent=agent, + real_result=real_result, + tool_output_guardrail_results=tool_output_guardrail_results, + ) + + # 4) Tool end hooks (with final result, which may have been overridden) + await asyncio.gather( + hooks.on_tool_end(tool_context, agent, func_tool, final_result), + ( + agent.hooks.on_tool_end( + tool_context, agent, func_tool, final_result + ) + if agent.hooks + else _coro.noop_coroutine() + ), + ) + result = final_result except Exception as e: _error_tracing.attach_error_to_current_span( SpanError( @@ -596,19 +826,21 @@ async def run_single_tool( results = await asyncio.gather(*tasks) - return [ + function_tool_results = [ FunctionToolResult( tool=tool_run.function_tool, output=result, run_item=ToolCallOutputItem( output=result, - raw_item=ItemHelpers.tool_call_output_item(tool_run.tool_call, str(result)), + raw_item=ItemHelpers.tool_call_output_item(tool_run.tool_call, result), agent=agent, ), ) for tool_run, result in zip(tool_runs, results) ] + return function_tool_results, tool_input_guardrail_results, tool_output_guardrail_results + @classmethod async def execute_local_shell_calls( cls, @@ -774,6 +1006,7 @@ async def execute_handoffs( else original_input, pre_handoff_items=tuple(pre_step_items), new_items=tuple(new_step_items), + run_context=context_wrapper, ) if not callable(input_filter): _error_tracing.attach_error_to_span( @@ -785,6 +1018,8 @@ async def execute_handoffs( ) raise UserError(f"Invalid input filter: {input_filter}") filtered = input_filter(handoff_input_data) + if inspect.isawaitable(filtered): + filtered = await filtered if not isinstance(filtered, HandoffInputData): _error_tracing.attach_error_to_span( span_handoff, @@ -809,6 +1044,8 @@ async def execute_handoffs( pre_step_items=pre_step_items, new_step_items=new_step_items, next_step=NextStepHandoff(new_agent), + tool_input_guardrail_results=[], + tool_output_guardrail_results=[], ) @classmethod @@ -857,6 +1094,8 @@ async def execute_final_output( final_output: Any, hooks: RunHooks[TContext], context_wrapper: RunContextWrapper[TContext], + tool_input_guardrail_results: list[ToolInputGuardrailResult], + tool_output_guardrail_results: list[ToolOutputGuardrailResult], ) -> SingleStepResult: # Run the on_end hooks await cls.run_final_output_hooks(agent, hooks, context_wrapper, final_output) @@ -867,6 +1106,8 @@ async def execute_final_output( pre_step_items=pre_step_items, new_step_items=new_step_items, next_step=NextStepFinalOutput(final_output), + tool_input_guardrail_results=tool_input_guardrail_results, + tool_output_guardrail_results=tool_output_guardrail_results, ) @classmethod @@ -911,12 +1152,12 @@ async def run_single_output_guardrail( return result @classmethod - def stream_step_result_to_queue( + def stream_step_items_to_queue( cls, - step_result: SingleStepResult, + new_step_items: list[RunItem], queue: asyncio.Queue[StreamEvent | QueueCompleteSentinel], ): - for item in step_result.new_step_items: + for item in new_step_items: if isinstance(item, MessageOutputItem): event = RunItemStreamEvent(item=item, name="message_output_created") elif isinstance(item, HandoffCallItem): @@ -931,6 +1172,8 @@ def stream_step_result_to_queue( event = RunItemStreamEvent(item=item, name="reasoning_item_created") elif isinstance(item, MCPApprovalRequestItem): event = RunItemStreamEvent(item=item, name="mcp_approval_requested") + elif isinstance(item, MCPApprovalResponseItem): + event = RunItemStreamEvent(item=item, name="mcp_approval_response") elif isinstance(item, MCPListToolsItem): event = RunItemStreamEvent(item=item, name="mcp_list_tools") @@ -941,6 +1184,14 @@ def stream_step_result_to_queue( if event: queue.put_nowait(event) + @classmethod + def stream_step_result_to_queue( + cls, + step_result: SingleStepResult, + queue: asyncio.Queue[StreamEvent | QueueCompleteSentinel], + ): + cls.stream_step_items_to_queue(step_result.new_step_items, queue) + @classmethod async def _check_for_final_output_from_tools( cls, @@ -950,7 +1201,10 @@ async def _check_for_final_output_from_tools( context_wrapper: RunContextWrapper[TContext], config: RunConfig, ) -> ToolsToFinalOutputResult: - """Returns (i, final_output).""" + """Determine if tool results should produce a final output. + Returns: + ToolsToFinalOutputResult: Indicates whether final output is ready, and the output value. + """ if not tool_results: return _NOT_FINAL_OUTPUT @@ -1171,11 +1425,30 @@ async def execute( return ToolCallOutputItem( agent=agent, - output=output, - raw_item={ + output=result, + # LocalShellCallOutput type uses the field name "id", but the server wants "call_id". + # raw_item keeps the upstream type, so we ignore the type checker here. + raw_item={ # type: ignore[misc, arg-type] "type": "local_shell_call_output", - "id": call.tool_call.call_id, + "call_id": call.tool_call.call_id, "output": result, - # "id": "out" + call.tool_call.id, # TODO remove this, it should be optional }, ) + + +def _build_litellm_json_tool_call(output: ResponseFunctionToolCall) -> FunctionTool: + async def on_invoke_tool(_ctx: ToolContext[Any], value: Any) -> Any: + if isinstance(value, str): + import json + + return json.loads(value) + return value + + return FunctionTool( + name=output.name, + description=output.name, + params_json_schema={}, + on_invoke_tool=on_invoke_tool, + strict_json_schema=True, + is_enabled=True, + ) diff --git a/src/agents/agent.py b/src/agents/agent.py index 9c107a81b..a061926b1 100644 --- a/src/agents/agent.py +++ b/src/agents/agent.py @@ -17,6 +17,11 @@ from .logger import logger from .mcp import MCPUtil from .model_settings import ModelSettings +from .models.default_models import ( + get_default_model_settings, + gpt_5_reasoning_settings_required, + is_gpt_5_default, +) from .models.interface import Model from .prompts import DynamicPromptFunction, Prompt, PromptUtil from .run_context import RunContextWrapper, TContext @@ -25,9 +30,11 @@ from .util._types import MaybeAwaitable if TYPE_CHECKING: - from .lifecycle import AgentHooks + from .lifecycle import AgentHooks, RunHooks from .mcp import MCPServer + from .memory.session import Session from .result import RunResult + from .run import RunConfig @dataclass @@ -101,7 +108,7 @@ async def get_mcp_tools(self, run_context: RunContextWrapper[TContext]) -> list[ self.mcp_servers, convert_schemas_to_strict, run_context, self ) - async def get_all_tools(self, run_context: RunContextWrapper[Any]) -> list[Tool]: + async def get_all_tools(self, run_context: RunContextWrapper[TContext]) -> list[Tool]: """All agent tools, including MCP tools and function tools.""" mcp_tools = await self.get_mcp_tools(run_context) @@ -158,7 +165,7 @@ class Agent(AgentBase, Generic[TContext]): usable with OpenAI models, using the Responses API. """ - handoffs: list[Agent[Any] | Handoff[TContext]] = field(default_factory=list) + handoffs: list[Agent[Any] | Handoff[TContext, Any]] = field(default_factory=list) """Handoffs are sub-agents that the agent can delegate to. You can provide a list of handoffs, and the agent can choose to delegate to them if relevant. Allows for separation of concerns and modularity. @@ -168,10 +175,10 @@ class Agent(AgentBase, Generic[TContext]): """The model implementation to use when invoking the LLM. By default, if not set, the agent will use the default model configured in - `openai_provider.DEFAULT_MODEL` (currently "gpt-4o"). + `agents.models.get_default_model()` (currently "gpt-4.1"). """ - model_settings: ModelSettings = field(default_factory=ModelSettings) + model_settings: ModelSettings = field(default_factory=get_default_model_settings) """Configures model-specific tuning parameters (e.g. temperature, top_p). """ @@ -201,31 +208,174 @@ class Agent(AgentBase, Generic[TContext]): tool_use_behavior: ( Literal["run_llm_again", "stop_on_first_tool"] | StopAtTools | ToolsToFinalOutputFunction ) = "run_llm_again" - """This lets you configure how tool use is handled. + """ + This lets you configure how tool use is handled. - "run_llm_again": The default behavior. Tools are run, and then the LLM receives the results and gets to respond. - - "stop_on_first_tool": The output of the first tool call is used as the final output. This - means that the LLM does not process the result of the tool call. - - A list of tool names: The agent will stop running if any of the tools in the list are called. - The final output will be the output of the first matching tool call. The LLM does not - process the result of the tool call. + - "stop_on_first_tool": The output from the first tool call is treated as the final result. + In other words, it isn’t sent back to the LLM for further processing but is used directly + as the final output. + - A StopAtTools object: The agent will stop running if any of the tools listed in + `stop_at_tool_names` is called. + The final output will be the output of the first matching tool call. + The LLM does not process the result of the tool call. - A function: If you pass a function, it will be called with the run context and the list of tool results. It must return a `ToolsToFinalOutputResult`, which determines whether the tool calls result in a final output. NOTE: This configuration is specific to FunctionTools. Hosted tools, such as file search, - web search, etc are always processed by the LLM. + web search, etc. are always processed by the LLM. """ reset_tool_choice: bool = True """Whether to reset the tool choice to the default value after a tool has been called. Defaults to True. This ensures that the agent doesn't enter an infinite loop of tool usage.""" + def __post_init__(self): + from typing import get_origin + + if not isinstance(self.name, str): + raise TypeError(f"Agent name must be a string, got {type(self.name).__name__}") + + if self.handoff_description is not None and not isinstance(self.handoff_description, str): + raise TypeError( + f"Agent handoff_description must be a string or None, " + f"got {type(self.handoff_description).__name__}" + ) + + if not isinstance(self.tools, list): + raise TypeError(f"Agent tools must be a list, got {type(self.tools).__name__}") + + if not isinstance(self.mcp_servers, list): + raise TypeError( + f"Agent mcp_servers must be a list, got {type(self.mcp_servers).__name__}" + ) + + if not isinstance(self.mcp_config, dict): + raise TypeError( + f"Agent mcp_config must be a dict, got {type(self.mcp_config).__name__}" + ) + + if ( + self.instructions is not None + and not isinstance(self.instructions, str) + and not callable(self.instructions) + ): + raise TypeError( + f"Agent instructions must be a string, callable, or None, " + f"got {type(self.instructions).__name__}" + ) + + if ( + self.prompt is not None + and not callable(self.prompt) + and not hasattr(self.prompt, "get") + ): + raise TypeError( + f"Agent prompt must be a Prompt, DynamicPromptFunction, or None, " + f"got {type(self.prompt).__name__}" + ) + + if not isinstance(self.handoffs, list): + raise TypeError(f"Agent handoffs must be a list, got {type(self.handoffs).__name__}") + + if self.model is not None and not isinstance(self.model, str): + from .models.interface import Model + + if not isinstance(self.model, Model): + raise TypeError( + f"Agent model must be a string, Model, or None, got {type(self.model).__name__}" + ) + + if not isinstance(self.model_settings, ModelSettings): + raise TypeError( + f"Agent model_settings must be a ModelSettings instance, " + f"got {type(self.model_settings).__name__}" + ) + + if ( + # The user sets a non-default model + self.model is not None + and ( + # The default model is gpt-5 + is_gpt_5_default() is True + # However, the specified model is not a gpt-5 model + and ( + isinstance(self.model, str) is False + or gpt_5_reasoning_settings_required(self.model) is False # type: ignore + ) + # The model settings are not customized for the specified model + and self.model_settings == get_default_model_settings() + ) + ): + # In this scenario, we should use a generic model settings + # because non-gpt-5 models are not compatible with the default gpt-5 model settings. + # This is a best-effort attempt to make the agent work with non-gpt-5 models. + self.model_settings = ModelSettings() + + if not isinstance(self.input_guardrails, list): + raise TypeError( + f"Agent input_guardrails must be a list, got {type(self.input_guardrails).__name__}" + ) + + if not isinstance(self.output_guardrails, list): + raise TypeError( + f"Agent output_guardrails must be a list, " + f"got {type(self.output_guardrails).__name__}" + ) + + if self.output_type is not None: + from .agent_output import AgentOutputSchemaBase + + if not ( + isinstance(self.output_type, (type, AgentOutputSchemaBase)) + or get_origin(self.output_type) is not None + ): + raise TypeError( + f"Agent output_type must be a type, AgentOutputSchemaBase, or None, " + f"got {type(self.output_type).__name__}" + ) + + if self.hooks is not None: + from .lifecycle import AgentHooksBase + + if not isinstance(self.hooks, AgentHooksBase): + raise TypeError( + f"Agent hooks must be an AgentHooks instance or None, " + f"got {type(self.hooks).__name__}" + ) + + if ( + not ( + isinstance(self.tool_use_behavior, str) + and self.tool_use_behavior in ["run_llm_again", "stop_on_first_tool"] + ) + and not isinstance(self.tool_use_behavior, dict) + and not callable(self.tool_use_behavior) + ): + raise TypeError( + f"Agent tool_use_behavior must be 'run_llm_again', 'stop_on_first_tool', " + f"StopAtTools dict, or callable, got {type(self.tool_use_behavior).__name__}" + ) + + if not isinstance(self.reset_tool_choice, bool): + raise TypeError( + f"Agent reset_tool_choice must be a boolean, " + f"got {type(self.reset_tool_choice).__name__}" + ) + def clone(self, **kwargs: Any) -> Agent[TContext]: - """Make a copy of the agent, with the given arguments changed. For example, you could do: - ``` - new_agent = agent.clone(instructions="New instructions") - ``` + """Make a copy of the agent, with the given arguments changed. + Notes: + - Uses `dataclasses.replace`, which performs a **shallow copy**. + - Mutable attributes like `tools` and `handoffs` are shallow-copied: + new list objects are created only if overridden, but their contents + (tool functions and handoff objects) are shared with the original. + - To modify these independently, pass new lists when calling `clone()`. + Example: + ```python + new_agent = agent.clone(instructions="New instructions") + ``` """ return dataclasses.replace(self, **kwargs) @@ -234,6 +384,14 @@ def as_tool( tool_name: str | None, tool_description: str | None, custom_output_extractor: Callable[[RunResult], Awaitable[str]] | None = None, + is_enabled: bool + | Callable[[RunContextWrapper[Any], AgentBase[Any]], MaybeAwaitable[bool]] = True, + run_config: RunConfig | None = None, + max_turns: int | None = None, + hooks: RunHooks[TContext] | None = None, + previous_response_id: str | None = None, + conversation_id: str | None = None, + session: Session | None = None, ) -> Tool: """Transform this agent into a tool, callable by other agents. @@ -249,19 +407,31 @@ def as_tool( when to use it. custom_output_extractor: A function that extracts the output from the agent. If not provided, the last message from the agent will be used. + is_enabled: Whether the tool is enabled. Can be a bool or a callable that takes the run + context and agent and returns whether the tool is enabled. Disabled tools are hidden + from the LLM at runtime. """ @function_tool( name_override=tool_name or _transforms.transform_string_function_style(self.name), description_override=tool_description or "", + is_enabled=is_enabled, ) async def run_agent(context: RunContextWrapper, input: str) -> str: - from .run import Runner + from .run import DEFAULT_MAX_TURNS, Runner + + resolved_max_turns = max_turns if max_turns is not None else DEFAULT_MAX_TURNS output = await Runner.run( starting_agent=self, input=input, context=context.context, + run_config=run_config, + max_turns=resolved_max_turns, + hooks=hooks, + previous_response_id=previous_response_id, + conversation_id=conversation_id, + session=session, ) if custom_output_extractor: return await custom_output_extractor(output) @@ -271,16 +441,31 @@ async def run_agent(context: RunContextWrapper, input: str) -> str: return run_agent async def get_system_prompt(self, run_context: RunContextWrapper[TContext]) -> str | None: - """Get the system prompt for the agent.""" if isinstance(self.instructions, str): return self.instructions elif callable(self.instructions): + # Inspect the signature of the instructions function + sig = inspect.signature(self.instructions) + params = list(sig.parameters.values()) + + # Enforce exactly 2 parameters + if len(params) != 2: + raise TypeError( + f"'instructions' callable must accept exactly 2 arguments (context, agent), " + f"but got {len(params)}: {[p.name for p in params]}" + ) + + # Call the instructions function properly if inspect.iscoroutinefunction(self.instructions): return await cast(Awaitable[str], self.instructions(run_context, self)) else: return cast(str, self.instructions(run_context, self)) + elif self.instructions is not None: - logger.error(f"Instructions must be a string or a function, got {self.instructions}") + logger.error( + f"Instructions must be a string or a callable function, " + f"got {type(self.instructions).__name__}" + ) return None @@ -289,30 +474,3 @@ async def get_prompt( ) -> ResponsePromptParam | None: """Get the prompt for the agent.""" return await PromptUtil.to_model_input(self.prompt, run_context, self) - - async def get_mcp_tools(self, run_context: RunContextWrapper[TContext]) -> list[Tool]: - """Fetches the available tools from the MCP servers.""" - convert_schemas_to_strict = self.mcp_config.get("convert_schemas_to_strict", False) - return await MCPUtil.get_all_function_tools( - self.mcp_servers, convert_schemas_to_strict, run_context, self - ) - - async def get_all_tools(self, run_context: RunContextWrapper[Any]) -> list[Tool]: - """All agent tools, including MCP tools and function tools.""" - mcp_tools = await self.get_mcp_tools(run_context) - - async def _check_tool_enabled(tool: Tool) -> bool: - if not isinstance(tool, FunctionTool): - return True - - attr = tool.is_enabled - if isinstance(attr, bool): - return attr - res = attr(run_context, self) - if inspect.isawaitable(res): - return bool(await res) - return bool(res) - - results = await asyncio.gather(*(_check_tool_enabled(t) for t in self.tools)) - enabled: list[Tool] = [t for t, ok in zip(self.tools, results) if ok] - return [*mcp_tools, *enabled] diff --git a/src/agents/agent_output.py b/src/agents/agent_output.py index ee14956e3..61d4a1c26 100644 --- a/src/agents/agent_output.py +++ b/src/agents/agent_output.py @@ -115,8 +115,8 @@ def __init__(self, output_type: type[Any], strict_json_schema: bool = True): except UserError as e: raise UserError( "Strict JSON schema is enabled, but the output type is not valid. " - "Either make the output type strict, or pass output_schema_strict=False to " - "your Agent()" + "Either make the output type strict, " + "or wrap your type with AgentOutputSchema(YourType, strict_json_schema=False)" ) from e def is_plain_text(self) -> bool: diff --git a/src/agents/exceptions.py b/src/agents/exceptions.py index c00024c2e..39518c39d 100644 --- a/src/agents/exceptions.py +++ b/src/agents/exceptions.py @@ -8,6 +8,11 @@ from .guardrail import InputGuardrailResult, OutputGuardrailResult from .items import ModelResponse, RunItem, TResponseInputItem from .run_context import RunContextWrapper + from .tool_guardrails import ( + ToolGuardrailFunctionOutput, + ToolInputGuardrail, + ToolOutputGuardrail, + ) from .util._pretty_print import pretty_print_run_error_details @@ -94,3 +99,33 @@ def __init__(self, guardrail_result: OutputGuardrailResult): super().__init__( f"Guardrail {guardrail_result.guardrail.__class__.__name__} triggered tripwire" ) + + +class ToolInputGuardrailTripwireTriggered(AgentsException): + """Exception raised when a tool input guardrail tripwire is triggered.""" + + guardrail: ToolInputGuardrail[Any] + """The guardrail that was triggered.""" + + output: ToolGuardrailFunctionOutput + """The output from the guardrail function.""" + + def __init__(self, guardrail: ToolInputGuardrail[Any], output: ToolGuardrailFunctionOutput): + self.guardrail = guardrail + self.output = output + super().__init__(f"Tool input guardrail {guardrail.__class__.__name__} triggered tripwire") + + +class ToolOutputGuardrailTripwireTriggered(AgentsException): + """Exception raised when a tool output guardrail tripwire is triggered.""" + + guardrail: ToolOutputGuardrail[Any] + """The guardrail that was triggered.""" + + output: ToolGuardrailFunctionOutput + """The output from the guardrail function.""" + + def __init__(self, guardrail: ToolOutputGuardrail[Any], output: ToolGuardrailFunctionOutput): + self.guardrail = guardrail + self.output = output + super().__init__(f"Tool output guardrail {guardrail.__class__.__name__} triggered tripwire") diff --git a/src/agents/extensions/handoff_filters.py b/src/agents/extensions/handoff_filters.py index f4f9b8bf6..a4433ae0c 100644 --- a/src/agents/extensions/handoff_filters.py +++ b/src/agents/extensions/handoff_filters.py @@ -4,6 +4,7 @@ from ..items import ( HandoffCallItem, HandoffOutputItem, + ReasoningItem, RunItem, ToolCallItem, ToolCallOutputItem, @@ -29,6 +30,7 @@ def remove_all_tools(handoff_input_data: HandoffInputData) -> HandoffInputData: input_history=filtered_history, pre_handoff_items=filtered_pre_handoff_items, new_items=filtered_new_items, + run_context=handoff_input_data.run_context, ) @@ -40,6 +42,7 @@ def _remove_tools_from_items(items: tuple[RunItem, ...]) -> tuple[RunItem, ...]: or isinstance(item, HandoffOutputItem) or isinstance(item, ToolCallItem) or isinstance(item, ToolCallOutputItem) + or isinstance(item, ReasoningItem) ): continue filtered_items.append(item) diff --git a/src/agents/extensions/memory/__init__.py b/src/agents/extensions/memory/__init__.py new file mode 100644 index 000000000..5d670c4ad --- /dev/null +++ b/src/agents/extensions/memory/__init__.py @@ -0,0 +1,63 @@ +"""Session memory backends living in the extensions namespace. + +This package contains optional, production-grade session implementations that +introduce extra third-party dependencies (database drivers, ORMs, etc.). They +conform to the :class:`agents.memory.session.Session` protocol so they can be +used as a drop-in replacement for :class:`agents.memory.session.SQLiteSession`. +""" + +from __future__ import annotations + +from typing import Any + +__all__: list[str] = [ + "EncryptedSession", + "RedisSession", + "SQLAlchemySession", + "AdvancedSQLiteSession", +] + + +def __getattr__(name: str) -> Any: + if name == "EncryptedSession": + try: + from .encrypt_session import EncryptedSession # noqa: F401 + + return EncryptedSession + except ModuleNotFoundError as e: + raise ImportError( + "EncryptedSession requires the 'cryptography' extra. " + "Install it with: pip install openai-agents[encrypt]" + ) from e + + if name == "RedisSession": + try: + from .redis_session import RedisSession # noqa: F401 + + return RedisSession + except ModuleNotFoundError as e: + raise ImportError( + "RedisSession requires the 'redis' extra. " + "Install it with: pip install openai-agents[redis]" + ) from e + + if name == "SQLAlchemySession": + try: + from .sqlalchemy_session import SQLAlchemySession # noqa: F401 + + return SQLAlchemySession + except ModuleNotFoundError as e: + raise ImportError( + "SQLAlchemySession requires the 'sqlalchemy' extra. " + "Install it with: pip install openai-agents[sqlalchemy]" + ) from e + + if name == "AdvancedSQLiteSession": + try: + from .advanced_sqlite_session import AdvancedSQLiteSession # noqa: F401 + + return AdvancedSQLiteSession + except ModuleNotFoundError as e: + raise ImportError(f"Failed to import AdvancedSQLiteSession: {e}") from e + + raise AttributeError(f"module {__name__} has no attribute {name}") diff --git a/src/agents/extensions/memory/advanced_sqlite_session.py b/src/agents/extensions/memory/advanced_sqlite_session.py new file mode 100644 index 000000000..fefb73026 --- /dev/null +++ b/src/agents/extensions/memory/advanced_sqlite_session.py @@ -0,0 +1,1285 @@ +from __future__ import annotations + +import asyncio +import json +import logging +import threading +from contextlib import closing +from pathlib import Path +from typing import Any, Union, cast + +from agents.result import RunResult +from agents.usage import Usage + +from ...items import TResponseInputItem +from ...memory import SQLiteSession + + +class AdvancedSQLiteSession(SQLiteSession): + """Enhanced SQLite session with conversation branching and usage analytics.""" + + def __init__( + self, + *, + session_id: str, + db_path: str | Path = ":memory:", + create_tables: bool = False, + logger: logging.Logger | None = None, + **kwargs, + ): + """Initialize the AdvancedSQLiteSession. + + Args: + session_id: The ID of the session + db_path: The path to the SQLite database file. Defaults to `:memory:` for in-memory storage + create_tables: Whether to create the structure tables + logger: The logger to use. Defaults to the module logger + **kwargs: Additional keyword arguments to pass to the superclass + """ # noqa: E501 + super().__init__(session_id, db_path, **kwargs) + if create_tables: + self._init_structure_tables() + self._current_branch_id = "main" + self._logger = logger or logging.getLogger(__name__) + + def _init_structure_tables(self): + """Add structure and usage tracking tables. + + Creates the message_structure and turn_usage tables with appropriate + indexes for conversation branching and usage analytics. + """ + conn = self._get_connection() + + # Message structure with branch support + conn.execute(""" + CREATE TABLE IF NOT EXISTS message_structure ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + session_id TEXT NOT NULL, + message_id INTEGER NOT NULL, + branch_id TEXT NOT NULL DEFAULT 'main', + message_type TEXT NOT NULL, + sequence_number INTEGER NOT NULL, + user_turn_number INTEGER, + branch_turn_number INTEGER, + tool_name TEXT, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (session_id) REFERENCES agent_sessions(session_id) ON DELETE CASCADE, + FOREIGN KEY (message_id) REFERENCES agent_messages(id) ON DELETE CASCADE + ) + """) + + # Turn-level usage tracking with branch support and full JSON details + conn.execute(""" + CREATE TABLE IF NOT EXISTS turn_usage ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + session_id TEXT NOT NULL, + branch_id TEXT NOT NULL DEFAULT 'main', + user_turn_number INTEGER NOT NULL, + requests INTEGER DEFAULT 0, + input_tokens INTEGER DEFAULT 0, + output_tokens INTEGER DEFAULT 0, + total_tokens INTEGER DEFAULT 0, + input_tokens_details JSON, + output_tokens_details JSON, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (session_id) REFERENCES agent_sessions(session_id) ON DELETE CASCADE, + UNIQUE(session_id, branch_id, user_turn_number) + ) + """) + + # Indexes + conn.execute(""" + CREATE INDEX IF NOT EXISTS idx_structure_session_seq + ON message_structure(session_id, sequence_number) + """) + conn.execute(""" + CREATE INDEX IF NOT EXISTS idx_structure_branch + ON message_structure(session_id, branch_id) + """) + conn.execute(""" + CREATE INDEX IF NOT EXISTS idx_structure_turn + ON message_structure(session_id, branch_id, user_turn_number) + """) + conn.execute(""" + CREATE INDEX IF NOT EXISTS idx_structure_branch_seq + ON message_structure(session_id, branch_id, sequence_number) + """) + conn.execute(""" + CREATE INDEX IF NOT EXISTS idx_turn_usage_session_turn + ON turn_usage(session_id, branch_id, user_turn_number) + """) + + conn.commit() + + async def add_items(self, items: list[TResponseInputItem]) -> None: + """Add items to the session. + + Args: + items: The items to add to the session + """ + # Add to base table first + await super().add_items(items) + + # Extract structure metadata with precise sequencing + if items: + await self._add_structure_metadata(items) + + async def get_items( + self, + limit: int | None = None, + branch_id: str | None = None, + ) -> list[TResponseInputItem]: + """Get items from current or specified branch. + + Args: + limit: Maximum number of items to return. If None, returns all items. + branch_id: Branch to get items from. If None, uses current branch. + + Returns: + List of conversation items from the specified branch. + """ + if branch_id is None: + branch_id = self._current_branch_id + + # Get all items for this branch + def _get_all_items_sync(): + """Synchronous helper to get all items for a branch.""" + conn = self._get_connection() + # TODO: Refactor SQLiteSession to use asyncio.Lock instead of threading.Lock and update this code # noqa: E501 + with self._lock if self._is_memory_db else threading.Lock(): + with closing(conn.cursor()) as cursor: + if limit is None: + cursor.execute( + """ + SELECT m.message_data + FROM agent_messages m + JOIN message_structure s ON m.id = s.message_id + WHERE m.session_id = ? AND s.branch_id = ? + ORDER BY s.sequence_number ASC + """, + (self.session_id, branch_id), + ) + else: + cursor.execute( + """ + SELECT m.message_data + FROM agent_messages m + JOIN message_structure s ON m.id = s.message_id + WHERE m.session_id = ? AND s.branch_id = ? + ORDER BY s.sequence_number DESC + LIMIT ? + """, + (self.session_id, branch_id, limit), + ) + + rows = cursor.fetchall() + if limit is not None: + rows = list(reversed(rows)) + + items = [] + for (message_data,) in rows: + try: + item = json.loads(message_data) + items.append(item) + except json.JSONDecodeError: + continue + return items + + return await asyncio.to_thread(_get_all_items_sync) + + def _get_items_sync(): + """Synchronous helper to get items for a specific branch.""" + conn = self._get_connection() + # TODO: Refactor SQLiteSession to use asyncio.Lock instead of threading.Lock and update this code # noqa: E501 + with self._lock if self._is_memory_db else threading.Lock(): + with closing(conn.cursor()) as cursor: + # Get message IDs in correct order for this branch + if limit is None: + cursor.execute( + """ + SELECT m.message_data + FROM agent_messages m + JOIN message_structure s ON m.id = s.message_id + WHERE m.session_id = ? AND s.branch_id = ? + ORDER BY s.sequence_number ASC + """, + (self.session_id, branch_id), + ) + else: + cursor.execute( + """ + SELECT m.message_data + FROM agent_messages m + JOIN message_structure s ON m.id = s.message_id + WHERE m.session_id = ? AND s.branch_id = ? + ORDER BY s.sequence_number DESC + LIMIT ? + """, + (self.session_id, branch_id, limit), + ) + + rows = cursor.fetchall() + if limit is not None: + rows = list(reversed(rows)) + + items = [] + for (message_data,) in rows: + try: + item = json.loads(message_data) + items.append(item) + except json.JSONDecodeError: + continue + return items + + return await asyncio.to_thread(_get_items_sync) + + async def store_run_usage(self, result: RunResult) -> None: + """Store usage data for the current conversation turn. + + This is designed to be called after `Runner.run()` completes. + Session-level usage can be aggregated from turn data when needed. + + Args: + result: The result from the run + """ + try: + if result.context_wrapper.usage is not None: + # Get the current turn number for this branch + current_turn = self._get_current_turn_number() + # Only update turn-level usage - session usage is aggregated on demand + await self._update_turn_usage_internal(current_turn, result.context_wrapper.usage) + except Exception as e: + self._logger.error(f"Failed to store usage for session {self.session_id}: {e}") + + def _get_next_turn_number(self, branch_id: str) -> int: + """Get the next turn number for a specific branch. + + Args: + branch_id: The branch ID to get the next turn number for. + + Returns: + The next available turn number for the specified branch. + """ + conn = self._get_connection() + with closing(conn.cursor()) as cursor: + cursor.execute( + """ + SELECT COALESCE(MAX(user_turn_number), 0) + FROM message_structure + WHERE session_id = ? AND branch_id = ? + """, + (self.session_id, branch_id), + ) + result = cursor.fetchone() + max_turn = result[0] if result else 0 + return max_turn + 1 + + def _get_next_branch_turn_number(self, branch_id: str) -> int: + """Get the next branch turn number for a specific branch. + + Args: + branch_id: The branch ID to get the next branch turn number for. + + Returns: + The next available branch turn number for the specified branch. + """ + conn = self._get_connection() + with closing(conn.cursor()) as cursor: + cursor.execute( + """ + SELECT COALESCE(MAX(branch_turn_number), 0) + FROM message_structure + WHERE session_id = ? AND branch_id = ? + """, + (self.session_id, branch_id), + ) + result = cursor.fetchone() + max_turn = result[0] if result else 0 + return max_turn + 1 + + def _get_current_turn_number(self) -> int: + """Get the current turn number for the current branch. + + Returns: + The current turn number for the active branch. + """ + conn = self._get_connection() + with closing(conn.cursor()) as cursor: + cursor.execute( + """ + SELECT COALESCE(MAX(user_turn_number), 0) + FROM message_structure + WHERE session_id = ? AND branch_id = ? + """, + (self.session_id, self._current_branch_id), + ) + result = cursor.fetchone() + return result[0] if result else 0 + + async def _add_structure_metadata(self, items: list[TResponseInputItem]) -> None: + """Extract structure metadata with branch-aware turn tracking. + + This method: + - Assigns turn numbers per branch (not globally) + - Assigns explicit sequence numbers for precise ordering + - Links messages to their database IDs for structure tracking + - Handles multiple user messages in a single batch correctly + + Args: + items: The items to add to the session + """ + + def _add_structure_sync(): + """Synchronous helper to add structure metadata to database.""" + conn = self._get_connection() + # TODO: Refactor SQLiteSession to use asyncio.Lock instead of threading.Lock and update this code # noqa: E501 + with self._lock if self._is_memory_db else threading.Lock(): + # Get the IDs of messages we just inserted, in order + with closing(conn.cursor()) as cursor: + cursor.execute( + f"SELECT id FROM {self.messages_table} " + f"WHERE session_id = ? ORDER BY id DESC LIMIT ?", + (self.session_id, len(items)), + ) + message_ids = [row[0] for row in cursor.fetchall()] + message_ids.reverse() # Match order of items + + # Get current max sequence number (global) + with closing(conn.cursor()) as cursor: + cursor.execute( + """ + SELECT COALESCE(MAX(sequence_number), 0) + FROM message_structure + WHERE session_id = ? + """, + (self.session_id,), + ) + seq_start = cursor.fetchone()[0] + + # Get current turn numbers atomically with a single query + with closing(conn.cursor()) as cursor: + cursor.execute( + """ + SELECT + COALESCE(MAX(user_turn_number), 0) as max_global_turn, + COALESCE(MAX(branch_turn_number), 0) as max_branch_turn + FROM message_structure + WHERE session_id = ? AND branch_id = ? + """, + (self.session_id, self._current_branch_id), + ) + result = cursor.fetchone() + current_turn = result[0] if result else 0 + current_branch_turn = result[1] if result else 0 + + # Process items and assign turn numbers correctly + structure_data = [] + user_message_count = 0 + + for i, (item, msg_id) in enumerate(zip(items, message_ids)): + msg_type = self._classify_message_type(item) + tool_name = self._extract_tool_name(item) + + # If this is a user message, increment turn counters + if self._is_user_message(item): + user_message_count += 1 + item_turn = current_turn + user_message_count + item_branch_turn = current_branch_turn + user_message_count + else: + # Non-user messages inherit the turn number of the most recent user message + item_turn = current_turn + user_message_count + item_branch_turn = current_branch_turn + user_message_count + + structure_data.append( + ( + self.session_id, + msg_id, + self._current_branch_id, + msg_type, + seq_start + i + 1, # Global sequence + item_turn, # Global turn number + item_branch_turn, # Branch-specific turn number + tool_name, + ) + ) + + with closing(conn.cursor()) as cursor: + cursor.executemany( + """ + INSERT INTO message_structure + (session_id, message_id, branch_id, message_type, sequence_number, + user_turn_number, branch_turn_number, tool_name) + VALUES (?, ?, ?, ?, ?, ?, ?, ?) + """, + structure_data, + ) + conn.commit() + + try: + await asyncio.to_thread(_add_structure_sync) + except Exception as e: + self._logger.error( + f"Failed to add structure metadata for session {self.session_id}: {e}" + ) + # Try to clean up any orphaned messages to maintain consistency + try: + await self._cleanup_orphaned_messages() + except Exception as cleanup_error: + self._logger.error(f"Failed to cleanup orphaned messages: {cleanup_error}") + # Don't re-raise - structure metadata is supplementary + + async def _cleanup_orphaned_messages(self) -> None: + """Remove messages that exist in agent_messages but not in message_structure. + + This can happen if _add_structure_metadata fails after super().add_items() succeeds. + Used for maintaining data consistency. + """ + + def _cleanup_sync(): + """Synchronous helper to cleanup orphaned messages.""" + conn = self._get_connection() + # TODO: Refactor SQLiteSession to use asyncio.Lock instead of threading.Lock and update this code # noqa: E501 + with self._lock if self._is_memory_db else threading.Lock(): + with closing(conn.cursor()) as cursor: + # Find messages without structure metadata + cursor.execute( + """ + SELECT am.id + FROM agent_messages am + LEFT JOIN message_structure ms ON am.id = ms.message_id + WHERE am.session_id = ? AND ms.message_id IS NULL + """, + (self.session_id,), + ) + + orphaned_ids = [row[0] for row in cursor.fetchall()] + + if orphaned_ids: + # Delete orphaned messages + placeholders = ",".join("?" * len(orphaned_ids)) + cursor.execute( + f"DELETE FROM agent_messages WHERE id IN ({placeholders})", orphaned_ids + ) + + deleted_count = cursor.rowcount + conn.commit() + + self._logger.info(f"Cleaned up {deleted_count} orphaned messages") + return deleted_count + + return 0 + + return await asyncio.to_thread(_cleanup_sync) + + def _classify_message_type(self, item: TResponseInputItem) -> str: + """Classify the type of a message item. + + Args: + item: The message item to classify. + + Returns: + String representing the message type (user, assistant, etc.). + """ + if isinstance(item, dict): + if item.get("role") == "user": + return "user" + elif item.get("role") == "assistant": + return "assistant" + elif item.get("type"): + return str(item.get("type")) + return "other" + + def _extract_tool_name(self, item: TResponseInputItem) -> str | None: + """Extract tool name if this is a tool call/output. + + Args: + item: The message item to extract tool name from. + + Returns: + Tool name if item is a tool call, None otherwise. + """ + if isinstance(item, dict): + item_type = item.get("type") + + # For MCP tools, try to extract from server_label if available + if item_type in {"mcp_call", "mcp_approval_request"} and "server_label" in item: + server_label = item.get("server_label") + tool_name = item.get("name") + if tool_name and server_label: + return f"{server_label}.{tool_name}" + elif server_label: + return str(server_label) + elif tool_name: + return str(tool_name) + + # For tool types without a 'name' field, derive from the type + elif item_type in { + "computer_call", + "file_search_call", + "web_search_call", + "code_interpreter_call", + }: + return item_type + + # Most other tool calls have a 'name' field + elif "name" in item: + name = item.get("name") + return str(name) if name is not None else None + + return None + + def _is_user_message(self, item: TResponseInputItem) -> bool: + """Check if this is a user message. + + Args: + item: The message item to check. + + Returns: + True if the item is a user message, False otherwise. + """ + return isinstance(item, dict) and item.get("role") == "user" + + async def create_branch_from_turn( + self, turn_number: int, branch_name: str | None = None + ) -> str: + """Create a new branch starting from a specific user message turn. + + Args: + turn_number: The branch turn number of the user message to branch from + branch_name: Optional name for the branch (auto-generated if None) + + Returns: + The branch_id of the newly created branch + + Raises: + ValueError: If turn doesn't exist or doesn't contain a user message + """ + import time + + # Validate the turn exists and contains a user message + def _validate_turn(): + """Synchronous helper to validate turn exists and contains user message.""" + conn = self._get_connection() + with closing(conn.cursor()) as cursor: + cursor.execute( + """ + SELECT am.message_data + FROM message_structure ms + JOIN agent_messages am ON ms.message_id = am.id + WHERE ms.session_id = ? AND ms.branch_id = ? + AND ms.branch_turn_number = ? AND ms.message_type = 'user' + """, + (self.session_id, self._current_branch_id, turn_number), + ) + + result = cursor.fetchone() + if not result: + raise ValueError( + f"Turn {turn_number} does not contain a user message " + f"in branch '{self._current_branch_id}'" + ) + + message_data = result[0] + try: + content = json.loads(message_data).get("content", "") + return content[:50] + "..." if len(content) > 50 else content + except Exception: + return "Unable to parse content" + + turn_content = await asyncio.to_thread(_validate_turn) + + # Generate branch name if not provided + if branch_name is None: + timestamp = int(time.time()) + branch_name = f"branch_from_turn_{turn_number}_{timestamp}" + + # Copy messages before the branch point to the new branch + await self._copy_messages_to_new_branch(branch_name, turn_number) + + # Switch to new branch + old_branch = self._current_branch_id + self._current_branch_id = branch_name + + self._logger.debug( + f"Created branch '{branch_name}' from turn {turn_number} ('{turn_content}') in '{old_branch}'" # noqa: E501 + ) + return branch_name + + async def create_branch_from_content( + self, search_term: str, branch_name: str | None = None + ) -> str: + """Create branch from the first user turn matching the search term. + + Args: + search_term: Text to search for in user messages. + branch_name: Optional name for the branch (auto-generated if None). + + Returns: + The branch_id of the newly created branch. + + Raises: + ValueError: If no matching turns are found. + """ + matching_turns = await self.find_turns_by_content(search_term) + if not matching_turns: + raise ValueError(f"No user turns found containing '{search_term}'") + + # Use the first (earliest) match + turn_number = matching_turns[0]["turn"] + return await self.create_branch_from_turn(turn_number, branch_name) + + async def switch_to_branch(self, branch_id: str) -> None: + """Switch to a different branch. + + Args: + branch_id: The branch to switch to. + + Raises: + ValueError: If the branch doesn't exist. + """ + + # Validate branch exists + def _validate_branch(): + """Synchronous helper to validate branch exists.""" + conn = self._get_connection() + with closing(conn.cursor()) as cursor: + cursor.execute( + """ + SELECT COUNT(*) FROM message_structure + WHERE session_id = ? AND branch_id = ? + """, + (self.session_id, branch_id), + ) + + count = cursor.fetchone()[0] + if count == 0: + raise ValueError(f"Branch '{branch_id}' does not exist") + + await asyncio.to_thread(_validate_branch) + + old_branch = self._current_branch_id + self._current_branch_id = branch_id + self._logger.info(f"Switched from branch '{old_branch}' to '{branch_id}'") + + async def delete_branch(self, branch_id: str, force: bool = False) -> None: + """Delete a branch and all its associated data. + + Args: + branch_id: The branch to delete. + force: If True, allows deleting the current branch (will switch to 'main'). + + Raises: + ValueError: If branch doesn't exist, is 'main', or is current branch without force. + """ + if not branch_id or not branch_id.strip(): + raise ValueError("Branch ID cannot be empty") + + branch_id = branch_id.strip() + + # Protect main branch + if branch_id == "main": + raise ValueError("Cannot delete the 'main' branch") + + # Check if trying to delete current branch + if branch_id == self._current_branch_id: + if not force: + raise ValueError( + f"Cannot delete current branch '{branch_id}'. Use force=True or switch branches first" # noqa: E501 + ) + else: + # Switch to main before deleting + await self.switch_to_branch("main") + + def _delete_sync(): + """Synchronous helper to delete branch and associated data.""" + conn = self._get_connection() + # TODO: Refactor SQLiteSession to use asyncio.Lock instead of threading.Lock and update this code # noqa: E501 + with self._lock if self._is_memory_db else threading.Lock(): + with closing(conn.cursor()) as cursor: + # First verify the branch exists + cursor.execute( + """ + SELECT COUNT(*) FROM message_structure + WHERE session_id = ? AND branch_id = ? + """, + (self.session_id, branch_id), + ) + + count = cursor.fetchone()[0] + if count == 0: + raise ValueError(f"Branch '{branch_id}' does not exist") + + # Delete from turn_usage first (foreign key constraint) + cursor.execute( + """ + DELETE FROM turn_usage + WHERE session_id = ? AND branch_id = ? + """, + (self.session_id, branch_id), + ) + + usage_deleted = cursor.rowcount + + # Delete from message_structure + cursor.execute( + """ + DELETE FROM message_structure + WHERE session_id = ? AND branch_id = ? + """, + (self.session_id, branch_id), + ) + + structure_deleted = cursor.rowcount + + conn.commit() + + return usage_deleted, structure_deleted + + usage_deleted, structure_deleted = await asyncio.to_thread(_delete_sync) + + self._logger.info( + f"Deleted branch '{branch_id}': {structure_deleted} message entries, {usage_deleted} usage entries" # noqa: E501 + ) + + async def list_branches(self) -> list[dict[str, Any]]: + """List all branches in this session. + + Returns: + List of dicts with branch info containing: + - 'branch_id': Branch identifier + - 'message_count': Number of messages in branch + - 'user_turns': Number of user turns in branch + - 'is_current': Whether this is the current branch + - 'created_at': When the branch was first created + """ + + def _list_branches_sync(): + """Synchronous helper to list all branches.""" + conn = self._get_connection() + with closing(conn.cursor()) as cursor: + cursor.execute( + """ + SELECT + ms.branch_id, + COUNT(*) as message_count, + COUNT(CASE WHEN ms.message_type = 'user' THEN 1 END) as user_turns, + MIN(ms.created_at) as created_at + FROM message_structure ms + WHERE ms.session_id = ? + GROUP BY ms.branch_id + ORDER BY created_at + """, + (self.session_id,), + ) + + branches = [] + for row in cursor.fetchall(): + branch_id, msg_count, user_turns, created_at = row + branches.append( + { + "branch_id": branch_id, + "message_count": msg_count, + "user_turns": user_turns, + "is_current": branch_id == self._current_branch_id, + "created_at": created_at, + } + ) + + return branches + + return await asyncio.to_thread(_list_branches_sync) + + async def _copy_messages_to_new_branch(self, new_branch_id: str, from_turn_number: int) -> None: + """Copy messages before the branch point to the new branch. + + Args: + new_branch_id: The ID of the new branch to copy messages to. + from_turn_number: The turn number to copy messages up to (exclusive). + """ + + def _copy_sync(): + """Synchronous helper to copy messages to new branch.""" + conn = self._get_connection() + # TODO: Refactor SQLiteSession to use asyncio.Lock instead of threading.Lock and update this code # noqa: E501 + with self._lock if self._is_memory_db else threading.Lock(): + with closing(conn.cursor()) as cursor: + # Get all messages before the branch point + cursor.execute( + """ + SELECT + ms.message_id, + ms.message_type, + ms.sequence_number, + ms.user_turn_number, + ms.branch_turn_number, + ms.tool_name + FROM message_structure ms + WHERE ms.session_id = ? AND ms.branch_id = ? + AND ms.branch_turn_number < ? + ORDER BY ms.sequence_number + """, + (self.session_id, self._current_branch_id, from_turn_number), + ) + + messages_to_copy = cursor.fetchall() + + if messages_to_copy: + # Get the max sequence number for the new inserts + cursor.execute( + """ + SELECT COALESCE(MAX(sequence_number), 0) + FROM message_structure + WHERE session_id = ? + """, + (self.session_id,), + ) + + seq_start = cursor.fetchone()[0] + + # Insert copied messages with new branch_id + new_structure_data = [] + for i, ( + msg_id, + msg_type, + _, + user_turn, + branch_turn, + tool_name, + ) in enumerate(messages_to_copy): + new_structure_data.append( + ( + self.session_id, + msg_id, # Same message_id (sharing the actual message data) + new_branch_id, + msg_type, + seq_start + i + 1, # New sequence number + user_turn, # Keep same global turn number + branch_turn, # Keep same branch turn number + tool_name, + ) + ) + + cursor.executemany( + """ + INSERT INTO message_structure + (session_id, message_id, branch_id, message_type, sequence_number, + user_turn_number, branch_turn_number, tool_name) + VALUES (?, ?, ?, ?, ?, ?, ?, ?) + """, + new_structure_data, + ) + + conn.commit() + + await asyncio.to_thread(_copy_sync) + + async def get_conversation_turns(self, branch_id: str | None = None) -> list[dict[str, Any]]: + """Get user turns with content for easy browsing and branching decisions. + + Args: + branch_id: Branch to get turns from (current branch if None). + + Returns: + List of dicts with turn info containing: + - 'turn': Branch turn number + - 'content': User message content (truncated) + - 'full_content': Full user message content + - 'timestamp': When the turn was created + - 'can_branch': Always True (all user messages can branch) + """ + if branch_id is None: + branch_id = self._current_branch_id + + def _get_turns_sync(): + """Synchronous helper to get conversation turns.""" + conn = self._get_connection() + with closing(conn.cursor()) as cursor: + cursor.execute( + """ + SELECT + ms.branch_turn_number, + am.message_data, + ms.created_at + FROM message_structure ms + JOIN agent_messages am ON ms.message_id = am.id + WHERE ms.session_id = ? AND ms.branch_id = ? + AND ms.message_type = 'user' + ORDER BY ms.branch_turn_number + """, + (self.session_id, branch_id), + ) + + turns = [] + for row in cursor.fetchall(): + turn_num, message_data, created_at = row + try: + content = json.loads(message_data).get("content", "") + turns.append( + { + "turn": turn_num, + "content": content[:100] + "..." if len(content) > 100 else content, + "full_content": content, + "timestamp": created_at, + "can_branch": True, + } + ) + except (json.JSONDecodeError, AttributeError): + continue + + return turns + + return await asyncio.to_thread(_get_turns_sync) + + async def find_turns_by_content( + self, search_term: str, branch_id: str | None = None + ) -> list[dict[str, Any]]: + """Find user turns containing specific content. + + Args: + search_term: Text to search for in user messages. + branch_id: Branch to search in (current branch if None). + + Returns: + List of matching turns with same format as get_conversation_turns(). + """ + if branch_id is None: + branch_id = self._current_branch_id + + def _search_sync(): + """Synchronous helper to search turns by content.""" + conn = self._get_connection() + with closing(conn.cursor()) as cursor: + cursor.execute( + """ + SELECT + ms.branch_turn_number, + am.message_data, + ms.created_at + FROM message_structure ms + JOIN agent_messages am ON ms.message_id = am.id + WHERE ms.session_id = ? AND ms.branch_id = ? + AND ms.message_type = 'user' + AND am.message_data LIKE ? + ORDER BY ms.branch_turn_number + """, + (self.session_id, branch_id, f"%{search_term}%"), + ) + + matches = [] + for row in cursor.fetchall(): + turn_num, message_data, created_at = row + try: + content = json.loads(message_data).get("content", "") + matches.append( + { + "turn": turn_num, + "content": content, + "full_content": content, + "timestamp": created_at, + "can_branch": True, + } + ) + except (json.JSONDecodeError, AttributeError): + continue + + return matches + + return await asyncio.to_thread(_search_sync) + + async def get_conversation_by_turns( + self, branch_id: str | None = None + ) -> dict[int, list[dict[str, str | None]]]: + """Get conversation grouped by user turns for specified branch. + + Args: + branch_id: Branch to get conversation from (current branch if None). + + Returns: + Dictionary mapping turn numbers to lists of message metadata. + """ + if branch_id is None: + branch_id = self._current_branch_id + + def _get_conversation_sync(): + """Synchronous helper to get conversation by turns.""" + conn = self._get_connection() + with closing(conn.cursor()) as cursor: + cursor.execute( + """ + SELECT user_turn_number, message_type, tool_name + FROM message_structure + WHERE session_id = ? AND branch_id = ? + ORDER BY sequence_number + """, + (self.session_id, branch_id), + ) + + turns: dict[int, list[dict[str, str | None]]] = {} + for row in cursor.fetchall(): + turn_num, msg_type, tool_name = row + if turn_num not in turns: + turns[turn_num] = [] + turns[turn_num].append({"type": msg_type, "tool_name": tool_name}) + return turns + + return await asyncio.to_thread(_get_conversation_sync) + + async def get_tool_usage(self, branch_id: str | None = None) -> list[tuple[str, int, int]]: + """Get all tool usage by turn for specified branch. + + Args: + branch_id: Branch to get tool usage from (current branch if None). + + Returns: + List of tuples containing (tool_name, usage_count, turn_number). + """ + if branch_id is None: + branch_id = self._current_branch_id + + def _get_tool_usage_sync(): + """Synchronous helper to get tool usage statistics.""" + conn = self._get_connection() + with closing(conn.cursor()) as cursor: + cursor.execute( + """ + SELECT tool_name, COUNT(*), user_turn_number + FROM message_structure + WHERE session_id = ? AND branch_id = ? AND message_type IN ( + 'tool_call', 'function_call', 'computer_call', 'file_search_call', + 'web_search_call', 'code_interpreter_call', 'custom_tool_call', + 'mcp_call', 'mcp_approval_request' + ) + GROUP BY tool_name, user_turn_number + ORDER BY user_turn_number + """, + (self.session_id, branch_id), + ) + return cursor.fetchall() + + return await asyncio.to_thread(_get_tool_usage_sync) + + async def get_session_usage(self, branch_id: str | None = None) -> dict[str, int] | None: + """Get cumulative usage for session or specific branch. + + Args: + branch_id: If provided, only get usage for that branch. If None, get all branches. + + Returns: + Dictionary with usage statistics or None if no usage data found. + """ + + def _get_usage_sync(): + """Synchronous helper to get session usage data.""" + conn = self._get_connection() + # TODO: Refactor SQLiteSession to use asyncio.Lock instead of threading.Lock and update this code # noqa: E501 + with self._lock if self._is_memory_db else threading.Lock(): + if branch_id: + # Branch-specific usage + query = """ + SELECT + SUM(requests) as total_requests, + SUM(input_tokens) as total_input_tokens, + SUM(output_tokens) as total_output_tokens, + SUM(total_tokens) as total_total_tokens, + COUNT(*) as total_turns + FROM turn_usage + WHERE session_id = ? AND branch_id = ? + """ + params: tuple[str, ...] = (self.session_id, branch_id) + else: + # All branches + query = """ + SELECT + SUM(requests) as total_requests, + SUM(input_tokens) as total_input_tokens, + SUM(output_tokens) as total_output_tokens, + SUM(total_tokens) as total_total_tokens, + COUNT(*) as total_turns + FROM turn_usage + WHERE session_id = ? + """ + params = (self.session_id,) + + with closing(conn.cursor()) as cursor: + cursor.execute(query, params) + row = cursor.fetchone() + + if row and row[0] is not None: + return { + "requests": row[0] or 0, + "input_tokens": row[1] or 0, + "output_tokens": row[2] or 0, + "total_tokens": row[3] or 0, + "total_turns": row[4] or 0, + } + return None + + result = await asyncio.to_thread(_get_usage_sync) + + return cast(Union[dict[str, int], None], result) + + async def get_turn_usage( + self, + user_turn_number: int | None = None, + branch_id: str | None = None, + ) -> list[dict[str, Any]] | dict[str, Any]: + """Get usage statistics by turn with full JSON token details. + + Args: + user_turn_number: Specific turn to get usage for. If None, returns all turns. + branch_id: Branch to get usage from (current branch if None). + + Returns: + Dictionary with usage data for specific turn, or list of dictionaries for all turns. + """ + + if branch_id is None: + branch_id = self._current_branch_id + + def _get_turn_usage_sync(): + """Synchronous helper to get turn usage statistics.""" + conn = self._get_connection() + + if user_turn_number is not None: + query = """ + SELECT requests, input_tokens, output_tokens, total_tokens, + input_tokens_details, output_tokens_details + FROM turn_usage + WHERE session_id = ? AND branch_id = ? AND user_turn_number = ? + """ + + with closing(conn.cursor()) as cursor: + cursor.execute(query, (self.session_id, branch_id, user_turn_number)) + row = cursor.fetchone() + + if row: + # Parse JSON details if present + input_details = None + output_details = None + + if row[4]: # input_tokens_details + try: + input_details = json.loads(row[4]) + except json.JSONDecodeError: + pass + + if row[5]: # output_tokens_details + try: + output_details = json.loads(row[5]) + except json.JSONDecodeError: + pass + + return { + "requests": row[0], + "input_tokens": row[1], + "output_tokens": row[2], + "total_tokens": row[3], + "input_tokens_details": input_details, + "output_tokens_details": output_details, + } + return {} + else: + query = """ + SELECT user_turn_number, requests, input_tokens, output_tokens, + total_tokens, input_tokens_details, output_tokens_details + FROM turn_usage + WHERE session_id = ? AND branch_id = ? + ORDER BY user_turn_number + """ + + with closing(conn.cursor()) as cursor: + cursor.execute(query, (self.session_id, branch_id)) + results = [] + for row in cursor.fetchall(): + # Parse JSON details if present + input_details = None + output_details = None + + if row[5]: # input_tokens_details + try: + input_details = json.loads(row[5]) + except json.JSONDecodeError: + pass + + if row[6]: # output_tokens_details + try: + output_details = json.loads(row[6]) + except json.JSONDecodeError: + pass + + results.append( + { + "user_turn_number": row[0], + "requests": row[1], + "input_tokens": row[2], + "output_tokens": row[3], + "total_tokens": row[4], + "input_tokens_details": input_details, + "output_tokens_details": output_details, + } + ) + return results + + result = await asyncio.to_thread(_get_turn_usage_sync) + + return cast(Union[list[dict[str, Any]], dict[str, Any]], result) + + async def _update_turn_usage_internal(self, user_turn_number: int, usage_data: Usage) -> None: + """Internal method to update usage for a specific turn with full JSON details. + + Args: + user_turn_number: The turn number to update usage for. + usage_data: The usage data to store. + """ + + def _update_sync(): + """Synchronous helper to update turn usage data.""" + conn = self._get_connection() + # TODO: Refactor SQLiteSession to use asyncio.Lock instead of threading.Lock and update this code # noqa: E501 + with self._lock if self._is_memory_db else threading.Lock(): + # Serialize token details as JSON + input_details_json = None + output_details_json = None + + if hasattr(usage_data, "input_tokens_details") and usage_data.input_tokens_details: + try: + input_details_json = json.dumps(usage_data.input_tokens_details.__dict__) + except (TypeError, ValueError) as e: + self._logger.warning(f"Failed to serialize input tokens details: {e}") + input_details_json = None + + if ( + hasattr(usage_data, "output_tokens_details") + and usage_data.output_tokens_details + ): + try: + output_details_json = json.dumps( + usage_data.output_tokens_details.__dict__ + ) + except (TypeError, ValueError) as e: + self._logger.warning(f"Failed to serialize output tokens details: {e}") + output_details_json = None + + with closing(conn.cursor()) as cursor: + cursor.execute( + """ + INSERT OR REPLACE INTO turn_usage + (session_id, branch_id, user_turn_number, requests, input_tokens, output_tokens, + total_tokens, input_tokens_details, output_tokens_details) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) + """, # noqa: E501 + ( + self.session_id, + self._current_branch_id, + user_turn_number, + usage_data.requests or 0, + usage_data.input_tokens or 0, + usage_data.output_tokens or 0, + usage_data.total_tokens or 0, + input_details_json, + output_details_json, + ), + ) + conn.commit() + + await asyncio.to_thread(_update_sync) diff --git a/src/agents/extensions/memory/encrypt_session.py b/src/agents/extensions/memory/encrypt_session.py new file mode 100644 index 000000000..1fc032e47 --- /dev/null +++ b/src/agents/extensions/memory/encrypt_session.py @@ -0,0 +1,185 @@ +"""Encrypted Session wrapper for secure conversation storage. + +This module provides transparent encryption for session storage with automatic +expiration of old data. When TTL expires, expired items are silently skipped. + +Usage:: + + from agents.extensions.memory import EncryptedSession, SQLAlchemySession + + # Create underlying session (e.g. SQLAlchemySession) + underlying_session = SQLAlchemySession.from_url( + session_id="user-123", + url="postgresql+asyncpg://app:secret@db.example.com/agents", + create_tables=True, + ) + + # Wrap with encryption and TTL-based expiration + session = EncryptedSession( + session_id="user-123", + underlying_session=underlying_session, + encryption_key="your-encryption-key", + ttl=600, # 10 minutes + ) + + await Runner.run(agent, "Hello", session=session) +""" + +from __future__ import annotations + +import base64 +import json +from typing import Any, cast + +from cryptography.fernet import Fernet, InvalidToken +from cryptography.hazmat.primitives import hashes +from cryptography.hazmat.primitives.kdf.hkdf import HKDF +from typing_extensions import Literal, TypedDict, TypeGuard + +from ...items import TResponseInputItem +from ...memory.session import SessionABC + + +class EncryptedEnvelope(TypedDict): + """TypedDict for encrypted message envelopes stored in the underlying session.""" + + __enc__: Literal[1] + v: int + kid: str + payload: str + + +def _ensure_fernet_key_bytes(master_key: str) -> bytes: + """ + Accept either a Fernet key (urlsafe-b64, 32 bytes after decode) or a raw string. + Returns raw bytes suitable for HKDF input. + """ + if not master_key: + raise ValueError("encryption_key not set; required for EncryptedSession.") + try: + key_bytes = base64.urlsafe_b64decode(master_key) + if len(key_bytes) == 32: + return key_bytes + except Exception: + pass + return master_key.encode("utf-8") + + +def _derive_session_fernet_key(master_key_bytes: bytes, session_id: str) -> Fernet: + hkdf = HKDF( + algorithm=hashes.SHA256(), + length=32, + salt=session_id.encode("utf-8"), + info=b"agents.session-store.hkdf.v1", + ) + derived = hkdf.derive(master_key_bytes) + return Fernet(base64.urlsafe_b64encode(derived)) + + +def _to_json_bytes(obj: Any) -> bytes: + return json.dumps(obj, ensure_ascii=False, separators=(",", ":"), default=str).encode("utf-8") + + +def _from_json_bytes(data: bytes) -> Any: + return json.loads(data.decode("utf-8")) + + +def _is_encrypted_envelope(item: object) -> TypeGuard[EncryptedEnvelope]: + """Type guard to check if an item is an encrypted envelope.""" + return ( + isinstance(item, dict) + and item.get("__enc__") == 1 + and "payload" in item + and "kid" in item + and "v" in item + ) + + +class EncryptedSession(SessionABC): + """Encrypted wrapper for Session implementations with TTL-based expiration. + + This class wraps any SessionABC implementation to provide transparent + encryption/decryption of stored items using Fernet encryption with + per-session key derivation and automatic expiration of old data. + + When items expire (exceed TTL), they are silently skipped during retrieval. + + Note: Expired tokens are rejected based on the system clock of the application server. + To avoid valid tokens being rejected due to clock drift, ensure all servers in + your environment are synchronized using NTP. + """ + + def __init__( + self, + session_id: str, + underlying_session: SessionABC, + encryption_key: str, + ttl: int = 600, + ): + """ + Args: + session_id: ID for this session + underlying_session: The real session store (e.g. SQLiteSession, SQLAlchemySession) + encryption_key: Master key (Fernet key or raw secret) + ttl: Token time-to-live in seconds (default 10 min) + """ + self.session_id = session_id + self.underlying_session = underlying_session + self.ttl = ttl + + master = _ensure_fernet_key_bytes(encryption_key) + self.cipher = _derive_session_fernet_key(master, session_id) + self._kid = "hkdf-v1" + self._ver = 1 + + def __getattr__(self, name): + return getattr(self.underlying_session, name) + + def _wrap(self, item: TResponseInputItem) -> EncryptedEnvelope: + if isinstance(item, dict): + payload = item + elif hasattr(item, "model_dump"): + payload = item.model_dump() + elif hasattr(item, "__dict__"): + payload = item.__dict__ + else: + payload = dict(item) + + token = self.cipher.encrypt(_to_json_bytes(payload)).decode("utf-8") + return {"__enc__": 1, "v": self._ver, "kid": self._kid, "payload": token} + + def _unwrap(self, item: TResponseInputItem | EncryptedEnvelope) -> TResponseInputItem | None: + if not _is_encrypted_envelope(item): + return cast(TResponseInputItem, item) + + try: + token = item["payload"].encode("utf-8") + plaintext = self.cipher.decrypt(token, ttl=self.ttl) + return cast(TResponseInputItem, _from_json_bytes(plaintext)) + except (InvalidToken, KeyError): + return None + + async def get_items(self, limit: int | None = None) -> list[TResponseInputItem]: + encrypted_items = await self.underlying_session.get_items(limit) + valid_items: list[TResponseInputItem] = [] + for enc in encrypted_items: + item = self._unwrap(enc) + if item is not None: + valid_items.append(item) + return valid_items + + async def add_items(self, items: list[TResponseInputItem]) -> None: + wrapped: list[EncryptedEnvelope] = [self._wrap(it) for it in items] + await self.underlying_session.add_items(cast(list[TResponseInputItem], wrapped)) + + async def pop_item(self) -> TResponseInputItem | None: + while True: + enc = await self.underlying_session.pop_item() + if not enc: + return None + item = self._unwrap(enc) + if item is not None: + return item + + async def clear_session(self) -> None: + await self.underlying_session.clear_session() diff --git a/src/agents/extensions/memory/redis_session.py b/src/agents/extensions/memory/redis_session.py new file mode 100644 index 000000000..68fd0351b --- /dev/null +++ b/src/agents/extensions/memory/redis_session.py @@ -0,0 +1,267 @@ +"""Redis-powered Session backend. + +Usage:: + + from agents.extensions.memory import RedisSession + + # Create from Redis URL + session = RedisSession.from_url( + session_id="user-123", + url="redis://localhost:6379/0", + ) + + # Or pass an existing Redis client that your application already manages + session = RedisSession( + session_id="user-123", + redis_client=my_redis_client, + ) + + await Runner.run(agent, "Hello", session=session) +""" + +from __future__ import annotations + +import asyncio +import json +import time +from typing import Any +from urllib.parse import urlparse + +try: + import redis.asyncio as redis + from redis.asyncio import Redis +except ImportError as e: + raise ImportError( + "RedisSession requires the 'redis' package. Install it with: pip install redis" + ) from e + +from ...items import TResponseInputItem +from ...memory.session import SessionABC + + +class RedisSession(SessionABC): + """Redis implementation of :pyclass:`agents.memory.session.Session`.""" + + def __init__( + self, + session_id: str, + *, + redis_client: Redis, + key_prefix: str = "agents:session", + ttl: int | None = None, + ): + """Initializes a new RedisSession. + + Args: + session_id (str): Unique identifier for the conversation. + redis_client (Redis[bytes]): A pre-configured Redis async client. + key_prefix (str, optional): Prefix for Redis keys to avoid collisions. + Defaults to "agents:session". + ttl (int | None, optional): Time-to-live in seconds for session data. + If None, data persists indefinitely. Defaults to None. + """ + self.session_id = session_id + self._redis = redis_client + self._key_prefix = key_prefix + self._ttl = ttl + self._lock = asyncio.Lock() + self._owns_client = False # Track if we own the Redis client + + # Redis key patterns + self._session_key = f"{self._key_prefix}:{self.session_id}" + self._messages_key = f"{self._session_key}:messages" + self._counter_key = f"{self._session_key}:counter" + + @classmethod + def from_url( + cls, + session_id: str, + *, + url: str, + redis_kwargs: dict[str, Any] | None = None, + **kwargs: Any, + ) -> RedisSession: + """Create a session from a Redis URL string. + + Args: + session_id (str): Conversation ID. + url (str): Redis URL, e.g. "redis://localhost:6379/0" or "rediss://host:6380". + redis_kwargs (dict[str, Any] | None): Additional keyword arguments forwarded to + redis.asyncio.from_url. + **kwargs: Additional keyword arguments forwarded to the main constructor + (e.g., key_prefix, ttl, etc.). + + Returns: + RedisSession: An instance of RedisSession connected to the specified Redis server. + """ + redis_kwargs = redis_kwargs or {} + + # Parse URL to determine if we need SSL + parsed = urlparse(url) + if parsed.scheme == "rediss": + redis_kwargs.setdefault("ssl", True) + + redis_client = redis.from_url(https://github.com/url,%20**redis_kwargs) + session = cls(session_id, redis_client=redis_client, **kwargs) + session._owns_client = True # We created the client, so we own it + return session + + async def _serialize_item(self, item: TResponseInputItem) -> str: + """Serialize an item to JSON string. Can be overridden by subclasses.""" + return json.dumps(item, separators=(",", ":")) + + async def _deserialize_item(self, item: str) -> TResponseInputItem: + """Deserialize a JSON string to an item. Can be overridden by subclasses.""" + return json.loads(item) # type: ignore[no-any-return] # json.loads returns Any but we know the structure + + async def _get_next_id(self) -> int: + """Get the next message ID using Redis INCR for atomic increment.""" + result = await self._redis.incr(self._counter_key) + return int(result) + + async def _set_ttl_if_configured(self, *keys: str) -> None: + """Set TTL on keys if configured.""" + if self._ttl is not None: + pipe = self._redis.pipeline() + for key in keys: + pipe.expire(key, self._ttl) + await pipe.execute() + + # ------------------------------------------------------------------ + # Session protocol implementation + # ------------------------------------------------------------------ + + async def get_items(self, limit: int | None = None) -> list[TResponseInputItem]: + """Retrieve the conversation history for this session. + + Args: + limit: Maximum number of items to retrieve. If None, retrieves all items. + When specified, returns the latest N items in chronological order. + + Returns: + List of input items representing the conversation history + """ + async with self._lock: + if limit is None: + # Get all messages in chronological order + raw_messages = await self._redis.lrange(self._messages_key, 0, -1) # type: ignore[misc] # Redis library returns Union[Awaitable[T], T] in async context + else: + if limit <= 0: + return [] + # Get the latest N messages (Redis list is ordered chronologically) + # Use negative indices to get from the end - Redis uses -N to -1 for last N items + raw_messages = await self._redis.lrange(self._messages_key, -limit, -1) # type: ignore[misc] # Redis library returns Union[Awaitable[T], T] in async context + + items: list[TResponseInputItem] = [] + for raw_msg in raw_messages: + try: + # Handle both bytes (default) and str (decode_responses=True) Redis clients + if isinstance(raw_msg, bytes): + msg_str = raw_msg.decode("utf-8") + else: + msg_str = raw_msg # Already a string + item = await self._deserialize_item(msg_str) + items.append(item) + except (json.JSONDecodeError, UnicodeDecodeError): + # Skip corrupted messages + continue + + return items + + async def add_items(self, items: list[TResponseInputItem]) -> None: + """Add new items to the conversation history. + + Args: + items: List of input items to add to the history + """ + if not items: + return + + async with self._lock: + pipe = self._redis.pipeline() + + # Set session metadata with current timestamp + pipe.hset( + self._session_key, + mapping={ + "session_id": self.session_id, + "created_at": str(int(time.time())), + "updated_at": str(int(time.time())), + }, + ) + + # Add all items to the messages list + serialized_items = [] + for item in items: + serialized = await self._serialize_item(item) + serialized_items.append(serialized) + + if serialized_items: + pipe.rpush(self._messages_key, *serialized_items) + + # Update the session timestamp + pipe.hset(self._session_key, "updated_at", str(int(time.time()))) + + # Execute all commands + await pipe.execute() + + # Set TTL if configured + await self._set_ttl_if_configured( + self._session_key, self._messages_key, self._counter_key + ) + + async def pop_item(self) -> TResponseInputItem | None: + """Remove and return the most recent item from the session. + + Returns: + The most recent item if it exists, None if the session is empty + """ + async with self._lock: + # Use RPOP to atomically remove and return the rightmost (most recent) item + raw_msg = await self._redis.rpop(self._messages_key) # type: ignore[misc] # Redis library returns Union[Awaitable[T], T] in async context + + if raw_msg is None: + return None + + try: + # Handle both bytes (default) and str (decode_responses=True) Redis clients + if isinstance(raw_msg, bytes): + msg_str = raw_msg.decode("utf-8") + else: + msg_str = raw_msg # Already a string + return await self._deserialize_item(msg_str) + except (json.JSONDecodeError, UnicodeDecodeError): + # Return None for corrupted messages (already removed) + return None + + async def clear_session(self) -> None: + """Clear all items for this session.""" + async with self._lock: + # Delete all keys associated with this session + await self._redis.delete( + self._session_key, + self._messages_key, + self._counter_key, + ) + + async def close(self) -> None: + """Close the Redis connection. + + Only closes the connection if this session owns the Redis client + (i.e., created via from_url). If the client was injected externally, + the caller is responsible for managing its lifecycle. + """ + if self._owns_client: + await self._redis.aclose() + + async def ping(self) -> bool: + """Test Redis connectivity. + + Returns: + True if Redis is reachable, False otherwise. + """ + try: + await self._redis.ping() + return True + except Exception: + return False diff --git a/src/agents/extensions/memory/sqlalchemy_session.py b/src/agents/extensions/memory/sqlalchemy_session.py new file mode 100644 index 000000000..d9e52e391 --- /dev/null +++ b/src/agents/extensions/memory/sqlalchemy_session.py @@ -0,0 +1,334 @@ +"""SQLAlchemy-powered Session backend. + +Usage:: + + from agents.extensions.memory import SQLAlchemySession + + # Create from SQLAlchemy URL (uses asyncpg driver under the hood for Postgres) + session = SQLAlchemySession.from_url( + session_id="user-123", + url="postgresql+asyncpg://app:secret@db.example.com/agents", + create_tables=True, # If you want to auto-create tables, set to True. + ) + + # Or pass an existing AsyncEngine that your application already manages + session = SQLAlchemySession( + session_id="user-123", + engine=my_async_engine, + create_tables=True, # If you want to auto-create tables, set to True. + ) + + await Runner.run(agent, "Hello", session=session) +""" + +from __future__ import annotations + +import asyncio +import json +from typing import Any + +from sqlalchemy import ( + TIMESTAMP, + Column, + ForeignKey, + Index, + Integer, + MetaData, + String, + Table, + Text, + delete, + insert, + select, + text as sql_text, + update, +) +from sqlalchemy.ext.asyncio import AsyncEngine, async_sessionmaker, create_async_engine + +from ...items import TResponseInputItem +from ...memory.session import SessionABC + + +class SQLAlchemySession(SessionABC): + """SQLAlchemy implementation of :pyclass:`agents.memory.session.Session`.""" + + _metadata: MetaData + _sessions: Table + _messages: Table + + def __init__( + self, + session_id: str, + *, + engine: AsyncEngine, + create_tables: bool = False, + sessions_table: str = "agent_sessions", + messages_table: str = "agent_messages", + ): + """Initializes a new SQLAlchemySession. + + Args: + session_id (str): Unique identifier for the conversation. + engine (AsyncEngine): A pre-configured SQLAlchemy async engine. The engine + must be created with an async driver (e.g., 'postgresql+asyncpg://', + 'mysql+aiomysql://', or 'sqlite+aiosqlite://'). + create_tables (bool, optional): Whether to automatically create the required + tables and indexes. Defaults to False for production use. Set to True for + development and testing when migrations aren't used. + sessions_table (str, optional): Override the default table name for sessions if needed. + messages_table (str, optional): Override the default table name for messages if needed. + """ + self.session_id = session_id + self._engine = engine + self._lock = asyncio.Lock() + + self._metadata = MetaData() + self._sessions = Table( + sessions_table, + self._metadata, + Column("session_id", String, primary_key=True), + Column( + "created_at", + TIMESTAMP(timezone=False), + server_default=sql_text("CURRENT_TIMESTAMP"), + nullable=False, + ), + Column( + "updated_at", + TIMESTAMP(timezone=False), + server_default=sql_text("CURRENT_TIMESTAMP"), + onupdate=sql_text("CURRENT_TIMESTAMP"), + nullable=False, + ), + ) + + self._messages = Table( + messages_table, + self._metadata, + Column("id", Integer, primary_key=True, autoincrement=True), + Column( + "session_id", + String, + ForeignKey(f"{sessions_table}.session_id", ondelete="CASCADE"), + nullable=False, + ), + Column("message_data", Text, nullable=False), + Column( + "created_at", + TIMESTAMP(timezone=False), + server_default=sql_text("CURRENT_TIMESTAMP"), + nullable=False, + ), + Index( + f"idx_{messages_table}_session_time", + "session_id", + "created_at", + ), + sqlite_autoincrement=True, + ) + + # Async session factory + self._session_factory = async_sessionmaker(self._engine, expire_on_commit=False) + + self._create_tables = create_tables + + # --------------------------------------------------------------------- + # Convenience constructors + # --------------------------------------------------------------------- + @classmethod + def from_url( + cls, + session_id: str, + *, + url: str, + engine_kwargs: dict[str, Any] | None = None, + **kwargs: Any, + ) -> SQLAlchemySession: + """Create a session from a database URL string. + + Args: + session_id (str): Conversation ID. + url (str): Any SQLAlchemy async URL, e.g. "postgresql+asyncpg://user:pass@host/db". + engine_kwargs (dict[str, Any] | None): Additional keyword arguments forwarded to + sqlalchemy.ext.asyncio.create_async_engine. + **kwargs: Additional keyword arguments forwarded to the main constructor + (e.g., create_tables, custom table names, etc.). + + Returns: + SQLAlchemySession: An instance of SQLAlchemySession connected to the specified database. + """ + engine_kwargs = engine_kwargs or {} + engine = create_async_engine(url, **engine_kwargs) + return cls(session_id, engine=engine, **kwargs) + + async def _serialize_item(self, item: TResponseInputItem) -> str: + """Serialize an item to JSON string. Can be overridden by subclasses.""" + return json.dumps(item, separators=(",", ":")) + + async def _deserialize_item(self, item: str) -> TResponseInputItem: + """Deserialize a JSON string to an item. Can be overridden by subclasses.""" + return json.loads(item) # type: ignore[no-any-return] + + # ------------------------------------------------------------------ + # Session protocol implementation + # ------------------------------------------------------------------ + async def _ensure_tables(self) -> None: + """Ensure tables are created before any database operations.""" + if self._create_tables: + async with self._engine.begin() as conn: + await conn.run_sync(self._metadata.create_all) + self._create_tables = False # Only create once + + async def get_items(self, limit: int | None = None) -> list[TResponseInputItem]: + """Retrieve the conversation history for this session. + + Args: + limit: Maximum number of items to retrieve. If None, retrieves all items. + When specified, returns the latest N items in chronological order. + + Returns: + List of input items representing the conversation history + """ + await self._ensure_tables() + async with self._session_factory() as sess: + if limit is None: + stmt = ( + select(self._messages.c.message_data) + .where(self._messages.c.session_id == self.session_id) + .order_by( + self._messages.c.created_at.asc(), + self._messages.c.id.asc(), + ) + ) + else: + stmt = ( + select(self._messages.c.message_data) + .where(self._messages.c.session_id == self.session_id) + # Use DESC + LIMIT to get the latest N + # then reverse later for chronological order. + .order_by( + self._messages.c.created_at.desc(), + self._messages.c.id.desc(), + ) + .limit(limit) + ) + + result = await sess.execute(stmt) + rows: list[str] = [row[0] for row in result.all()] + + if limit is not None: + rows.reverse() + + items: list[TResponseInputItem] = [] + for raw in rows: + try: + items.append(await self._deserialize_item(raw)) + except json.JSONDecodeError: + # Skip corrupted rows + continue + return items + + async def add_items(self, items: list[TResponseInputItem]) -> None: + """Add new items to the conversation history. + + Args: + items: List of input items to add to the history + """ + if not items: + return + + await self._ensure_tables() + payload = [ + { + "session_id": self.session_id, + "message_data": await self._serialize_item(item), + } + for item in items + ] + + async with self._session_factory() as sess: + async with sess.begin(): + # Ensure the parent session row exists - use merge for cross-DB compatibility + # Check if session exists + existing = await sess.execute( + select(self._sessions.c.session_id).where( + self._sessions.c.session_id == self.session_id + ) + ) + if not existing.scalar_one_or_none(): + # Session doesn't exist, create it + await sess.execute( + insert(self._sessions).values({"session_id": self.session_id}) + ) + + # Insert messages in bulk + await sess.execute(insert(self._messages), payload) + + # Touch updated_at column + await sess.execute( + update(self._sessions) + .where(self._sessions.c.session_id == self.session_id) + .values(updated_at=sql_text("CURRENT_TIMESTAMP")) + ) + + async def pop_item(self) -> TResponseInputItem | None: + """Remove and return the most recent item from the session. + + Returns: + The most recent item if it exists, None if the session is empty + """ + await self._ensure_tables() + async with self._session_factory() as sess: + async with sess.begin(): + # Fallback for all dialects - get ID first, then delete + subq = ( + select(self._messages.c.id) + .where(self._messages.c.session_id == self.session_id) + .order_by( + self._messages.c.created_at.desc(), + self._messages.c.id.desc(), + ) + .limit(1) + ) + res = await sess.execute(subq) + row_id = res.scalar_one_or_none() + if row_id is None: + return None + # Fetch data before deleting + res_data = await sess.execute( + select(self._messages.c.message_data).where(self._messages.c.id == row_id) + ) + row = res_data.scalar_one_or_none() + await sess.execute(delete(self._messages).where(self._messages.c.id == row_id)) + + if row is None: + return None + try: + return await self._deserialize_item(row) + except json.JSONDecodeError: + return None + + async def clear_session(self) -> None: + """Clear all items for this session.""" + await self._ensure_tables() + async with self._session_factory() as sess: + async with sess.begin(): + await sess.execute( + delete(self._messages).where(self._messages.c.session_id == self.session_id) + ) + await sess.execute( + delete(self._sessions).where(self._sessions.c.session_id == self.session_id) + ) + + @property + def engine(self) -> AsyncEngine: + """Access the underlying SQLAlchemy AsyncEngine. + + This property provides direct access to the engine for advanced use cases, + such as checking connection pool status, configuring engine settings, + or manually disposing the engine when needed. + + Returns: + AsyncEngine: The SQLAlchemy async engine instance. + """ + return self._engine diff --git a/src/agents/extensions/models/litellm_model.py b/src/agents/extensions/models/litellm_model.py index a06c61dc3..6389b38b2 100644 --- a/src/agents/extensions/models/litellm_model.py +++ b/src/agents/extensions/models/litellm_model.py @@ -3,6 +3,7 @@ import json import time from collections.abc import AsyncIterator +from copy import copy from typing import Any, Literal, cast, overload from openai.types.responses.response_usage import InputTokensDetails, OutputTokensDetails @@ -17,14 +18,19 @@ "dependency group: `pip install 'openai-agents[litellm]'`." ) from _e -from openai import NOT_GIVEN, AsyncStream, NotGiven -from openai.types.chat import ChatCompletionChunk, ChatCompletionMessageToolCall +from openai import AsyncStream, NotGiven, omit +from openai.types.chat import ( + ChatCompletionChunk, + ChatCompletionMessageCustomToolCall, + ChatCompletionMessageFunctionToolCall, + ChatCompletionMessageParam, +) from openai.types.chat.chat_completion_message import ( Annotation, AnnotationURLCitation, ChatCompletionMessage, ) -from openai.types.chat.chat_completion_message_tool_call import Function +from openai.types.chat.chat_completion_message_function_tool_call import Function from openai.types.responses import Response from ... import _debug @@ -34,15 +40,26 @@ from ...logger import logger from ...model_settings import ModelSettings from ...models.chatcmpl_converter import Converter -from ...models.chatcmpl_helpers import HEADERS +from ...models.chatcmpl_helpers import HEADERS, HEADERS_OVERRIDE from ...models.chatcmpl_stream_handler import ChatCmplStreamHandler from ...models.fake_id import FAKE_RESPONSES_ID from ...models.interface import Model, ModelTracing +from ...models.openai_responses import Converter as OpenAIResponsesConverter from ...tool import Tool from ...tracing import generation_span from ...tracing.span_data import GenerationSpanData from ...tracing.spans import Span from ...usage import Usage +from ...util._json import _to_dump_compatible + + +class InternalChatCompletionMessage(ChatCompletionMessage): + """ + An internal subclass to carry reasoning_content and thinking_blocks without modifying the original model. + """ # noqa: E501 + + reasoning_content: str + thinking_blocks: list[dict[str, Any]] | None = None class LitellmModel(Model): @@ -70,7 +87,8 @@ async def get_response( output_schema: AgentOutputSchemaBase | None, handoffs: list[Handoff], tracing: ModelTracing, - previous_response_id: str | None, + previous_response_id: str | None = None, # unused + conversation_id: str | None = None, # unused prompt: Any | None = None, ) -> ModelResponse: with generation_span( @@ -92,18 +110,26 @@ async def get_response( prompt=prompt, ) - assert isinstance(response.choices[0], litellm.types.utils.Choices) + message: litellm.types.utils.Message | None = None + first_choice: litellm.types.utils.Choices | None = None + if response.choices and len(response.choices) > 0: + choice = response.choices[0] + if isinstance(choice, litellm.types.utils.Choices): + first_choice = choice + message = first_choice.message if _debug.DONT_LOG_MODEL_DATA: logger.debug("Received model response") else: - logger.debug( - f"""LLM resp:\n{ - json.dumps( - response.choices[0].message.model_dump(), indent=2, ensure_ascii=False - ) - }\n""" - ) + if message is not None: + logger.debug( + f"""LLM resp:\n{ + json.dumps(message.model_dump(), indent=2, ensure_ascii=False) + }\n""" + ) + else: + finish_reason = first_choice.finish_reason if first_choice else "-" + logger.debug(f"LLM resp had no message. finish_reason: {finish_reason}") if hasattr(response, "usage"): response_usage = response.usage @@ -134,14 +160,20 @@ async def get_response( logger.warning("No usage information returned from Litellm") if tracing.include_data(): - span_generation.span_data.output = [response.choices[0].message.model_dump()] + span_generation.span_data.output = ( + [message.model_dump()] if message is not None else [] + ) span_generation.span_data.usage = { "input_tokens": usage.input_tokens, "output_tokens": usage.output_tokens, } - items = Converter.message_to_output_items( - LitellmConverter.convert_message_to_openai(response.choices[0].message) + items = ( + Converter.message_to_output_items( + LitellmConverter.convert_message_to_openai(message) + ) + if message is not None + else [] ) return ModelResponse( @@ -159,7 +191,8 @@ async def stream_response( output_schema: AgentOutputSchemaBase | None, handoffs: list[Handoff], tracing: ModelTracing, - previous_response_id: str | None, + previous_response_id: str | None = None, # unused + conversation_id: str | None = None, # unused prompt: Any | None = None, ) -> AsyncIterator[TResponseStreamEvent]: with generation_span( @@ -240,7 +273,19 @@ async def _fetch_response( stream: bool = False, prompt: Any | None = None, ) -> litellm.types.utils.ModelResponse | tuple[Response, AsyncStream[ChatCompletionChunk]]: - converted_messages = Converter.items_to_messages(input) + # Preserve reasoning messages for tool calls when reasoning is on + # This is needed for models like Claude 4 Sonnet/Opus which support interleaved thinking + preserve_thinking_blocks = ( + model_settings.reasoning is not None and model_settings.reasoning.effort is not None + ) + + converted_messages = Converter.items_to_messages( + input, preserve_thinking_blocks=preserve_thinking_blocks + ) + + # Fix for interleaved thinking bug: reorder messages to ensure tool_use comes before tool_result # noqa: E501 + if "anthropic" in self.model.lower() or "claude" in self.model.lower(): + converted_messages = self._fix_tool_message_ordering(converted_messages) if system_instructions: converted_messages.insert( @@ -250,6 +295,8 @@ async def _fetch_response( "role": "system", }, ) + converted_messages = _to_dump_compatible(converted_messages) + if tracing.include_data(): span.span_data.input = converted_messages @@ -268,19 +315,48 @@ async def _fetch_response( for handoff in handoffs: converted_tools.append(Converter.convert_handoff_tool(handoff)) + converted_tools = _to_dump_compatible(converted_tools) + if _debug.DONT_LOG_MODEL_DATA: logger.debug("Calling LLM") else: + messages_json = json.dumps( + converted_messages, + indent=2, + ensure_ascii=False, + ) + tools_json = json.dumps( + converted_tools, + indent=2, + ensure_ascii=False, + ) logger.debug( f"Calling Litellm model: {self.model}\n" - f"{json.dumps(converted_messages, indent=2, ensure_ascii=False)}\n" - f"Tools:\n{json.dumps(converted_tools, indent=2, ensure_ascii=False)}\n" + f"{messages_json}\n" + f"Tools:\n{tools_json}\n" f"Stream: {stream}\n" f"Tool choice: {tool_choice}\n" f"Response format: {response_format}\n" ) reasoning_effort = model_settings.reasoning.effort if model_settings.reasoning else None + # Enable developers to pass non-OpenAI compatible reasoning_effort data like "none" + # Priority order: + # 1. model_settings.reasoning.effort + # 2. model_settings.extra_body["reasoning_effort"] + # 3. model_settings.extra_args["reasoning_effort"] + if ( + reasoning_effort is None # Unset in model_settings + and isinstance(model_settings.extra_body, dict) + and "reasoning_effort" in model_settings.extra_body + ): + reasoning_effort = model_settings.extra_body["reasoning_effort"] + if ( + reasoning_effort is None # Unset in both model_settings and model_settings.extra_body + and model_settings.extra_args + and "reasoning_effort" in model_settings.extra_args + ): + reasoning_effort = model_settings.extra_args["reasoning_effort"] stream_options = None if stream and model_settings.include_usage is not None: @@ -288,9 +364,9 @@ async def _fetch_response( extra_kwargs = {} if model_settings.extra_query: - extra_kwargs["extra_query"] = model_settings.extra_query + extra_kwargs["extra_query"] = copy(model_settings.extra_query) if model_settings.metadata: - extra_kwargs["metadata"] = model_settings.metadata + extra_kwargs["metadata"] = copy(model_settings.metadata) if model_settings.extra_body and isinstance(model_settings.extra_body, dict): extra_kwargs.update(model_settings.extra_body) @@ -298,6 +374,9 @@ async def _fetch_response( if model_settings.extra_args: extra_kwargs.update(model_settings.extra_args) + # Prevent duplicate reasoning_effort kwargs when it was promoted to a top-level argument. + extra_kwargs.pop("reasoning_effort", None) + ret = await litellm.acompletion( model=self.model, messages=converted_messages, @@ -313,7 +392,8 @@ async def _fetch_response( stream=stream, stream_options=stream_options, reasoning_effort=reasoning_effort, - extra_headers={**HEADERS, **(model_settings.extra_headers or {})}, + top_logprobs=model_settings.top_logprobs, + extra_headers=self._merge_headers(model_settings), api_key=self.api_key, base_url=self.base_url, **extra_kwargs, @@ -322,15 +402,19 @@ async def _fetch_response( if isinstance(ret, litellm.types.utils.ModelResponse): return ret + responses_tool_choice = OpenAIResponsesConverter.convert_tool_choice( + model_settings.tool_choice + ) + if responses_tool_choice is None or responses_tool_choice is omit: + responses_tool_choice = "auto" + response = Response( id=FAKE_RESPONSES_ID, created_at=time.time(), model=self.model, object="response", output=[], - tool_choice=cast(Literal["auto", "required", "none"], tool_choice) - if tool_choice != NOT_GIVEN - else "auto", + tool_choice=responses_tool_choice, # type: ignore[arg-type] top_p=model_settings.top_p, temperature=model_settings.temperature, tools=[], @@ -339,11 +423,129 @@ async def _fetch_response( ) return response, ret + def _fix_tool_message_ordering( + self, messages: list[ChatCompletionMessageParam] + ) -> list[ChatCompletionMessageParam]: + """ + Fix the ordering of tool messages to ensure tool_use messages come before tool_result messages. + + This addresses the interleaved thinking bug where conversation histories may contain + tool results before their corresponding tool calls, causing Anthropic API to reject the request. + """ # noqa: E501 + if not messages: + return messages + + # Collect all tool calls and tool results + tool_call_messages = {} # tool_id -> (index, message) + tool_result_messages = {} # tool_id -> (index, message) + other_messages = [] # (index, message) for non-tool messages + + for i, message in enumerate(messages): + if not isinstance(message, dict): + other_messages.append((i, message)) + continue + + role = message.get("role") + + if role == "assistant" and message.get("tool_calls"): + # Extract tool calls from this assistant message + tool_calls = message.get("tool_calls", []) + if isinstance(tool_calls, list): + for tool_call in tool_calls: + if isinstance(tool_call, dict): + tool_id = tool_call.get("id") + if tool_id: + # Create a separate assistant message for each tool call + single_tool_msg = cast(dict[str, Any], message.copy()) + single_tool_msg["tool_calls"] = [tool_call] + tool_call_messages[tool_id] = ( + i, + cast(ChatCompletionMessageParam, single_tool_msg), + ) + + elif role == "tool": + tool_call_id = message.get("tool_call_id") + if tool_call_id: + tool_result_messages[tool_call_id] = (i, message) + else: + other_messages.append((i, message)) + else: + other_messages.append((i, message)) + + # First, identify which tool results will be paired to avoid duplicates + paired_tool_result_indices = set() + for tool_id in tool_call_messages: + if tool_id in tool_result_messages: + tool_result_idx, _ = tool_result_messages[tool_id] + paired_tool_result_indices.add(tool_result_idx) + + # Create the fixed message sequence + fixed_messages: list[ChatCompletionMessageParam] = [] + used_indices = set() + + # Add messages in their original order, but ensure tool_use → tool_result pairing + for i, original_message in enumerate(messages): + if i in used_indices: + continue + + if not isinstance(original_message, dict): + fixed_messages.append(original_message) + used_indices.add(i) + continue + + role = original_message.get("role") + + if role == "assistant" and original_message.get("tool_calls"): + # Process each tool call in this assistant message + tool_calls = original_message.get("tool_calls", []) + if isinstance(tool_calls, list): + for tool_call in tool_calls: + if isinstance(tool_call, dict): + tool_id = tool_call.get("id") + if ( + tool_id + and tool_id in tool_call_messages + and tool_id in tool_result_messages + ): + # Add tool_use → tool_result pair + _, tool_call_msg = tool_call_messages[tool_id] + tool_result_idx, tool_result_msg = tool_result_messages[tool_id] + + fixed_messages.append(tool_call_msg) + fixed_messages.append(tool_result_msg) + + # Mark both as used + used_indices.add(tool_call_messages[tool_id][0]) + used_indices.add(tool_result_idx) + elif tool_id and tool_id in tool_call_messages: + # Tool call without result - add just the tool call + _, tool_call_msg = tool_call_messages[tool_id] + fixed_messages.append(tool_call_msg) + used_indices.add(tool_call_messages[tool_id][0]) + + used_indices.add(i) # Mark original multi-tool message as used + + elif role == "tool": + # Only preserve unmatched tool results to avoid duplicates + if i not in paired_tool_result_indices: + fixed_messages.append(original_message) + used_indices.add(i) + + else: + # Regular message - add it normally + fixed_messages.append(original_message) + used_indices.add(i) + + return fixed_messages + def _remove_not_given(self, value: Any) -> Any: - if isinstance(value, NotGiven): + if value is omit or isinstance(value, NotGiven): return None return value + def _merge_headers(self, model_settings: ModelSettings): + return {**HEADERS, **(model_settings.extra_headers or {}), **(HEADERS_OVERRIDE.get() or {})} + class LitellmConverter: @classmethod @@ -353,7 +555,9 @@ def convert_message_to_openai( if message.role != "assistant": raise ModelBehaviorError(f"Unsupported role: {message.role}") - tool_calls = ( + tool_calls: ( + list[ChatCompletionMessageFunctionToolCall | ChatCompletionMessageCustomToolCall] | None + ) = ( [LitellmConverter.convert_tool_call_to_openai(tool) for tool in message.tool_calls] if message.tool_calls else None @@ -364,13 +568,39 @@ def convert_message_to_openai( provider_specific_fields.get("refusal", None) if provider_specific_fields else None ) - return ChatCompletionMessage( + reasoning_content = "" + if hasattr(message, "reasoning_content") and message.reasoning_content: + reasoning_content = message.reasoning_content + + # Extract full thinking blocks including signatures (for Anthropic) + thinking_blocks: list[dict[str, Any]] | None = None + if hasattr(message, "thinking_blocks") and message.thinking_blocks: + # Convert thinking blocks to dict format for compatibility + thinking_blocks = [] + for block in message.thinking_blocks: + if isinstance(block, dict): + thinking_blocks.append(cast(dict[str, Any], block)) + else: + # Convert object to dict by accessing its attributes + block_dict: dict[str, Any] = {} + if hasattr(block, "__dict__"): + block_dict = dict(block.__dict__.items()) + elif hasattr(block, "model_dump"): + block_dict = block.model_dump() + else: + # Last resort: convert to string representation + block_dict = {"thinking": str(block)} + thinking_blocks.append(block_dict) + + return InternalChatCompletionMessage( content=message.content, refusal=refusal, role="assistant", annotations=cls.convert_annotations_to_openai(message), audio=message.get("audio", None), # litellm deletes audio if not present tool_calls=tool_calls, + reasoning_content=reasoning_content, + thinking_blocks=thinking_blocks, ) @classmethod @@ -399,11 +629,12 @@ def convert_annotations_to_openai( @classmethod def convert_tool_call_to_openai( cls, tool_call: litellm.types.utils.ChatCompletionMessageToolCall - ) -> ChatCompletionMessageToolCall: - return ChatCompletionMessageToolCall( + ) -> ChatCompletionMessageFunctionToolCall: + return ChatCompletionMessageFunctionToolCall( id=tool_call.id, type="function", function=Function( - name=tool_call.function.name or "", arguments=tool_call.function.arguments + name=tool_call.function.name or "", + arguments=tool_call.function.arguments, ), ) diff --git a/src/agents/extensions/models/litellm_provider.py b/src/agents/extensions/models/litellm_provider.py index 5a2dc1666..b046d4080 100644 --- a/src/agents/extensions/models/litellm_provider.py +++ b/src/agents/extensions/models/litellm_provider.py @@ -1,6 +1,8 @@ +from ...models.default_models import get_default_model from ...models.interface import Model, ModelProvider from .litellm_model import LitellmModel +# This is kept for backward compatiblity but using get_default_model() method is recommended. DEFAULT_MODEL: str = "gpt-4.1" @@ -18,4 +20,4 @@ class LitellmProvider(ModelProvider): """ def get_model(self, model_name: str | None) -> Model: - return LitellmModel(model_name or DEFAULT_MODEL) + return LitellmModel(model_name or get_default_model()) diff --git a/src/agents/extensions/visualization.py b/src/agents/extensions/visualization.py index be762a330..67ca7d267 100644 --- a/src/agents/extensions/visualization.py +++ b/src/agents/extensions/visualization.py @@ -71,6 +71,12 @@ def get_all_nodes( f"fillcolor=lightgreen, width=0.5, height=0.3];" ) + for mcp_server in agent.mcp_servers: + parts.append( + f'"{mcp_server.name}" [label="{mcp_server.name}", shape=box, style=filled, ' + f"fillcolor=lightgrey, width=1, height=0.5];" + ) + for handoff in agent.handoffs: if isinstance(handoff, Handoff): parts.append( @@ -119,6 +125,11 @@ def get_all_edges( "{agent.name}" -> "{tool.name}" [style=dotted, penwidth=1.5]; "{tool.name}" -> "{agent.name}" [style=dotted, penwidth=1.5];""") + for mcp_server in agent.mcp_servers: + parts.append(f""" + "{agent.name}" -> "{mcp_server.name}" [style=dashed, penwidth=1.5]; + "{mcp_server.name}" -> "{agent.name}" [style=dashed, penwidth=1.5];""") + for handoff in agent.handoffs: if isinstance(handoff, Handoff): parts.append(f""" diff --git a/src/agents/function_schema.py b/src/agents/function_schema.py index ec54d8227..b9331da87 100644 --- a/src/agents/function_schema.py +++ b/src/agents/function_schema.py @@ -5,7 +5,7 @@ import logging import re from dataclasses import dataclass -from typing import Any, Callable, Literal, get_args, get_origin, get_type_hints +from typing import Annotated, Any, Callable, Literal, get_args, get_origin, get_type_hints from griffe import Docstring, DocstringSectionKind from pydantic import BaseModel, Field, create_model @@ -76,7 +76,7 @@ def to_call_args(self, data: BaseModel) -> tuple[list[Any], dict[str, Any]]: @dataclass class FuncDocumentation: - """Contains metadata about a python function, extracted from its docstring.""" + """Contains metadata about a Python function, extracted from its docstring.""" name: str """The name of the function, via `__name__`.""" @@ -185,6 +185,31 @@ def generate_func_documentation( ) +def _strip_annotated(annotation: Any) -> tuple[Any, tuple[Any, ...]]: + """Returns the underlying annotation and any metadata from typing.Annotated.""" + + metadata: tuple[Any, ...] = () + ann = annotation + + while get_origin(ann) is Annotated: + args = get_args(ann) + if not args: + break + ann = args[0] + metadata = (*metadata, *args[1:]) + + return ann, metadata + + +def _extract_description_from_metadata(metadata: tuple[Any, ...]) -> str | None: + """Extracts a human readable description from Annotated metadata if present.""" + + for item in metadata: + if isinstance(item, str): + return item + return None + + def function_schema( func: Callable[..., Any], docstring_style: DocstringStyle | None = None, @@ -194,7 +219,7 @@ def function_schema( strict_json_schema: bool = True, ) -> FuncSchema: """ - Given a python function, extracts a `FuncSchema` from it, capturing the name, description, + Given a Python function, extracts a `FuncSchema` from it, capturing the name, description, parameter descriptions, and other metadata. Args: @@ -208,7 +233,7 @@ def function_schema( descriptions. strict_json_schema: Whether the JSON schema is in strict mode. If True, we'll ensure that the schema adheres to the "strict" standard the OpenAI API expects. We **strongly** - recommend setting this to True, as it increases the likelihood of the LLM providing + recommend setting this to True, as it increases the likelihood of the LLM producing correct JSON input. Returns: @@ -219,17 +244,34 @@ def function_schema( # 1. Grab docstring info if use_docstring_info: doc_info = generate_func_documentation(func, docstring_style) - param_descs = doc_info.param_descriptions or {} + param_descs = dict(doc_info.param_descriptions or {}) else: doc_info = None param_descs = {} + type_hints_with_extras = get_type_hints(func, include_extras=True) + type_hints: dict[str, Any] = {} + annotated_param_descs: dict[str, str] = {} + + for name, annotation in type_hints_with_extras.items(): + if name == "return": + continue + + stripped_ann, metadata = _strip_annotated(annotation) + type_hints[name] = stripped_ann + + description = _extract_description_from_metadata(metadata) + if description is not None: + annotated_param_descs[name] = description + + for name, description in annotated_param_descs.items(): + param_descs.setdefault(name, description) + # Ensure name_override takes precedence even if docstring info is disabled. func_name = name_override or (doc_info.name if doc_info else func.__name__) # 2. Inspect function signature and get type hints sig = inspect.signature(func) - type_hints = get_type_hints(func) params = list(sig.parameters.items()) takes_context = False filtered_params = [] @@ -291,7 +333,7 @@ def function_schema( # Default factory to empty list fields[name] = ( ann, - Field(default_factory=list, description=field_description), # type: ignore + Field(default_factory=list, description=field_description), ) elif param.kind == param.VAR_KEYWORD: @@ -309,7 +351,7 @@ def function_schema( fields[name] = ( ann, - Field(default_factory=dict, description=field_description), # type: ignore + Field(default_factory=dict, description=field_description), ) else: diff --git a/src/agents/guardrail.py b/src/agents/guardrail.py index f8a272b53..99e287675 100644 --- a/src/agents/guardrail.py +++ b/src/agents/guardrail.py @@ -78,8 +78,9 @@ class InputGuardrail(Generic[TContext]): You can use the `@input_guardrail()` decorator to turn a function into an `InputGuardrail`, or create an `InputGuardrail` manually. - Guardrails return a `GuardrailResult`. If `result.tripwire_triggered` is `True`, the agent - execution will immediately stop and a `InputGuardrailTripwireTriggered` exception will be raised + Guardrails return a `GuardrailResult`. If `result.tripwire_triggered` is `True`, + the agent's execution will immediately stop, and + an `InputGuardrailTripwireTriggered` exception will be raised """ guardrail_function: Callable[ @@ -132,7 +133,7 @@ class OutputGuardrail(Generic[TContext]): You can use the `@output_guardrail()` decorator to turn a function into an `OutputGuardrail`, or create an `OutputGuardrail` manually. - Guardrails return a `GuardrailResult`. If `result.tripwire_triggered` is `True`, a + Guardrails return a `GuardrailResult`. If `result.tripwire_triggered` is `True`, an `OutputGuardrailTripwireTriggered` exception will be raised. """ @@ -244,7 +245,7 @@ def decorator( return InputGuardrail( guardrail_function=f, # If not set, guardrail name uses the function’s name by default. - name=name if name else f.__name__ + name=name if name else f.__name__, ) if func is not None: @@ -314,7 +315,11 @@ async def my_async_guardrail(...): ... def decorator( f: _OutputGuardrailFuncSync[TContext_co] | _OutputGuardrailFuncAsync[TContext_co], ) -> OutputGuardrail[TContext_co]: - return OutputGuardrail(guardrail_function=f, name=name) + return OutputGuardrail( + guardrail_function=f, + # Guardrail name defaults to function's name when not specified (None). + name=name if name else f.__name__, + ) if func is not None: # Decorator was used without parentheses diff --git a/src/agents/handoffs.py b/src/agents/handoffs.py index cb2752e4f..2c52737ad 100644 --- a/src/agents/handoffs.py +++ b/src/agents/handoffs.py @@ -3,7 +3,7 @@ import inspect import json from collections.abc import Awaitable -from dataclasses import dataclass +from dataclasses import dataclass, replace as dataclasses_replace from typing import TYPE_CHECKING, Any, Callable, Generic, cast, overload from pydantic import TypeAdapter @@ -18,12 +18,15 @@ from .util._types import MaybeAwaitable if TYPE_CHECKING: - from .agent import Agent + from .agent import Agent, AgentBase # The handoff input type is the type of data passed when the agent is called via a handoff. THandoffInput = TypeVar("THandoffInput", default=Any) +# The agent type that the handoff returns +TAgent = TypeVar("TAgent", bound="AgentBase[Any]", default="Agent[Any]") + OnHandoffWithInput = Callable[[RunContextWrapper[Any], THandoffInput], Any] OnHandoffWithoutInput = Callable[[RunContextWrapper[Any]], Any] @@ -46,13 +49,29 @@ class HandoffInputData: handoff and the tool output message representing the response from the handoff output. """ + run_context: RunContextWrapper[Any] | None = None + """ + The run context at the time the handoff was invoked. + Note that, since this property was added later on, it's optional for backwards compatibility. + """ + + def clone(self, **kwargs: Any) -> HandoffInputData: + """ + Make a copy of the handoff input data, with the given arguments changed. For example, you + could do: + ``` + new_handoff_input_data = handoff_input_data.clone(new_items=()) + ``` + """ + return dataclasses_replace(self, **kwargs) + -HandoffInputFilter: TypeAlias = Callable[[HandoffInputData], HandoffInputData] +HandoffInputFilter: TypeAlias = Callable[[HandoffInputData], MaybeAwaitable[HandoffInputData]] """A function that filters the input data passed to the next agent.""" @dataclass -class Handoff(Generic[TContext]): +class Handoff(Generic[TContext, TAgent]): """A handoff is when an agent delegates a task to another agent. For example, in a customer support scenario you might have a "triage agent" that determines which agent should handle the user's request, and sub-agents that specialize in different @@ -69,7 +88,7 @@ class Handoff(Generic[TContext]): """The JSON schema for the handoff input. Can be empty if the handoff does not take an input. """ - on_invoke_handoff: Callable[[RunContextWrapper[Any], str], Awaitable[Agent[TContext]]] + on_invoke_handoff: Callable[[RunContextWrapper[Any], str], Awaitable[TAgent]] """The function that invokes the handoff. The parameters passed are: 1. The handoff run context 2. The arguments from the LLM, as a JSON string. Empty string if input_json_schema is empty. @@ -100,20 +119,22 @@ class Handoff(Generic[TContext]): True, as it increases the likelihood of correct JSON input. """ - is_enabled: bool | Callable[[RunContextWrapper[Any], Agent[Any]], MaybeAwaitable[bool]] = True + is_enabled: bool | Callable[[RunContextWrapper[Any], AgentBase[Any]], MaybeAwaitable[bool]] = ( + True + ) """Whether the handoff is enabled. Either a bool or a Callable that takes the run context and agent and returns whether the handoff is enabled. You can use this to dynamically enable/disable a handoff based on your context/state.""" - def get_transfer_message(self, agent: Agent[Any]) -> str: + def get_transfer_message(self, agent: AgentBase[Any]) -> str: return json.dumps({"assistant": agent.name}) @classmethod - def default_tool_name(cls, agent: Agent[Any]) -> str: + def default_tool_name(cls, agent: AgentBase[Any]) -> str: return _transforms.transform_string_function_style(f"transfer_to_{agent.name}") @classmethod - def default_tool_description(cls, agent: Agent[Any]) -> str: + def default_tool_description(cls, agent: AgentBase[Any]) -> str: return ( f"Handoff to the {agent.name} agent to handle the request. " f"{agent.handoff_description or ''}" @@ -128,7 +149,7 @@ def handoff( tool_description_override: str | None = None, input_filter: Callable[[HandoffInputData], HandoffInputData] | None = None, is_enabled: bool | Callable[[RunContextWrapper[Any], Agent[Any]], MaybeAwaitable[bool]] = True, -) -> Handoff[TContext]: ... +) -> Handoff[TContext, Agent[TContext]]: ... @overload @@ -141,7 +162,7 @@ def handoff( tool_name_override: str | None = None, input_filter: Callable[[HandoffInputData], HandoffInputData] | None = None, is_enabled: bool | Callable[[RunContextWrapper[Any], Agent[Any]], MaybeAwaitable[bool]] = True, -) -> Handoff[TContext]: ... +) -> Handoff[TContext, Agent[TContext]]: ... @overload @@ -153,7 +174,7 @@ def handoff( tool_name_override: str | None = None, input_filter: Callable[[HandoffInputData], HandoffInputData] | None = None, is_enabled: bool | Callable[[RunContextWrapper[Any], Agent[Any]], MaybeAwaitable[bool]] = True, -) -> Handoff[TContext]: ... +) -> Handoff[TContext, Agent[TContext]]: ... def handoff( @@ -163,8 +184,9 @@ def handoff( on_handoff: OnHandoffWithInput[THandoffInput] | OnHandoffWithoutInput | None = None, input_type: type[THandoffInput] | None = None, input_filter: Callable[[HandoffInputData], HandoffInputData] | None = None, - is_enabled: bool | Callable[[RunContextWrapper[Any], Agent[Any]], MaybeAwaitable[bool]] = True, -) -> Handoff[TContext]: + is_enabled: bool + | Callable[[RunContextWrapper[Any], Agent[TContext]], MaybeAwaitable[bool]] = True, +) -> Handoff[TContext, Agent[TContext]]: """Create a handoff from an agent. Args: @@ -202,7 +224,7 @@ def handoff( async def _invoke_handoff( ctx: RunContextWrapper[Any], input_json: str | None = None - ) -> Agent[Any]: + ) -> Agent[TContext]: if input_type is not None and type_adapter is not None: if input_json is None: _error_tracing.attach_error_to_current_span( @@ -239,6 +261,18 @@ async def _invoke_handoff( # If there is a need, we can make this configurable in the future input_json_schema = ensure_strict_json_schema(input_json_schema) + async def _is_enabled(ctx: RunContextWrapper[Any], agent_base: AgentBase[Any]) -> bool: + from .agent import Agent + + assert callable(is_enabled), "is_enabled must be callable here" + assert isinstance(agent_base, Agent), "Can't handoff to a non-Agent" + result = is_enabled(ctx, agent_base) + + if inspect.isawaitable(result): + return await result + + return result + return Handoff( tool_name=tool_name, tool_description=tool_description, @@ -246,5 +280,5 @@ async def _invoke_handoff( on_invoke_handoff=_invoke_handoff, input_filter=input_filter, agent_name=agent.name, - is_enabled=is_enabled, + is_enabled=_is_enabled if callable(is_enabled) else is_enabled, ) diff --git a/src/agents/items.py b/src/agents/items.py index 64797ad22..8e7d1cfc3 100644 --- a/src/agents/items.py +++ b/src/agents/items.py @@ -1,10 +1,10 @@ from __future__ import annotations import abc -import copy from dataclasses import dataclass from typing import TYPE_CHECKING, Any, Generic, Literal, TypeVar, Union +import pydantic from openai.types.responses import ( Response, ResponseComputerToolCall, @@ -21,6 +21,12 @@ from openai.types.responses.response_code_interpreter_tool_call import ( ResponseCodeInterpreterToolCall, ) +from openai.types.responses.response_function_call_output_item_list_param import ( + ResponseFunctionCallOutputItemListParam, + ResponseFunctionCallOutputItemParam, +) +from openai.types.responses.response_input_file_content_param import ResponseInputFileContentParam +from openai.types.responses.response_input_image_content_param import ResponseInputImageContentParam from openai.types.responses.response_input_item_param import ( ComputerCallOutput, FunctionCallOutput, @@ -36,9 +42,17 @@ ) from openai.types.responses.response_reasoning_item import ResponseReasoningItem from pydantic import BaseModel -from typing_extensions import TypeAlias +from typing_extensions import TypeAlias, assert_never from .exceptions import AgentsException, ModelBehaviorError +from .logger import logger +from .tool import ( + ToolOutputFileContent, + ToolOutputImage, + ToolOutputText, + ValidToolOutputPydanticModels, + ValidToolOutputPydanticModelsTypeAdapter, +) from .usage import Usage if TYPE_CHECKING: @@ -65,7 +79,7 @@ class RunItemBase(Generic[T], abc.ABC): """The agent whose run caused this item to be generated.""" raw_item: T - """The raw Responses item from the run. This will always be a either an output item (i.e. + """The raw Responses item from the run. This will always be either an output item (i.e. `openai.types.responses.ResponseOutputItem` or an input item (i.e. `openai.types.responses.ResponseInputItemParam`). """ @@ -212,7 +226,7 @@ class MCPApprovalResponseItem(RunItemBase[McpApprovalResponse]): """An item generated by an agent.""" -@dataclass +@pydantic.dataclasses.dataclass class ModelResponse: output: list[TResponseOutputItem] """A list of outputs (messages, tool calls, etc) generated by the model""" @@ -242,6 +256,8 @@ def extract_last_content(cls, message: TResponseOutputItem) -> str: if not isinstance(message, ResponseOutputMessage): return "" + if not message.content: + return "" last_content = message.content[-1] if isinstance(last_content, ResponseOutputText): return last_content.text @@ -254,6 +270,8 @@ def extract_last_content(cls, message: TResponseOutputItem) -> str: def extract_last_text(cls, message: TResponseOutputItem) -> str | None: """Extracts the last text content from a message, if any. Ignores refusals.""" if isinstance(message, ResponseOutputMessage): + if not message.content: + return None last_content = message.content[-1] if isinstance(last_content, ResponseOutputText): return last_content.text @@ -272,7 +290,7 @@ def input_to_new_input_list( "role": "user", } ] - return copy.deepcopy(input) + return input.copy() @classmethod def text_message_outputs(cls, items: list[RunItem]) -> str: @@ -294,11 +312,96 @@ def text_message_output(cls, message: MessageOutputItem) -> str: @classmethod def tool_call_output_item( - cls, tool_call: ResponseFunctionToolCall, output: str + cls, tool_call: ResponseFunctionToolCall, output: Any ) -> FunctionCallOutput: - """Creates a tool call output item from a tool call and its output.""" + """Creates a tool call output item from a tool call and its output. + + Accepts either plain values (stringified) or structured outputs using + input_text/input_image/input_file shapes. Structured outputs may be + provided as Pydantic models or dicts, or an iterable of such items. + """ + + converted_output = cls._convert_tool_output(output) + return { "call_id": tool_call.call_id, - "output": output, + "output": converted_output, "type": "function_call_output", } + + @classmethod + def _convert_tool_output(cls, output: Any) -> str | ResponseFunctionCallOutputItemListParam: + """Converts a tool return value into an output acceptable by the Responses API.""" + + # If the output is either a single or list of the known structured output types, convert to + # ResponseFunctionCallOutputItemListParam. Else, just stringify. + if isinstance(output, (list, tuple)): + maybe_converted_output_list = [ + cls._maybe_get_output_as_structured_function_output(item) for item in output + ] + if all(maybe_converted_output_list): + return [ + cls._convert_single_tool_output_pydantic_model(item) + for item in maybe_converted_output_list + if item is not None + ] + else: + return str(output) + else: + maybe_converted_output = cls._maybe_get_output_as_structured_function_output(output) + if maybe_converted_output: + return [cls._convert_single_tool_output_pydantic_model(maybe_converted_output)] + else: + return str(output) + + @classmethod + def _maybe_get_output_as_structured_function_output( + cls, output: Any + ) -> ValidToolOutputPydanticModels | None: + if isinstance(output, (ToolOutputText, ToolOutputImage, ToolOutputFileContent)): + return output + elif isinstance(output, dict): + # Require explicit 'type' field in dict to be considered a structured output + if "type" not in output: + return None + try: + return ValidToolOutputPydanticModelsTypeAdapter.validate_python(output) + except pydantic.ValidationError: + logger.debug("dict was not a valid tool output pydantic model") + return None + + return None + + @classmethod + def _convert_single_tool_output_pydantic_model( + cls, output: ValidToolOutputPydanticModels + ) -> ResponseFunctionCallOutputItemParam: + if isinstance(output, ToolOutputText): + return {"type": "input_text", "text": output.text} + elif isinstance(output, ToolOutputImage): + # Forward all provided optional fields so the Responses API receives + # the correct identifiers and settings for the image resource. + result: ResponseInputImageContentParam = {"type": "input_image"} + if output.image_url is not None: + result["image_url"] = output.image_url + if output.file_id is not None: + result["file_id"] = output.file_id + if output.detail is not None: + result["detail"] = output.detail + return result + elif isinstance(output, ToolOutputFileContent): + # Forward all provided optional fields so the Responses API receives + # the correct identifiers and metadata for the file resource. + result_file: ResponseInputFileContentParam = {"type": "input_file"} + if output.file_data is not None: + result_file["file_data"] = output.file_data + if output.file_url is not None: + result_file["file_url"] = output.file_url + if output.file_id is not None: + result_file["file_id"] = output.file_id + if output.filename is not None: + result_file["filename"] = output.filename + return result_file + else: + assert_never(output) + raise ValueError(f"Unexpected tool output type: {output}") diff --git a/src/agents/lifecycle.py b/src/agents/lifecycle.py index 2cce496c8..438f25d7a 100644 --- a/src/agents/lifecycle.py +++ b/src/agents/lifecycle.py @@ -1,8 +1,9 @@ -from typing import Any, Generic +from typing import Any, Generic, Optional from typing_extensions import TypeVar from .agent import Agent, AgentBase +from .items import ModelResponse, TResponseInputItem from .run_context import RunContextWrapper, TContext from .tool import Tool @@ -14,6 +15,25 @@ class RunHooksBase(Generic[TContext, TAgent]): override the methods you need. """ + async def on_llm_start( + self, + context: RunContextWrapper[TContext], + agent: Agent[TContext], + system_prompt: Optional[str], + input_items: list[TResponseInputItem], + ) -> None: + """Called just before invoking the LLM for this agent.""" + pass + + async def on_llm_end( + self, + context: RunContextWrapper[TContext], + agent: Agent[TContext], + response: ModelResponse, + ) -> None: + """Called immediately after the LLM call returns for this agent.""" + pass + async def on_agent_start(self, context: RunContextWrapper[TContext], agent: TAgent) -> None: """Called before the agent is invoked. Called each time the current agent changes.""" pass @@ -42,7 +62,7 @@ async def on_tool_start( agent: TAgent, tool: Tool, ) -> None: - """Called before a tool is invoked.""" + """Called concurrently with tool invocation.""" pass async def on_tool_end( @@ -93,7 +113,7 @@ async def on_tool_start( agent: TAgent, tool: Tool, ) -> None: - """Called before a tool is invoked.""" + """Called concurrently with tool invocation.""" pass async def on_tool_end( @@ -106,6 +126,25 @@ async def on_tool_end( """Called after a tool is invoked.""" pass + async def on_llm_start( + self, + context: RunContextWrapper[TContext], + agent: Agent[TContext], + system_prompt: Optional[str], + input_items: list[TResponseInputItem], + ) -> None: + """Called immediately before the agent issues an LLM call.""" + pass + + async def on_llm_end( + self, + context: RunContextWrapper[TContext], + agent: Agent[TContext], + response: ModelResponse, + ) -> None: + """Called immediately after the agent receives the LLM response.""" + pass + RunHooks = RunHooksBase[TContext, Agent] """Run hooks when using `Agent`.""" diff --git a/src/agents/mcp/server.py b/src/agents/mcp/server.py index 91a9274fc..dfd331eaa 100644 --- a/src/agents/mcp/server.py +++ b/src/agents/mcp/server.py @@ -3,13 +3,15 @@ import abc import asyncio import inspect +from collections.abc import Awaitable from contextlib import AbstractAsyncContextManager, AsyncExitStack from datetime import timedelta from pathlib import Path -from typing import TYPE_CHECKING, Any, Literal, cast +from typing import TYPE_CHECKING, Any, Callable, Literal, TypeVar from anyio.streams.memory import MemoryObjectReceiveStream, MemoryObjectSendStream from mcp import ClientSession, StdioServerParameters, Tool as MCPTool, stdio_client +from mcp.client.session import MessageHandlerFnT from mcp.client.sse import sse_client from mcp.client.streamable_http import GetSessionIdCallback, streamablehttp_client from mcp.shared.message import SessionMessage @@ -19,7 +21,9 @@ from ..exceptions import UserError from ..logger import logger from ..run_context import RunContextWrapper -from .util import ToolFilter, ToolFilterCallable, ToolFilterContext, ToolFilterStatic +from .util import HttpClientFactory, ToolFilter, ToolFilterContext, ToolFilterStatic + +T = TypeVar("T") if TYPE_CHECKING: from ..agent import AgentBase @@ -28,6 +32,17 @@ class MCPServer(abc.ABC): """Base class for Model Context Protocol servers.""" + def __init__(self, use_structured_content: bool = False): + """ + Args: + use_structured_content: Whether to use `tool_result.structured_content` when calling an + MCP tool.Defaults to False for backwards compatibility - most MCP servers still + include the structured content in the `tool_result.content`, and using it by + default will cause duplicate content. You can set this to True if you know the + server will not duplicate the structured content in the `tool_result.content`. + """ + self.use_structured_content = use_structured_content + @abc.abstractmethod async def connect(self): """Connect to the server. For example, this might mean spawning a subprocess or @@ -86,6 +101,10 @@ def __init__( cache_tools_list: bool, client_session_timeout_seconds: float | None, tool_filter: ToolFilter = None, + use_structured_content: bool = False, + max_retry_attempts: int = 0, + retry_backoff_seconds_base: float = 1.0, + message_handler: MessageHandlerFnT | None = None, ): """ Args: @@ -98,7 +117,19 @@ def __init__( client_session_timeout_seconds: the read timeout passed to the MCP ClientSession. tool_filter: The tool filter to use for filtering tools. + use_structured_content: Whether to use `tool_result.structured_content` when calling an + MCP tool. Defaults to False for backwards compatibility - most MCP servers still + include the structured content in the `tool_result.content`, and using it by + default will cause duplicate content. You can set this to True if you know the + server will not duplicate the structured content in the `tool_result.content`. + max_retry_attempts: Number of times to retry failed list_tools/call_tool calls. + Defaults to no retries. + retry_backoff_seconds_base: The base delay, in seconds, used for exponential + backoff between retries. + message_handler: Optional handler invoked for session messages as delivered by the + ClientSession. """ + super().__init__(use_structured_content=use_structured_content) self.session: ClientSession | None = None self.exit_stack: AsyncExitStack = AsyncExitStack() self._cleanup_lock: asyncio.Lock = asyncio.Lock() @@ -106,6 +137,9 @@ def __init__( self.server_initialize_result: InitializeResult | None = None self.client_session_timeout_seconds = client_session_timeout_seconds + self.max_retry_attempts = max_retry_attempts + self.retry_backoff_seconds_base = retry_backoff_seconds_base + self.message_handler = message_handler # The cache is always dirty at startup, so that we fetch tools at least once self._cache_dirty = True @@ -157,10 +191,10 @@ async def _apply_dynamic_tool_filter( ) -> list[MCPTool]: """Apply dynamic tool filtering using a callable filter function.""" - # Ensure we have a callable filter and cast to help mypy + # Ensure we have a callable filter if not callable(self.tool_filter): raise ValueError("Tool filter must be callable for dynamic filtering") - tool_filter_func = cast(ToolFilterCallable, self.tool_filter) + tool_filter_func = self.tool_filter # Create filter context filter_context = ToolFilterContext( @@ -215,6 +249,18 @@ def invalidate_tools_cache(self): """Invalidate the tools cache.""" self._cache_dirty = True + async def _run_with_retries(self, func: Callable[[], Awaitable[T]]) -> T: + attempts = 0 + while True: + try: + return await func() + except Exception: + attempts += 1 + if self.max_retry_attempts != -1 and attempts > self.max_retry_attempts: + raise + backoff = self.retry_backoff_seconds_base * (2 ** (attempts - 1)) + await asyncio.sleep(backoff) + async def connect(self): """Connect to the server.""" try: @@ -231,6 +277,7 @@ async def connect(self): timedelta(seconds=self.client_session_timeout_seconds) if self.client_session_timeout_seconds else None, + message_handler=self.message_handler, ) ) server_result = await session.initialize() @@ -249,15 +296,17 @@ async def list_tools( """List the tools available on the server.""" if not self.session: raise UserError("Server not initialized. Make sure you call `connect()` first.") + session = self.session + assert session is not None # Return from cache if caching is enabled, we have tools, and the cache is not dirty if self.cache_tools_list and not self._cache_dirty and self._tools_list: tools = self._tools_list else: - # Reset the cache dirty to False - self._cache_dirty = False # Fetch the tools from the server - self._tools_list = (await self.session.list_tools()).tools + result = await self._run_with_retries(lambda: session.list_tools()) + self._tools_list = result.tools + self._cache_dirty = False tools = self._tools_list # Filter tools based on tool_filter @@ -272,8 +321,10 @@ async def call_tool(self, tool_name: str, arguments: dict[str, Any] | None) -> C """Invoke a tool on the server.""" if not self.session: raise UserError("Server not initialized. Make sure you call `connect()` first.") + session = self.session + assert session is not None - return await self.session.call_tool(tool_name, arguments) + return await self._run_with_retries(lambda: session.call_tool(tool_name, arguments)) async def list_prompts( self, @@ -346,6 +397,10 @@ def __init__( name: str | None = None, client_session_timeout_seconds: float | None = 5, tool_filter: ToolFilter = None, + use_structured_content: bool = False, + max_retry_attempts: int = 0, + retry_backoff_seconds_base: float = 1.0, + message_handler: MessageHandlerFnT | None = None, ): """Create a new MCP server based on the stdio transport. @@ -364,11 +419,26 @@ def __init__( command. client_session_timeout_seconds: the read timeout passed to the MCP ClientSession. tool_filter: The tool filter to use for filtering tools. + use_structured_content: Whether to use `tool_result.structured_content` when calling an + MCP tool. Defaults to False for backwards compatibility - most MCP servers still + include the structured content in the `tool_result.content`, and using it by + default will cause duplicate content. You can set this to True if you know the + server will not duplicate the structured content in the `tool_result.content`. + max_retry_attempts: Number of times to retry failed list_tools/call_tool calls. + Defaults to no retries. + retry_backoff_seconds_base: The base delay, in seconds, for exponential + backoff between retries. + message_handler: Optional handler invoked for session messages as delivered by the + ClientSession. """ super().__init__( cache_tools_list, client_session_timeout_seconds, tool_filter, + use_structured_content, + max_retry_attempts, + retry_backoff_seconds_base, + message_handler=message_handler, ) self.params = StdioServerParameters( @@ -429,6 +499,10 @@ def __init__( name: str | None = None, client_session_timeout_seconds: float | None = 5, tool_filter: ToolFilter = None, + use_structured_content: bool = False, + max_retry_attempts: int = 0, + retry_backoff_seconds_base: float = 1.0, + message_handler: MessageHandlerFnT | None = None, ): """Create a new MCP server based on the HTTP with SSE transport. @@ -449,11 +523,26 @@ def __init__( client_session_timeout_seconds: the read timeout passed to the MCP ClientSession. tool_filter: The tool filter to use for filtering tools. + use_structured_content: Whether to use `tool_result.structured_content` when calling an + MCP tool. Defaults to False for backwards compatibility - most MCP servers still + include the structured content in the `tool_result.content`, and using it by + default will cause duplicate content. You can set this to True if you know the + server will not duplicate the structured content in the `tool_result.content`. + max_retry_attempts: Number of times to retry failed list_tools/call_tool calls. + Defaults to no retries. + retry_backoff_seconds_base: The base delay, in seconds, for exponential + backoff between retries. + message_handler: Optional handler invoked for session messages as delivered by the + ClientSession. """ super().__init__( cache_tools_list, client_session_timeout_seconds, tool_filter, + use_structured_content, + max_retry_attempts, + retry_backoff_seconds_base, + message_handler=message_handler, ) self.params = params @@ -500,6 +589,9 @@ class MCPServerStreamableHttpParams(TypedDict): terminate_on_close: NotRequired[bool] """Terminate on close""" + httpx_client_factory: NotRequired[HttpClientFactory] + """Custom HTTP client factory for configuring httpx.AsyncClient behavior.""" + class MCPServerStreamableHttp(_MCPServerWithClientSession): """MCP server implementation that uses the Streamable HTTP transport. See the [spec] @@ -514,14 +606,18 @@ def __init__( name: str | None = None, client_session_timeout_seconds: float | None = 5, tool_filter: ToolFilter = None, + use_structured_content: bool = False, + max_retry_attempts: int = 0, + retry_backoff_seconds_base: float = 1.0, + message_handler: MessageHandlerFnT | None = None, ): """Create a new MCP server based on the Streamable HTTP transport. Args: params: The params that configure the server. This includes the URL of the server, - the headers to send to the server, the timeout for the HTTP request, and the - timeout for the Streamable HTTP connection and whether we need to - terminate on close. + the headers to send to the server, the timeout for the HTTP request, the + timeout for the Streamable HTTP connection, whether we need to + terminate on close, and an optional custom HTTP client factory. cache_tools_list: Whether to cache the tools list. If `True`, the tools list will be cached and only fetched from the server once. If `False`, the tools list will be @@ -535,11 +631,26 @@ def __init__( client_session_timeout_seconds: the read timeout passed to the MCP ClientSession. tool_filter: The tool filter to use for filtering tools. + use_structured_content: Whether to use `tool_result.structured_content` when calling an + MCP tool. Defaults to False for backwards compatibility - most MCP servers still + include the structured content in the `tool_result.content`, and using it by + default will cause duplicate content. You can set this to True if you know the + server will not duplicate the structured content in the `tool_result.content`. + max_retry_attempts: Number of times to retry failed list_tools/call_tool calls. + Defaults to no retries. + retry_backoff_seconds_base: The base delay, in seconds, for exponential + backoff between retries. + message_handler: Optional handler invoked for session messages as delivered by the + ClientSession. """ super().__init__( cache_tools_list, client_session_timeout_seconds, tool_filter, + use_structured_content, + max_retry_attempts, + retry_backoff_seconds_base, + message_handler=message_handler, ) self.params = params @@ -555,13 +666,24 @@ def create_streams( ] ]: """Create the streams for the server.""" - return streamablehttp_client( - url=self.params["url"], - headers=self.params.get("headers", None), - timeout=self.params.get("timeout", 5), - sse_read_timeout=self.params.get("sse_read_timeout", 60 * 5), - terminate_on_close=self.params.get("terminate_on_close", True), - ) + # Only pass httpx_client_factory if it's provided + if "httpx_client_factory" in self.params: + return streamablehttp_client( + url=self.params["url"], + headers=self.params.get("headers", None), + timeout=self.params.get("timeout", 5), + sse_read_timeout=self.params.get("sse_read_timeout", 60 * 5), + terminate_on_close=self.params.get("terminate_on_close", True), + httpx_client_factory=self.params["httpx_client_factory"], + ) + else: + return streamablehttp_client( + url=self.params["url"], + headers=self.params.get("headers", None), + timeout=self.params.get("timeout", 5), + sse_read_timeout=self.params.get("sse_read_timeout", 60 * 5), + terminate_on_close=self.params.get("terminate_on_close", True), + ) @property def name(self) -> str: diff --git a/src/agents/mcp/util.py b/src/agents/mcp/util.py index 18cf4440a..6cfe5c96d 100644 --- a/src/agents/mcp/util.py +++ b/src/agents/mcp/util.py @@ -1,8 +1,9 @@ import functools import json from dataclasses import dataclass -from typing import TYPE_CHECKING, Any, Callable, Optional, Union +from typing import TYPE_CHECKING, Any, Callable, Optional, Protocol, Union +import httpx from typing_extensions import NotRequired, TypedDict from .. import _debug @@ -21,6 +22,21 @@ from .server import MCPServer +class HttpClientFactory(Protocol): + """Protocol for HTTP client factory functions. + + This interface matches the MCP SDK's McpHttpClientFactory but is defined locally + to avoid accessing internal MCP SDK modules. + """ + + def __call__( + self, + headers: Optional[dict[str, str]] = None, + timeout: Optional[httpx.Timeout] = None, + auth: Optional[httpx.Auth] = None, + ) -> httpx.AsyncClient: ... + + @dataclass class ToolFilterContext: """Context information available to tool filter functions.""" @@ -194,15 +210,21 @@ async def invoke_mcp_tool( else: logger.debug(f"MCP tool {tool.name} returned {result}") - # The MCP tool result is a list of content items, whereas OpenAI tool outputs are a single - # string. We'll try to convert. - if len(result.content) == 1: - tool_output = result.content[0].model_dump_json() - elif len(result.content) > 1: - tool_output = json.dumps([item.model_dump(mode="json") for item in result.content]) + # If structured content is requested and available, use it exclusively + if server.use_structured_content and result.structuredContent: + tool_output = json.dumps(result.structuredContent) else: - logger.error(f"Errored MCP tool result: {result}") - tool_output = "Error running tool." + # Fall back to regular text content processing + # The MCP tool result is a list of content items, whereas OpenAI tool + # outputs are a single string. We'll try to convert. + if len(result.content) == 1: + tool_output = result.content[0].model_dump_json() + elif len(result.content) > 1: + tool_results = [item.model_dump(mode="json") for item in result.content] + tool_output = json.dumps(tool_results) + else: + # Empty content is a valid result (e.g., "no results found") + tool_output = "[]" current_span = get_current_span() if current_span: diff --git a/src/agents/memory/__init__.py b/src/agents/memory/__init__.py index 059ca57ab..1db1598ac 100644 --- a/src/agents/memory/__init__.py +++ b/src/agents/memory/__init__.py @@ -1,3 +1,12 @@ -from .session import Session, SQLiteSession +from .openai_conversations_session import OpenAIConversationsSession +from .session import Session, SessionABC +from .sqlite_session import SQLiteSession +from .util import SessionInputCallback -__all__ = ["Session", "SQLiteSession"] +__all__ = [ + "Session", + "SessionABC", + "SessionInputCallback", + "SQLiteSession", + "OpenAIConversationsSession", +] diff --git a/src/agents/memory/openai_conversations_session.py b/src/agents/memory/openai_conversations_session.py new file mode 100644 index 000000000..6a14e81a0 --- /dev/null +++ b/src/agents/memory/openai_conversations_session.py @@ -0,0 +1,91 @@ +from __future__ import annotations + +from openai import AsyncOpenAI + +from agents.models._openai_shared import get_default_openai_client + +from ..items import TResponseInputItem +from .session import SessionABC + + +async def start_openai_conversations_session(openai_client: AsyncOpenAI | None = None) -> str: + _maybe_openai_client = openai_client + if openai_client is None: + _maybe_openai_client = get_default_openai_client() or AsyncOpenAI() + # this never be None here + _openai_client: AsyncOpenAI = _maybe_openai_client # type: ignore [assignment] + + response = await _openai_client.conversations.create(items=[]) + return response.id + + +class OpenAIConversationsSession(SessionABC): + def __init__( + self, + *, + conversation_id: str | None = None, + openai_client: AsyncOpenAI | None = None, + ): + self._session_id: str | None = conversation_id + _openai_client = openai_client + if _openai_client is None: + _openai_client = get_default_openai_client() or AsyncOpenAI() + # this never be None here + self._openai_client: AsyncOpenAI = _openai_client + + async def _get_session_id(self) -> str: + if self._session_id is None: + self._session_id = await start_openai_conversations_session(self._openai_client) + return self._session_id + + async def _clear_session_id(self) -> None: + self._session_id = None + + async def get_items(self, limit: int | None = None) -> list[TResponseInputItem]: + session_id = await self._get_session_id() + all_items = [] + if limit is None: + async for item in self._openai_client.conversations.items.list( + conversation_id=session_id, + order="asc", + ): + # calling model_dump() to make this serializable + all_items.append(item.model_dump(exclude_unset=True)) + else: + async for item in self._openai_client.conversations.items.list( + conversation_id=session_id, + limit=limit, + order="desc", + ): + # calling model_dump() to make this serializable + all_items.append(item.model_dump(exclude_unset=True)) + if limit is not None and len(all_items) >= limit: + break + all_items.reverse() + + return all_items # type: ignore + + async def add_items(self, items: list[TResponseInputItem]) -> None: + session_id = await self._get_session_id() + await self._openai_client.conversations.items.create( + conversation_id=session_id, + items=items, + ) + + async def pop_item(self) -> TResponseInputItem | None: + session_id = await self._get_session_id() + items = await self.get_items(limit=1) + if not items: + return None + item_id: str = str(items[0]["id"]) # type: ignore [typeddict-item] + await self._openai_client.conversations.items.delete( + conversation_id=session_id, item_id=item_id + ) + return items[0] + + async def clear_session(self) -> None: + session_id = await self._get_session_id() + await self._openai_client.conversations.delete( + conversation_id=session_id, + ) + await self._clear_session_id() diff --git a/src/agents/memory/session.py b/src/agents/memory/session.py index 8db0971eb..9c85af6dd 100644 --- a/src/agents/memory/session.py +++ b/src/agents/memory/session.py @@ -1,11 +1,6 @@ from __future__ import annotations -import asyncio -import json -import sqlite3 -import threading from abc import ABC, abstractmethod -from pathlib import Path from typing import TYPE_CHECKING, Protocol, runtime_checkable if TYPE_CHECKING: @@ -102,268 +97,3 @@ async def pop_item(self) -> TResponseInputItem | None: async def clear_session(self) -> None: """Clear all items for this session.""" ... - - -class SQLiteSession(SessionABC): - """SQLite-based implementation of session storage. - - This implementation stores conversation history in a SQLite database. - By default, uses an in-memory database that is lost when the process ends. - For persistent storage, provide a file path. - """ - - def __init__( - self, - session_id: str, - db_path: str | Path = ":memory:", - sessions_table: str = "agent_sessions", - messages_table: str = "agent_messages", - ): - """Initialize the SQLite session. - - Args: - session_id: Unique identifier for the conversation session - db_path: Path to the SQLite database file. Defaults to ':memory:' (in-memory database) - sessions_table: Name of the table to store session metadata. Defaults to - 'agent_sessions' - messages_table: Name of the table to store message data. Defaults to 'agent_messages' - """ - self.session_id = session_id - self.db_path = db_path - self.sessions_table = sessions_table - self.messages_table = messages_table - self._local = threading.local() - self._lock = threading.Lock() - - # For in-memory databases, we need a shared connection to avoid thread isolation - # For file databases, we use thread-local connections for better concurrency - self._is_memory_db = str(db_path) == ":memory:" - if self._is_memory_db: - self._shared_connection = sqlite3.connect(":memory:", check_same_thread=False) - self._shared_connection.execute("PRAGMA journal_mode=WAL") - self._init_db_for_connection(self._shared_connection) - else: - # For file databases, initialize the schema once since it persists - init_conn = sqlite3.connect(str(self.db_path), check_same_thread=False) - init_conn.execute("PRAGMA journal_mode=WAL") - self._init_db_for_connection(init_conn) - init_conn.close() - - def _get_connection(self) -> sqlite3.Connection: - """Get a database connection.""" - if self._is_memory_db: - # Use shared connection for in-memory database to avoid thread isolation - return self._shared_connection - else: - # Use thread-local connections for file databases - if not hasattr(self._local, "connection"): - self._local.connection = sqlite3.connect( - str(self.db_path), - check_same_thread=False, - ) - self._local.connection.execute("PRAGMA journal_mode=WAL") - assert isinstance(self._local.connection, sqlite3.Connection), ( - f"Expected sqlite3.Connection, got {type(self._local.connection)}" - ) - return self._local.connection - - def _init_db_for_connection(self, conn: sqlite3.Connection) -> None: - """Initialize the database schema for a specific connection.""" - conn.execute( - f""" - CREATE TABLE IF NOT EXISTS {self.sessions_table} ( - session_id TEXT PRIMARY KEY, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP - ) - """ - ) - - conn.execute( - f""" - CREATE TABLE IF NOT EXISTS {self.messages_table} ( - id INTEGER PRIMARY KEY AUTOINCREMENT, - session_id TEXT NOT NULL, - message_data TEXT NOT NULL, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - FOREIGN KEY (session_id) REFERENCES {self.sessions_table} (session_id) - ON DELETE CASCADE - ) - """ - ) - - conn.execute( - f""" - CREATE INDEX IF NOT EXISTS idx_{self.messages_table}_session_id - ON {self.messages_table} (session_id, created_at) - """ - ) - - conn.commit() - - async def get_items(self, limit: int | None = None) -> list[TResponseInputItem]: - """Retrieve the conversation history for this session. - - Args: - limit: Maximum number of items to retrieve. If None, retrieves all items. - When specified, returns the latest N items in chronological order. - - Returns: - List of input items representing the conversation history - """ - - def _get_items_sync(): - conn = self._get_connection() - with self._lock if self._is_memory_db else threading.Lock(): - if limit is None: - # Fetch all items in chronological order - cursor = conn.execute( - f""" - SELECT message_data FROM {self.messages_table} - WHERE session_id = ? - ORDER BY created_at ASC - """, - (self.session_id,), - ) - else: - # Fetch the latest N items in chronological order - cursor = conn.execute( - f""" - SELECT message_data FROM {self.messages_table} - WHERE session_id = ? - ORDER BY created_at DESC - LIMIT ? - """, - (self.session_id, limit), - ) - - rows = cursor.fetchall() - - # Reverse to get chronological order when using DESC - if limit is not None: - rows = list(reversed(rows)) - - items = [] - for (message_data,) in rows: - try: - item = json.loads(message_data) - items.append(item) - except json.JSONDecodeError: - # Skip invalid JSON entries - continue - - return items - - return await asyncio.to_thread(_get_items_sync) - - async def add_items(self, items: list[TResponseInputItem]) -> None: - """Add new items to the conversation history. - - Args: - items: List of input items to add to the history - """ - if not items: - return - - def _add_items_sync(): - conn = self._get_connection() - - with self._lock if self._is_memory_db else threading.Lock(): - # Ensure session exists - conn.execute( - f""" - INSERT OR IGNORE INTO {self.sessions_table} (session_id) VALUES (?) - """, - (self.session_id,), - ) - - # Add items - message_data = [(self.session_id, json.dumps(item)) for item in items] - conn.executemany( - f""" - INSERT INTO {self.messages_table} (session_id, message_data) VALUES (?, ?) - """, - message_data, - ) - - # Update session timestamp - conn.execute( - f""" - UPDATE {self.sessions_table} - SET updated_at = CURRENT_TIMESTAMP - WHERE session_id = ? - """, - (self.session_id,), - ) - - conn.commit() - - await asyncio.to_thread(_add_items_sync) - - async def pop_item(self) -> TResponseInputItem | None: - """Remove and return the most recent item from the session. - - Returns: - The most recent item if it exists, None if the session is empty - """ - - def _pop_item_sync(): - conn = self._get_connection() - with self._lock if self._is_memory_db else threading.Lock(): - # Use DELETE with RETURNING to atomically delete and return the most recent item - cursor = conn.execute( - f""" - DELETE FROM {self.messages_table} - WHERE id = ( - SELECT id FROM {self.messages_table} - WHERE session_id = ? - ORDER BY created_at DESC - LIMIT 1 - ) - RETURNING message_data - """, - (self.session_id,), - ) - - result = cursor.fetchone() - conn.commit() - - if result: - message_data = result[0] - try: - item = json.loads(message_data) - return item - except json.JSONDecodeError: - # Return None for corrupted JSON entries (already deleted) - return None - - return None - - return await asyncio.to_thread(_pop_item_sync) - - async def clear_session(self) -> None: - """Clear all items for this session.""" - - def _clear_session_sync(): - conn = self._get_connection() - with self._lock if self._is_memory_db else threading.Lock(): - conn.execute( - f"DELETE FROM {self.messages_table} WHERE session_id = ?", - (self.session_id,), - ) - conn.execute( - f"DELETE FROM {self.sessions_table} WHERE session_id = ?", - (self.session_id,), - ) - conn.commit() - - await asyncio.to_thread(_clear_session_sync) - - def close(self) -> None: - """Close the database connection.""" - if self._is_memory_db: - if hasattr(self, "_shared_connection"): - self._shared_connection.close() - else: - if hasattr(self._local, "connection"): - self._local.connection.close() diff --git a/src/agents/memory/sqlite_session.py b/src/agents/memory/sqlite_session.py new file mode 100644 index 000000000..2c2386ec7 --- /dev/null +++ b/src/agents/memory/sqlite_session.py @@ -0,0 +1,275 @@ +from __future__ import annotations + +import asyncio +import json +import sqlite3 +import threading +from pathlib import Path + +from ..items import TResponseInputItem +from .session import SessionABC + + +class SQLiteSession(SessionABC): + """SQLite-based implementation of session storage. + + This implementation stores conversation history in a SQLite database. + By default, uses an in-memory database that is lost when the process ends. + For persistent storage, provide a file path. + """ + + def __init__( + self, + session_id: str, + db_path: str | Path = ":memory:", + sessions_table: str = "agent_sessions", + messages_table: str = "agent_messages", + ): + """Initialize the SQLite session. + + Args: + session_id: Unique identifier for the conversation session + db_path: Path to the SQLite database file. Defaults to ':memory:' (in-memory database) + sessions_table: Name of the table to store session metadata. Defaults to + 'agent_sessions' + messages_table: Name of the table to store message data. Defaults to 'agent_messages' + """ + self.session_id = session_id + self.db_path = db_path + self.sessions_table = sessions_table + self.messages_table = messages_table + self._local = threading.local() + self._lock = threading.Lock() + + # For in-memory databases, we need a shared connection to avoid thread isolation + # For file databases, we use thread-local connections for better concurrency + self._is_memory_db = str(db_path) == ":memory:" + if self._is_memory_db: + self._shared_connection = sqlite3.connect(":memory:", check_same_thread=False) + self._shared_connection.execute("PRAGMA journal_mode=WAL") + self._init_db_for_connection(self._shared_connection) + else: + # For file databases, initialize the schema once since it persists + init_conn = sqlite3.connect(str(self.db_path), check_same_thread=False) + init_conn.execute("PRAGMA journal_mode=WAL") + self._init_db_for_connection(init_conn) + init_conn.close() + + def _get_connection(self) -> sqlite3.Connection: + """Get a database connection.""" + if self._is_memory_db: + # Use shared connection for in-memory database to avoid thread isolation + return self._shared_connection + else: + # Use thread-local connections for file databases + if not hasattr(self._local, "connection"): + self._local.connection = sqlite3.connect( + str(self.db_path), + check_same_thread=False, + ) + self._local.connection.execute("PRAGMA journal_mode=WAL") + assert isinstance(self._local.connection, sqlite3.Connection), ( + f"Expected sqlite3.Connection, got {type(self._local.connection)}" + ) + return self._local.connection + + def _init_db_for_connection(self, conn: sqlite3.Connection) -> None: + """Initialize the database schema for a specific connection.""" + conn.execute( + f""" + CREATE TABLE IF NOT EXISTS {self.sessions_table} ( + session_id TEXT PRIMARY KEY, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP + ) + """ + ) + + conn.execute( + f""" + CREATE TABLE IF NOT EXISTS {self.messages_table} ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + session_id TEXT NOT NULL, + message_data TEXT NOT NULL, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (session_id) REFERENCES {self.sessions_table} (session_id) + ON DELETE CASCADE + ) + """ + ) + + conn.execute( + f""" + CREATE INDEX IF NOT EXISTS idx_{self.messages_table}_session_id + ON {self.messages_table} (session_id, created_at) + """ + ) + + conn.commit() + + async def get_items(self, limit: int | None = None) -> list[TResponseInputItem]: + """Retrieve the conversation history for this session. + + Args: + limit: Maximum number of items to retrieve. If None, retrieves all items. + When specified, returns the latest N items in chronological order. + + Returns: + List of input items representing the conversation history + """ + + def _get_items_sync(): + conn = self._get_connection() + with self._lock if self._is_memory_db else threading.Lock(): + if limit is None: + # Fetch all items in chronological order + cursor = conn.execute( + f""" + SELECT message_data FROM {self.messages_table} + WHERE session_id = ? + ORDER BY created_at ASC + """, + (self.session_id,), + ) + else: + # Fetch the latest N items in chronological order + cursor = conn.execute( + f""" + SELECT message_data FROM {self.messages_table} + WHERE session_id = ? + ORDER BY created_at DESC + LIMIT ? + """, + (self.session_id, limit), + ) + + rows = cursor.fetchall() + + # Reverse to get chronological order when using DESC + if limit is not None: + rows = list(reversed(rows)) + + items = [] + for (message_data,) in rows: + try: + item = json.loads(message_data) + items.append(item) + except json.JSONDecodeError: + # Skip invalid JSON entries + continue + + return items + + return await asyncio.to_thread(_get_items_sync) + + async def add_items(self, items: list[TResponseInputItem]) -> None: + """Add new items to the conversation history. + + Args: + items: List of input items to add to the history + """ + if not items: + return + + def _add_items_sync(): + conn = self._get_connection() + + with self._lock if self._is_memory_db else threading.Lock(): + # Ensure session exists + conn.execute( + f""" + INSERT OR IGNORE INTO {self.sessions_table} (session_id) VALUES (?) + """, + (self.session_id,), + ) + + # Add items + message_data = [(self.session_id, json.dumps(item)) for item in items] + conn.executemany( + f""" + INSERT INTO {self.messages_table} (session_id, message_data) VALUES (?, ?) + """, + message_data, + ) + + # Update session timestamp + conn.execute( + f""" + UPDATE {self.sessions_table} + SET updated_at = CURRENT_TIMESTAMP + WHERE session_id = ? + """, + (self.session_id,), + ) + + conn.commit() + + await asyncio.to_thread(_add_items_sync) + + async def pop_item(self) -> TResponseInputItem | None: + """Remove and return the most recent item from the session. + + Returns: + The most recent item if it exists, None if the session is empty + """ + + def _pop_item_sync(): + conn = self._get_connection() + with self._lock if self._is_memory_db else threading.Lock(): + # Use DELETE with RETURNING to atomically delete and return the most recent item + cursor = conn.execute( + f""" + DELETE FROM {self.messages_table} + WHERE id = ( + SELECT id FROM {self.messages_table} + WHERE session_id = ? + ORDER BY created_at DESC + LIMIT 1 + ) + RETURNING message_data + """, + (self.session_id,), + ) + + result = cursor.fetchone() + conn.commit() + + if result: + message_data = result[0] + try: + item = json.loads(message_data) + return item + except json.JSONDecodeError: + # Return None for corrupted JSON entries (already deleted) + return None + + return None + + return await asyncio.to_thread(_pop_item_sync) + + async def clear_session(self) -> None: + """Clear all items for this session.""" + + def _clear_session_sync(): + conn = self._get_connection() + with self._lock if self._is_memory_db else threading.Lock(): + conn.execute( + f"DELETE FROM {self.messages_table} WHERE session_id = ?", + (self.session_id,), + ) + conn.execute( + f"DELETE FROM {self.sessions_table} WHERE session_id = ?", + (self.session_id,), + ) + conn.commit() + + await asyncio.to_thread(_clear_session_sync) + + def close(self) -> None: + """Close the database connection.""" + if self._is_memory_db: + if hasattr(self, "_shared_connection"): + self._shared_connection.close() + else: + if hasattr(self._local, "connection"): + self._local.connection.close() diff --git a/src/agents/memory/util.py b/src/agents/memory/util.py new file mode 100644 index 000000000..49f281151 --- /dev/null +++ b/src/agents/memory/util.py @@ -0,0 +1,20 @@ +from __future__ import annotations + +from typing import Callable + +from ..items import TResponseInputItem +from ..util._types import MaybeAwaitable + +SessionInputCallback = Callable[ + [list[TResponseInputItem], list[TResponseInputItem]], + MaybeAwaitable[list[TResponseInputItem]], +] +"""A function that combines session history with new input items. + +Args: + history_items: The list of items from the session history. + new_items: The list of new input items for the current turn. + +Returns: + A list of combined items to be used as input for the agent. Can be sync or async. +""" diff --git a/src/agents/model_settings.py b/src/agents/model_settings.py index edb692960..6a3dbd04c 100644 --- a/src/agents/model_settings.py +++ b/src/agents/model_settings.py @@ -2,7 +2,7 @@ import dataclasses from collections.abc import Mapping -from dataclasses import dataclass, fields, replace +from dataclasses import fields, replace from typing import Annotated, Any, Literal, Union from openai import Omit as _Omit @@ -10,6 +10,7 @@ from openai.types.responses import ResponseIncludable from openai.types.shared import Reasoning from pydantic import BaseModel, GetCoreSchemaHandler +from pydantic.dataclasses import dataclass from pydantic_core import core_schema from typing_extensions import TypeAlias @@ -90,7 +91,10 @@ class ModelSettings: """ truncation: Literal["auto", "disabled"] | None = None - """The truncation strategy to use when calling the model.""" + """The truncation strategy to use when calling the model. + See [Responses API documentation](https://platform.openai.com/docs/api-reference/responses/create#responses_create-truncation) + for more details. + """ max_tokens: int | None = None """The maximum number of output tokens to generate.""" @@ -100,21 +104,33 @@ class ModelSettings: [reasoning models](https://platform.openai.com/docs/guides/reasoning). """ + verbosity: Literal["low", "medium", "high"] | None = None + """Constrains the verbosity of the model's response. + """ + metadata: dict[str, str] | None = None """Metadata to include with the model response call.""" store: bool | None = None """Whether to store the generated model response for later retrieval. - Defaults to True if not provided.""" + For Responses API: automatically enabled when not specified. + For Chat Completions API: disabled when not specified.""" include_usage: bool | None = None """Whether to include usage chunk. - Defaults to True if not provided.""" + Only available for Chat Completions API.""" - response_include: list[ResponseIncludable] | None = None + # TODO: revisit ResponseIncludable | str if ResponseIncludable covers more cases + # We've added str to support missing ones like + # "web_search_call.action.sources" etc. + response_include: list[ResponseIncludable | str] | None = None """Additional output data to include in the model response. [include parameter](https://platform.openai.com/docs/api-reference/responses/create#responses-create-include)""" + top_logprobs: int | None = None + """Number of top tokens to return logprobs for. Setting this will + automatically include ``"message.output_text.logprobs"`` in the response.""" + extra_query: Query | None = None """Additional query fields to provide with the request. Defaults to None if not provided.""" diff --git a/src/agents/models/__init__.py b/src/agents/models/__init__.py index e69de29bb..82998ac57 100644 --- a/src/agents/models/__init__.py +++ b/src/agents/models/__init__.py @@ -0,0 +1,13 @@ +from .default_models import ( + get_default_model, + get_default_model_settings, + gpt_5_reasoning_settings_required, + is_gpt_5_default, +) + +__all__ = [ + "get_default_model", + "get_default_model_settings", + "gpt_5_reasoning_settings_required", + "is_gpt_5_default", +] diff --git a/src/agents/models/chatcmpl_converter.py b/src/agents/models/chatcmpl_converter.py index d3c71c24e..6e01874a8 100644 --- a/src/agents/models/chatcmpl_converter.py +++ b/src/agents/models/chatcmpl_converter.py @@ -2,18 +2,19 @@ import json from collections.abc import Iterable -from typing import Any, Literal, cast +from typing import Any, Literal, Union, cast -from openai import NOT_GIVEN, NotGiven +from openai import Omit, omit from openai.types.chat import ( ChatCompletionAssistantMessageParam, ChatCompletionContentPartImageParam, + ChatCompletionContentPartInputAudioParam, ChatCompletionContentPartParam, ChatCompletionContentPartTextParam, ChatCompletionDeveloperMessageParam, ChatCompletionMessage, + ChatCompletionMessageFunctionToolCallParam, ChatCompletionMessageParam, - ChatCompletionMessageToolCallParam, ChatCompletionSystemMessageParam, ChatCompletionToolChoiceOptionParam, ChatCompletionToolMessageParam, @@ -27,6 +28,7 @@ ResponseFileSearchToolCallParam, ResponseFunctionToolCall, ResponseFunctionToolCallParam, + ResponseInputAudioParam, ResponseInputContentParam, ResponseInputFileParam, ResponseInputImageParam, @@ -36,9 +38,10 @@ ResponseOutputRefusal, ResponseOutputText, ResponseReasoningItem, + ResponseReasoningItemParam, ) from openai.types.responses.response_input_param import FunctionCallOutput, ItemReference, Message -from openai.types.responses.response_reasoning_item import Summary +from openai.types.responses.response_reasoning_item import Content, Summary from ..agent_output import AgentOutputSchemaBase from ..exceptions import AgentsException, UserError @@ -53,9 +56,9 @@ class Converter: @classmethod def convert_tool_choice( cls, tool_choice: Literal["auto", "required", "none"] | str | MCPToolChoice | None - ) -> ChatCompletionToolChoiceOptionParam | NotGiven: + ) -> ChatCompletionToolChoiceOptionParam | Omit: if tool_choice is None: - return NOT_GIVEN + return omit elif isinstance(tool_choice, MCPToolChoice): raise UserError("MCPToolChoice is not supported for Chat Completions models") elif tool_choice == "auto": @@ -75,9 +78,9 @@ def convert_tool_choice( @classmethod def convert_response_format( cls, final_output_schema: AgentOutputSchemaBase | None - ) -> ResponseFormat | NotGiven: + ) -> ResponseFormat | Omit: if not final_output_schema or final_output_schema.is_plain_text(): - return NOT_GIVEN + return omit return { "type": "json_schema", @@ -92,16 +95,38 @@ def convert_response_format( def message_to_output_items(cls, message: ChatCompletionMessage) -> list[TResponseOutputItem]: items: list[TResponseOutputItem] = [] - # Handle reasoning content if available + # Check if message is agents.extentions.models.litellm_model.InternalChatCompletionMessage + # We can't actually import it here because litellm is an optional dependency + # So we use hasattr to check for reasoning_content and thinking_blocks if hasattr(message, "reasoning_content") and message.reasoning_content: - items.append( - ResponseReasoningItem( - id=FAKE_RESPONSES_ID, - summary=[Summary(text=message.reasoning_content, type="summary_text")], - type="reasoning", - ) + reasoning_item = ResponseReasoningItem( + id=FAKE_RESPONSES_ID, + summary=[Summary(text=message.reasoning_content, type="summary_text")], + type="reasoning", ) + # Store thinking blocks for Anthropic compatibility + if hasattr(message, "thinking_blocks") and message.thinking_blocks: + # Store thinking text in content and signature in encrypted_content + reasoning_item.content = [] + signatures: list[str] = [] + for block in message.thinking_blocks: + if isinstance(block, dict): + thinking_text = block.get("thinking", "") + if thinking_text: + reasoning_item.content.append( + Content(text=thinking_text, type="reasoning_text") + ) + # Store the signature if present + if signature := block.get("signature"): + signatures.append(signature) + + # Store the signatures in encrypted_content with newline delimiter + if signatures: + reasoning_item.encrypted_content = "\n".join(signatures) + + items.append(reasoning_item) + message_item = ResponseOutputMessage( id=FAKE_RESPONSES_ID, content=[], @@ -125,15 +150,18 @@ def message_to_output_items(cls, message: ChatCompletionMessage) -> list[TRespon if message.tool_calls: for tool_call in message.tool_calls: - items.append( - ResponseFunctionToolCall( - id=FAKE_RESPONSES_ID, - call_id=tool_call.id, - arguments=tool_call.function.arguments, - name=tool_call.function.name, - type="function_call", + if tool_call.type == "function": + items.append( + ResponseFunctionToolCall( + id=FAKE_RESPONSES_ID, + call_id=tool_call.id, + arguments=tool_call.function.arguments, + name=tool_call.function.name, + type="function_call", + ) ) - ) + elif tool_call.type == "custom": + pass return items @@ -210,6 +238,12 @@ def maybe_response_output_message(cls, item: Any) -> ResponseOutputMessageParam return cast(ResponseOutputMessageParam, item) return None + @classmethod + def maybe_reasoning_message(cls, item: Any) -> ResponseReasoningItemParam | None: + if isinstance(item, dict) and item.get("type") == "reasoning": + return cast(ResponseReasoningItemParam, item) + return None + @classmethod def extract_text_content( cls, content: str | Iterable[ResponseInputContentParam] @@ -255,20 +289,44 @@ def extract_all_content( }, ) ) + elif isinstance(c, dict) and c.get("type") == "input_audio": + casted_audio_param = cast(ResponseInputAudioParam, c) + audio_payload = casted_audio_param.get("input_audio") + if not audio_payload: + raise UserError( + f"Only audio data is supported for input_audio {casted_audio_param}" + ) + if not isinstance(audio_payload, dict): + raise UserError( + f"input_audio must provide audio data and format {casted_audio_param}" + ) + audio_data = audio_payload.get("data") + audio_format = audio_payload.get("format") + if not audio_data or not audio_format: + raise UserError( + f"input_audio requires both data and format {casted_audio_param}" + ) + out.append( + ChatCompletionContentPartInputAudioParam( + type="input_audio", + input_audio={ + "data": audio_data, + "format": audio_format, + }, + ) + ) elif isinstance(c, dict) and c.get("type") == "input_file": casted_file_param = cast(ResponseInputFileParam, c) if "file_data" not in casted_file_param or not casted_file_param["file_data"]: raise UserError( f"Only file_data is supported for input_file {casted_file_param}" ) - out.append( - File( - type="file", - file=FileFile( - file_data=casted_file_param["file_data"], - ), - ) - ) + filedata = FileFile(file_data=casted_file_param["file_data"]) + + if "filename" in casted_file_param and casted_file_param["filename"]: + filedata["filename"] = casted_file_param["filename"] + + out.append(File(type="file", file=filedata)) else: raise UserError(f"Unknown content: {c}") return out @@ -277,10 +335,18 @@ def extract_all_content( def items_to_messages( cls, items: str | Iterable[TResponseInputItem], + preserve_thinking_blocks: bool = False, ) -> list[ChatCompletionMessageParam]: """ Convert a sequence of 'Item' objects into a list of ChatCompletionMessageParam. + Args: + items: A string or iterable of response input items to convert + preserve_thinking_blocks: Whether to preserve thinking blocks in tool calls + for reasoning models like Claude 4 Sonnet/Opus which support interleaved + thinking. When True, thinking blocks are reconstructed and included in + assistant messages with tool calls. + Rules: - EasyInputMessage or InputMessage (role=user) => ChatCompletionUserMessageParam - EasyInputMessage or InputMessage (role=system) => ChatCompletionSystemMessageParam @@ -301,6 +367,7 @@ def items_to_messages( result: list[ChatCompletionMessageParam] = [] current_assistant_msg: ChatCompletionAssistantMessageParam | None = None + pending_thinking_blocks: list[dict[str, str]] | None = None def flush_assistant_message() -> None: nonlocal current_assistant_msg @@ -312,10 +379,11 @@ def flush_assistant_message() -> None: current_assistant_msg = None def ensure_assistant_message() -> ChatCompletionAssistantMessageParam: - nonlocal current_assistant_msg + nonlocal current_assistant_msg, pending_thinking_blocks if current_assistant_msg is None: current_assistant_msg = ChatCompletionAssistantMessageParam(role="assistant") current_assistant_msg["tool_calls"] = [] + return current_assistant_msg for item in items: @@ -413,7 +481,7 @@ def ensure_assistant_message() -> ChatCompletionAssistantMessageParam: elif file_search := cls.maybe_file_search_call(item): asst = ensure_assistant_message() tool_calls = list(asst.get("tool_calls", [])) - new_tool_call = ChatCompletionMessageToolCallParam( + new_tool_call = ChatCompletionMessageFunctionToolCallParam( id=file_search["id"], type="function", function={ @@ -431,9 +499,29 @@ def ensure_assistant_message() -> ChatCompletionAssistantMessageParam: elif func_call := cls.maybe_function_tool_call(item): asst = ensure_assistant_message() + + # If we have pending thinking blocks, use them as the content + # This is required for Anthropic API tool calls with interleaved thinking + if pending_thinking_blocks: + # If there is a text content, save it to append after thinking blocks + # content type is Union[str, Iterable[ContentArrayOfContentPart], None] + if "content" in asst and isinstance(asst["content"], str): + text_content = ChatCompletionContentPartTextParam( + text=asst["content"], type="text" + ) + asst["content"] = [text_content] + + if "content" not in asst or asst["content"] is None: + asst["content"] = [] + + # Thinking blocks MUST come before any other content + # We ignore type errors because pending_thinking_blocks is not openai standard + asst["content"] = pending_thinking_blocks + asst["content"] # type: ignore + pending_thinking_blocks = None # Clear after using + tool_calls = list(asst.get("tool_calls", [])) arguments = func_call["arguments"] if func_call["arguments"] else "{}" - new_tool_call = ChatCompletionMessageToolCallParam( + new_tool_call = ChatCompletionMessageFunctionToolCallParam( id=func_call["call_id"], type="function", function={ @@ -446,10 +534,13 @@ def ensure_assistant_message() -> ChatCompletionAssistantMessageParam: # 5) function call output => tool message elif func_output := cls.maybe_function_tool_call_output(item): flush_assistant_message() + output_content = cast( + Union[str, Iterable[ResponseInputContentParam]], func_output["output"] + ) msg: ChatCompletionToolMessageParam = { "role": "tool", "tool_call_id": func_output["call_id"], - "content": func_output["output"], + "content": cls.extract_text_content(output_content), } result.append(msg) @@ -459,7 +550,35 @@ def ensure_assistant_message() -> ChatCompletionAssistantMessageParam: f"Encountered an item_reference, which is not supported: {item_ref}" ) - # 7) If we haven't recognized it => fail or ignore + # 7) reasoning message => extract thinking blocks if present + elif reasoning_item := cls.maybe_reasoning_message(item): + # Reconstruct thinking blocks from content (text) and encrypted_content (signature) + content_items = reasoning_item.get("content", []) + encrypted_content = reasoning_item.get("encrypted_content") + signatures = encrypted_content.split("\n") if encrypted_content else [] + + if content_items and preserve_thinking_blocks: + # Reconstruct thinking blocks from content and signature + reconstructed_thinking_blocks = [] + for content_item in content_items: + if ( + isinstance(content_item, dict) + and content_item.get("type") == "reasoning_text" + ): + thinking_block = { + "type": "thinking", + "thinking": content_item.get("text", ""), + } + # Add signatures if available + if signatures: + thinking_block["signature"] = signatures.pop(0) + reconstructed_thinking_blocks.append(thinking_block) + + # Store thinking blocks as pending for the next assistant message + # This preserves the original behavior + pending_thinking_blocks = reconstructed_thinking_blocks + + # 8) If we haven't recognized it => fail or ignore else: raise UserError(f"Unhandled item type or structure: {item}") @@ -484,7 +603,7 @@ def tool_to_openai(cls, tool: Tool) -> ChatCompletionToolParam: ) @classmethod - def convert_handoff_tool(cls, handoff: Handoff[Any]) -> ChatCompletionToolParam: + def convert_handoff_tool(cls, handoff: Handoff[Any, Any]) -> ChatCompletionToolParam: return { "type": "function", "function": { diff --git a/src/agents/models/chatcmpl_helpers.py b/src/agents/models/chatcmpl_helpers.py index 0cee21ecc..335e3f521 100644 --- a/src/agents/models/chatcmpl_helpers.py +++ b/src/agents/models/chatcmpl_helpers.py @@ -1,5 +1,7 @@ from __future__ import annotations +from contextvars import ContextVar + from openai import AsyncOpenAI from ..model_settings import ModelSettings @@ -8,6 +10,10 @@ _USER_AGENT = f"Agents/Python {__version__}" HEADERS = {"User-Agent": _USER_AGENT} +HEADERS_OVERRIDE: ContextVar[dict[str, str] | None] = ContextVar( + "openai_chatcompletions_headers_override", default=None +) + class ChatCmplHelpers: @classmethod diff --git a/src/agents/models/chatcmpl_stream_handler.py b/src/agents/models/chatcmpl_stream_handler.py index 83fa32abc..5faf06c14 100644 --- a/src/agents/models/chatcmpl_stream_handler.py +++ b/src/agents/models/chatcmpl_stream_handler.py @@ -28,11 +28,17 @@ ResponseTextDeltaEvent, ResponseUsage, ) -from openai.types.responses.response_reasoning_item import Summary +from openai.types.responses.response_reasoning_item import Content, Summary from openai.types.responses.response_reasoning_summary_part_added_event import ( Part as AddedEventPart, ) from openai.types.responses.response_reasoning_summary_part_done_event import Part as DoneEventPart +from openai.types.responses.response_reasoning_text_delta_event import ( + ResponseReasoningTextDeltaEvent, +) +from openai.types.responses.response_reasoning_text_done_event import ( + ResponseReasoningTextDoneEvent, +) from openai.types.responses.response_usage import InputTokensDetails, OutputTokensDetails from ..items import TResponseStreamEvent @@ -53,6 +59,12 @@ class StreamingState: refusal_content_index_and_output: tuple[int, ResponseOutputRefusal] | None = None reasoning_content_index_and_output: tuple[int, ResponseReasoningItem] | None = None function_calls: dict[int, ResponseFunctionToolCall] = field(default_factory=dict) + # Fields for real-time function call streaming + function_call_streaming: dict[int, bool] = field(default_factory=dict) + function_call_output_idx: dict[int, int] = field(default_factory=dict) + # Store accumulated thinking text and signature for Anthropic compatibility + thinking_text: str = "" + thinking_signature: str | None = None class SequenceNumber: @@ -92,7 +104,20 @@ async def handle_stream( delta = chunk.choices[0].delta - # Handle reasoning content + # Handle thinking blocks from Anthropic (for preserving signatures) + if hasattr(delta, "thinking_blocks") and delta.thinking_blocks: + for block in delta.thinking_blocks: + if isinstance(block, dict): + # Accumulate thinking text + thinking_text = block.get("thinking", "") + if thinking_text: + state.thinking_text += thinking_text + # Store signature if present + signature = block.get("signature") + if signature: + state.thinking_signature = signature + + # Handle reasoning content for reasoning summaries if hasattr(delta, "reasoning_content"): reasoning_content = delta.reasoning_content if reasoning_content and not state.reasoning_content_index_and_output: @@ -125,6 +150,12 @@ async def handle_stream( ) if reasoning_content and state.reasoning_content_index_and_output: + # Ensure summary list has at least one element + if not state.reasoning_content_index_and_output[1].summary: + state.reasoning_content_index_and_output[1].summary = [ + Summary(text="", type="summary_text") + ] + yield ResponseReasoningSummaryTextDeltaEvent( delta=reasoning_content, item_id=FAKE_RESPONSES_ID, @@ -135,10 +166,55 @@ async def handle_stream( ) # Create a new summary with updated text - current_summary = state.reasoning_content_index_and_output[1].summary[0] - updated_text = current_summary.text + reasoning_content - new_summary = Summary(text=updated_text, type="summary_text") - state.reasoning_content_index_and_output[1].summary[0] = new_summary + current_content = state.reasoning_content_index_and_output[1].summary[0] + updated_text = current_content.text + reasoning_content + new_content = Summary(text=updated_text, type="summary_text") + state.reasoning_content_index_and_output[1].summary[0] = new_content + + # Handle reasoning content from 3rd party platforms + if hasattr(delta, "reasoning"): + reasoning_text = delta.reasoning + if reasoning_text and not state.reasoning_content_index_and_output: + state.reasoning_content_index_and_output = ( + 0, + ResponseReasoningItem( + id=FAKE_RESPONSES_ID, + summary=[], + content=[Content(text="", type="reasoning_text")], + type="reasoning", + ), + ) + yield ResponseOutputItemAddedEvent( + item=ResponseReasoningItem( + id=FAKE_RESPONSES_ID, + summary=[], + content=[Content(text="", type="reasoning_text")], + type="reasoning", + ), + output_index=0, + type="response.output_item.added", + sequence_number=sequence_number.get_and_increment(), + ) + + if reasoning_text and state.reasoning_content_index_and_output: + yield ResponseReasoningTextDeltaEvent( + delta=reasoning_text, + item_id=FAKE_RESPONSES_ID, + output_index=0, + content_index=0, + type="response.reasoning_text.delta", + sequence_number=sequence_number.get_and_increment(), + ) + + # Create a new summary with updated text + if not state.reasoning_content_index_and_output[1].content: + state.reasoning_content_index_and_output[1].content = [ + Content(text="", type="reasoning_text") + ] + current_text = state.reasoning_content_index_and_output[1].content[0] + updated_text = current_text.text + reasoning_text + new_text_content = Content(text=updated_text, type="reasoning_text") + state.reasoning_content_index_and_output[1].content[0] = new_text_content # Handle regular content if delta.content is not None: @@ -195,6 +271,7 @@ async def handle_stream( is not None, # fixed 0 -> 0 or 1 type="response.output_text.delta", sequence_number=sequence_number.get_and_increment(), + logprobs=[], ) # Accumulate the text into the response part state.text_content_index_and_output[1].text += delta.content @@ -255,9 +332,7 @@ async def handle_stream( # Accumulate the refusal string in the output part state.refusal_content_index_and_output[1].refusal += delta.refusal - # Handle tool calls - # Because we don't know the name of the function until the end of the stream, we'll - # save everything and yield events at the end + # Handle tool calls with real-time streaming support if delta.tool_calls: for tc_delta in delta.tool_calls: if tc_delta.index not in state.function_calls: @@ -268,28 +343,104 @@ async def handle_stream( type="function_call", call_id="", ) + state.function_call_streaming[tc_delta.index] = False + tc_function = tc_delta.function + # Accumulate arguments as they come in state.function_calls[tc_delta.index].arguments += ( tc_function.arguments if tc_function else "" ) or "" - state.function_calls[tc_delta.index].name += ( - tc_function.name if tc_function else "" - ) or "" - state.function_calls[tc_delta.index].call_id = tc_delta.id or "" + + # Set function name directly (it's correct from the first function call chunk) + if tc_function and tc_function.name: + state.function_calls[tc_delta.index].name = tc_function.name + + if tc_delta.id: + state.function_calls[tc_delta.index].call_id = tc_delta.id + + function_call = state.function_calls[tc_delta.index] + + # Start streaming as soon as we have function name and call_id + if ( + not state.function_call_streaming[tc_delta.index] + and function_call.name + and function_call.call_id + ): + # Calculate the output index for this function call + function_call_starting_index = 0 + if state.reasoning_content_index_and_output: + function_call_starting_index += 1 + if state.text_content_index_and_output: + function_call_starting_index += 1 + if state.refusal_content_index_and_output: + function_call_starting_index += 1 + + # Add offset for already started function calls + function_call_starting_index += sum( + 1 for streaming in state.function_call_streaming.values() if streaming + ) + + # Mark this function call as streaming and store its output index + state.function_call_streaming[tc_delta.index] = True + state.function_call_output_idx[tc_delta.index] = ( + function_call_starting_index + ) + + # Send initial function call added event + yield ResponseOutputItemAddedEvent( + item=ResponseFunctionToolCall( + id=FAKE_RESPONSES_ID, + call_id=function_call.call_id, + arguments="", # Start with empty arguments + name=function_call.name, + type="function_call", + ), + output_index=function_call_starting_index, + type="response.output_item.added", + sequence_number=sequence_number.get_and_increment(), + ) + + # Stream arguments if we've started streaming this function call + if ( + state.function_call_streaming.get(tc_delta.index, False) + and tc_function + and tc_function.arguments + ): + output_index = state.function_call_output_idx[tc_delta.index] + yield ResponseFunctionCallArgumentsDeltaEvent( + delta=tc_function.arguments, + item_id=FAKE_RESPONSES_ID, + output_index=output_index, + type="response.function_call_arguments.delta", + sequence_number=sequence_number.get_and_increment(), + ) if state.reasoning_content_index_and_output: - yield ResponseReasoningSummaryPartDoneEvent( - item_id=FAKE_RESPONSES_ID, - output_index=0, - summary_index=0, - part=DoneEventPart( - text=state.reasoning_content_index_and_output[1].summary[0].text, - type="summary_text", - ), - type="response.reasoning_summary_part.done", - sequence_number=sequence_number.get_and_increment(), - ) + if ( + state.reasoning_content_index_and_output[1].summary + and len(state.reasoning_content_index_and_output[1].summary) > 0 + ): + yield ResponseReasoningSummaryPartDoneEvent( + item_id=FAKE_RESPONSES_ID, + output_index=0, + summary_index=0, + part=DoneEventPart( + text=state.reasoning_content_index_and_output[1].summary[0].text, + type="summary_text", + ), + type="response.reasoning_summary_part.done", + sequence_number=sequence_number.get_and_increment(), + ) + elif state.reasoning_content_index_and_output[1].content is not None: + yield ResponseReasoningTextDoneEvent( + item_id=FAKE_RESPONSES_ID, + output_index=0, + content_index=0, + text=state.reasoning_content_index_and_output[1].content[0].text, + type="response.reasoning_text.done", + sequence_number=sequence_number.get_and_increment(), + ) yield ResponseOutputItemDoneEvent( item=state.reasoning_content_index_and_output[1], output_index=0, @@ -327,49 +478,90 @@ async def handle_stream( sequence_number=sequence_number.get_and_increment(), ) - # Actually send events for the function calls - for function_call in state.function_calls.values(): - # First, a ResponseOutputItemAdded for the function call - yield ResponseOutputItemAddedEvent( - item=ResponseFunctionToolCall( - id=FAKE_RESPONSES_ID, - call_id=function_call.call_id, - arguments=function_call.arguments, - name=function_call.name, - type="function_call", - ), - output_index=function_call_starting_index, - type="response.output_item.added", - sequence_number=sequence_number.get_and_increment(), - ) - # Then, yield the args - yield ResponseFunctionCallArgumentsDeltaEvent( - delta=function_call.arguments, - item_id=FAKE_RESPONSES_ID, - output_index=function_call_starting_index, - type="response.function_call_arguments.delta", - sequence_number=sequence_number.get_and_increment(), - ) - # Finally, the ResponseOutputItemDone - yield ResponseOutputItemDoneEvent( - item=ResponseFunctionToolCall( - id=FAKE_RESPONSES_ID, - call_id=function_call.call_id, - arguments=function_call.arguments, - name=function_call.name, - type="function_call", - ), - output_index=function_call_starting_index, - type="response.output_item.done", - sequence_number=sequence_number.get_and_increment(), - ) + # Send completion events for function calls + for index, function_call in state.function_calls.items(): + if state.function_call_streaming.get(index, False): + # Function call was streamed, just send the completion event + output_index = state.function_call_output_idx[index] + yield ResponseOutputItemDoneEvent( + item=ResponseFunctionToolCall( + id=FAKE_RESPONSES_ID, + call_id=function_call.call_id, + arguments=function_call.arguments, + name=function_call.name, + type="function_call", + ), + output_index=output_index, + type="response.output_item.done", + sequence_number=sequence_number.get_and_increment(), + ) + else: + # Function call was not streamed (fallback to old behavior) + # This handles edge cases where function name never arrived + fallback_starting_index = 0 + if state.reasoning_content_index_and_output: + fallback_starting_index += 1 + if state.text_content_index_and_output: + fallback_starting_index += 1 + if state.refusal_content_index_and_output: + fallback_starting_index += 1 + + # Add offset for already started function calls + fallback_starting_index += sum( + 1 for streaming in state.function_call_streaming.values() if streaming + ) + + # Send all events at once (backward compatibility) + yield ResponseOutputItemAddedEvent( + item=ResponseFunctionToolCall( + id=FAKE_RESPONSES_ID, + call_id=function_call.call_id, + arguments=function_call.arguments, + name=function_call.name, + type="function_call", + ), + output_index=fallback_starting_index, + type="response.output_item.added", + sequence_number=sequence_number.get_and_increment(), + ) + yield ResponseFunctionCallArgumentsDeltaEvent( + delta=function_call.arguments, + item_id=FAKE_RESPONSES_ID, + output_index=fallback_starting_index, + type="response.function_call_arguments.delta", + sequence_number=sequence_number.get_and_increment(), + ) + yield ResponseOutputItemDoneEvent( + item=ResponseFunctionToolCall( + id=FAKE_RESPONSES_ID, + call_id=function_call.call_id, + arguments=function_call.arguments, + name=function_call.name, + type="function_call", + ), + output_index=fallback_starting_index, + type="response.output_item.done", + sequence_number=sequence_number.get_and_increment(), + ) # Finally, send the Response completed event outputs: list[ResponseOutputItem] = [] # include Reasoning item if it exists if state.reasoning_content_index_and_output: - outputs.append(state.reasoning_content_index_and_output[1]) + reasoning_item = state.reasoning_content_index_and_output[1] + # Store thinking text in content and signature in encrypted_content + if state.thinking_text: + # Add thinking text as a Content object + if not reasoning_item.content: + reasoning_item.content = [] + reasoning_item.content.append( + Content(text=state.thinking_text, type="reasoning_text") + ) + # Store signature in encrypted_content + if state.thinking_signature: + reasoning_item.encrypted_content = state.thinking_signature + outputs.append(reasoning_item) # include text or refusal content if they exist if state.text_content_index_and_output or state.refusal_content_index_and_output: @@ -402,9 +594,9 @@ async def handle_stream( final_response.output = outputs final_response.usage = ( ResponseUsage( - input_tokens=usage.prompt_tokens, - output_tokens=usage.completion_tokens, - total_tokens=usage.total_tokens, + input_tokens=usage.prompt_tokens or 0, + output_tokens=usage.completion_tokens or 0, + total_tokens=usage.total_tokens or 0, output_tokens_details=OutputTokensDetails( reasoning_tokens=usage.completion_tokens_details.reasoning_tokens if usage.completion_tokens_details diff --git a/src/agents/models/default_models.py b/src/agents/models/default_models.py new file mode 100644 index 000000000..0259534ac --- /dev/null +++ b/src/agents/models/default_models.py @@ -0,0 +1,58 @@ +import copy +import os +from typing import Optional + +from openai.types.shared.reasoning import Reasoning + +from agents.model_settings import ModelSettings + +OPENAI_DEFAULT_MODEL_ENV_VARIABLE_NAME = "OPENAI_DEFAULT_MODEL" + +# discourage directly accessing this constant +# use the get_default_model and get_default_model_settings() functions instead +_GPT_5_DEFAULT_MODEL_SETTINGS: ModelSettings = ModelSettings( + # We chose "low" instead of "minimal" because some of the built-in tools + # (e.g., file search, image generation, etc.) do not support "minimal" + # If you want to use "minimal" reasoning effort, you can pass your own model settings + reasoning=Reasoning(effort="low"), + verbosity="low", +) + + +def gpt_5_reasoning_settings_required(model_name: str) -> bool: + """ + Returns True if the model name is a GPT-5 model and reasoning settings are required. + """ + if model_name.startswith("gpt-5-chat"): + # gpt-5-chat-latest does not require reasoning settings + return False + # matches any of gpt-5 models + return model_name.startswith("gpt-5") + + +def is_gpt_5_default() -> bool: + """ + Returns True if the default model is a GPT-5 model. + This is used to determine if the default model settings are compatible with GPT-5 models. + If the default model is not a GPT-5 model, the model settings are compatible with other models. + """ + return gpt_5_reasoning_settings_required(get_default_model()) + + +def get_default_model() -> str: + """ + Returns the default model name. + """ + return os.getenv(OPENAI_DEFAULT_MODEL_ENV_VARIABLE_NAME, "gpt-4.1").lower() + + +def get_default_model_settings(model: Optional[str] = None) -> ModelSettings: + """ + Returns the default model settings. + If the default model is a GPT-5 model, returns the GPT-5 default model settings. + Otherwise, returns the legacy default model settings. + """ + _model = model if model is not None else get_default_model() + if gpt_5_reasoning_settings_required(_model): + return copy.deepcopy(_GPT_5_DEFAULT_MODEL_SETTINGS) + return ModelSettings() diff --git a/src/agents/models/interface.py b/src/agents/models/interface.py index 5a185806c..f25934780 100644 --- a/src/agents/models/interface.py +++ b/src/agents/models/interface.py @@ -48,6 +48,7 @@ async def get_response( tracing: ModelTracing, *, previous_response_id: str | None, + conversation_id: str | None, prompt: ResponsePromptParam | None, ) -> ModelResponse: """Get a response from the model. @@ -62,6 +63,7 @@ async def get_response( tracing: Tracing configuration. previous_response_id: the ID of the previous response. Generally not used by the model, except for the OpenAI Responses API. + conversation_id: The ID of the stored conversation, if any. prompt: The prompt config to use for the model. Returns: @@ -81,6 +83,7 @@ def stream_response( tracing: ModelTracing, *, previous_response_id: str | None, + conversation_id: str | None, prompt: ResponsePromptParam | None, ) -> AsyncIterator[TResponseStreamEvent]: """Stream a response from the model. @@ -95,6 +98,7 @@ def stream_response( tracing: Tracing configuration. previous_response_id: the ID of the previous response. Generally not used by the model, except for the OpenAI Responses API. + conversation_id: The ID of the stored conversation, if any. prompt: The prompt config to use for the model. Returns: diff --git a/src/agents/models/openai_chatcompletions.py b/src/agents/models/openai_chatcompletions.py index 6de431b4d..d6cf662d2 100644 --- a/src/agents/models/openai_chatcompletions.py +++ b/src/agents/models/openai_chatcompletions.py @@ -5,7 +5,7 @@ from collections.abc import AsyncIterator from typing import TYPE_CHECKING, Any, Literal, cast, overload -from openai import NOT_GIVEN, AsyncOpenAI, AsyncStream +from openai import AsyncOpenAI, AsyncStream, Omit, omit from openai.types import ChatModel from openai.types.chat import ChatCompletion, ChatCompletionChunk, ChatCompletionMessage from openai.types.chat.chat_completion import Choice @@ -23,11 +23,13 @@ from ..tracing.span_data import GenerationSpanData from ..tracing.spans import Span from ..usage import Usage +from ..util._json import _to_dump_compatible from .chatcmpl_converter import Converter -from .chatcmpl_helpers import HEADERS, ChatCmplHelpers +from .chatcmpl_helpers import HEADERS, HEADERS_OVERRIDE, ChatCmplHelpers from .chatcmpl_stream_handler import ChatCmplStreamHandler from .fake_id import FAKE_RESPONSES_ID from .interface import Model, ModelTracing +from .openai_responses import Converter as OpenAIResponsesConverter if TYPE_CHECKING: from ..model_settings import ModelSettings @@ -42,8 +44,8 @@ def __init__( self.model = model self._client = openai_client - def _non_null_or_not_given(self, value: Any) -> Any: - return value if value is not None else NOT_GIVEN + def _non_null_or_omit(self, value: Any) -> Any: + return value if value is not None else omit async def get_response( self, @@ -54,7 +56,8 @@ async def get_response( output_schema: AgentOutputSchemaBase | None, handoffs: list[Handoff], tracing: ModelTracing, - previous_response_id: str | None, + previous_response_id: str | None = None, # unused + conversation_id: str | None = None, # unused prompt: ResponsePromptParam | None = None, ) -> ModelResponse: with generation_span( @@ -141,7 +144,8 @@ async def stream_response( output_schema: AgentOutputSchemaBase | None, handoffs: list[Handoff], tracing: ModelTracing, - previous_response_id: str | None, + previous_response_id: str | None = None, # unused + conversation_id: str | None = None, # unused prompt: ResponsePromptParam | None = None, ) -> AsyncIterator[TResponseStreamEvent]: """ @@ -234,16 +238,17 @@ async def _fetch_response( "role": "system", }, ) + converted_messages = _to_dump_compatible(converted_messages) + if tracing.include_data(): span.span_data.input = converted_messages - parallel_tool_calls = ( - True - if model_settings.parallel_tool_calls and tools and len(tools) > 0 - else False - if model_settings.parallel_tool_calls is False - else NOT_GIVEN - ) + if model_settings.parallel_tool_calls and tools: + parallel_tool_calls: bool | Omit = True + elif model_settings.parallel_tool_calls is False: + parallel_tool_calls = False + else: + parallel_tool_calls = omit tool_choice = Converter.convert_tool_choice(model_settings.tool_choice) response_format = Converter.convert_response_format(output_schema) @@ -252,12 +257,25 @@ async def _fetch_response( for handoff in handoffs: converted_tools.append(Converter.convert_handoff_tool(handoff)) + converted_tools = _to_dump_compatible(converted_tools) + tools_param = converted_tools if converted_tools else omit + if _debug.DONT_LOG_MODEL_DATA: logger.debug("Calling LLM") else: + messages_json = json.dumps( + converted_messages, + indent=2, + ensure_ascii=False, + ) + tools_json = json.dumps( + converted_tools, + indent=2, + ensure_ascii=False, + ) logger.debug( - f"{json.dumps(converted_messages, indent=2, ensure_ascii=False)}\n" - f"Tools:\n{json.dumps(converted_tools, indent=2, ensure_ascii=False)}\n" + f"{messages_json}\n" + f"Tools:\n{tools_json}\n" f"Stream: {stream}\n" f"Tool choice: {tool_choice}\n" f"Response format: {response_format}\n" @@ -270,41 +288,56 @@ async def _fetch_response( self._get_client(), model_settings, stream=stream ) + stream_param: Literal[True] | Omit = True if stream else omit + ret = await self._get_client().chat.completions.create( model=self.model, messages=converted_messages, - tools=converted_tools or NOT_GIVEN, - temperature=self._non_null_or_not_given(model_settings.temperature), - top_p=self._non_null_or_not_given(model_settings.top_p), - frequency_penalty=self._non_null_or_not_given(model_settings.frequency_penalty), - presence_penalty=self._non_null_or_not_given(model_settings.presence_penalty), - max_tokens=self._non_null_or_not_given(model_settings.max_tokens), + tools=tools_param, + temperature=self._non_null_or_omit(model_settings.temperature), + top_p=self._non_null_or_omit(model_settings.top_p), + frequency_penalty=self._non_null_or_omit(model_settings.frequency_penalty), + presence_penalty=self._non_null_or_omit(model_settings.presence_penalty), + max_tokens=self._non_null_or_omit(model_settings.max_tokens), tool_choice=tool_choice, response_format=response_format, parallel_tool_calls=parallel_tool_calls, - stream=stream, - stream_options=self._non_null_or_not_given(stream_options), - store=self._non_null_or_not_given(store), - reasoning_effort=self._non_null_or_not_given(reasoning_effort), - extra_headers={**HEADERS, **(model_settings.extra_headers or {})}, + stream=cast(Any, stream_param), + stream_options=self._non_null_or_omit(stream_options), + store=self._non_null_or_omit(store), + reasoning_effort=self._non_null_or_omit(reasoning_effort), + verbosity=self._non_null_or_omit(model_settings.verbosity), + top_logprobs=self._non_null_or_omit(model_settings.top_logprobs), + extra_headers=self._merge_headers(model_settings), extra_query=model_settings.extra_query, extra_body=model_settings.extra_body, - metadata=self._non_null_or_not_given(model_settings.metadata), + metadata=self._non_null_or_omit(model_settings.metadata), **(model_settings.extra_args or {}), ) if isinstance(ret, ChatCompletion): return ret + responses_tool_choice = OpenAIResponsesConverter.convert_tool_choice( + model_settings.tool_choice + ) + if responses_tool_choice is None or responses_tool_choice is omit: + # For Responses API data compatibility with Chat Completions patterns, + # we need to set "none" if tool_choice is absent. + # Without this fix, you'll get the following error: + # pydantic_core._pydantic_core.ValidationError: 4 validation errors for Response + # tool_choice.literal['none','auto','required'] + # Input should be 'none', 'auto' or 'required' + # see also: https://github.com/openai/openai-agents-python/issues/980 + responses_tool_choice = "auto" + response = Response( id=FAKE_RESPONSES_ID, created_at=time.time(), model=self.model, object="response", output=[], - tool_choice=cast(Literal["auto", "required", "none"], tool_choice) - if tool_choice != NOT_GIVEN - else "auto", + tool_choice=responses_tool_choice, # type: ignore[arg-type] top_p=model_settings.top_p, temperature=model_settings.temperature, tools=[], @@ -317,3 +350,10 @@ def _get_client(self) -> AsyncOpenAI: if self._client is None: self._client = AsyncOpenAI() return self._client + + def _merge_headers(self, model_settings: ModelSettings): + return { + **HEADERS, + **(model_settings.extra_headers or {}), + **(HEADERS_OVERRIDE.get() or {}), + } diff --git a/src/agents/models/openai_provider.py b/src/agents/models/openai_provider.py index e7e922ab4..91f2366bc 100644 --- a/src/agents/models/openai_provider.py +++ b/src/agents/models/openai_provider.py @@ -4,10 +4,12 @@ from openai import AsyncOpenAI, DefaultAsyncHttpxClient from . import _openai_shared +from .default_models import get_default_model from .interface import Model, ModelProvider from .openai_chatcompletions import OpenAIChatCompletionsModel from .openai_responses import OpenAIResponsesModel +# This is kept for backward compatiblity but using get_default_model() method is recommended. DEFAULT_MODEL: str = "gpt-4o" @@ -80,7 +82,7 @@ def _get_client(self) -> AsyncOpenAI: def get_model(self, model_name: str | None) -> Model: if model_name is None: - model_name = DEFAULT_MODEL + model_name = get_default_model() client = self._get_client() diff --git a/src/agents/models/openai_responses.py b/src/agents/models/openai_responses.py index 76c67903c..36a981404 100644 --- a/src/agents/models/openai_responses.py +++ b/src/agents/models/openai_responses.py @@ -2,10 +2,11 @@ import json from collections.abc import AsyncIterator +from contextvars import ContextVar from dataclasses import dataclass -from typing import TYPE_CHECKING, Any, Literal, overload +from typing import TYPE_CHECKING, Any, Literal, Union, cast, overload -from openai import NOT_GIVEN, APIStatusError, AsyncOpenAI, AsyncStream, NotGiven +from openai import APIStatusError, AsyncOpenAI, AsyncStream, Omit, omit from openai.types import ChatModel from openai.types.responses import ( Response, @@ -14,7 +15,6 @@ ResponseStreamEvent, ResponseTextConfigParam, ToolParam, - WebSearchToolParam, response_create_params, ) from openai.types.responses.response_prompt_param import ResponsePromptParam @@ -39,6 +39,7 @@ ) from ..tracing import SpanError, response_span from ..usage import Usage +from ..util._json import _to_dump_compatible from ..version import __version__ from .interface import Model, ModelTracing @@ -49,6 +50,11 @@ _USER_AGENT = f"Agents/Python {__version__}" _HEADERS = {"User-Agent": _USER_AGENT} +# Override headers used by the Responses API. +_HEADERS_OVERRIDE: ContextVar[dict[str, str] | None] = ContextVar( + "openai_responses_headers_override", default=None +) + class OpenAIResponsesModel(Model): """ @@ -63,8 +69,8 @@ def __init__( self.model = model self._client = openai_client - def _non_null_or_not_given(self, value: Any) -> Any: - return value if value is not None else NOT_GIVEN + def _non_null_or_omit(self, value: Any) -> Any: + return value if value is not None else omit async def get_response( self, @@ -75,7 +81,8 @@ async def get_response( output_schema: AgentOutputSchemaBase | None, handoffs: list[Handoff], tracing: ModelTracing, - previous_response_id: str | None, + previous_response_id: str | None = None, + conversation_id: str | None = None, prompt: ResponsePromptParam | None = None, ) -> ModelResponse: with response_span(disabled=tracing.is_disabled()) as span_response: @@ -87,7 +94,8 @@ async def get_response( tools, output_schema, handoffs, - previous_response_id, + previous_response_id=previous_response_id, + conversation_id=conversation_id, stream=False, prompt=prompt, ) @@ -150,7 +158,8 @@ async def stream_response( output_schema: AgentOutputSchemaBase | None, handoffs: list[Handoff], tracing: ModelTracing, - previous_response_id: str | None, + previous_response_id: str | None = None, + conversation_id: str | None = None, prompt: ResponsePromptParam | None = None, ) -> AsyncIterator[ResponseStreamEvent]: """ @@ -165,7 +174,8 @@ async def stream_response( tools, output_schema, handoffs, - previous_response_id, + previous_response_id=previous_response_id, + conversation_id=conversation_id, stream=True, prompt=prompt, ) @@ -203,6 +213,7 @@ async def _fetch_response( output_schema: AgentOutputSchemaBase | None, handoffs: list[Handoff], previous_response_id: str | None, + conversation_id: str | None, stream: Literal[True], prompt: ResponsePromptParam | None = None, ) -> AsyncStream[ResponseStreamEvent]: ... @@ -217,6 +228,7 @@ async def _fetch_response( output_schema: AgentOutputSchemaBase | None, handoffs: list[Handoff], previous_response_id: str | None, + conversation_id: str | None, stream: Literal[False], prompt: ResponsePromptParam | None = None, ) -> Response: ... @@ -229,71 +241,107 @@ async def _fetch_response( tools: list[Tool], output_schema: AgentOutputSchemaBase | None, handoffs: list[Handoff], - previous_response_id: str | None, + previous_response_id: str | None = None, + conversation_id: str | None = None, stream: Literal[True] | Literal[False] = False, prompt: ResponsePromptParam | None = None, ) -> Response | AsyncStream[ResponseStreamEvent]: list_input = ItemHelpers.input_to_new_input_list(input) + list_input = _to_dump_compatible(list_input) - parallel_tool_calls = ( - True - if model_settings.parallel_tool_calls and tools and len(tools) > 0 - else False - if model_settings.parallel_tool_calls is False - else NOT_GIVEN - ) + if model_settings.parallel_tool_calls and tools: + parallel_tool_calls: bool | Omit = True + elif model_settings.parallel_tool_calls is False: + parallel_tool_calls = False + else: + parallel_tool_calls = omit tool_choice = Converter.convert_tool_choice(model_settings.tool_choice) converted_tools = Converter.convert_tools(tools, handoffs) + converted_tools_payload = _to_dump_compatible(converted_tools.tools) response_format = Converter.get_response_format(output_schema) - include: list[ResponseIncludable] = converted_tools.includes + include_set: set[str] = set(converted_tools.includes) if model_settings.response_include is not None: - include = list({*include, *model_settings.response_include}) + include_set.update(model_settings.response_include) + if model_settings.top_logprobs is not None: + include_set.add("message.output_text.logprobs") + include = cast(list[ResponseIncludable], list(include_set)) if _debug.DONT_LOG_MODEL_DATA: logger.debug("Calling LLM") else: + input_json = json.dumps( + list_input, + indent=2, + ensure_ascii=False, + ) + tools_json = json.dumps( + converted_tools_payload, + indent=2, + ensure_ascii=False, + ) logger.debug( f"Calling LLM {self.model} with input:\n" - f"{json.dumps(list_input, indent=2, ensure_ascii=False)}\n" - f"Tools:\n{json.dumps(converted_tools.tools, indent=2, ensure_ascii=False)}\n" + f"{input_json}\n" + f"Tools:\n{tools_json}\n" f"Stream: {stream}\n" f"Tool choice: {tool_choice}\n" f"Response format: {response_format}\n" f"Previous response id: {previous_response_id}\n" + f"Conversation id: {conversation_id}\n" ) - return await self._client.responses.create( - previous_response_id=self._non_null_or_not_given(previous_response_id), - instructions=self._non_null_or_not_given(system_instructions), + extra_args = dict(model_settings.extra_args or {}) + if model_settings.top_logprobs is not None: + extra_args["top_logprobs"] = model_settings.top_logprobs + if model_settings.verbosity is not None: + if response_format is not omit: + response_format["verbosity"] = model_settings.verbosity # type: ignore [index] + else: + response_format = {"verbosity": model_settings.verbosity} + + stream_param: Literal[True] | Omit = True if stream else omit + + response = await self._client.responses.create( + previous_response_id=self._non_null_or_omit(previous_response_id), + conversation=self._non_null_or_omit(conversation_id), + instructions=self._non_null_or_omit(system_instructions), model=self.model, input=list_input, include=include, - tools=converted_tools.tools, - prompt=self._non_null_or_not_given(prompt), - temperature=self._non_null_or_not_given(model_settings.temperature), - top_p=self._non_null_or_not_given(model_settings.top_p), - truncation=self._non_null_or_not_given(model_settings.truncation), - max_output_tokens=self._non_null_or_not_given(model_settings.max_tokens), + tools=converted_tools_payload, + prompt=self._non_null_or_omit(prompt), + temperature=self._non_null_or_omit(model_settings.temperature), + top_p=self._non_null_or_omit(model_settings.top_p), + truncation=self._non_null_or_omit(model_settings.truncation), + max_output_tokens=self._non_null_or_omit(model_settings.max_tokens), tool_choice=tool_choice, parallel_tool_calls=parallel_tool_calls, - stream=stream, - extra_headers={**_HEADERS, **(model_settings.extra_headers or {})}, + stream=cast(Any, stream_param), + extra_headers=self._merge_headers(model_settings), extra_query=model_settings.extra_query, extra_body=model_settings.extra_body, text=response_format, - store=self._non_null_or_not_given(model_settings.store), - reasoning=self._non_null_or_not_given(model_settings.reasoning), - metadata=self._non_null_or_not_given(model_settings.metadata), - **(model_settings.extra_args or {}), + store=self._non_null_or_omit(model_settings.store), + reasoning=self._non_null_or_omit(model_settings.reasoning), + metadata=self._non_null_or_omit(model_settings.metadata), + **extra_args, ) + return cast(Union[Response, AsyncStream[ResponseStreamEvent]], response) def _get_client(self) -> AsyncOpenAI: if self._client is None: self._client = AsyncOpenAI() return self._client + def _merge_headers(self, model_settings: ModelSettings): + return { + **_HEADERS, + **(model_settings.extra_headers or {}), + **(_HEADERS_OVERRIDE.get() or {}), + } + @dataclass class ConvertedTools: @@ -305,9 +353,9 @@ class Converter: @classmethod def convert_tool_choice( cls, tool_choice: Literal["auto", "required", "none"] | str | MCPToolChoice | None - ) -> response_create_params.ToolChoice | NotGiven: + ) -> response_create_params.ToolChoice | Omit: if tool_choice is None: - return NOT_GIVEN + return omit elif isinstance(tool_choice, MCPToolChoice): return { "server_label": tool_choice.server_label, @@ -324,6 +372,11 @@ def convert_tool_choice( return { "type": "file_search", } + elif tool_choice == "web_search": + return { + # TODO: revist the type: ignore comment when ToolChoice is updated in the future + "type": "web_search", # type: ignore [typeddict-item] + } elif tool_choice == "web_search_preview": return { "type": "web_search_preview", @@ -353,9 +406,9 @@ def convert_tool_choice( @classmethod def get_response_format( cls, output_schema: AgentOutputSchemaBase | None - ) -> ResponseTextConfigParam | NotGiven: + ) -> ResponseTextConfigParam | Omit: if output_schema is None or output_schema.is_plain_text(): - return NOT_GIVEN + return omit else: return { "format": { @@ -370,7 +423,7 @@ def get_response_format( def convert_tools( cls, tools: list[Tool], - handoffs: list[Handoff[Any]], + handoffs: list[Handoff[Any, Any]], ) -> ConvertedTools: converted_tools: list[ToolParam] = [] includes: list[ResponseIncludable] = [] @@ -404,12 +457,13 @@ def _convert_tool(cls, tool: Tool) -> tuple[ToolParam, ResponseIncludable | None } includes: ResponseIncludable | None = None elif isinstance(tool, WebSearchTool): - ws: WebSearchToolParam = { - "type": "web_search_preview", + # TODO: revist the type: ignore comment when ToolParam is updated in the future + converted_tool = { + "type": "web_search", + "filters": tool.filters.model_dump() if tool.filters is not None else None, # type: ignore [typeddict-item] "user_location": tool.user_location, "search_context_size": tool.search_context_size, } - converted_tool = ws includes = None elif isinstance(tool, FileSearchTool): converted_tool = { diff --git a/src/agents/realtime/__init__.py b/src/agents/realtime/__init__.py index 0e3e12f75..3f0793fa1 100644 --- a/src/agents/realtime/__init__.py +++ b/src/agents/realtime/__init__.py @@ -3,6 +3,7 @@ RealtimeAudioFormat, RealtimeClientMessage, RealtimeGuardrailsSettings, + RealtimeInputAudioNoiseReductionConfig, RealtimeInputAudioTranscriptionConfig, RealtimeModelName, RealtimeModelTracingConfig, @@ -30,6 +31,7 @@ RealtimeToolEnd, RealtimeToolStart, ) +from .handoffs import realtime_handoff from .items import ( AssistantMessageItem, AssistantText, @@ -46,6 +48,8 @@ RealtimeModel, RealtimeModelConfig, RealtimeModelListener, + RealtimePlaybackState, + RealtimePlaybackTracker, ) from .model_events import ( RealtimeConnectionStatus, @@ -92,10 +96,13 @@ "RealtimeAgentHooks", "RealtimeRunHooks", "RealtimeRunner", + # Handoffs + "realtime_handoff", # Config "RealtimeAudioFormat", "RealtimeClientMessage", "RealtimeGuardrailsSettings", + "RealtimeInputAudioNoiseReductionConfig", "RealtimeInputAudioTranscriptionConfig", "RealtimeModelName", "RealtimeModelTracingConfig", @@ -136,6 +143,8 @@ "RealtimeModel", "RealtimeModelConfig", "RealtimeModelListener", + "RealtimePlaybackTracker", + "RealtimePlaybackState", # Model Events "RealtimeConnectionStatus", "RealtimeModelAudioDoneEvent", diff --git a/src/agents/realtime/_default_tracker.py b/src/agents/realtime/_default_tracker.py new file mode 100644 index 000000000..49bc827c2 --- /dev/null +++ b/src/agents/realtime/_default_tracker.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from dataclasses import dataclass +from datetime import datetime + +from ._util import calculate_audio_length_ms +from .config import RealtimeAudioFormat + + +@dataclass +class ModelAudioState: + initial_received_time: datetime + audio_length_ms: float + + +class ModelAudioTracker: + def __init__(self) -> None: + # (item_id, item_content_index) -> ModelAudioState + self._states: dict[tuple[str, int], ModelAudioState] = {} + self._last_audio_item: tuple[str, int] | None = None + + def set_audio_format(self, format: RealtimeAudioFormat) -> None: + """Called when the model wants to set the audio format.""" + self._format = format + + def on_audio_delta(self, item_id: str, item_content_index: int, audio_bytes: bytes) -> None: + """Called when an audio delta is received from the model.""" + ms = calculate_audio_length_ms(self._format, audio_bytes) + new_key = (item_id, item_content_index) + + self._last_audio_item = new_key + if new_key not in self._states: + self._states[new_key] = ModelAudioState(datetime.now(), ms) + else: + self._states[new_key].audio_length_ms += ms + + def on_interrupted(self) -> None: + """Called when the audio playback has been interrupted.""" + self._last_audio_item = None + + def get_state(self, item_id: str, item_content_index: int) -> ModelAudioState | None: + """Called when the model wants to get the current playback state.""" + return self._states.get((item_id, item_content_index)) + + def get_last_audio_item(self) -> tuple[str, int] | None: + """Called when the model wants to get the last audio item ID and content index.""" + return self._last_audio_item diff --git a/src/agents/realtime/_util.py b/src/agents/realtime/_util.py new file mode 100644 index 000000000..52a3483e9 --- /dev/null +++ b/src/agents/realtime/_util.py @@ -0,0 +1,9 @@ +from __future__ import annotations + +from .config import RealtimeAudioFormat + + +def calculate_audio_length_ms(format: RealtimeAudioFormat | None, audio_bytes: bytes) -> float: + if format and isinstance(format, str) and format.startswith("g711"): + return (len(audio_bytes) / 8000) * 1000 + return (len(audio_bytes) / 24 / 2) * 1000 diff --git a/src/agents/realtime/agent.py b/src/agents/realtime/agent.py index 9bbed8cb4..c04053db4 100644 --- a/src/agents/realtime/agent.py +++ b/src/agents/realtime/agent.py @@ -3,10 +3,14 @@ import dataclasses import inspect from collections.abc import Awaitable -from dataclasses import dataclass +from dataclasses import dataclass, field from typing import Any, Callable, Generic, cast +from agents.prompts import Prompt + from ..agent import AgentBase +from ..guardrail import OutputGuardrail +from ..handoffs import Handoff from ..lifecycle import AgentHooksBase, RunHooksBase from ..logger import logger from ..run_context import RunContextWrapper, TContext @@ -53,6 +57,24 @@ class RealtimeAgent(AgentBase, Generic[TContext]): return a string. """ + prompt: Prompt | None = None + """A prompt object. Prompts allow you to dynamically configure the instructions, tools + and other config for an agent outside of your code. Only usable with OpenAI models. + """ + + handoffs: list[RealtimeAgent[Any] | Handoff[TContext, RealtimeAgent[Any]]] = field( + default_factory=list + ) + """Handoffs are sub-agents that the agent can delegate to. You can provide a list of handoffs, + and the agent can choose to delegate to them if relevant. Allows for separation of concerns and + modularity. + """ + + output_guardrails: list[OutputGuardrail[TContext]] = field(default_factory=list) + """A list of checks that run on the final output of the agent, after generating a response. + Runs only if the agent produces a final output. + """ + hooks: RealtimeAgentHooks | None = None """A class that receives callbacks on various lifecycle events for this agent. """ diff --git a/src/agents/realtime/audio_formats.py b/src/agents/realtime/audio_formats.py new file mode 100644 index 000000000..d9757d244 --- /dev/null +++ b/src/agents/realtime/audio_formats.py @@ -0,0 +1,29 @@ +from __future__ import annotations + +from openai.types.realtime.realtime_audio_formats import ( + AudioPCM, + AudioPCMA, + AudioPCMU, + RealtimeAudioFormats, +) + +from ..logger import logger + + +def to_realtime_audio_format( + input_audio_format: str | RealtimeAudioFormats | None, +) -> RealtimeAudioFormats | None: + format: RealtimeAudioFormats | None = None + if input_audio_format is not None: + if isinstance(input_audio_format, str): + if input_audio_format in ["pcm16", "audio/pcm", "pcm"]: + format = AudioPCM(type="audio/pcm", rate=24000) + elif input_audio_format in ["g711_ulaw", "audio/pcmu", "pcmu"]: + format = AudioPCMU(type="audio/pcmu") + elif input_audio_format in ["g711_alaw", "audio/pcma", "pcma"]: + format = AudioPCMA(type="audio/pcma") + else: + logger.debug(f"Unknown input_audio_format: {input_audio_format}") + else: + format = input_audio_format + return format diff --git a/src/agents/realtime/config.py b/src/agents/realtime/config.py index 7f874cfb0..9b6712a28 100644 --- a/src/agents/realtime/config.py +++ b/src/agents/realtime/config.py @@ -6,14 +6,22 @@ Union, ) +from openai.types.realtime.realtime_audio_formats import ( + RealtimeAudioFormats as OpenAIRealtimeAudioFormats, +) from typing_extensions import NotRequired, TypeAlias, TypedDict +from agents.prompts import Prompt + from ..guardrail import OutputGuardrail +from ..handoffs import Handoff from ..model_settings import ToolChoice from ..tool import Tool RealtimeModelName: TypeAlias = Union[ Literal[ + "gpt-realtime", + "gpt-realtime-2025-08-28", "gpt-4o-realtime-preview", "gpt-4o-mini-realtime-preview", "gpt-4o-realtime-preview-2025-06-03", @@ -27,52 +35,114 @@ RealtimeAudioFormat: TypeAlias = Union[Literal["pcm16", "g711_ulaw", "g711_alaw"], str] +"""The audio format for realtime audio streams.""" class RealtimeClientMessage(TypedDict): """A raw message to be sent to the model.""" type: str # explicitly required + """The type of the message.""" + other_data: NotRequired[dict[str, Any]] """Merged into the message body.""" class RealtimeInputAudioTranscriptionConfig(TypedDict): + """Configuration for audio transcription in realtime sessions.""" + language: NotRequired[str] + """The language code for transcription.""" + model: NotRequired[Literal["gpt-4o-transcribe", "gpt-4o-mini-transcribe", "whisper-1"] | str] + """The transcription model to use.""" + prompt: NotRequired[str] + """An optional prompt to guide transcription.""" + + +class RealtimeInputAudioNoiseReductionConfig(TypedDict): + """Noise reduction configuration for input audio.""" + + type: NotRequired[Literal["near_field", "far_field"]] + """Noise reduction mode to apply to input audio.""" class RealtimeTurnDetectionConfig(TypedDict): """Turn detection config. Allows extra vendor keys if needed.""" type: NotRequired[Literal["semantic_vad", "server_vad"]] + """The type of voice activity detection to use.""" + create_response: NotRequired[bool] + """Whether to create a response when a turn is detected.""" + eagerness: NotRequired[Literal["auto", "low", "medium", "high"]] + """How eagerly to detect turn boundaries.""" + interrupt_response: NotRequired[bool] + """Whether to allow interrupting the assistant's response.""" + prefix_padding_ms: NotRequired[int] + """Padding time in milliseconds before turn detection.""" + silence_duration_ms: NotRequired[int] + """Duration of silence in milliseconds to trigger turn detection.""" + threshold: NotRequired[float] + """The threshold for voice activity detection.""" + + idle_timeout_ms: NotRequired[int] + """Threshold for server-vad to trigger a response if the user is idle for this duration.""" class RealtimeSessionModelSettings(TypedDict): """Model settings for a realtime model session.""" model_name: NotRequired[RealtimeModelName] + """The name of the realtime model to use.""" instructions: NotRequired[str] + """System instructions for the model.""" + + prompt: NotRequired[Prompt] + """The prompt to use for the model.""" + modalities: NotRequired[list[Literal["text", "audio"]]] + """The modalities the model should support.""" + voice: NotRequired[str] + """The voice to use for audio output.""" + + speed: NotRequired[float] + """The speed of the model's responses.""" + + input_audio_format: NotRequired[RealtimeAudioFormat | OpenAIRealtimeAudioFormats] + """The format for input audio streams.""" + + output_audio_format: NotRequired[RealtimeAudioFormat | OpenAIRealtimeAudioFormats] + """The format for output audio streams.""" - input_audio_format: NotRequired[RealtimeAudioFormat] - output_audio_format: NotRequired[RealtimeAudioFormat] input_audio_transcription: NotRequired[RealtimeInputAudioTranscriptionConfig] + """Configuration for transcribing input audio.""" + + input_audio_noise_reduction: NotRequired[RealtimeInputAudioNoiseReductionConfig | None] + """Noise reduction configuration for input audio.""" + turn_detection: NotRequired[RealtimeTurnDetectionConfig] + """Configuration for detecting conversation turns.""" tool_choice: NotRequired[ToolChoice] + """How the model should choose which tools to call.""" + tools: NotRequired[list[Tool]] + """List of tools available to the model.""" + + handoffs: NotRequired[list[Handoff]] + """List of handoff configurations.""" tracing: NotRequired[RealtimeModelTracingConfig | None] + """Configuration for request tracing.""" class RealtimeGuardrailsSettings(TypedDict): @@ -100,7 +170,10 @@ class RealtimeModelTracingConfig(TypedDict): class RealtimeRunConfig(TypedDict): + """Configuration for running a realtime agent session.""" + model_settings: NotRequired[RealtimeSessionModelSettings] + """Settings for the realtime model session.""" output_guardrails: NotRequired[list[OutputGuardrail[Any]]] """List of output guardrails to run on the agent's responses.""" @@ -111,18 +184,42 @@ class RealtimeRunConfig(TypedDict): tracing_disabled: NotRequired[bool] """Whether tracing is disabled for this run.""" + async_tool_calls: NotRequired[bool] + """Whether function tool calls should run asynchronously. Defaults to True.""" + # TODO (rm) Add history audio storage config class RealtimeUserInputText(TypedDict): + """A text input from the user.""" + type: Literal["input_text"] + """The type identifier for text input.""" + text: str + """The text content from the user.""" + + +class RealtimeUserInputImage(TypedDict, total=False): + """An image input from the user (Realtime).""" + + type: Literal["input_image"] + image_url: str + detail: NotRequired[Literal["auto", "low", "high"] | str] class RealtimeUserInputMessage(TypedDict): + """A message input from the user.""" + type: Literal["message"] + """The type identifier for message inputs.""" + role: Literal["user"] - content: list[RealtimeUserInputText] + """The role identifier for user messages.""" + + content: list[RealtimeUserInputText | RealtimeUserInputImage] + """List of content items (text and image) in the message.""" RealtimeUserInput: TypeAlias = Union[str, RealtimeUserInputMessage] +"""User input that can be a string or structured message.""" diff --git a/src/agents/realtime/events.py b/src/agents/realtime/events.py index 24444b66e..3c523c33b 100644 --- a/src/agents/realtime/events.py +++ b/src/agents/realtime/events.py @@ -115,6 +115,12 @@ class RealtimeAudioEnd: info: RealtimeEventInfo """Common info for all events, such as the context.""" + item_id: str + """The ID of the item containing audio.""" + + content_index: int + """The index of the audio content in `item.content`""" + type: Literal["audio_end"] = "audio_end" @@ -125,6 +131,12 @@ class RealtimeAudio: audio: RealtimeModelAudioEvent """The audio event from the model layer.""" + item_id: str + """The ID of the item containing audio.""" + + content_index: int + """The index of the audio content in `item.content`""" + info: RealtimeEventInfo """Common info for all events, such as the context.""" @@ -140,6 +152,12 @@ class RealtimeAudioInterrupted: info: RealtimeEventInfo """Common info for all events, such as the context.""" + item_id: str + """The ID of the item containing audio.""" + + content_index: int + """The index of the audio content in `item.content`""" + type: Literal["audio_interrupted"] = "audio_interrupted" @@ -198,6 +216,16 @@ class RealtimeGuardrailTripped: type: Literal["guardrail_tripped"] = "guardrail_tripped" +@dataclass +class RealtimeInputAudioTimeoutTriggered: + """Called when the model detects a period of inactivity/silence from the user.""" + + info: RealtimeEventInfo + """Common info for all events, such as the context.""" + + type: Literal["input_audio_timeout_triggered"] = "input_audio_timeout_triggered" + + RealtimeSessionEvent: TypeAlias = Union[ RealtimeAgentStartEvent, RealtimeAgentEndEvent, @@ -212,5 +240,6 @@ class RealtimeGuardrailTripped: RealtimeHistoryUpdated, RealtimeHistoryAdded, RealtimeGuardrailTripped, + RealtimeInputAudioTimeoutTriggered, ] """An event emitted by the realtime session.""" diff --git a/src/agents/realtime/handoffs.py b/src/agents/realtime/handoffs.py new file mode 100644 index 000000000..fa84b3a3f --- /dev/null +++ b/src/agents/realtime/handoffs.py @@ -0,0 +1,165 @@ +from __future__ import annotations + +import inspect +from typing import TYPE_CHECKING, Any, Callable, cast, overload + +from pydantic import TypeAdapter +from typing_extensions import TypeVar + +from ..exceptions import ModelBehaviorError, UserError +from ..handoffs import Handoff +from ..run_context import RunContextWrapper, TContext +from ..strict_schema import ensure_strict_json_schema +from ..tracing.spans import SpanError +from ..util import _error_tracing, _json +from ..util._types import MaybeAwaitable +from . import RealtimeAgent + +if TYPE_CHECKING: + from ..agent import AgentBase + + +# The handoff input type is the type of data passed when the agent is called via a handoff. +THandoffInput = TypeVar("THandoffInput", default=Any) + +OnHandoffWithInput = Callable[[RunContextWrapper[Any], THandoffInput], Any] +OnHandoffWithoutInput = Callable[[RunContextWrapper[Any]], Any] + + +@overload +def realtime_handoff( + agent: RealtimeAgent[TContext], + *, + tool_name_override: str | None = None, + tool_description_override: str | None = None, + is_enabled: bool + | Callable[[RunContextWrapper[Any], RealtimeAgent[Any]], MaybeAwaitable[bool]] = True, +) -> Handoff[TContext, RealtimeAgent[TContext]]: ... + + +@overload +def realtime_handoff( + agent: RealtimeAgent[TContext], + *, + on_handoff: OnHandoffWithInput[THandoffInput], + input_type: type[THandoffInput], + tool_description_override: str | None = None, + tool_name_override: str | None = None, + is_enabled: bool + | Callable[[RunContextWrapper[Any], RealtimeAgent[Any]], MaybeAwaitable[bool]] = True, +) -> Handoff[TContext, RealtimeAgent[TContext]]: ... + + +@overload +def realtime_handoff( + agent: RealtimeAgent[TContext], + *, + on_handoff: OnHandoffWithoutInput, + tool_description_override: str | None = None, + tool_name_override: str | None = None, + is_enabled: bool + | Callable[[RunContextWrapper[Any], RealtimeAgent[Any]], MaybeAwaitable[bool]] = True, +) -> Handoff[TContext, RealtimeAgent[TContext]]: ... + + +def realtime_handoff( + agent: RealtimeAgent[TContext], + tool_name_override: str | None = None, + tool_description_override: str | None = None, + on_handoff: OnHandoffWithInput[THandoffInput] | OnHandoffWithoutInput | None = None, + input_type: type[THandoffInput] | None = None, + is_enabled: bool + | Callable[[RunContextWrapper[Any], RealtimeAgent[Any]], MaybeAwaitable[bool]] = True, +) -> Handoff[TContext, RealtimeAgent[TContext]]: + """Create a handoff from a RealtimeAgent. + + Args: + agent: The RealtimeAgent to handoff to, or a function that returns a RealtimeAgent. + tool_name_override: Optional override for the name of the tool that represents the handoff. + tool_description_override: Optional override for the description of the tool that + represents the handoff. + on_handoff: A function that runs when the handoff is invoked. + input_type: the type of the input to the handoff. If provided, the input will be validated + against this type. Only relevant if you pass a function that takes an input. + is_enabled: Whether the handoff is enabled. Can be a bool or a callable that takes the run + context and agent and returns whether the handoff is enabled. Disabled handoffs are + hidden from the LLM at runtime. + + Note: input_filter is not supported for RealtimeAgent handoffs. + """ + assert (on_handoff and input_type) or not (on_handoff and input_type), ( + "You must provide either both on_handoff and input_type, or neither" + ) + type_adapter: TypeAdapter[Any] | None + if input_type is not None: + assert callable(on_handoff), "on_handoff must be callable" + sig = inspect.signature(on_handoff) + if len(sig.parameters) != 2: + raise UserError("on_handoff must take two arguments: context and input") + + type_adapter = TypeAdapter(input_type) + input_json_schema = type_adapter.json_schema() + else: + type_adapter = None + input_json_schema = {} + if on_handoff is not None: + sig = inspect.signature(on_handoff) + if len(sig.parameters) != 1: + raise UserError("on_handoff must take one argument: context") + + async def _invoke_handoff( + ctx: RunContextWrapper[Any], input_json: str | None = None + ) -> RealtimeAgent[TContext]: + if input_type is not None and type_adapter is not None: + if input_json is None: + _error_tracing.attach_error_to_current_span( + SpanError( + message="Handoff function expected non-null input, but got None", + data={"details": "input_json is None"}, + ) + ) + raise ModelBehaviorError("Handoff function expected non-null input, but got None") + + validated_input = _json.validate_json( + json_str=input_json, + type_adapter=type_adapter, + partial=False, + ) + input_func = cast(OnHandoffWithInput[THandoffInput], on_handoff) + if inspect.iscoroutinefunction(input_func): + await input_func(ctx, validated_input) + else: + input_func(ctx, validated_input) + elif on_handoff is not None: + no_input_func = cast(OnHandoffWithoutInput, on_handoff) + if inspect.iscoroutinefunction(no_input_func): + await no_input_func(ctx) + else: + no_input_func(ctx) + + return agent + + tool_name = tool_name_override or Handoff.default_tool_name(agent) + tool_description = tool_description_override or Handoff.default_tool_description(agent) + + # Always ensure the input JSON schema is in strict mode + # If there is a need, we can make this configurable in the future + input_json_schema = ensure_strict_json_schema(input_json_schema) + + async def _is_enabled(ctx: RunContextWrapper[Any], agent_base: AgentBase[Any]) -> bool: + assert callable(is_enabled), "is_enabled must be non-null here" + assert isinstance(agent_base, RealtimeAgent), "Can't handoff to a non-RealtimeAgent" + result = is_enabled(ctx, agent_base) + if inspect.isawaitable(result): + return await result + return result + + return Handoff( + tool_name=tool_name, + tool_description=tool_description, + input_json_schema=input_json_schema, + on_invoke_handoff=_invoke_handoff, + input_filter=None, # Not supported for RealtimeAgent handoffs + agent_name=agent.name, + is_enabled=_is_enabled if callable(is_enabled) else is_enabled, + ) diff --git a/src/agents/realtime/items.py b/src/agents/realtime/items.py index a835e7a88..58106fad8 100644 --- a/src/agents/realtime/items.py +++ b/src/agents/realtime/items.py @@ -6,59 +6,143 @@ class InputText(BaseModel): + """Text input content for realtime messages.""" + type: Literal["input_text"] = "input_text" + """The type identifier for text input.""" + text: str | None = None + """The text content.""" # Allow extra data model_config = ConfigDict(extra="allow") class InputAudio(BaseModel): + """Audio input content for realtime messages.""" + type: Literal["input_audio"] = "input_audio" + """The type identifier for audio input.""" + audio: str | None = None + """The base64-encoded audio data.""" + transcript: str | None = None + """The transcript of the audio, if available.""" # Allow extra data model_config = ConfigDict(extra="allow") +class InputImage(BaseModel): + """Image input content for realtime messages.""" + + type: Literal["input_image"] = "input_image" + """The type identifier for image input.""" + + image_url: str | None = None + """Data/remote URL string (data:... or https:...).""" + + detail: str | None = None + """Optional detail hint (e.g., 'auto', 'high', 'low').""" + + # Allow extra data (e.g., `detail`) + model_config = ConfigDict(extra="allow") + + class AssistantText(BaseModel): + """Text content from the assistant in realtime responses.""" + type: Literal["text"] = "text" + """The type identifier for text content.""" + text: str | None = None + """The text content from the assistant.""" + + # Allow extra data + model_config = ConfigDict(extra="allow") + + +class AssistantAudio(BaseModel): + """Audio content from the assistant in realtime responses.""" + + type: Literal["audio"] = "audio" + """The type identifier for audio content.""" + + audio: str | None = None + """The base64-encoded audio data from the assistant.""" + + transcript: str | None = None + """The transcript of the audio response.""" # Allow extra data model_config = ConfigDict(extra="allow") class SystemMessageItem(BaseModel): + """A system message item in realtime conversations.""" + item_id: str + """Unique identifier for this message item.""" + previous_item_id: str | None = None + """ID of the previous item in the conversation.""" + type: Literal["message"] = "message" + """The type identifier for message items.""" + role: Literal["system"] = "system" + """The role identifier for system messages.""" + content: list[InputText] + """List of text content for the system message.""" # Allow extra data model_config = ConfigDict(extra="allow") class UserMessageItem(BaseModel): + """A user message item in realtime conversations.""" + item_id: str + """Unique identifier for this message item.""" + previous_item_id: str | None = None + """ID of the previous item in the conversation.""" + type: Literal["message"] = "message" + """The type identifier for message items.""" + role: Literal["user"] = "user" - content: list[Annotated[InputText | InputAudio, Field(discriminator="type")]] + """The role identifier for user messages.""" + + content: list[Annotated[InputText | InputAudio | InputImage, Field(discriminator="type")]] + """List of content items, can be text or audio.""" # Allow extra data model_config = ConfigDict(extra="allow") class AssistantMessageItem(BaseModel): + """An assistant message item in realtime conversations.""" + item_id: str + """Unique identifier for this message item.""" + previous_item_id: str | None = None + """ID of the previous item in the conversation.""" + type: Literal["message"] = "message" + """The type identifier for message items.""" + role: Literal["assistant"] = "assistant" + """The role identifier for assistant messages.""" + status: Literal["in_progress", "completed", "incomplete"] | None = None - content: list[AssistantText] + """The status of the assistant's response.""" + + content: list[Annotated[AssistantText | AssistantAudio, Field(discriminator="type")]] + """List of content items from the assistant, can be text or audio.""" # Allow extra data model_config = ConfigDict(extra="allow") @@ -68,24 +152,49 @@ class AssistantMessageItem(BaseModel): Union[SystemMessageItem, UserMessageItem, AssistantMessageItem], Field(discriminator="role"), ] +"""A message item that can be from system, user, or assistant.""" class RealtimeToolCallItem(BaseModel): + """A tool call item in realtime conversations.""" + item_id: str + """Unique identifier for this tool call item.""" + previous_item_id: str | None = None + """ID of the previous item in the conversation.""" + + call_id: str | None + """The call ID for this tool invocation.""" + type: Literal["function_call"] = "function_call" + """The type identifier for function call items.""" + status: Literal["in_progress", "completed"] + """The status of the tool call execution.""" + arguments: str + """The JSON string arguments passed to the tool.""" + name: str + """The name of the tool being called.""" + output: str | None = None + """The output result from the tool execution.""" # Allow extra data model_config = ConfigDict(extra="allow") RealtimeItem = Union[RealtimeMessageItem, RealtimeToolCallItem] +"""A realtime item that can be a message or tool call.""" class RealtimeResponse(BaseModel): + """A response from the realtime model.""" + id: str + """Unique identifier for this response.""" + output: list[RealtimeMessageItem] + """List of message items in the response.""" diff --git a/src/agents/realtime/model.py b/src/agents/realtime/model.py index e279ecc95..c0632aa9b 100644 --- a/src/agents/realtime/model.py +++ b/src/agents/realtime/model.py @@ -6,13 +6,95 @@ from typing_extensions import NotRequired, TypedDict from ..util._types import MaybeAwaitable +from ._util import calculate_audio_length_ms from .config import ( + RealtimeAudioFormat, RealtimeSessionModelSettings, ) from .model_events import RealtimeModelEvent from .model_inputs import RealtimeModelSendEvent +class RealtimePlaybackState(TypedDict): + current_item_id: str | None + """The item ID of the current item being played.""" + + current_item_content_index: int | None + """The index of the current item content being played.""" + + elapsed_ms: float | None + """The number of milliseconds of audio that have been played.""" + + +class RealtimePlaybackTracker: + """If you have custom playback logic or expect that audio is played with delays or at different + speeds, create an instance of RealtimePlaybackTracker and pass it to the session. You are + responsible for tracking the audio playback progress and calling `on_play_bytes` or + `on_play_ms` when the user has played some audio.""" + + def __init__(self) -> None: + self._format: RealtimeAudioFormat | None = None + # (item_id, item_content_index) + self._current_item: tuple[str, int] | None = None + self._elapsed_ms: float | None = None + + def on_play_bytes(self, item_id: str, item_content_index: int, bytes: bytes) -> None: + """Called by you when you have played some audio. + + Args: + item_id: The item ID of the audio being played. + item_content_index: The index of the audio content in `item.content` + bytes: The audio bytes that have been fully played. + """ + ms = calculate_audio_length_ms(self._format, bytes) + self.on_play_ms(item_id, item_content_index, ms) + + def on_play_ms(self, item_id: str, item_content_index: int, ms: float) -> None: + """Called by you when you have played some audio. + + Args: + item_id: The item ID of the audio being played. + item_content_index: The index of the audio content in `item.content` + ms: The number of milliseconds of audio that have been played. + """ + if self._current_item != (item_id, item_content_index): + self._current_item = (item_id, item_content_index) + self._elapsed_ms = ms + else: + assert self._elapsed_ms is not None + self._elapsed_ms += ms + + def on_interrupted(self) -> None: + """Called by the model when the audio playback has been interrupted.""" + self._current_item = None + self._elapsed_ms = None + + def set_audio_format(self, format: RealtimeAudioFormat) -> None: + """Will be called by the model to set the audio format. + + Args: + format: The audio format to use. + """ + self._format = format + + def get_state(self) -> RealtimePlaybackState: + """Will be called by the model to get the current playback state.""" + if self._current_item is None: + return { + "current_item_id": None, + "current_item_content_index": None, + "elapsed_ms": None, + } + assert self._elapsed_ms is not None + + item_id, item_content_index = self._current_item + return { + "current_item_id": item_id, + "current_item_content_index": item_content_index, + "elapsed_ms": self._elapsed_ms, + } + + class RealtimeModelListener(abc.ABC): """A listener for realtime transport events.""" @@ -36,9 +118,27 @@ class RealtimeModelConfig(TypedDict): the OpenAI Realtime model will use the default OpenAI WebSocket URL. """ + headers: NotRequired[dict[str, str]] + """The headers to use when connecting. If unset, the model will use a sane default. + Note that, when you set this, authorization header won't be set under the hood. + e.g., {"api-key": "your api key here"} for Azure OpenAI Realtime WebSocket connections. + """ + initial_model_settings: NotRequired[RealtimeSessionModelSettings] """The initial model settings to use when connecting.""" + playback_tracker: NotRequired[RealtimePlaybackTracker] + """The playback tracker to use when tracking audio playback progress. If not set, the model will + use a default implementation that assumes audio is played immediately, at realtime speed. + + A playback tracker is useful for interruptions. The model generates audio much faster than + realtime playback speed. So if there's an interruption, its useful for the model to know how + much of the audio has been played by the user. In low-latency scenarios, it's fine to assume + that audio is played back immediately at realtime speed. But in scenarios like phone calls or + other remote interactions, you can set a playback tracker that lets the model know when audio + is played to the user. + """ + class RealtimeModel(abc.ABC): """Interface for connecting to a realtime model and sending/receiving events.""" diff --git a/src/agents/realtime/model_events.py b/src/agents/realtime/model_events.py index 3a158ef4e..7c839aa18 100644 --- a/src/agents/realtime/model_events.py +++ b/src/agents/realtime/model_events.py @@ -40,6 +40,12 @@ class RealtimeModelAudioEvent: data: bytes response_id: str + item_id: str + """The ID of the item containing audio.""" + + content_index: int + """The index of the audio content in `item.content`""" + type: Literal["audio"] = "audio" @@ -47,6 +53,12 @@ class RealtimeModelAudioEvent: class RealtimeModelAudioInterruptedEvent: """Audio interrupted.""" + item_id: str + """The ID of the item containing audio.""" + + content_index: int + """The index of the audio content in `item.content`""" + type: Literal["audio_interrupted"] = "audio_interrupted" @@ -54,6 +66,12 @@ class RealtimeModelAudioInterruptedEvent: class RealtimeModelAudioDoneEvent: """Audio done.""" + item_id: str + """The ID of the item containing audio.""" + + content_index: int + """The index of the audio content in `item.content`""" + type: Literal["audio_done"] = "audio_done" @@ -67,6 +85,17 @@ class RealtimeModelInputAudioTranscriptionCompletedEvent: type: Literal["input_audio_transcription_completed"] = "input_audio_transcription_completed" +@dataclass +class RealtimeModelInputAudioTimeoutTriggeredEvent: + """Input audio timeout triggered.""" + + item_id: str + audio_start_ms: int + audio_end_ms: int + + type: Literal["input_audio_timeout_triggered"] = "input_audio_timeout_triggered" + + @dataclass class RealtimeModelTranscriptDeltaEvent: """Partial transcript update.""" @@ -138,6 +167,15 @@ class RealtimeModelExceptionEvent: type: Literal["exception"] = "exception" +@dataclass +class RealtimeModelRawServerEvent: + """Raw events forwarded from the server.""" + + data: Any + + type: Literal["raw_server_event"] = "raw_server_event" + + # TODO (rm) Add usage events @@ -147,6 +185,7 @@ class RealtimeModelExceptionEvent: RealtimeModelAudioEvent, RealtimeModelAudioInterruptedEvent, RealtimeModelAudioDoneEvent, + RealtimeModelInputAudioTimeoutTriggeredEvent, RealtimeModelInputAudioTranscriptionCompletedEvent, RealtimeModelTranscriptDeltaEvent, RealtimeModelItemUpdatedEvent, @@ -156,4 +195,5 @@ class RealtimeModelExceptionEvent: RealtimeModelTurnEndedEvent, RealtimeModelOtherEvent, RealtimeModelExceptionEvent, + RealtimeModelRawServerEvent, ] diff --git a/src/agents/realtime/model_inputs.py b/src/agents/realtime/model_inputs.py index df09e6697..411177b7a 100644 --- a/src/agents/realtime/model_inputs.py +++ b/src/agents/realtime/model_inputs.py @@ -24,12 +24,26 @@ class RealtimeModelInputTextContent(TypedDict): text: str +class RealtimeModelInputImageContent(TypedDict, total=False): + """An image to be sent to the model. + + The Realtime API expects `image_url` to be a string data/remote URL. + """ + + type: Literal["input_image"] + image_url: str + """String URL (data:... or https:...).""" + + detail: NotRequired[str] + """Optional detail hint such as 'high', 'low', or 'auto'.""" + + class RealtimeModelUserInputMessage(TypedDict): """A message to be sent to the model.""" type: Literal["message"] role: Literal["user"] - content: list[RealtimeModelInputTextContent] + content: list[RealtimeModelInputTextContent | RealtimeModelInputImageContent] RealtimeModelUserInput: TypeAlias = Union[str, RealtimeModelUserInputMessage] @@ -81,6 +95,9 @@ class RealtimeModelSendToolOutput: class RealtimeModelSendInterrupt: """Send an interrupt to the model.""" + force_response_cancel: bool = False + """Force sending a response.cancel event even if automatic cancellation is enabled.""" + @dataclass class RealtimeModelSendSessionUpdate: diff --git a/src/agents/realtime/openai_realtime.py b/src/agents/realtime/openai_realtime.py index 1c4a4de3c..873062c1d 100644 --- a/src/agents/realtime/openai_realtime.py +++ b/src/agents/realtime/openai_realtime.py @@ -5,29 +5,93 @@ import inspect import json import os +from collections.abc import Mapping from datetime import datetime -from typing import Any, Callable, Literal +from typing import Annotated, Any, Callable, Literal, Union, cast import pydantic import websockets -from openai.types.beta.realtime.conversation_item import ConversationItem -from openai.types.beta.realtime.realtime_server_event import ( +from openai.types.realtime import realtime_audio_config as _rt_audio_config +from openai.types.realtime.conversation_item import ( + ConversationItem, + ConversationItem as OpenAIConversationItem, +) +from openai.types.realtime.conversation_item_create_event import ( + ConversationItemCreateEvent as OpenAIConversationItemCreateEvent, +) +from openai.types.realtime.conversation_item_retrieve_event import ( + ConversationItemRetrieveEvent as OpenAIConversationItemRetrieveEvent, +) +from openai.types.realtime.conversation_item_truncate_event import ( + ConversationItemTruncateEvent as OpenAIConversationItemTruncateEvent, +) +from openai.types.realtime.input_audio_buffer_append_event import ( + InputAudioBufferAppendEvent as OpenAIInputAudioBufferAppendEvent, +) +from openai.types.realtime.input_audio_buffer_commit_event import ( + InputAudioBufferCommitEvent as OpenAIInputAudioBufferCommitEvent, +) +from openai.types.realtime.realtime_audio_formats import ( + AudioPCM, + AudioPCMA, + AudioPCMU, +) +from openai.types.realtime.realtime_client_event import ( + RealtimeClientEvent as OpenAIRealtimeClientEvent, +) +from openai.types.realtime.realtime_conversation_item_assistant_message import ( + RealtimeConversationItemAssistantMessage, +) +from openai.types.realtime.realtime_conversation_item_function_call_output import ( + RealtimeConversationItemFunctionCallOutput, +) +from openai.types.realtime.realtime_conversation_item_system_message import ( + RealtimeConversationItemSystemMessage, +) +from openai.types.realtime.realtime_conversation_item_user_message import ( + Content, + RealtimeConversationItemUserMessage, +) +from openai.types.realtime.realtime_function_tool import ( + RealtimeFunctionTool as OpenAISessionFunction, +) +from openai.types.realtime.realtime_server_event import ( RealtimeServerEvent as OpenAIRealtimeServerEvent, ) -from openai.types.beta.realtime.response_audio_delta_event import ResponseAudioDeltaEvent -from openai.types.beta.realtime.session_update_event import ( - Session as OpenAISessionObject, - SessionTool as OpenAISessionTool, +from openai.types.realtime.realtime_session_create_request import ( + RealtimeSessionCreateRequest as OpenAISessionCreateRequest, ) -from pydantic import TypeAdapter +from openai.types.realtime.realtime_tracing_config import ( + TracingConfiguration as OpenAITracingConfiguration, +) +from openai.types.realtime.realtime_transcription_session_create_request import ( + RealtimeTranscriptionSessionCreateRequest as OpenAIRealtimeTranscriptionSessionCreateRequest, +) +from openai.types.realtime.response_audio_delta_event import ResponseAudioDeltaEvent +from openai.types.realtime.response_cancel_event import ( + ResponseCancelEvent as OpenAIResponseCancelEvent, +) +from openai.types.realtime.response_create_event import ( + ResponseCreateEvent as OpenAIResponseCreateEvent, +) +from openai.types.realtime.session_update_event import ( + SessionUpdateEvent as OpenAISessionUpdateEvent, +) +from openai.types.responses.response_prompt import ResponsePrompt +from pydantic import Field, TypeAdapter from typing_extensions import assert_never from websockets.asyncio.client import ClientConnection +from agents.handoffs import Handoff +from agents.prompts import Prompt +from agents.realtime._default_tracker import ModelAudioTracker +from agents.realtime.audio_formats import to_realtime_audio_format from agents.tool import FunctionTool, Tool from agents.util._types import MaybeAwaitable from ..exceptions import UserError from ..logger import logger +from ..version import __version__ from .config import ( RealtimeModelTracingConfig, RealtimeSessionModelSettings, @@ -37,6 +101,8 @@ RealtimeModel, RealtimeModelConfig, RealtimeModelListener, + RealtimePlaybackState, + RealtimePlaybackTracker, ) from .model_events import ( RealtimeModelAudioDoneEvent, @@ -45,9 +111,11 @@ RealtimeModelErrorEvent, RealtimeModelEvent, RealtimeModelExceptionEvent, + RealtimeModelInputAudioTimeoutTriggeredEvent, RealtimeModelInputAudioTranscriptionCompletedEvent, RealtimeModelItemDeletedEvent, RealtimeModelItemUpdatedEvent, + RealtimeModelRawServerEvent, RealtimeModelToolCallEvent, RealtimeModelTranscriptDeltaEvent, RealtimeModelTurnEndedEvent, @@ -63,15 +131,23 @@ RealtimeModelSendUserInput, ) +# Avoid direct imports of non-exported names by referencing via module +OpenAIRealtimeAudioConfig = _rt_audio_config.RealtimeAudioConfig +OpenAIRealtimeAudioInput = _rt_audio_config.RealtimeAudioConfigInput # type: ignore[attr-defined] +OpenAIRealtimeAudioOutput = _rt_audio_config.RealtimeAudioConfigOutput # type: ignore[attr-defined] + + +_USER_AGENT = f"Agents/Python {__version__}" + DEFAULT_MODEL_SETTINGS: RealtimeSessionModelSettings = { "voice": "ash", - "modalities": ["text", "audio"], + "modalities": ["audio"], "input_audio_format": "pcm16", "output_audio_format": "pcm16", "input_audio_transcription": { "model": "gpt-4o-mini-transcribe", }, - "turn_detection": {"type": "semantic_vad"}, + "turn_detection": {"type": "semantic_vad", "interrupt_response": True}, } @@ -87,20 +163,41 @@ async def get_api_key(key: str | Callable[[], MaybeAwaitable[str]] | None) -> st return os.getenv("OPENAI_API_KEY") +AllRealtimeServerEvents = Annotated[ + Union[OpenAIRealtimeServerEvent,], + Field(discriminator="type"), +] + +ServerEventTypeAdapter: TypeAdapter[AllRealtimeServerEvents] | None = None + + +def get_server_event_type_adapter() -> TypeAdapter[AllRealtimeServerEvents]: + global ServerEventTypeAdapter + if not ServerEventTypeAdapter: + ServerEventTypeAdapter = TypeAdapter(AllRealtimeServerEvents) + return ServerEventTypeAdapter + + +# Note: Avoid a module-level union alias for Python 3.9 compatibility. +# Using a union at runtime (e.g., A | B) in a type alias triggers evaluation +# during import on 3.9. We instead inline the union in annotations below. + + class OpenAIRealtimeWebSocketModel(RealtimeModel): """A model that uses OpenAI's WebSocket API.""" def __init__(self) -> None: - self.model = "gpt-4o-realtime-preview" # Default model + self.model = "gpt-realtime" # Default model self._websocket: ClientConnection | None = None self._websocket_task: asyncio.Task[None] | None = None self._listeners: list[RealtimeModelListener] = [] self._current_item_id: str | None = None - self._audio_start_time: datetime | None = None - self._audio_length_ms: float = 0.0 + self._audio_state_tracker: ModelAudioTracker = ModelAudioTracker() self._ongoing_response: bool = False - self._current_audio_content_index: int | None = None self._tracing_config: RealtimeModelTracingConfig | Literal["auto"] | None = None + self._playback_tracker: RealtimePlaybackTracker | None = None + self._created_session: OpenAISessionCreateRequest | None = None + self._server_event_type_adapter = get_server_event_type_adapter() async def connect(self, options: RealtimeModelConfig) -> None: """Establish a connection to the model and keep it alive.""" @@ -109,6 +206,8 @@ async def connect(self, options: RealtimeModelConfig) -> None: model_settings: RealtimeSessionModelSettings = options.get("initial_model_settings", {}) + self._playback_tracker = options.get("playback_tracker", None) + self.model = model_settings.get("model_name", self.model) api_key = await get_api_key(options.get("api_key")) @@ -117,16 +216,24 @@ async def connect(self, options: RealtimeModelConfig) -> None: else: self._tracing_config = "auto" - if not api_key: - raise UserError("API key is required but was not provided.") - url = options.get("url", f"wss://api.openai.com/v1/realtime?model={self.model}") - headers = { - "Authorization": f"Bearer {api_key}", - "OpenAI-Beta": "realtime=v1", - } - self._websocket = await websockets.connect(url, additional_headers=headers) + headers: dict[str, str] = {} + if options.get("headers") is not None: + # For customizing request headers + headers.update(options["headers"]) + else: + # OpenAI's Realtime API + if not api_key: + raise UserError("API key is required but was not provided.") + + headers.update({"Authorization": f"Bearer {api_key}"}) + self._websocket = await websockets.connect( + url, + user_agent_header=_USER_AGENT, + additional_headers=headers, + max_size=None, # Allow any size of message + ) self._websocket_task = asyncio.create_task(self._listen_for_messages()) await self._update_session_config(model_settings) @@ -135,12 +242,15 @@ async def _send_tracing_config( ) -> None: """Update tracing configuration via session.update event.""" if tracing_config is not None: + converted_tracing_config = _ConversionHelper.convert_tracing_config(tracing_config) await self._send_raw_message( - RealtimeModelSendRawMessage( - message={ - "type": "session.update", - "other_data": {"session": {"tracing": tracing_config}}, - } + OpenAISessionUpdateEvent( + session=OpenAISessionCreateRequest( + model=self.model, + type="realtime", + tracing=converted_tracing_config, + ), + type="session.update", ) ) @@ -156,7 +266,8 @@ def remove_listener(self, listener: RealtimeModelListener) -> None: async def _emit_event(self, event: RealtimeModelEvent) -> None: """Emit an event to the listeners.""" - for listener in self._listeners: + # Copy list to avoid modification during iteration + for listener in list(self._listeners): await listener.on_event(event) async def _listen_for_messages(self): @@ -182,7 +293,7 @@ async def _listen_for_messages(self): except websockets.exceptions.ConnectionClosedOK: # Normal connection closure - no exception event needed - logger.info("WebSocket connection closed normally") + logger.debug("WebSocket connection closed normally") except websockets.exceptions.ConnectionClosed as e: await self._emit_event( RealtimeModelExceptionEvent( @@ -199,7 +310,11 @@ async def _listen_for_messages(self): async def send_event(self, event: RealtimeModelSendEvent) -> None: """Send an event to the model.""" if isinstance(event, RealtimeModelSendRawMessage): - await self._send_raw_message(event) + converted = _ConversionHelper.try_convert_raw_message(event) + if converted is not None: + await self._send_raw_message(converted) + else: + logger.error(f"Failed to convert raw message: {event}") elif isinstance(event, RealtimeModelSendUserInput): await self._send_user_input(event) elif isinstance(event, RealtimeModelSendAudio): @@ -214,77 +329,33 @@ async def send_event(self, event: RealtimeModelSendEvent) -> None: assert_never(event) raise ValueError(f"Unknown event type: {type(event)}") - async def _send_raw_message(self, event: RealtimeModelSendRawMessage) -> None: + async def _send_raw_message(self, event: OpenAIRealtimeClientEvent) -> None: """Send a raw message to the model.""" assert self._websocket is not None, "Not connected" - - converted_event = { - "type": event.message["type"], - } - - converted_event.update(event.message.get("other_data", {})) - - await self._websocket.send(json.dumps(converted_event)) + payload = event.model_dump_json(exclude_none=True, exclude_unset=True) + await self._websocket.send(payload) async def _send_user_input(self, event: RealtimeModelSendUserInput) -> None: - message = ( - event.user_input - if isinstance(event.user_input, dict) - else { - "type": "message", - "role": "user", - "content": [{"type": "input_text", "text": event.user_input}], - } - ) - other_data = { - "item": message, - } - - await self._send_raw_message( - RealtimeModelSendRawMessage( - message={"type": "conversation.item.create", "other_data": other_data} - ) - ) - await self._send_raw_message( - RealtimeModelSendRawMessage(message={"type": "response.create"}) - ) + converted = _ConversionHelper.convert_user_input_to_item_create(event) + await self._send_raw_message(converted) + await self._send_raw_message(OpenAIResponseCreateEvent(type="response.create")) async def _send_audio(self, event: RealtimeModelSendAudio) -> None: - base64_audio = base64.b64encode(event.audio).decode("utf-8") - await self._send_raw_message( - RealtimeModelSendRawMessage( - message={ - "type": "input_audio_buffer.append", - "other_data": { - "audio": base64_audio, - }, - } - ) - ) + converted = _ConversionHelper.convert_audio_to_input_audio_buffer_append(event) + await self._send_raw_message(converted) if event.commit: await self._send_raw_message( - RealtimeModelSendRawMessage(message={"type": "input_audio_buffer.commit"}) + OpenAIInputAudioBufferCommitEvent(type="input_audio_buffer.commit") ) async def _send_tool_output(self, event: RealtimeModelSendToolOutput) -> None: - await self._send_raw_message( - RealtimeModelSendRawMessage( - message={ - "type": "conversation.item.create", - "other_data": { - "item": { - "type": "function_call_output", - "output": event.output, - "call_id": event.tool_call.id, - }, - }, - } - ) - ) + converted = _ConversionHelper.convert_tool_output(event) + await self._send_raw_message(converted) tool_item = RealtimeToolCallItem( item_id=event.tool_call.id or "", previous_item_id=event.tool_call.previous_item_id, + call_id=event.tool_call.call_id, type="function_call", status="completed", arguments=event.tool_call.arguments, @@ -294,36 +365,85 @@ async def _send_tool_output(self, event: RealtimeModelSendToolOutput) -> None: await self._emit_event(RealtimeModelItemUpdatedEvent(item=tool_item)) if event.start_response: - await self._send_raw_message( - RealtimeModelSendRawMessage(message={"type": "response.create"}) - ) + await self._send_raw_message(OpenAIResponseCreateEvent(type="response.create")) - async def _send_interrupt(self, event: RealtimeModelSendInterrupt) -> None: - if not self._current_item_id or not self._audio_start_time: - return + def _get_playback_state(self) -> RealtimePlaybackState: + if self._playback_tracker: + return self._playback_tracker.get_state() - await self._cancel_response() + if last_audio_item_id := self._audio_state_tracker.get_last_audio_item(): + item_id, item_content_index = last_audio_item_id + audio_state = self._audio_state_tracker.get_state(item_id, item_content_index) + if audio_state: + elapsed_ms = ( + datetime.now() - audio_state.initial_received_time + ).total_seconds() * 1000 + return { + "current_item_id": item_id, + "current_item_content_index": item_content_index, + "elapsed_ms": elapsed_ms, + } - elapsed_time_ms = (datetime.now() - self._audio_start_time).total_seconds() * 1000 - if elapsed_time_ms > 0 and elapsed_time_ms < self._audio_length_ms: - await self._emit_event(RealtimeModelAudioInterruptedEvent()) - await self._send_raw_message( - RealtimeModelSendRawMessage( - message={ - "type": "conversation.item.truncate", - "other_data": { - "item_id": self._current_item_id, - "content_index": self._current_audio_content_index, - "audio_end_ms": elapsed_time_ms, - }, - } - ) + return { + "current_item_id": None, + "current_item_content_index": None, + "elapsed_ms": None, + } + + async def _send_interrupt(self, event: RealtimeModelSendInterrupt) -> None: + playback_state = self._get_playback_state() + current_item_id = playback_state.get("current_item_id") + current_item_content_index = playback_state.get("current_item_content_index") + elapsed_ms = playback_state.get("elapsed_ms") + + if current_item_id is None or elapsed_ms is None: + logger.debug( + "Skipping interrupt. " + f"Item id: {current_item_id}, " + f"elapsed ms: {elapsed_ms}, " + f"content index: {current_item_content_index}" ) + else: + current_item_content_index = current_item_content_index or 0 + if elapsed_ms > 0: + await self._emit_event( + RealtimeModelAudioInterruptedEvent( + item_id=current_item_id, + content_index=current_item_content_index, + ) + ) + converted = _ConversionHelper.convert_interrupt( + current_item_id, + current_item_content_index, + int(elapsed_ms), + ) + await self._send_raw_message(converted) + else: + logger.debug( + "Didn't interrupt bc elapsed ms is < 0. " + f"Item id: {current_item_id}, " + f"elapsed ms: {elapsed_ms}, " + f"content index: {current_item_content_index}" + ) - self._current_item_id = None - self._audio_start_time = None - self._audio_length_ms = 0.0 - self._current_audio_content_index = None + session = self._created_session + automatic_response_cancellation_enabled = ( + session + and session.audio is not None + and session.audio.input is not None + and session.audio.input.turn_detection is not None + and session.audio.input.turn_detection.interrupt_response is True + ) + should_cancel_response = event.force_response_cancel or ( + not automatic_response_cancellation_enabled + ) + if should_cancel_response: + await self._cancel_response() + + if current_item_id is not None and elapsed_ms is not None: + self._audio_state_tracker.on_interrupted() + if self._playback_tracker: + self._playback_tracker.on_interrupted() async def _send_session_update(self, event: RealtimeModelSendSessionUpdate) -> None: """Send a session update to the model.""" @@ -331,29 +451,28 @@ async def _send_session_update(self, event: RealtimeModelSendSessionUpdate) -> N async def _handle_audio_delta(self, parsed: ResponseAudioDeltaEvent) -> None: """Handle audio delta events and update audio tracking state.""" - self._current_audio_content_index = parsed.content_index self._current_item_id = parsed.item_id - if self._audio_start_time is None: - self._audio_start_time = datetime.now() - self._audio_length_ms = 0.0 audio_bytes = base64.b64decode(parsed.delta) - # Calculate audio length in ms using 24KHz pcm16le - self._audio_length_ms += self._calculate_audio_length_ms(audio_bytes) + + self._audio_state_tracker.on_audio_delta(parsed.item_id, parsed.content_index, audio_bytes) + await self._emit_event( - RealtimeModelAudioEvent(data=audio_bytes, response_id=parsed.response_id) + RealtimeModelAudioEvent( + data=audio_bytes, + response_id=parsed.response_id, + item_id=parsed.item_id, + content_index=parsed.content_index, + ) ) - def _calculate_audio_length_ms(self, audio_bytes: bytes) -> float: - """Calculate audio length in milliseconds for 24KHz PCM16LE format.""" - return len(audio_bytes) / 24 / 2 - async def _handle_output_item(self, item: ConversationItem) -> None: """Handle response output item events (function calls and messages).""" if item.type == "function_call" and item.status == "completed": tool_call = RealtimeToolCallItem( item_id=item.id or "", previous_item_id=None, + call_id=item.call_id, type="function_call", # We use the same item for tool call and output, so it will be completed by the # output being added @@ -365,7 +484,7 @@ async def _handle_output_item(self, item: ConversationItem) -> None: await self._emit_event(RealtimeModelItemUpdatedEvent(item=tool_call)) await self._emit_event( RealtimeModelToolCallEvent( - call_id=item.id or "", + call_id=item.call_id or "", name=item.name or "", arguments=item.arguments or "", id=item.id or "", @@ -378,7 +497,9 @@ async def _handle_output_item(self, item: ConversationItem) -> None: "item_id": item.id or "", "type": item.type, "role": item.role, - "content": item.content, + "content": ( + [content.model_dump() for content in item.content] if item.content else [] + ), "status": "in_progress", } ) @@ -400,47 +521,116 @@ async def close(self) -> None: self._websocket = None if self._websocket_task: self._websocket_task.cancel() + try: + await self._websocket_task + except asyncio.CancelledError: + pass self._websocket_task = None async def _cancel_response(self) -> None: if self._ongoing_response: - await self._send_raw_message( - RealtimeModelSendRawMessage(message={"type": "response.cancel"}) - ) + await self._send_raw_message(OpenAIResponseCancelEvent(type="response.cancel")) self._ongoing_response = False async def _handle_ws_event(self, event: dict[str, Any]): + await self._emit_event(RealtimeModelRawServerEvent(data=event)) + # The public interface definedo on this Agents SDK side (e.g., RealtimeMessageItem) + # must be the same even after the GA migration, so this part does the conversion + if isinstance(event, dict) and event.get("type") in ( + "response.output_item.added", + "response.output_item.done", + ): + item = event.get("item") + if isinstance(item, dict) and item.get("type") == "message": + raw_content = item.get("content") or [] + converted_content: list[dict[str, Any]] = [] + for part in raw_content: + if not isinstance(part, dict): + continue + if part.get("type") == "audio": + converted_content.append( + { + "type": "audio", + "audio": part.get("audio"), + "transcript": part.get("transcript"), + } + ) + elif part.get("type") == "text": + converted_content.append({"type": "text", "text": part.get("text")}) + status = item.get("status") + if status not in ("in_progress", "completed", "incomplete"): + is_done = event.get("type") == "response.output_item.done" + status = "completed" if is_done else "in_progress" + # Explicitly type the adapter for mypy + type_adapter: TypeAdapter[RealtimeMessageItem] = TypeAdapter(RealtimeMessageItem) + message_item: RealtimeMessageItem = type_adapter.validate_python( + { + "item_id": item.get("id", ""), + "type": "message", + "role": item.get("role", "assistant"), + "content": converted_content, + "status": status, + } + ) + await self._emit_event(RealtimeModelItemUpdatedEvent(item=message_item)) + return + try: if "previous_item_id" in event and event["previous_item_id"] is None: event["previous_item_id"] = "" # TODO (rm) remove - parsed: OpenAIRealtimeServerEvent = TypeAdapter( - OpenAIRealtimeServerEvent - ).validate_python(event) + parsed: AllRealtimeServerEvents = self._server_event_type_adapter.validate_python(event) except pydantic.ValidationError as e: logger.error(f"Failed to validate server event: {event}", exc_info=True) - await self._emit_event( - RealtimeModelErrorEvent( - error=e, - ) - ) + await self._emit_event(RealtimeModelErrorEvent(error=e)) return except Exception as e: event_type = event.get("type", "unknown") if isinstance(event, dict) else "unknown" logger.error(f"Failed to validate server event: {event}", exc_info=True) - await self._emit_event( - RealtimeModelExceptionEvent( - exception=e, - context=f"Failed to validate server event: {event_type}", - ) + exception_event = RealtimeModelExceptionEvent( + exception=e, + context=f"Failed to validate server event: {event_type}", ) + await self._emit_event(exception_event) return - if parsed.type == "response.audio.delta": + if parsed.type == "response.output_audio.delta": await self._handle_audio_delta(parsed) - elif parsed.type == "response.audio.done": - await self._emit_event(RealtimeModelAudioDoneEvent()) + elif parsed.type == "response.output_audio.done": + audio_done_event = RealtimeModelAudioDoneEvent( + item_id=parsed.item_id, + content_index=parsed.content_index, + ) + await self._emit_event(audio_done_event) elif parsed.type == "input_audio_buffer.speech_started": - await self._send_interrupt(RealtimeModelSendInterrupt()) + # On VAD speech start, immediately stop local playback so the user can + # barge‑in without overlapping assistant audio. + last_audio = self._audio_state_tracker.get_last_audio_item() + if last_audio is not None: + item_id, content_index = last_audio + await self._emit_event( + RealtimeModelAudioInterruptedEvent(item_id=item_id, content_index=content_index) + ) + + # Reset trackers so subsequent playback state queries don't + # reference audio that has been interrupted client‑side. + self._audio_state_tracker.on_interrupted() + if self._playback_tracker: + self._playback_tracker.on_interrupted() + + # If server isn't configured to auto‑interrupt/cancel, cancel the + # response to prevent further audio. + session = self._created_session + automatic_response_cancellation_enabled = ( + session + and session.audio is not None + and session.audio.input is not None + and session.audio.input.turn_detection is not None + and session.audio.input.turn_detection.interrupt_response is True + ) + if not automatic_response_cancellation_enabled: + await self._cancel_response() + # Avoid sending conversation.item.truncate here; when GA is set to + # interrupt on VAD start, the server will handle truncation. elif parsed.type == "response.created": self._ongoing_response = True await self._emit_event(RealtimeModelTurnStartedEvent()) @@ -449,12 +639,16 @@ async def _handle_ws_event(self, event: dict[str, Any]): await self._emit_event(RealtimeModelTurnEndedEvent()) elif parsed.type == "session.created": await self._send_tracing_config(self._tracing_config) + self._update_created_session(parsed.session) + elif parsed.type == "session.updated": + self._update_created_session(parsed.session) elif parsed.type == "error": await self._emit_event(RealtimeModelErrorEvent(error=parsed.error)) elif parsed.type == "conversation.item.deleted": await self._emit_event(RealtimeModelItemDeletedEvent(item_id=parsed.item_id)) elif ( - parsed.type == "conversation.item.created" + parsed.type == "conversation.item.added" + or parsed.type == "conversation.item.created" or parsed.type == "conversation.item.retrieved" ): previous_item_id = ( @@ -466,23 +660,20 @@ async def _handle_ws_event(self, event: dict[str, Any]): parsed.type == "conversation.item.input_audio_transcription.completed" or parsed.type == "conversation.item.truncated" ): - await self._send_raw_message( - RealtimeModelSendRawMessage( - message={ - "type": "conversation.item.retrieve", - "other_data": { - "item_id": self._current_item_id, - }, - } + if self._current_item_id: + await self._send_raw_message( + OpenAIConversationItemRetrieveEvent( + type="conversation.item.retrieve", + item_id=self._current_item_id, + ) ) - ) if parsed.type == "conversation.item.input_audio_transcription.completed": await self._emit_event( RealtimeModelInputAudioTranscriptionCompletedEvent( item_id=parsed.item_id, transcript=parsed.transcript ) ) - elif parsed.type == "response.audio_transcript.delta": + elif parsed.type == "response.output_audio_transcript.delta": await self._emit_event( RealtimeModelTranscriptDeltaEvent( item_id=parsed.item_id, delta=parsed.delta, response_id=parsed.response_id @@ -490,7 +681,7 @@ async def _handle_ws_event(self, event: dict[str, Any]): ) elif ( parsed.type == "conversation.item.input_audio_transcription.delta" - or parsed.type == "response.text.delta" + or parsed.type == "response.output_text.delta" or parsed.type == "response.function_call_arguments.delta" ): # No support for partials yet @@ -500,68 +691,241 @@ async def _handle_ws_event(self, event: dict[str, Any]): or parsed.type == "response.output_item.done" ): await self._handle_output_item(parsed.item) + elif parsed.type == "input_audio_buffer.timeout_triggered": + await self._emit_event( + RealtimeModelInputAudioTimeoutTriggeredEvent( + item_id=parsed.item_id, + audio_start_ms=parsed.audio_start_ms, + audio_end_ms=parsed.audio_end_ms, + ) + ) + + def _update_created_session( + self, + session: OpenAISessionCreateRequest + | OpenAIRealtimeTranscriptionSessionCreateRequest + | Mapping[str, object] + | pydantic.BaseModel, + ) -> None: + # Only store/playback-format information for realtime sessions (not transcription-only) + normalized_session = self._normalize_session_payload(session) + if not normalized_session: + return + + self._created_session = normalized_session + normalized_format = self._extract_audio_format(normalized_session) + if normalized_format is None: + return + + self._audio_state_tracker.set_audio_format(normalized_format) + if self._playback_tracker: + self._playback_tracker.set_audio_format(normalized_format) + + @staticmethod + def _normalize_session_payload( + session: OpenAISessionCreateRequest + | OpenAIRealtimeTranscriptionSessionCreateRequest + | Mapping[str, object] + | pydantic.BaseModel, + ) -> OpenAISessionCreateRequest | None: + if isinstance(session, OpenAISessionCreateRequest): + return session + + if isinstance(session, OpenAIRealtimeTranscriptionSessionCreateRequest): + return None + + session_payload: Mapping[str, object] + if isinstance(session, pydantic.BaseModel): + session_payload = cast(Mapping[str, object], session.model_dump()) + elif isinstance(session, Mapping): + session_payload = session + else: + return None + + if OpenAIRealtimeWebSocketModel._is_transcription_session(session_payload): + return None + + try: + return OpenAISessionCreateRequest.model_validate(session_payload) + except pydantic.ValidationError: + return None + + @staticmethod + def _is_transcription_session(payload: Mapping[str, object]) -> bool: + try: + OpenAIRealtimeTranscriptionSessionCreateRequest.model_validate(payload) + except pydantic.ValidationError: + return False + else: + return True + + @staticmethod + def _extract_audio_format(session: OpenAISessionCreateRequest) -> str | None: + audio = session.audio + if not audio or not audio.output or not audio.output.format: + return None + + return OpenAIRealtimeWebSocketModel._normalize_audio_format(audio.output.format) + + @staticmethod + def _normalize_audio_format(fmt: object) -> str: + if isinstance(fmt, AudioPCM): + return "pcm16" + if isinstance(fmt, AudioPCMU): + return "g711_ulaw" + if isinstance(fmt, AudioPCMA): + return "g711_alaw" + + fmt_type = OpenAIRealtimeWebSocketModel._read_format_type(fmt) + if isinstance(fmt_type, str) and fmt_type: + return fmt_type + + return str(fmt) + + @staticmethod + def _read_format_type(fmt: object) -> str | None: + if isinstance(fmt, str): + return fmt + + if isinstance(fmt, Mapping): + type_value = fmt.get("type") + return type_value if isinstance(type_value, str) else None + + if isinstance(fmt, pydantic.BaseModel): + type_value = fmt.model_dump().get("type") + return type_value if isinstance(type_value, str) else None + + try: + type_value = fmt.type # type: ignore[attr-defined] + except AttributeError: + return None + + return type_value if isinstance(type_value, str) else None async def _update_session_config(self, model_settings: RealtimeSessionModelSettings) -> None: session_config = self._get_session_config(model_settings) await self._send_raw_message( - RealtimeModelSendRawMessage( - message={ - "type": "session.update", - "other_data": { - "session": session_config.model_dump(exclude_unset=True, exclude_none=True) - }, - } - ) + OpenAISessionUpdateEvent(session=session_config, type="session.update") ) def _get_session_config( self, model_settings: RealtimeSessionModelSettings - ) -> OpenAISessionObject: + ) -> OpenAISessionCreateRequest: """Get the session config.""" - return OpenAISessionObject( - instructions=model_settings.get("instructions", None), - model=( - model_settings.get("model_name", self.model) # type: ignore - or DEFAULT_MODEL_SETTINGS.get("model_name") - ), - voice=model_settings.get("voice", DEFAULT_MODEL_SETTINGS.get("voice")), - modalities=model_settings.get("modalities", DEFAULT_MODEL_SETTINGS.get("modalities")), - input_audio_format=model_settings.get( - "input_audio_format", - DEFAULT_MODEL_SETTINGS.get("input_audio_format"), # type: ignore - ), - output_audio_format=model_settings.get( - "output_audio_format", - DEFAULT_MODEL_SETTINGS.get("output_audio_format"), # type: ignore - ), - input_audio_transcription=model_settings.get( - "input_audio_transcription", - DEFAULT_MODEL_SETTINGS.get("input_audio_transcription"), # type: ignore - ), - turn_detection=model_settings.get( - "turn_detection", - DEFAULT_MODEL_SETTINGS.get("turn_detection"), # type: ignore - ), - tool_choice=model_settings.get( - "tool_choice", - DEFAULT_MODEL_SETTINGS.get("tool_choice"), # type: ignore + model_name = (model_settings.get("model_name") or self.model) or "gpt-realtime" + + voice = model_settings.get("voice", DEFAULT_MODEL_SETTINGS.get("voice")) + speed = model_settings.get("speed") + modalities = model_settings.get("modalities", DEFAULT_MODEL_SETTINGS.get("modalities")) + + input_audio_format = model_settings.get( + "input_audio_format", + DEFAULT_MODEL_SETTINGS.get("input_audio_format"), + ) + input_audio_transcription = model_settings.get( + "input_audio_transcription", + DEFAULT_MODEL_SETTINGS.get("input_audio_transcription"), + ) + turn_detection = model_settings.get( + "turn_detection", + DEFAULT_MODEL_SETTINGS.get("turn_detection"), + ) + output_audio_format = model_settings.get( + "output_audio_format", + DEFAULT_MODEL_SETTINGS.get("output_audio_format"), + ) + input_audio_noise_reduction = model_settings.get( + "input_audio_noise_reduction", + DEFAULT_MODEL_SETTINGS.get("input_audio_noise_reduction"), + ) + + input_audio_config = None + if any( + value is not None + for value in [ + input_audio_format, + input_audio_noise_reduction, + input_audio_transcription, + turn_detection, + ] + ): + input_audio_config = OpenAIRealtimeAudioInput( + format=to_realtime_audio_format(input_audio_format), + noise_reduction=cast(Any, input_audio_noise_reduction), + transcription=cast(Any, input_audio_transcription), + turn_detection=cast(Any, turn_detection), + ) + + output_audio_config = None + if any(value is not None for value in [output_audio_format, speed, voice]): + output_audio_config = OpenAIRealtimeAudioOutput( + format=to_realtime_audio_format(output_audio_format), + speed=speed, + voice=voice, + ) + + audio_config = None + if input_audio_config or output_audio_config: + audio_config = OpenAIRealtimeAudioConfig( + input=input_audio_config, + output=output_audio_config, + ) + + prompt: ResponsePrompt | None = None + if model_settings.get("prompt") is not None: + _passed_prompt: Prompt = model_settings["prompt"] + variables: dict[str, Any] | None = _passed_prompt.get("variables") + prompt = ResponsePrompt( + id=_passed_prompt["id"], + variables=variables, + version=_passed_prompt.get("version"), + ) + + # Construct full session object. `type` will be excluded at serialization time for updates. + return OpenAISessionCreateRequest( + model=model_name, + type="realtime", + instructions=model_settings.get("instructions"), + prompt=prompt, + output_modalities=modalities, + audio=audio_config, + max_output_tokens=cast(Any, model_settings.get("max_output_tokens")), + tool_choice=cast(Any, model_settings.get("tool_choice")), + tools=cast( + Any, + self._tools_to_session_tools( + tools=model_settings.get("tools", []), + handoffs=model_settings.get("handoffs", []), + ), ), - tools=self._tools_to_session_tools(model_settings.get("tools", [])), ) - def _tools_to_session_tools(self, tools: list[Tool]) -> list[OpenAISessionTool]: - converted_tools: list[OpenAISessionTool] = [] + def _tools_to_session_tools( + self, tools: list[Tool], handoffs: list[Handoff] + ) -> list[OpenAISessionFunction]: + converted_tools: list[OpenAISessionFunction] = [] for tool in tools: if not isinstance(tool, FunctionTool): raise UserError(f"Tool {tool.name} is unsupported. Must be a function tool.") converted_tools.append( - OpenAISessionTool( + OpenAISessionFunction( name=tool.name, description=tool.description, parameters=tool.params_json_schema, type="function", ) ) + + for handoff in handoffs: + converted_tools.append( + OpenAISessionFunction( + name=handoff.tool_name, + description=handoff.tool_description, + parameters=handoff.input_json_schema, + type="function", + ) + ) + return converted_tools @@ -570,15 +934,158 @@ class _ConversionHelper: def conversation_item_to_realtime_message_item( cls, item: ConversationItem, previous_item_id: str | None ) -> RealtimeMessageItem: + if not isinstance( + item, + ( + RealtimeConversationItemUserMessage, + RealtimeConversationItemAssistantMessage, + RealtimeConversationItemSystemMessage, + ), + ): + raise ValueError("Unsupported conversation item type for message conversion.") + content: list[dict[str, Any]] = [] + for each in item.content: + c = each.model_dump() + if each.type == "output_text": + # For backward-compatibility of assistant message items + c["type"] = "text" + elif each.type == "output_audio": + # For backward-compatibility of assistant message items + c["type"] = "audio" + content.append(c) return TypeAdapter(RealtimeMessageItem).validate_python( { "item_id": item.id or "", "previous_item_id": previous_item_id, "type": item.type, "role": item.role, - "content": ( - [content.model_dump() for content in item.content] if item.content else [] - ), + "content": content, "status": "in_progress", }, ) + + @classmethod + def try_convert_raw_message( + cls, message: RealtimeModelSendRawMessage + ) -> OpenAIRealtimeClientEvent | None: + try: + data = {} + data["type"] = message.message["type"] + data.update(message.message.get("other_data", {})) + return TypeAdapter(OpenAIRealtimeClientEvent).validate_python(data) + except Exception: + return None + + @classmethod + def convert_tracing_config( + cls, tracing_config: RealtimeModelTracingConfig | Literal["auto"] | None + ) -> OpenAITracingConfiguration | Literal["auto"] | None: + if tracing_config is None: + return None + elif tracing_config == "auto": + return "auto" + return OpenAITracingConfiguration( + group_id=tracing_config.get("group_id"), + metadata=tracing_config.get("metadata"), + workflow_name=tracing_config.get("workflow_name"), + ) + + @classmethod + def convert_user_input_to_conversation_item( + cls, event: RealtimeModelSendUserInput + ) -> OpenAIConversationItem: + user_input = event.user_input + + if isinstance(user_input, dict): + content: list[Content] = [] + for item in user_input.get("content", []): + try: + if not isinstance(item, dict): + continue + t = item.get("type") + if t == "input_text": + _txt = item.get("text") + text_val = _txt if isinstance(_txt, str) else None + content.append(Content(type="input_text", text=text_val)) + elif t == "input_image": + iu = item.get("image_url") + if isinstance(iu, str) and iu: + d = item.get("detail") + detail_val = cast( + Literal["auto", "low", "high"] | None, + d if isinstance(d, str) and d in ("auto", "low", "high") else None, + ) + if detail_val is None: + content.append( + Content( + type="input_image", + image_url=iu, + ) + ) + else: + content.append( + Content( + type="input_image", + image_url=iu, + detail=detail_val, + ) + ) + # ignore unknown types for forward-compat + except Exception: + # best-effort; skip malformed parts + continue + return RealtimeConversationItemUserMessage( + type="message", + role="user", + content=content, + ) + else: + return RealtimeConversationItemUserMessage( + type="message", + role="user", + content=[Content(type="input_text", text=user_input)], + ) + + @classmethod + def convert_user_input_to_item_create( + cls, event: RealtimeModelSendUserInput + ) -> OpenAIRealtimeClientEvent: + return OpenAIConversationItemCreateEvent( + type="conversation.item.create", + item=cls.convert_user_input_to_conversation_item(event), + ) + + @classmethod + def convert_audio_to_input_audio_buffer_append( + cls, event: RealtimeModelSendAudio + ) -> OpenAIRealtimeClientEvent: + base64_audio = base64.b64encode(event.audio).decode("utf-8") + return OpenAIInputAudioBufferAppendEvent( + type="input_audio_buffer.append", + audio=base64_audio, + ) + + @classmethod + def convert_tool_output(cls, event: RealtimeModelSendToolOutput) -> OpenAIRealtimeClientEvent: + return OpenAIConversationItemCreateEvent( + type="conversation.item.create", + item=RealtimeConversationItemFunctionCallOutput( + type="function_call_output", + output=event.output, + call_id=event.tool_call.call_id, + ), + ) + + @classmethod + def convert_interrupt( + cls, + current_item_id: str, + current_audio_content_index: int, + elapsed_time_ms: int, + ) -> OpenAIRealtimeClientEvent: + return OpenAIConversationItemTruncateEvent( + type="conversation.item.truncate", + item_id=current_item_id, + content_index=current_audio_content_index, + audio_end_ms=elapsed_time_ms, + ) diff --git a/src/agents/realtime/runner.py b/src/agents/realtime/runner.py index a7047a6f5..e51a094d8 100644 --- a/src/agents/realtime/runner.py +++ b/src/agents/realtime/runner.py @@ -2,13 +2,10 @@ from __future__ import annotations -import asyncio - -from ..run_context import RunContextWrapper, TContext +from ..run_context import TContext from .agent import RealtimeAgent from .config import ( RealtimeRunConfig, - RealtimeSessionModelSettings, ) from .model import ( RealtimeModel, @@ -67,16 +64,6 @@ async def run( print(event) ``` """ - model_settings = await self._get_model_settings( - agent=self._starting_agent, - disable_tracing=self._config.get("tracing_disabled", False) if self._config else False, - initial_settings=model_config.get("initial_model_settings") if model_config else None, - overrides=self._config.get("model_settings") if self._config else None, - ) - - model_config = model_config.copy() if model_config else {} - model_config["initial_model_settings"] = model_settings - # Create and return the connection session = RealtimeSession( model=self._model, @@ -87,32 +74,3 @@ async def run( ) return session - - async def _get_model_settings( - self, - agent: RealtimeAgent, - disable_tracing: bool, - context: TContext | None = None, - initial_settings: RealtimeSessionModelSettings | None = None, - overrides: RealtimeSessionModelSettings | None = None, - ) -> RealtimeSessionModelSettings: - context_wrapper = RunContextWrapper(context) - model_settings = initial_settings.copy() if initial_settings else {} - - instructions, tools = await asyncio.gather( - agent.get_system_prompt(context_wrapper), - agent.get_all_tools(context_wrapper), - ) - - if instructions is not None: - model_settings["instructions"] = instructions - if tools is not None: - model_settings["tools"] = tools - - if overrides: - model_settings.update(overrides) - - if disable_tracing: - model_settings["tracing"] = None - - return model_settings diff --git a/src/agents/realtime/session.py b/src/agents/realtime/session.py index 07791c8d8..6378382e1 100644 --- a/src/agents/realtime/session.py +++ b/src/agents/realtime/session.py @@ -1,6 +1,7 @@ from __future__ import annotations import asyncio +import inspect from collections.abc import AsyncIterator from typing import Any, cast @@ -9,6 +10,7 @@ from ..agent import Agent from ..exceptions import ModelBehaviorError, UserError from ..handoffs import Handoff +from ..logger import logger from ..run_context import RunContextWrapper, TContext from ..tool import FunctionTool from ..tool_context import ToolContext @@ -26,12 +28,23 @@ RealtimeHandoffEvent, RealtimeHistoryAdded, RealtimeHistoryUpdated, + RealtimeInputAudioTimeoutTriggered, RealtimeRawModelEvent, RealtimeSessionEvent, RealtimeToolEnd, RealtimeToolStart, ) -from .items import InputAudio, InputText, RealtimeItem +from .handoffs import realtime_handoff +from .items import ( + AssistantAudio, + AssistantMessageItem, + AssistantText, + InputAudio, + InputImage, + InputText, + RealtimeItem, + UserMessageItem, +) from .model import RealtimeModel, RealtimeModelConfig, RealtimeModelListener from .model_events import ( RealtimeModelEvent, @@ -91,12 +104,18 @@ def __init__( self._history: list[RealtimeItem] = [] self._model_config = model_config or {} self._run_config = run_config or {} + initial_model_settings = self._model_config.get("initial_model_settings") + run_config_settings = self._run_config.get("model_settings") + self._base_model_settings: RealtimeSessionModelSettings = { + **(run_config_settings or {}), + **(initial_model_settings or {}), + } self._event_queue: asyncio.Queue[RealtimeSessionEvent] = asyncio.Queue() self._closed = False - self._stored_exception: Exception | None = None + self._stored_exception: BaseException | None = None # Guardrails state tracking - self._interrupted_by_guardrail = False + self._interrupted_response_ids: set[str] = set() self._item_transcripts: dict[str, str] = {} # item_id -> accumulated transcript self._item_guardrail_run_counts: dict[str, int] = {} # item_id -> run count self._debounce_text_length = self._run_config.get("guardrails_settings", {}).get( @@ -104,6 +123,13 @@ def __init__( ) self._guardrail_tasks: set[asyncio.Task[Any]] = set() + self._tool_call_tasks: set[asyncio.Task[Any]] = set() + self._async_tool_calls: bool = bool(self._run_config.get("async_tool_calls", True)) + + @property + def model(self) -> RealtimeModel: + """Access the underlying model for adding listeners or other direct interaction.""" + return self._model async def __aenter__(self) -> RealtimeSession: """Start the session by connecting to the model. After this, you will be able to stream @@ -112,8 +138,14 @@ async def __aenter__(self) -> RealtimeSession: # Add ourselves as a listener self._model.add_listener(self) + model_config = self._model_config.copy() + model_config["initial_model_settings"] = await self._get_updated_model_settings_from_agent( + starting_settings=self._model_config.get("initial_model_settings", None), + agent=self._current_agent, + ) + # Connect to the model - await self._model.connect(self._model_config) + await self._model.connect(model_config) # Emit initial history update await self._put_event( @@ -167,23 +199,68 @@ async def interrupt(self) -> None: """Interrupt the model.""" await self._model.send_event(RealtimeModelSendInterrupt()) + async def update_agent(self, agent: RealtimeAgent) -> None: + """Update the active agent for this session and apply its settings to the model.""" + self._current_agent = agent + + updated_settings = await self._get_updated_model_settings_from_agent( + starting_settings=None, + agent=self._current_agent, + ) + + await self._model.send_event( + RealtimeModelSendSessionUpdate(session_settings=updated_settings) + ) + async def on_event(self, event: RealtimeModelEvent) -> None: await self._put_event(RealtimeRawModelEvent(data=event, info=self._event_info)) if event.type == "error": await self._put_event(RealtimeError(info=self._event_info, error=event.error)) elif event.type == "function_call": - await self._handle_tool_call(event) + agent_snapshot = self._current_agent + if self._async_tool_calls: + self._enqueue_tool_call_task(event, agent_snapshot) + else: + await self._handle_tool_call(event, agent_snapshot=agent_snapshot) elif event.type == "audio": - await self._put_event(RealtimeAudio(info=self._event_info, audio=event)) + await self._put_event( + RealtimeAudio( + info=self._event_info, + audio=event, + item_id=event.item_id, + content_index=event.content_index, + ) + ) elif event.type == "audio_interrupted": - await self._put_event(RealtimeAudioInterrupted(info=self._event_info)) + await self._put_event( + RealtimeAudioInterrupted( + info=self._event_info, item_id=event.item_id, content_index=event.content_index + ) + ) elif event.type == "audio_done": - await self._put_event(RealtimeAudioEnd(info=self._event_info)) + await self._put_event( + RealtimeAudioEnd( + info=self._event_info, item_id=event.item_id, content_index=event.content_index + ) + ) elif event.type == "input_audio_transcription_completed": + prev_len = len(self._history) self._history = RealtimeSession._get_new_history(self._history, event) + # If a new user item was appended (no existing item), + # emit history_added for incremental UIs. + if len(self._history) > prev_len and len(self._history) > 0: + new_item = self._history[-1] + await self._put_event(RealtimeHistoryAdded(info=self._event_info, item=new_item)) + else: + await self._put_event( + RealtimeHistoryUpdated(info=self._event_info, history=self._history) + ) + elif event.type == "input_audio_timeout_triggered": await self._put_event( - RealtimeHistoryUpdated(info=self._event_info, history=self._history) + RealtimeInputAudioTimeoutTriggered( + info=self._event_info, + ) ) elif event.type == "transcript_delta": # Accumulate transcript text for guardrail debouncing per item_id @@ -193,6 +270,13 @@ async def on_event(self, event: RealtimeModelEvent) -> None: self._item_guardrail_run_counts[item_id] = 0 self._item_transcripts[item_id] += event.delta + self._history = self._get_new_history( + self._history, + AssistantMessageItem( + item_id=item_id, + content=[AssistantAudio(transcript=self._item_transcripts[item_id])], + ), + ) # Check if we should run guardrails based on debounce threshold current_length = len(self._item_transcripts[item_id]) @@ -201,10 +285,62 @@ async def on_event(self, event: RealtimeModelEvent) -> None: if current_length >= next_run_threshold: self._item_guardrail_run_counts[item_id] += 1 - self._enqueue_guardrail_task(self._item_transcripts[item_id]) + # Pass response_id so we can ensure only a single interrupt per response + self._enqueue_guardrail_task(self._item_transcripts[item_id], event.response_id) elif event.type == "item_updated": is_new = not any(item.item_id == event.item.item_id for item in self._history) - self._history = self._get_new_history(self._history, event.item) + + # Preserve previously known transcripts when updating existing items. + # This prevents transcripts from disappearing when an item is later + # retrieved without transcript fields populated. + incoming_item = event.item + existing_item = next( + (i for i in self._history if i.item_id == incoming_item.item_id), None + ) + + if ( + existing_item is not None + and existing_item.type == "message" + and incoming_item.type == "message" + ): + try: + # Merge transcripts for matching content indices + existing_content = existing_item.content + new_content = [] + for idx, entry in enumerate(incoming_item.content): + # Only attempt to preserve for audio-like content + if entry.type in ("audio", "input_audio"): + # Use tuple form for Python 3.9 compatibility + assert isinstance(entry, (InputAudio, AssistantAudio)) + # Determine if transcript is missing/empty on the incoming entry + entry_transcript = entry.transcript + if not entry_transcript: + preserved: str | None = None + # First prefer any transcript from the existing history item + if idx < len(existing_content): + this_content = existing_content[idx] + if isinstance(this_content, AssistantAudio) or isinstance( + this_content, InputAudio + ): + preserved = this_content.transcript + + # If still missing and this is an assistant item, fall back to + # accumulated transcript deltas tracked during the turn. + if incoming_item.role == "assistant": + preserved = self._item_transcripts.get(incoming_item.item_id) + + if preserved: + entry = entry.model_copy(update={"transcript": preserved}) + + new_content.append(entry) + + if new_content: + incoming_item = incoming_item.model_copy(update={"content": new_content}) + except Exception: + logger.error("Error merging transcripts", exc_info=True) + pass + + self._history = self._get_new_history(self._history, incoming_item) if is_new: new_item = next( item for item in self._history if item.item_id == event.item.item_id @@ -233,7 +369,6 @@ async def on_event(self, event: RealtimeModelEvent) -> None: # Clear guardrail state for next turn self._item_transcripts.clear() self._item_guardrail_run_counts.clear() - self._interrupted_by_guardrail = False await self._put_event( RealtimeAgentEndEvent( @@ -246,6 +381,8 @@ async def on_event(self, event: RealtimeModelEvent) -> None: self._stored_exception = event.exception elif event.type == "other": pass + elif event.type == "raw_server_event": + pass else: assert_never(event) @@ -253,18 +390,27 @@ async def _put_event(self, event: RealtimeSessionEvent) -> None: """Put an event into the queue.""" await self._event_queue.put(event) - async def _handle_tool_call(self, event: RealtimeModelToolCallEvent) -> None: + async def _handle_tool_call( + self, + event: RealtimeModelToolCallEvent, + *, + agent_snapshot: RealtimeAgent | None = None, + ) -> None: """Handle a tool call event.""" - all_tools = await self._current_agent.get_all_tools(self._context_wrapper) - function_map = {tool.name: tool for tool in all_tools if isinstance(tool, FunctionTool)} - handoff_map = {tool.name: tool for tool in all_tools if isinstance(tool, Handoff)} + agent = agent_snapshot or self._current_agent + tools, handoffs = await asyncio.gather( + agent.get_all_tools(self._context_wrapper), + self._get_handoffs(agent, self._context_wrapper), + ) + function_map = {tool.name: tool for tool in tools if isinstance(tool, FunctionTool)} + handoff_map = {handoff.tool_name: handoff for handoff in handoffs} if event.name in function_map: await self._put_event( RealtimeToolStart( info=self._event_info, tool=function_map[event.name], - agent=self._current_agent, + agent=agent, ) ) @@ -274,6 +420,7 @@ async def _handle_tool_call(self, event: RealtimeModelToolCallEvent) -> None: usage=self._context_wrapper.usage, tool_name=event.name, tool_call_id=event.call_id, + tool_arguments=event.arguments, ) result = await func_tool.on_invoke_tool(tool_context, event.arguments) @@ -288,7 +435,7 @@ async def _handle_tool_call(self, event: RealtimeModelToolCallEvent) -> None: info=self._event_info, tool=func_tool, output=result, - agent=self._current_agent, + agent=agent, ) ) elif event.name in handoff_map: @@ -298,21 +445,27 @@ async def _handle_tool_call(self, event: RealtimeModelToolCallEvent) -> None: usage=self._context_wrapper.usage, tool_name=event.name, tool_call_id=event.call_id, + tool_arguments=event.arguments, ) # Execute the handoff to get the new agent result = await handoff.on_invoke_handoff(self._context_wrapper, event.arguments) if not isinstance(result, RealtimeAgent): - raise UserError(f"Handoff {handoff.name} returned invalid result: {type(result)}") + raise UserError( + f"Handoff {handoff.tool_name} returned invalid result: {type(result)}" + ) # Store previous agent for event - previous_agent = self._current_agent + previous_agent = agent # Update current agent self._current_agent = result # Get updated model settings from new agent - updated_settings = await self._get__updated_model_settings(self._current_agent) + updated_settings = await self._get_updated_model_settings_from_agent( + starting_settings=None, + agent=self._current_agent, + ) # Send handoff event await self._put_event( @@ -323,19 +476,20 @@ async def _handle_tool_call(self, event: RealtimeModelToolCallEvent) -> None: ) ) - # Send tool output to complete the handoff + # First, send the session update so the model receives the new instructions + await self._model.send_event( + RealtimeModelSendSessionUpdate(session_settings=updated_settings) + ) + + # Then send tool output to complete the handoff (this triggers a new response) + transfer_message = handoff.get_transfer_message(result) await self._model.send_event( RealtimeModelSendToolOutput( tool_call=event, - output=f"Handed off to {self._current_agent.name}", + output=transfer_message, start_response=True, ) ) - - # Send session update to model - await self._model.send_event( - RealtimeModelSendSessionUpdate(session_settings=updated_settings) - ) else: raise ModelBehaviorError(f"Tool {event.name} not found") @@ -345,9 +499,9 @@ def _get_new_history( old_history: list[RealtimeItem], event: RealtimeModelInputAudioTranscriptionCompletedEvent | RealtimeItem, ) -> list[RealtimeItem]: - # Merge transcript into placeholder input_audio message. if isinstance(event, RealtimeModelInputAudioTranscriptionCompletedEvent): new_history: list[RealtimeItem] = [] + existing_item_found = False for item in old_history: if item.item_id == event.item_id and item.type == "message" and item.role == "user": content: list[InputText | InputAudio] = [] @@ -360,11 +514,18 @@ def _get_new_history( new_history.append( item.model_copy(update={"content": content, "status": "completed"}) ) + existing_item_found = True else: new_history.append(item) + + if existing_item_found is False: + new_history.append( + UserMessageItem( + item_id=event.item_id, content=[InputText(text=event.transcript)] + ) + ) return new_history - # Otherwise it's just a new item # TODO (rm) Add support for audio storage config # If the item already exists, update it @@ -373,8 +534,122 @@ def _get_new_history( ) if existing_index is not None: new_history = old_history.copy() - new_history[existing_index] = event + if event.type == "message" and event.content is not None and len(event.content) > 0: + existing_item = old_history[existing_index] + if existing_item.type == "message": + # Merge content preserving existing transcript/text when incoming entry is empty + if event.role == "assistant" and existing_item.role == "assistant": + assistant_existing_content = existing_item.content + assistant_incoming = event.content + assistant_new_content: list[AssistantText | AssistantAudio] = [] + for idx, ac in enumerate(assistant_incoming): + if idx >= len(assistant_existing_content): + assistant_new_content.append(ac) + continue + assistant_current = assistant_existing_content[idx] + if ac.type == "audio": + if ac.transcript is None: + assistant_new_content.append(assistant_current) + else: + assistant_new_content.append(ac) + else: # text + cur_text = ( + assistant_current.text + if isinstance(assistant_current, AssistantText) + else None + ) + if cur_text is not None and ac.text is None: + assistant_new_content.append(assistant_current) + else: + assistant_new_content.append(ac) + updated_assistant = event.model_copy( + update={"content": assistant_new_content} + ) + new_history[existing_index] = updated_assistant + elif event.role == "user" and existing_item.role == "user": + user_existing_content = existing_item.content + user_incoming = event.content + + # Start from incoming content (prefer latest fields) + user_new_content: list[InputText | InputAudio | InputImage] = list( + user_incoming + ) + + # Merge by type with special handling for images and transcripts + def _image_url_str(val: object) -> str | None: + if isinstance(val, InputImage): + return val.image_url or None + return None + + # 1) Preserve any existing images that are missing from the incoming payload + incoming_image_urls: set[str] = set() + for part in user_incoming: + if isinstance(part, InputImage): + u = _image_url_str(part) + if u: + incoming_image_urls.add(u) + + missing_images: list[InputImage] = [] + for part in user_existing_content: + if isinstance(part, InputImage): + u = _image_url_str(part) + if u and u not in incoming_image_urls: + missing_images.append(part) + + # Insert missing images at the beginning to keep them visible and stable + if missing_images: + user_new_content = missing_images + user_new_content + + # 2) For text/audio entries, preserve existing when incoming entry is empty + merged: list[InputText | InputAudio | InputImage] = [] + for idx, uc in enumerate(user_new_content): + if uc.type == "input_audio": + # Attempt to preserve transcript if empty + transcript = getattr(uc, "transcript", None) + if transcript is None and idx < len(user_existing_content): + prev = user_existing_content[idx] + if isinstance(prev, InputAudio) and prev.transcript is not None: + uc = uc.model_copy(update={"transcript": prev.transcript}) + merged.append(uc) + elif uc.type == "input_text": + text = getattr(uc, "text", None) + if (text is None or text == "") and idx < len( + user_existing_content + ): + prev = user_existing_content[idx] + if isinstance(prev, InputText) and prev.text: + uc = uc.model_copy(update={"text": prev.text}) + merged.append(uc) + else: + merged.append(uc) + + updated_user = event.model_copy(update={"content": merged}) + new_history[existing_index] = updated_user + elif event.role == "system" and existing_item.role == "system": + system_existing_content = existing_item.content + system_incoming = event.content + # Prefer existing non-empty text when incoming is empty + system_new_content: list[InputText] = [] + for idx, sc in enumerate(system_incoming): + if idx >= len(system_existing_content): + system_new_content.append(sc) + continue + system_current = system_existing_content[idx] + cur_text = system_current.text + if cur_text is not None and sc.text is None: + system_new_content.append(system_current) + else: + system_new_content.append(sc) + updated_system = event.model_copy(update={"content": system_new_content}) + new_history[existing_index] = updated_system + else: + # Role changed or mismatched; just replace + new_history[existing_index] = event + else: + # If the existing item is not a message, just replace it. + new_history[existing_index] = event return new_history + # Otherwise, insert it after the previous_item_id if that is set elif event.previous_item_id: # Insert the new item after the previous item @@ -390,10 +665,21 @@ def _get_new_history( # Otherwise, add it to the end return old_history + [event] - async def _run_output_guardrails(self, text: str) -> bool: + async def _run_output_guardrails(self, text: str, response_id: str) -> bool: """Run output guardrails on the given text. Returns True if any guardrail was triggered.""" - output_guardrails = self._run_config.get("output_guardrails", []) - if not output_guardrails or self._interrupted_by_guardrail: + combined_guardrails = self._current_agent.output_guardrails + self._run_config.get( + "output_guardrails", [] + ) + seen_ids: set[int] = set() + output_guardrails = [] + for guardrail in combined_guardrails: + guardrail_id = id(guardrail) + if guardrail_id not in seen_ids: + output_guardrails.append(guardrail) + seen_ids.add(guardrail_id) + + # If we've already interrupted this response, skip + if not output_guardrails or response_id in self._interrupted_response_ids: return False triggered_results = [] @@ -413,8 +699,12 @@ async def _run_output_guardrails(self, text: str) -> bool: continue if triggered_results: - # Mark as interrupted to prevent multiple interrupts - self._interrupted_by_guardrail = True + # Double-check: bail if already interrupted for this response + if response_id in self._interrupted_response_ids: + return False + + # Mark as interrupted immediately (before any awaits) to minimize race window + self._interrupted_response_ids.add(response_id) # Emit guardrail tripped event await self._put_event( @@ -426,7 +716,7 @@ async def _run_output_guardrails(self, text: str) -> bool: ) # Interrupt the model - await self._model.send_event(RealtimeModelSendInterrupt()) + await self._model.send_event(RealtimeModelSendInterrupt(force_response_cancel=True)) # Send guardrail triggered message guardrail_names = [result.guardrail.get_name() for result in triggered_results] @@ -440,10 +730,10 @@ async def _run_output_guardrails(self, text: str) -> bool: return False - def _enqueue_guardrail_task(self, text: str) -> None: + def _enqueue_guardrail_task(self, text: str, response_id: str) -> None: # Runs the guardrails in a separate task to avoid blocking the main loop - task = asyncio.create_task(self._run_output_guardrails(text)) + task = asyncio.create_task(self._run_output_guardrails(text, response_id)) self._guardrail_tasks.add(task) # Add callback to remove completed tasks and handle exceptions @@ -474,10 +764,49 @@ def _cleanup_guardrail_tasks(self) -> None: task.cancel() self._guardrail_tasks.clear() + def _enqueue_tool_call_task( + self, event: RealtimeModelToolCallEvent, agent_snapshot: RealtimeAgent + ) -> None: + """Run tool calls in the background to avoid blocking realtime transport.""" + task = asyncio.create_task(self._handle_tool_call(event, agent_snapshot=agent_snapshot)) + self._tool_call_tasks.add(task) + task.add_done_callback(self._on_tool_call_task_done) + + def _on_tool_call_task_done(self, task: asyncio.Task[Any]) -> None: + self._tool_call_tasks.discard(task) + + if task.cancelled(): + return + + exception = task.exception() + if exception is None: + return + + logger.exception("Realtime tool call task failed", exc_info=exception) + + if self._stored_exception is None: + self._stored_exception = exception + + asyncio.create_task( + self._put_event( + RealtimeError( + info=self._event_info, + error={"message": f"Tool call task failed: {exception}"}, + ) + ) + ) + + def _cleanup_tool_call_tasks(self) -> None: + for task in self._tool_call_tasks: + if not task.done(): + task.cancel() + self._tool_call_tasks.clear() + async def _cleanup(self) -> None: """Clean up all resources and mark session as closed.""" # Cancel and cleanup guardrail tasks self._cleanup_guardrail_tasks() + self._cleanup_tool_call_tasks() # Remove ourselves as a listener self._model.remove_listener(self) @@ -488,15 +817,56 @@ async def _cleanup(self) -> None: # Mark as closed self._closed = True - async def _get__updated_model_settings( - self, new_agent: RealtimeAgent + async def _get_updated_model_settings_from_agent( + self, + starting_settings: RealtimeSessionModelSettings | None, + agent: RealtimeAgent, ) -> RealtimeSessionModelSettings: - updated_settings: RealtimeSessionModelSettings = {} - instructions, tools = await asyncio.gather( - new_agent.get_system_prompt(self._context_wrapper), - new_agent.get_all_tools(self._context_wrapper), + # Start with the merged base settings from run and model configuration. + updated_settings = self._base_model_settings.copy() + + if agent.prompt is not None: + updated_settings["prompt"] = agent.prompt + + instructions, tools, handoffs = await asyncio.gather( + agent.get_system_prompt(self._context_wrapper), + agent.get_all_tools(self._context_wrapper), + self._get_handoffs(agent, self._context_wrapper), ) updated_settings["instructions"] = instructions or "" updated_settings["tools"] = tools or [] + updated_settings["handoffs"] = handoffs or [] + + # Apply starting settings (from model config) next + if starting_settings: + updated_settings.update(starting_settings) + + disable_tracing = self._run_config.get("tracing_disabled", False) + if disable_tracing: + updated_settings["tracing"] = None return updated_settings + + @classmethod + async def _get_handoffs( + cls, agent: RealtimeAgent[Any], context_wrapper: RunContextWrapper[Any] + ) -> list[Handoff[Any, RealtimeAgent[Any]]]: + handoffs: list[Handoff[Any, RealtimeAgent[Any]]] = [] + for handoff_item in agent.handoffs: + if isinstance(handoff_item, Handoff): + handoffs.append(handoff_item) + elif isinstance(handoff_item, RealtimeAgent): + handoffs.append(realtime_handoff(handoff_item)) + + async def _check_handoff_enabled(handoff_obj: Handoff[Any, RealtimeAgent[Any]]) -> bool: + attr = handoff_obj.is_enabled + if isinstance(attr, bool): + return attr + res = attr(context_wrapper, agent) + if inspect.isawaitable(res): + return await res + return res + + results = await asyncio.gather(*(_check_handoff_enabled(h) for h in handoffs)) + enabled = [h for h, ok in zip(handoffs, results) if ok] + return enabled diff --git a/src/agents/repl.py b/src/agents/repl.py index f7142555f..34222870c 100644 --- a/src/agents/repl.py +++ b/src/agents/repl.py @@ -8,10 +8,13 @@ from .items import TResponseInputItem from .result import RunResultBase from .run import Runner +from .run_context import TContext from .stream_events import AgentUpdatedStreamEvent, RawResponsesStreamEvent, RunItemStreamEvent -async def run_demo_loop(agent: Agent[Any], *, stream: bool = True) -> None: +async def run_demo_loop( + agent: Agent[Any], *, stream: bool = True, context: TContext | None = None +) -> None: """Run a simple REPL loop with the given agent. This utility allows quick manual testing and debugging of an agent from the @@ -21,6 +24,7 @@ async def run_demo_loop(agent: Agent[Any], *, stream: bool = True) -> None: Args: agent: The starting agent to run. stream: Whether to stream the agent output. + context: Additional context information to pass to the runner. """ current_agent = agent @@ -40,7 +44,7 @@ async def run_demo_loop(agent: Agent[Any], *, stream: bool = True) -> None: result: RunResultBase if stream: - result = Runner.run_streamed(current_agent, input=input_items) + result = Runner.run_streamed(current_agent, input=input_items, context=context) async for event in result.stream_events(): if isinstance(event, RawResponsesStreamEvent): if isinstance(event.data, ResponseTextDeltaEvent): @@ -54,7 +58,7 @@ async def run_demo_loop(agent: Agent[Any], *, stream: bool = True) -> None: print(f"\n[Agent updated: {event.new_agent.name}]", flush=True) print() else: - result = await Runner.run(current_agent, input_items) + result = await Runner.run(current_agent, input_items, context=context) if result.final_output is not None: print(result.final_output) diff --git a/src/agents/result.py b/src/agents/result.py index 5cf0e74c8..3fe20cfa5 100644 --- a/src/agents/result.py +++ b/src/agents/result.py @@ -4,7 +4,7 @@ import asyncio from collections.abc import AsyncIterator from dataclasses import dataclass, field -from typing import TYPE_CHECKING, Any, cast +from typing import TYPE_CHECKING, Any, Literal, cast from typing_extensions import TypeVar @@ -31,6 +31,7 @@ if TYPE_CHECKING: from ._run_impl import QueueCompleteSentinel from .agent import Agent + from .tool_guardrails import ToolInputGuardrailResult, ToolOutputGuardrailResult T = TypeVar("T") @@ -59,6 +60,12 @@ class RunResultBase(abc.ABC): output_guardrail_results: list[OutputGuardrailResult] """Guardrail results for the final output of the agent.""" + tool_input_guardrail_results: list[ToolInputGuardrailResult] + """Tool input guardrail results from all tools executed during the run.""" + + tool_output_guardrail_results: list[ToolOutputGuardrailResult] + """Tool output guardrail results from all tools executed during the run.""" + context_wrapper: RunContextWrapper[Any] """The context wrapper for the agent run.""" @@ -157,6 +164,9 @@ class RunResultStreaming(RunResultBase): _output_guardrails_task: asyncio.Task[Any] | None = field(default=None, repr=False) _stored_exception: Exception | None = field(default=None, repr=False) + # Soft cancel state + _cancel_mode: Literal["none", "immediate", "after_turn"] = field(default="none", repr=False) + @property def last_agent(self) -> Agent[Any]: """The last agent that was run. Updates as the agent run progresses, so the true last agent @@ -164,17 +174,51 @@ def last_agent(self) -> Agent[Any]: """ return self.current_agent - def cancel(self) -> None: - """Cancels the streaming run, stopping all background tasks and marking the run as - complete.""" - self._cleanup_tasks() # Cancel all running tasks - self.is_complete = True # Mark the run as complete to stop event streaming + def cancel(self, mode: Literal["immediate", "after_turn"] = "immediate") -> None: + """Cancel the streaming run. - # Optionally, clear the event queue to prevent processing stale events - while not self._event_queue.empty(): - self._event_queue.get_nowait() - while not self._input_guardrail_queue.empty(): - self._input_guardrail_queue.get_nowait() + Args: + mode: Cancellation strategy: + - "immediate": Stop immediately, cancel all tasks, clear queues (default) + - "after_turn": Complete current turn gracefully before stopping + * Allows LLM response to finish + * Executes pending tool calls + * Saves session state properly + * Tracks usage accurately + * Stops before next turn begins + + Example: + ```python + result = Runner.run_streamed(agent, "Task", session=session) + + async for event in result.stream_events(): + if user_interrupted(): + result.cancel(mode="after_turn") # Graceful + # result.cancel() # Immediate (default) + ``` + + Note: After calling cancel(), you should continue consuming stream_events() + to allow the cancellation to complete properly. + """ + # Store the cancel mode for the background task to check + self._cancel_mode = mode + + if mode == "immediate": + # Existing behavior - immediate shutdown + self._cleanup_tasks() # Cancel all running tasks + self.is_complete = True # Mark the run as complete to stop event streaming + + # Optionally, clear the event queue to prevent processing stale events + while not self._event_queue.empty(): + self._event_queue.get_nowait() + while not self._input_guardrail_queue.empty(): + self._input_guardrail_queue.get_nowait() + + elif mode == "after_turn": + # Soft cancel - just set the flag + # The streaming loop will check this and stop gracefully + # Don't call _cleanup_tasks() or clear queues yet + pass async def stream_events(self) -> AsyncIterator[StreamEvent]: """Stream deltas for new items as they are generated. We're using the types from the @@ -185,31 +229,42 @@ async def stream_events(self) -> AsyncIterator[StreamEvent]: - A MaxTurnsExceeded exception if the agent exceeds the max_turns limit. - A GuardrailTripwireTriggered exception if a guardrail is tripped. """ - while True: - self._check_errors() - if self._stored_exception: - logger.debug("Breaking due to stored exception") - self.is_complete = True - break + try: + while True: + self._check_errors() + if self._stored_exception: + logger.debug("Breaking due to stored exception") + self.is_complete = True + break - if self.is_complete and self._event_queue.empty(): - break + if self.is_complete and self._event_queue.empty(): + break - try: - item = await self._event_queue.get() - except asyncio.CancelledError: - break + try: + item = await self._event_queue.get() + except asyncio.CancelledError: + break - if isinstance(item, QueueCompleteSentinel): - self._event_queue.task_done() - # Check for errors, in case the queue was completed due to an exception - self._check_errors() - break + if isinstance(item, QueueCompleteSentinel): + # Await input guardrails if they are still running, so late + # exceptions are captured. + await self._await_task_safely(self._input_guardrails_task) - yield item - self._event_queue.task_done() + self._event_queue.task_done() - self._cleanup_tasks() + # Check for errors, in case the queue was completed + # due to an exception + self._check_errors() + break + + yield item + self._event_queue.task_done() + finally: + # Ensure main execution completes before cleanup to avoid race conditions + # with session operations + await self._await_task_safely(self._run_impl_task) + # Safely terminate all background tasks after main execution has finished + self._cleanup_tasks() if self._stored_exception: raise self._stored_exception @@ -274,3 +329,19 @@ def _cleanup_tasks(self): def __str__(self) -> str: return pretty_print_run_result_streaming(self) + + async def _await_task_safely(self, task: asyncio.Task[Any] | None) -> None: + """Await a task if present, ignoring cancellation and storing exceptions elsewhere. + + This ensures we do not lose late guardrail exceptions while not surfacing + CancelledError to callers of stream_events. + """ + if task and not task.done(): + try: + await task + except asyncio.CancelledError: + # Task was cancelled (e.g., due to result.cancel()). Nothing to do here. + pass + except Exception: + # The exception will be surfaced via _check_errors() if needed. + pass diff --git a/src/agents/run.py b/src/agents/run.py index 2dd9524bb..58eef335e 100644 --- a/src/agents/run.py +++ b/src/agents/run.py @@ -1,15 +1,19 @@ from __future__ import annotations import asyncio -import copy import inspect +import os from dataclasses import dataclass, field -from typing import Any, Generic, cast +from typing import Any, Callable, Generic, cast, get_args -from openai.types.responses import ResponseCompletedEvent +from openai.types.responses import ( + ResponseCompletedEvent, + ResponseOutputItemDoneEvent, +) from openai.types.responses.response_prompt_param import ( ResponsePromptParam, ) +from openai.types.responses.response_reasoning_item import ResponseReasoningItem from typing_extensions import NotRequired, TypedDict, Unpack from ._run_impl import ( @@ -41,21 +45,37 @@ OutputGuardrailResult, ) from .handoffs import Handoff, HandoffInputFilter, handoff -from .items import ItemHelpers, ModelResponse, RunItem, TResponseInputItem -from .lifecycle import RunHooks +from .items import ( + HandoffCallItem, + ItemHelpers, + ModelResponse, + ReasoningItem, + RunItem, + ToolCallItem, + ToolCallItemTypes, + TResponseInputItem, +) +from .lifecycle import AgentHooksBase, RunHooks, RunHooksBase from .logger import logger -from .memory import Session +from .memory import Session, SessionInputCallback from .model_settings import ModelSettings from .models.interface import Model, ModelProvider from .models.multi_provider import MultiProvider from .result import RunResult, RunResultStreaming from .run_context import RunContextWrapper, TContext -from .stream_events import AgentUpdatedStreamEvent, RawResponsesStreamEvent +from .stream_events import ( + AgentUpdatedStreamEvent, + RawResponsesStreamEvent, + RunItemStreamEvent, + StreamEvent, +) from .tool import Tool +from .tool_guardrails import ToolInputGuardrailResult, ToolOutputGuardrailResult from .tracing import Span, SpanError, agent_span, get_current_trace, trace from .tracing.span_data import AgentSpanData from .usage import Usage from .util import _coro, _error_tracing +from .util._types import MaybeAwaitable DEFAULT_MAX_TURNS = 10 @@ -81,6 +101,78 @@ def get_default_agent_runner() -> AgentRunner: return DEFAULT_AGENT_RUNNER +def _default_trace_include_sensitive_data() -> bool: + """Returns the default value for trace_include_sensitive_data based on environment variable.""" + val = os.getenv("OPENAI_AGENTS_TRACE_INCLUDE_SENSITIVE_DATA", "true") + return val.strip().lower() in ("1", "true", "yes", "on") + + +@dataclass +class ModelInputData: + """Container for the data that will be sent to the model.""" + + input: list[TResponseInputItem] + instructions: str | None + + +@dataclass +class CallModelData(Generic[TContext]): + """Data passed to `RunConfig.call_model_input_filter` prior to model call.""" + + model_data: ModelInputData + agent: Agent[TContext] + context: TContext | None + + +@dataclass +class _ServerConversationTracker: + """Tracks server-side conversation state for either conversation_id or + previous_response_id modes.""" + + conversation_id: str | None = None + previous_response_id: str | None = None + sent_items: set[int] = field(default_factory=set) + server_items: set[int] = field(default_factory=set) + + def track_server_items(self, model_response: ModelResponse) -> None: + for output_item in model_response.output: + self.server_items.add(id(output_item)) + + # Update previous_response_id only when using previous_response_id + if ( + self.conversation_id is None + and self.previous_response_id is not None + and model_response.response_id is not None + ): + self.previous_response_id = model_response.response_id + + def prepare_input( + self, + original_input: str | list[TResponseInputItem], + generated_items: list[RunItem], + ) -> list[TResponseInputItem]: + input_items: list[TResponseInputItem] = [] + + # On first call (when there are no generated items yet), include the original input + if not generated_items: + input_items.extend(ItemHelpers.input_to_new_input_list(original_input)) + + # Process generated_items, skip items already sent or from server + for item in generated_items: + raw_item_id = id(item.raw_item) + + if raw_item_id in self.sent_items or raw_item_id in self.server_items: + continue + input_items.append(item.to_input_item()) + self.sent_items.add(raw_item_id) + + return input_items + + +# Type alias for the optional input filter callback +CallModelInputFilter = Callable[[CallModelData[Any]], MaybeAwaitable[ModelInputData]] + + @dataclass class RunConfig: """Configures settings for the entire agent run.""" @@ -114,7 +206,9 @@ class RunConfig: """Whether tracing is disabled for the agent run. If disabled, we will not trace the agent run. """ - trace_include_sensitive_data: bool = True + trace_include_sensitive_data: bool = field( + default_factory=_default_trace_include_sensitive_data + ) """Whether we include potentially sensitive data (for example: inputs/outputs of tool calls or LLM generations) in traces. If False, we'll still create spans for these events, but the sensitive data will not be included. @@ -139,6 +233,23 @@ class RunConfig: An optional dictionary of additional metadata to include with the trace. """ + session_input_callback: SessionInputCallback | None = None + """Defines how to handle session history when new input is provided. + - `None` (default): The new input is appended to the session history. + - `SessionInputCallback`: A custom function that receives the history and new input, and + returns the desired combined list of items. + """ + + call_model_input_filter: CallModelInputFilter | None = None + """ + Optional callback that is invoked immediately before calling the model. It receives the current + agent, context and the model input (instructions and input items), and must return a possibly + modified `ModelInputData` to use for the model call. + + This allows you to edit the input sent to the model e.g. to stay within a token limit. + For example, you can use this to add a system prompt to the input. + """ + class RunOptions(TypedDict, Generic[TContext]): """Arguments for ``AgentRunner`` methods.""" @@ -158,6 +269,9 @@ class RunOptions(TypedDict, Generic[TContext]): previous_response_id: NotRequired[str | None] """The ID of the previous response, if any.""" + conversation_id: NotRequired[str | None] + """The ID of the stored conversation, if any.""" + session: NotRequired[Session | None] """The session for the run.""" @@ -174,34 +288,57 @@ async def run( hooks: RunHooks[TContext] | None = None, run_config: RunConfig | None = None, previous_response_id: str | None = None, + conversation_id: str | None = None, session: Session | None = None, ) -> RunResult: - """Run a workflow starting at the given agent. The agent will run in a loop until a final - output is generated. The loop runs like so: - 1. The agent is invoked with the given input. - 2. If there is a final output (i.e. the agent produces something of type - `agent.output_type`, the loop terminates. - 3. If there's a handoff, we run the loop again, with the new agent. - 4. Else, we run tool calls (if any), and re-run the loop. + """ + Run a workflow starting at the given agent. + + The agent will run in a loop until a final output is generated. The loop runs like so: + + 1. The agent is invoked with the given input. + 2. If there is a final output (i.e. the agent produces something of type + `agent.output_type`), the loop terminates. + 3. If there's a handoff, we run the loop again, with the new agent. + 4. Else, we run tool calls (if any), and re-run the loop. + In two cases, the agent may raise an exception: - 1. If the max_turns is exceeded, a MaxTurnsExceeded exception is raised. - 2. If a guardrail tripwire is triggered, a GuardrailTripwireTriggered exception is raised. - Note that only the first agent's input guardrails are run. + + 1. If the max_turns is exceeded, a MaxTurnsExceeded exception is raised. + 2. If a guardrail tripwire is triggered, a GuardrailTripwireTriggered + exception is raised. + + Note: + Only the first agent's input guardrails are run. + Args: starting_agent: The starting agent to run. - input: The initial input to the agent. You can pass a single string for a user message, - or a list of input items. + input: The initial input to the agent. You can pass a single string for a + user message, or a list of input items. context: The context to run the agent with. - max_turns: The maximum number of turns to run the agent for. A turn is defined as one - AI invocation (including any tool calls that might occur). + max_turns: The maximum number of turns to run the agent for. A turn is + defined as one AI invocation (including any tool calls that might occur). hooks: An object that receives callbacks on various lifecycle events. run_config: Global settings for the entire agent run. - previous_response_id: The ID of the previous response, if using OpenAI models via the - Responses API, this allows you to skip passing in input from the previous turn. + previous_response_id: The ID of the previous response. If using OpenAI + models via the Responses API, this allows you to skip passing in input + from the previous turn. + conversation_id: The conversation ID + (https://platform.openai.com/docs/guides/conversation-state?api-mode=responses). + If provided, the conversation will be used to read and write items. + Every agent will have access to the conversation history so far, + and its output items will be written to the conversation. + We recommend only using this if you are exclusively using OpenAI models; + other model providers don't write to the Conversation object, + so you'll end up having partial conversations stored. + session: A session for automatic conversation history management. + Returns: - A run result containing all the inputs, guardrail results and the output of the last - agent. Agents may perform handoffs, so we don't know the specific type of the output. + A run result containing all the inputs, guardrail results and the output of + the last agent. Agents may perform handoffs, so we don't know the specific + type of the output. """ + runner = DEFAULT_AGENT_RUNNER return await runner.run( starting_agent, @@ -211,6 +348,7 @@ async def run( hooks=hooks, run_config=run_config, previous_response_id=previous_response_id, + conversation_id=conversation_id, session=session, ) @@ -225,37 +363,55 @@ def run_sync( hooks: RunHooks[TContext] | None = None, run_config: RunConfig | None = None, previous_response_id: str | None = None, + conversation_id: str | None = None, session: Session | None = None, ) -> RunResult: - """Run a workflow synchronously, starting at the given agent. Note that this just wraps the - `run` method, so it will not work if there's already an event loop (e.g. inside an async - function, or in a Jupyter notebook or async context like FastAPI). For those cases, use - the `run` method instead. - The agent will run in a loop until a final output is generated. The loop runs like so: - 1. The agent is invoked with the given input. - 2. If there is a final output (i.e. the agent produces something of type - `agent.output_type`, the loop terminates. - 3. If there's a handoff, we run the loop again, with the new agent. - 4. Else, we run tool calls (if any), and re-run the loop. + """ + Run a workflow synchronously, starting at the given agent. + + Note: + This just wraps the `run` method, so it will not work if there's already an + event loop (e.g. inside an async function, or in a Jupyter notebook or async + context like FastAPI). For those cases, use the `run` method instead. + + The agent will run in a loop until a final output is generated. The loop runs: + + 1. The agent is invoked with the given input. + 2. If there is a final output (i.e. the agent produces something of type + `agent.output_type`), the loop terminates. + 3. If there's a handoff, we run the loop again, with the new agent. + 4. Else, we run tool calls (if any), and re-run the loop. + In two cases, the agent may raise an exception: - 1. If the max_turns is exceeded, a MaxTurnsExceeded exception is raised. - 2. If a guardrail tripwire is triggered, a GuardrailTripwireTriggered exception is raised. - Note that only the first agent's input guardrails are run. + + 1. If the max_turns is exceeded, a MaxTurnsExceeded exception is raised. + 2. If a guardrail tripwire is triggered, a GuardrailTripwireTriggered + exception is raised. + + Note: + Only the first agent's input guardrails are run. + Args: starting_agent: The starting agent to run. - input: The initial input to the agent. You can pass a single string for a user message, - or a list of input items. + input: The initial input to the agent. You can pass a single string for a + user message, or a list of input items. context: The context to run the agent with. - max_turns: The maximum number of turns to run the agent for. A turn is defined as one - AI invocation (including any tool calls that might occur). + max_turns: The maximum number of turns to run the agent for. A turn is + defined as one AI invocation (including any tool calls that might occur). hooks: An object that receives callbacks on various lifecycle events. run_config: Global settings for the entire agent run. - previous_response_id: The ID of the previous response, if using OpenAI models via the - Responses API, this allows you to skip passing in input from the previous turn. + previous_response_id: The ID of the previous response, if using OpenAI + models via the Responses API, this allows you to skip passing in input + from the previous turn. + conversation_id: The ID of the stored conversation, if any. + session: A session for automatic conversation history management. + Returns: - A run result containing all the inputs, guardrail results and the output of the last - agent. Agents may perform handoffs, so we don't know the specific type of the output. + A run result containing all the inputs, guardrail results and the output of + the last agent. Agents may perform handoffs, so we don't know the specific + type of the output. """ + runner = DEFAULT_AGENT_RUNNER return runner.run_sync( starting_agent, @@ -265,6 +421,7 @@ def run_sync( hooks=hooks, run_config=run_config, previous_response_id=previous_response_id, + conversation_id=conversation_id, session=session, ) @@ -278,34 +435,52 @@ def run_streamed( hooks: RunHooks[TContext] | None = None, run_config: RunConfig | None = None, previous_response_id: str | None = None, + conversation_id: str | None = None, session: Session | None = None, ) -> RunResultStreaming: - """Run a workflow starting at the given agent in streaming mode. The returned result object - contains a method you can use to stream semantic events as they are generated. + """ + Run a workflow starting at the given agent in streaming mode. + + The returned result object contains a method you can use to stream semantic + events as they are generated. + The agent will run in a loop until a final output is generated. The loop runs like so: - 1. The agent is invoked with the given input. - 2. If there is a final output (i.e. the agent produces something of type - `agent.output_type`, the loop terminates. - 3. If there's a handoff, we run the loop again, with the new agent. - 4. Else, we run tool calls (if any), and re-run the loop. + + 1. The agent is invoked with the given input. + 2. If there is a final output (i.e. the agent produces something of type + `agent.output_type`), the loop terminates. + 3. If there's a handoff, we run the loop again, with the new agent. + 4. Else, we run tool calls (if any), and re-run the loop. + In two cases, the agent may raise an exception: - 1. If the max_turns is exceeded, a MaxTurnsExceeded exception is raised. - 2. If a guardrail tripwire is triggered, a GuardrailTripwireTriggered exception is raised. - Note that only the first agent's input guardrails are run. + + 1. If the max_turns is exceeded, a MaxTurnsExceeded exception is raised. + 2. If a guardrail tripwire is triggered, a GuardrailTripwireTriggered + exception is raised. + + Note: + Only the first agent's input guardrails are run. + Args: starting_agent: The starting agent to run. - input: The initial input to the agent. You can pass a single string for a user message, - or a list of input items. + input: The initial input to the agent. You can pass a single string for a + user message, or a list of input items. context: The context to run the agent with. - max_turns: The maximum number of turns to run the agent for. A turn is defined as one - AI invocation (including any tool calls that might occur). + max_turns: The maximum number of turns to run the agent for. A turn is + defined as one AI invocation (including any tool calls that might occur). hooks: An object that receives callbacks on various lifecycle events. run_config: Global settings for the entire agent run. - previous_response_id: The ID of the previous response, if using OpenAI models via the - Responses API, this allows you to skip passing in input from the previous turn. + previous_response_id: The ID of the previous response, if using OpenAI + models via the Responses API, this allows you to skip passing in input + from the previous turn. + conversation_id: The ID of the stored conversation, if any. + session: A session for automatic conversation history management. + Returns: - A result object that contains data about the run, as well as a method to stream events. + A result object that contains data about the run, as well as a method to + stream events. """ + runner = DEFAULT_AGENT_RUNNER return runner.run_streamed( starting_agent, @@ -315,6 +490,7 @@ def run_streamed( hooks=hooks, run_config=run_config, previous_response_id=previous_response_id, + conversation_id=conversation_id, session=session, ) @@ -333,17 +509,26 @@ async def run( ) -> RunResult: context = kwargs.get("context") max_turns = kwargs.get("max_turns", DEFAULT_MAX_TURNS) - hooks = kwargs.get("hooks") + hooks = cast(RunHooks[TContext], self._validate_run_hooks(kwargs.get("hooks"))) run_config = kwargs.get("run_config") previous_response_id = kwargs.get("previous_response_id") + conversation_id = kwargs.get("conversation_id") session = kwargs.get("session") - if hooks is None: - hooks = RunHooks[Any]() if run_config is None: run_config = RunConfig() - # Prepare input with session if enabled - prepared_input = await self._prepare_input_with_session(input, session) + if conversation_id is not None or previous_response_id is not None: + server_conversation_tracker = _ServerConversationTracker( + conversation_id=conversation_id, previous_response_id=previous_response_id + ) + else: + server_conversation_tracker = None + + # Keep original user input separate from session-prepared input + original_user_input = input + prepared_input = await self._prepare_input_with_session( + input, session, run_config.session_input_callback + ) tool_use_tracker = AgentToolUseTracker() @@ -355,7 +540,7 @@ async def run( disabled=run_config.tracing_disabled, ): current_turn = 0 - original_input: str | list[TResponseInputItem] = copy.deepcopy(prepared_input) + original_input: str | list[TResponseInputItem] = _copy_str_or_list(prepared_input) generated_items: list[RunItem] = [] model_responses: list[ModelResponse] = [] @@ -364,11 +549,16 @@ async def run( ) input_guardrail_results: list[InputGuardrailResult] = [] + tool_input_guardrail_results: list[ToolInputGuardrailResult] = [] + tool_output_guardrail_results: list[ToolOutputGuardrailResult] = [] current_span: Span[AgentSpanData] | None = None current_agent = starting_agent should_run_agent_start_hooks = True + # save only the new user input to the session, not the combined history + await self._save_result_to_session(session, original_user_input, []) + try: while True: all_tools = await AgentRunner._get_all_tools(current_agent, context_wrapper) @@ -414,7 +604,7 @@ async def run( starting_agent, starting_agent.input_guardrails + (run_config.input_guardrails or []), - copy.deepcopy(prepared_input), + _copy_str_or_list(prepared_input), context_wrapper, ), self._run_single_turn( @@ -427,7 +617,7 @@ async def run( run_config=run_config, should_run_agent_start_hooks=should_run_agent_start_hooks, tool_use_tracker=tool_use_tracker, - previous_response_id=previous_response_id, + server_conversation_tracker=server_conversation_tracker, ), ) else: @@ -441,7 +631,7 @@ async def run( run_config=run_config, should_run_agent_start_hooks=should_run_agent_start_hooks, tool_use_tracker=tool_use_tracker, - previous_response_id=previous_response_id, + server_conversation_tracker=server_conversation_tracker, ) should_run_agent_start_hooks = False @@ -449,6 +639,13 @@ async def run( original_input = turn_result.original_input generated_items = turn_result.generated_items + if server_conversation_tracker is not None: + server_conversation_tracker.track_server_items(turn_result.model_response) + + # Collect tool guardrail results from this turn + tool_input_guardrail_results.extend(turn_result.tool_input_guardrail_results) + tool_output_guardrail_results.extend(turn_result.tool_output_guardrail_results) + if isinstance(turn_result.next_step, NextStepFinalOutput): output_guardrail_results = await self._run_output_guardrails( current_agent.output_guardrails + (run_config.output_guardrails or []), @@ -464,11 +661,17 @@ async def run( _last_agent=current_agent, input_guardrail_results=input_guardrail_results, output_guardrail_results=output_guardrail_results, + tool_input_guardrail_results=tool_input_guardrail_results, + tool_output_guardrail_results=tool_output_guardrail_results, context_wrapper=context_wrapper, ) - - # Save the conversation to session if enabled - await self._save_result_to_session(session, input, result) + if not any( + guardrail_result.output.tripwire_triggered + for guardrail_result in input_guardrail_results + ): + await self._save_result_to_session( + session, [], turn_result.new_step_items + ) return result elif isinstance(turn_result.next_step, NextStepHandoff): @@ -477,7 +680,13 @@ async def run( current_span = None should_run_agent_start_hooks = True elif isinstance(turn_result.next_step, NextStepRunAgain): - pass + if not any( + guardrail_result.output.tripwire_triggered + for guardrail_result in input_guardrail_results + ): + await self._save_result_to_session( + session, [], turn_result.new_step_items + ) else: raise AgentsException( f"Unknown next step type: {type(turn_result.next_step)}" @@ -508,6 +717,7 @@ def run_sync( hooks = kwargs.get("hooks") run_config = kwargs.get("run_config") previous_response_id = kwargs.get("previous_response_id") + conversation_id = kwargs.get("conversation_id") session = kwargs.get("session") return asyncio.get_event_loop().run_until_complete( @@ -520,6 +730,7 @@ def run_sync( hooks=hooks, run_config=run_config, previous_response_id=previous_response_id, + conversation_id=conversation_id, ) ) @@ -531,13 +742,12 @@ def run_streamed( ) -> RunResultStreaming: context = kwargs.get("context") max_turns = kwargs.get("max_turns", DEFAULT_MAX_TURNS) - hooks = kwargs.get("hooks") + hooks = cast(RunHooks[TContext], self._validate_run_hooks(kwargs.get("hooks"))) run_config = kwargs.get("run_config") previous_response_id = kwargs.get("previous_response_id") + conversation_id = kwargs.get("conversation_id") session = kwargs.get("session") - if hooks is None: - hooks = RunHooks[Any]() if run_config is None: run_config = RunConfig() @@ -562,7 +772,7 @@ def run_streamed( ) streamed_result = RunResultStreaming( - input=copy.deepcopy(input), + input=_copy_str_or_list(input), new_items=[], current_agent=starting_agent, raw_responses=[], @@ -572,6 +782,8 @@ def run_streamed( max_turns=max_turns, input_guardrail_results=[], output_guardrail_results=[], + tool_input_guardrail_results=[], + tool_output_guardrail_results=[], _current_agent_output_schema=output_schema, trace=new_trace, context_wrapper=context_wrapper, @@ -588,11 +800,70 @@ def run_streamed( context_wrapper=context_wrapper, run_config=run_config, previous_response_id=previous_response_id, + conversation_id=conversation_id, session=session, ) ) return streamed_result + @staticmethod + def _validate_run_hooks( + hooks: RunHooksBase[Any, Agent[Any]] | AgentHooksBase[Any, Agent[Any]] | Any | None, + ) -> RunHooks[Any]: + if hooks is None: + return RunHooks[Any]() + input_hook_type = type(hooks).__name__ + if isinstance(hooks, AgentHooksBase): + raise TypeError( + "Run hooks must be instances of RunHooks. " + f"Received agent-scoped hooks ({input_hook_type}). " + "Attach AgentHooks to an Agent via Agent(..., hooks=...)." + ) + if not isinstance(hooks, RunHooksBase): + raise TypeError(f"Run hooks must be instances of RunHooks. Received {input_hook_type}.") + return hooks + + @classmethod + async def _maybe_filter_model_input( + cls, + *, + agent: Agent[TContext], + run_config: RunConfig, + context_wrapper: RunContextWrapper[TContext], + input_items: list[TResponseInputItem], + system_instructions: str | None, + ) -> ModelInputData: + """Apply optional call_model_input_filter to modify model input. + + Returns a `ModelInputData` that will be sent to the model. + """ + effective_instructions = system_instructions + effective_input: list[TResponseInputItem] = input_items + + if run_config.call_model_input_filter is None: + return ModelInputData(input=effective_input, instructions=effective_instructions) + + try: + model_input = ModelInputData( + input=effective_input.copy(), + instructions=effective_instructions, + ) + filter_payload: CallModelData[TContext] = CallModelData( + model_data=model_input, + agent=agent, + context=context_wrapper.context, + ) + maybe_updated = run_config.call_model_input_filter(filter_payload) + updated = await maybe_updated if inspect.isawaitable(maybe_updated) else maybe_updated + if not isinstance(updated, ModelInputData): + raise UserError("call_model_input_filter must return a ModelInputData instance") + return updated + except Exception as e: + _error_tracing.attach_error_to_current_span( + SpanError(message="Error in call_model_input_filter", data={"error": str(e)}) + ) + raise + @classmethod async def _run_input_guardrails_with_queue( cls, @@ -647,6 +918,7 @@ async def _start_streaming( context_wrapper: RunContextWrapper[TContext], run_config: RunConfig, previous_response_id: str | None, + conversation_id: str | None, session: Session | None, ): if streamed_result.trace: @@ -658,16 +930,33 @@ async def _start_streaming( should_run_agent_start_hooks = True tool_use_tracker = AgentToolUseTracker() + if conversation_id is not None or previous_response_id is not None: + server_conversation_tracker = _ServerConversationTracker( + conversation_id=conversation_id, previous_response_id=previous_response_id + ) + else: + server_conversation_tracker = None + streamed_result._event_queue.put_nowait(AgentUpdatedStreamEvent(new_agent=current_agent)) try: # Prepare input with session if enabled - prepared_input = await AgentRunner._prepare_input_with_session(starting_input, session) + prepared_input = await AgentRunner._prepare_input_with_session( + starting_input, session, run_config.session_input_callback + ) # Update the streamed result with the prepared input streamed_result.input = prepared_input + await AgentRunner._save_result_to_session(session, starting_input, []) + while True: + # Check for soft cancel before starting new turn + if streamed_result._cancel_mode == "after_turn": + streamed_result.is_complete = True + streamed_result._event_queue.put_nowait(QueueCompleteSentinel()) + break + if streamed_result.is_complete: break @@ -713,7 +1002,7 @@ async def _start_streaming( cls._run_input_guardrails_with_queue( starting_agent, starting_agent.input_guardrails + (run_config.input_guardrails or []), - copy.deepcopy(ItemHelpers.input_to_new_input_list(prepared_input)), + ItemHelpers.input_to_new_input_list(prepared_input), context_wrapper, streamed_result, current_span, @@ -729,7 +1018,7 @@ async def _start_streaming( should_run_agent_start_hooks, tool_use_tracker, all_tools, - previous_response_id, + server_conversation_tracker, ) should_run_agent_start_hooks = False @@ -739,7 +1028,24 @@ async def _start_streaming( streamed_result.input = turn_result.original_input streamed_result.new_items = turn_result.generated_items + if server_conversation_tracker is not None: + server_conversation_tracker.track_server_items(turn_result.model_response) + if isinstance(turn_result.next_step, NextStepHandoff): + # Save the conversation to session if enabled (before handoff) + # Note: Non-streaming path doesn't save handoff turns immediately, + # but streaming needs to for graceful cancellation support + if session is not None: + should_skip_session_save = ( + await AgentRunner._input_guardrail_tripwire_triggered_for_stream( + streamed_result + ) + ) + if should_skip_session_save is False: + await AgentRunner._save_result_to_session( + session, [], turn_result.new_step_items + ) + current_agent = turn_result.next_step.new_agent current_span.finish(reset_current=True) current_span = None @@ -747,6 +1053,12 @@ async def _start_streaming( streamed_result._event_queue.put_nowait( AgentUpdatedStreamEvent(new_agent=current_agent) ) + + # Check for soft cancel after handoff + if streamed_result._cancel_mode == "after_turn": # type: ignore[comparison-overlap] + streamed_result.is_complete = True + streamed_result._event_queue.put_nowait(QueueCompleteSentinel()) + break elif isinstance(turn_result.next_step, NextStepFinalOutput): streamed_result._output_guardrails_task = asyncio.create_task( cls._run_output_guardrails( @@ -769,24 +1081,35 @@ async def _start_streaming( streamed_result.is_complete = True # Save the conversation to session if enabled - # Create a temporary RunResult for session saving - temp_result = RunResult( - input=streamed_result.input, - new_items=streamed_result.new_items, - raw_responses=streamed_result.raw_responses, - final_output=streamed_result.final_output, - _last_agent=current_agent, - input_guardrail_results=streamed_result.input_guardrail_results, - output_guardrail_results=streamed_result.output_guardrail_results, - context_wrapper=context_wrapper, - ) - await AgentRunner._save_result_to_session( - session, starting_input, temp_result - ) + if session is not None: + should_skip_session_save = ( + await AgentRunner._input_guardrail_tripwire_triggered_for_stream( + streamed_result + ) + ) + if should_skip_session_save is False: + await AgentRunner._save_result_to_session( + session, [], turn_result.new_step_items + ) streamed_result._event_queue.put_nowait(QueueCompleteSentinel()) elif isinstance(turn_result.next_step, NextStepRunAgain): - pass + if session is not None: + should_skip_session_save = ( + await AgentRunner._input_guardrail_tripwire_triggered_for_stream( + streamed_result + ) + ) + if should_skip_session_save is False: + await AgentRunner._save_result_to_session( + session, [], turn_result.new_step_items + ) + + # Check for soft cancel after turn completion + if streamed_result._cancel_mode == "after_turn": # type: ignore[comparison-overlap] + streamed_result.is_complete = True + streamed_result._event_queue.put_nowait(QueueCompleteSentinel()) + break except AgentsException as exc: streamed_result.is_complete = True streamed_result._event_queue.put_nowait(QueueCompleteSentinel()) @@ -815,6 +1138,15 @@ async def _start_streaming( streamed_result.is_complete = True finally: + if streamed_result._input_guardrails_task: + try: + await AgentRunner._input_guardrail_tripwire_triggered_for_stream( + streamed_result + ) + except Exception as e: + logger.debug( + f"Error in streamed_result finalize for agent {current_agent.name} - {e}" + ) if current_span: current_span.finish(reset_current=True) if streamed_result.trace: @@ -831,8 +1163,11 @@ async def _run_single_turn_streamed( should_run_agent_start_hooks: bool, tool_use_tracker: AgentToolUseTracker, all_tools: list[Tool], - previous_response_id: str | None, + server_conversation_tracker: _ServerConversationTracker | None = None, ) -> SingleStepResult: + emitted_tool_call_ids: set[str] = set() + emitted_reasoning_item_ids: set[str] = set() + if should_run_agent_start_hooks: await asyncio.gather( hooks.on_agent_start(context_wrapper, agent), @@ -860,13 +1195,48 @@ async def _run_single_turn_streamed( final_response: ModelResponse | None = None - input = ItemHelpers.input_to_new_input_list(streamed_result.input) - input.extend([item.to_input_item() for item in streamed_result.new_items]) + if server_conversation_tracker is not None: + input = server_conversation_tracker.prepare_input( + streamed_result.input, streamed_result.new_items + ) + else: + input = ItemHelpers.input_to_new_input_list(streamed_result.input) + input.extend([item.to_input_item() for item in streamed_result.new_items]) + + # THIS IS THE RESOLVED CONFLICT BLOCK + filtered = await cls._maybe_filter_model_input( + agent=agent, + run_config=run_config, + context_wrapper=context_wrapper, + input_items=input, + system_instructions=system_prompt, + ) + + # Call hook just before the model is invoked, with the correct system_prompt. + await asyncio.gather( + hooks.on_llm_start(context_wrapper, agent, filtered.instructions, filtered.input), + ( + agent.hooks.on_llm_start( + context_wrapper, agent, filtered.instructions, filtered.input + ) + if agent.hooks + else _coro.noop_coroutine() + ), + ) + + previous_response_id = ( + server_conversation_tracker.previous_response_id + if server_conversation_tracker + else None + ) + conversation_id = ( + server_conversation_tracker.conversation_id if server_conversation_tracker else None + ) # 1. Stream the output events async for event in model.stream_response( - system_prompt, - input, + filtered.instructions, + filtered.input, model_settings, all_tools, output_schema, @@ -875,8 +1245,12 @@ async def _run_single_turn_streamed( run_config.tracing_disabled, run_config.trace_include_sensitive_data ), previous_response_id=previous_response_id, + conversation_id=conversation_id, prompt=prompt_config, ): + # Emit the raw event ASAP + streamed_result._event_queue.put_nowait(RawResponsesStreamEvent(data=event)) + if isinstance(event, ResponseCompletedEvent): usage = ( Usage( @@ -897,7 +1271,46 @@ async def _run_single_turn_streamed( ) context_wrapper.usage.add(usage) - streamed_result._event_queue.put_nowait(RawResponsesStreamEvent(data=event)) + if isinstance(event, ResponseOutputItemDoneEvent): + output_item = event.item + + if isinstance(output_item, _TOOL_CALL_TYPES): + call_id: str | None = getattr( + output_item, "call_id", getattr(output_item, "id", None) + ) + + if call_id and call_id not in emitted_tool_call_ids: + emitted_tool_call_ids.add(call_id) + + tool_item = ToolCallItem( + raw_item=cast(ToolCallItemTypes, output_item), + agent=agent, + ) + streamed_result._event_queue.put_nowait( + RunItemStreamEvent(item=tool_item, name="tool_called") + ) + + elif isinstance(output_item, ResponseReasoningItem): + reasoning_id: str | None = getattr(output_item, "id", None) + + if reasoning_id and reasoning_id not in emitted_reasoning_item_ids: + emitted_reasoning_item_ids.add(reasoning_id) + + reasoning_item = ReasoningItem(raw_item=output_item, agent=agent) + streamed_result._event_queue.put_nowait( + RunItemStreamEvent(item=reasoning_item, name="reasoning_item_created") + ) + + # Call hook just after the model response is finalized. + if final_response is not None: + await asyncio.gather( + ( + agent.hooks.on_llm_end(context_wrapper, agent, final_response) + if agent.hooks + else _coro.noop_coroutine() + ), + hooks.on_llm_end(context_wrapper, agent, final_response), + ) # 2. At this point, the streaming is complete for this turn of the agent loop. if not final_response: @@ -916,9 +1329,50 @@ async def _run_single_turn_streamed( context_wrapper=context_wrapper, run_config=run_config, tool_use_tracker=tool_use_tracker, + event_queue=streamed_result._event_queue, ) - RunImpl.stream_step_result_to_queue(single_step_result, streamed_result._event_queue) + import dataclasses as _dc + + # Filter out items that have already been sent to avoid duplicates + items_to_filter = single_step_result.new_step_items + + if emitted_tool_call_ids: + # Filter out tool call items that were already emitted during streaming + items_to_filter = [ + item + for item in items_to_filter + if not ( + isinstance(item, ToolCallItem) + and ( + call_id := getattr( + item.raw_item, "call_id", getattr(item.raw_item, "id", None) + ) + ) + and call_id in emitted_tool_call_ids + ) + ] + + if emitted_reasoning_item_ids: + # Filter out reasoning items that were already emitted during streaming + items_to_filter = [ + item + for item in items_to_filter + if not ( + isinstance(item, ReasoningItem) + and (reasoning_id := getattr(item.raw_item, "id", None)) + and reasoning_id in emitted_reasoning_item_ids + ) + ] + + # Filter out HandoffCallItem to avoid duplicates (already sent earlier) + items_to_filter = [ + item for item in items_to_filter if not isinstance(item, HandoffCallItem) + ] + + # Create filtered result and send to queue + filtered_result = _dc.replace(single_step_result, new_step_items=items_to_filter) + RunImpl.stream_step_result_to_queue(filtered_result, streamed_result._event_queue) return single_step_result @classmethod @@ -934,7 +1388,7 @@ async def _run_single_turn( run_config: RunConfig, should_run_agent_start_hooks: bool, tool_use_tracker: AgentToolUseTracker, - previous_response_id: str | None, + server_conversation_tracker: _ServerConversationTracker | None = None, ) -> SingleStepResult: # Ensure we run the hooks before anything else if should_run_agent_start_hooks: @@ -954,8 +1408,11 @@ async def _run_single_turn( output_schema = cls._get_output_schema(agent) handoffs = await cls._get_handoffs(agent, context_wrapper) - input = ItemHelpers.input_to_new_input_list(original_input) - input.extend([generated_item.to_input_item() for generated_item in generated_items]) + if server_conversation_tracker is not None: + input = server_conversation_tracker.prepare_input(original_input, generated_items) + else: + input = ItemHelpers.input_to_new_input_list(original_input) + input.extend([generated_item.to_input_item() for generated_item in generated_items]) new_response = await cls._get_new_response( agent, @@ -964,10 +1421,11 @@ async def _run_single_turn( output_schema, all_tools, handoffs, + hooks, context_wrapper, run_config, tool_use_tracker, - previous_response_id, + server_conversation_tracker, prompt_config, ) @@ -1000,6 +1458,7 @@ async def _get_single_step_result_from_response( context_wrapper: RunContextWrapper[TContext], run_config: RunConfig, tool_use_tracker: AgentToolUseTracker, + event_queue: asyncio.Queue[StreamEvent | QueueCompleteSentinel] | None = None, ) -> SingleStepResult: processed_response = RunImpl.process_model_response( agent=agent, @@ -1011,6 +1470,14 @@ async def _get_single_step_result_from_response( tool_use_tracker.add_tool_use(agent, processed_response.tools_used) + # Send handoff items immediately for streaming, but avoid duplicates + if event_queue is not None and processed_response.new_items: + handoff_items = [ + item for item in processed_response.new_items if isinstance(item, HandoffCallItem) + ] + if handoff_items: + RunImpl.stream_step_items_to_queue(cast(list[RunItem], handoff_items), event_queue) + return await RunImpl.execute_tools_and_side_effects( agent=agent, original_input=original_input, @@ -1023,6 +1490,56 @@ async def _get_single_step_result_from_response( run_config=run_config, ) + @classmethod + async def _get_single_step_result_from_streamed_response( + cls, + *, + agent: Agent[TContext], + all_tools: list[Tool], + streamed_result: RunResultStreaming, + new_response: ModelResponse, + output_schema: AgentOutputSchemaBase | None, + handoffs: list[Handoff], + hooks: RunHooks[TContext], + context_wrapper: RunContextWrapper[TContext], + run_config: RunConfig, + tool_use_tracker: AgentToolUseTracker, + ) -> SingleStepResult: + original_input = streamed_result.input + pre_step_items = streamed_result.new_items + event_queue = streamed_result._event_queue + + processed_response = RunImpl.process_model_response( + agent=agent, + all_tools=all_tools, + response=new_response, + output_schema=output_schema, + handoffs=handoffs, + ) + new_items_processed_response = processed_response.new_items + tool_use_tracker.add_tool_use(agent, processed_response.tools_used) + RunImpl.stream_step_items_to_queue(new_items_processed_response, event_queue) + + single_step_result = await RunImpl.execute_tools_and_side_effects( + agent=agent, + original_input=original_input, + pre_step_items=pre_step_items, + new_response=new_response, + processed_response=processed_response, + output_schema=output_schema, + hooks=hooks, + context_wrapper=context_wrapper, + run_config=run_config, + ) + new_step_items = [ + item + for item in single_step_result.new_step_items + if item not in new_items_processed_response + ] + RunImpl.stream_step_items_to_queue(new_step_items, event_queue) + + return single_step_result + @classmethod async def _run_input_guardrails( cls, @@ -1108,19 +1625,53 @@ async def _get_new_response( output_schema: AgentOutputSchemaBase | None, all_tools: list[Tool], handoffs: list[Handoff], + hooks: RunHooks[TContext], context_wrapper: RunContextWrapper[TContext], run_config: RunConfig, tool_use_tracker: AgentToolUseTracker, - previous_response_id: str | None, + server_conversation_tracker: _ServerConversationTracker | None, prompt_config: ResponsePromptParam | None, ) -> ModelResponse: + # Allow user to modify model input right before the call, if configured + filtered = await cls._maybe_filter_model_input( + agent=agent, + run_config=run_config, + context_wrapper=context_wrapper, + input_items=input, + system_instructions=system_prompt, + ) + model = cls._get_model(agent, run_config) model_settings = agent.model_settings.resolve(run_config.model_settings) model_settings = RunImpl.maybe_reset_tool_choice(agent, tool_use_tracker, model_settings) + # If we have run hooks, or if the agent has hooks, we need to call them before the LLM call + await asyncio.gather( + hooks.on_llm_start(context_wrapper, agent, filtered.instructions, filtered.input), + ( + agent.hooks.on_llm_start( + context_wrapper, + agent, + filtered.instructions, # Use filtered instructions + filtered.input, # Use filtered input + ) + if agent.hooks + else _coro.noop_coroutine() + ), + ) + + previous_response_id = ( + server_conversation_tracker.previous_response_id + if server_conversation_tracker + else None + ) + conversation_id = ( + server_conversation_tracker.conversation_id if server_conversation_tracker else None + ) + new_response = await model.get_response( - system_instructions=system_prompt, - input=input, + system_instructions=filtered.instructions, + input=filtered.input, model_settings=model_settings, tools=all_tools, output_schema=output_schema, @@ -1129,11 +1680,22 @@ async def _get_new_response( run_config.tracing_disabled, run_config.trace_include_sensitive_data ), previous_response_id=previous_response_id, + conversation_id=conversation_id, prompt=prompt_config, ) context_wrapper.usage.add(new_response.usage) + # If we have run hooks, or if the agent has hooks, we need to call them after the LLM call + await asyncio.gather( + ( + agent.hooks.on_llm_end(context_wrapper, agent, new_response) + if agent.hooks + else _coro.noop_coroutine() + ), + hooks.on_llm_end(context_wrapper, agent, new_response), + ) + return new_response @classmethod @@ -1191,19 +1753,20 @@ async def _prepare_input_with_session( cls, input: str | list[TResponseInputItem], session: Session | None, + session_input_callback: SessionInputCallback | None, ) -> str | list[TResponseInputItem]: """Prepare input by combining it with session history if enabled.""" if session is None: return input - # Validate that we don't have both a session and a list input, as this creates - # ambiguity about whether the list should append to or replace existing session history - if isinstance(input, list): + # If the user doesn't specify an input callback and pass a list as input + if isinstance(input, list) and not session_input_callback: raise UserError( - "Cannot provide both a session and a list of input items. " - "When using session memory, provide only a string input to append to the " - "conversation, or use session=None and provide a list to manually manage " - "conversation history." + "When using session memory, list inputs require a " + "`RunConfig.session_input_callback` to define how they should be merged " + "with the conversation history. If you don't want to use a callback, " + "provide your input as a string instead, or disable session memory " + "(session=None) and pass a list to manage the history manually." ) # Get previous conversation history @@ -1212,19 +1775,31 @@ async def _prepare_input_with_session( # Convert input to list format new_input_list = ItemHelpers.input_to_new_input_list(input) - # Combine history with new input - combined_input = history + new_input_list - - return combined_input + if session_input_callback is None: + return history + new_input_list + elif callable(session_input_callback): + res = session_input_callback(history, new_input_list) + if inspect.isawaitable(res): + return await res + return res + else: + raise UserError( + f"Invalid `session_input_callback` value: {session_input_callback}. " + "Choose between `None` or a custom callable function." + ) @classmethod async def _save_result_to_session( cls, session: Session | None, original_input: str | list[TResponseInputItem], - result: RunResult, + new_items: list[RunItem], ) -> None: - """Save the conversation turn to session.""" + """ + Save the conversation turn to session. + It does not account for any filtering or modification performed by + `RunConfig.session_input_callback`. + """ if session is None: return @@ -1232,11 +1807,36 @@ async def _save_result_to_session( input_list = ItemHelpers.input_to_new_input_list(original_input) # Convert new items to input format - new_items_as_input = [item.to_input_item() for item in result.new_items] + new_items_as_input = [item.to_input_item() for item in new_items] # Save all items from this turn items_to_save = input_list + new_items_as_input await session.add_items(items_to_save) + @staticmethod + async def _input_guardrail_tripwire_triggered_for_stream( + streamed_result: RunResultStreaming, + ) -> bool: + """Return True if any input guardrail triggered during a streamed run.""" + + task = streamed_result._input_guardrails_task + if task is None: + return False + + if not task.done(): + await task + + return any( + guardrail_result.output.tripwire_triggered + for guardrail_result in streamed_result.input_guardrail_results + ) + DEFAULT_AGENT_RUNNER = AgentRunner() +_TOOL_CALL_TYPES: tuple[type, ...] = get_args(ToolCallItemTypes) + + +def _copy_str_or_list(input: str | list[TResponseInputItem]) -> str | list[TResponseInputItem]: + if isinstance(input, str): + return input + return input.copy() diff --git a/src/agents/stream_events.py b/src/agents/stream_events.py index a271e8acd..c0e9807a1 100644 --- a/src/agents/stream_events.py +++ b/src/agents/stream_events.py @@ -37,6 +37,7 @@ class RunItemStreamEvent: "tool_output", "reasoning_item_created", "mcp_approval_requested", + "mcp_approval_response", "mcp_list_tools", ] """The name of the event.""" diff --git a/src/agents/strict_schema.py b/src/agents/strict_schema.py index 3f37660a0..650c17308 100644 --- a/src/agents/strict_schema.py +++ b/src/agents/strict_schema.py @@ -87,6 +87,20 @@ def _ensure_strict_json_schema( for i, variant in enumerate(any_of) ] + # oneOf is not supported by OpenAI's structured outputs in nested contexts, + # so we convert it to anyOf which provides equivalent functionality for + # discriminated unions + one_of = json_schema.get("oneOf") + if is_list(one_of): + existing_any_of = json_schema.get("anyOf", []) + if not is_list(existing_any_of): + existing_any_of = [] + json_schema["anyOf"] = existing_any_of + [ + _ensure_strict_json_schema(variant, path=(*path, "oneOf", str(i)), root=root) + for i, variant in enumerate(one_of) + ] + json_schema.pop("oneOf") + # intersections all_of = json_schema.get("allOf") if is_list(all_of): diff --git a/src/agents/tool.py b/src/agents/tool.py index b967e899b..39db129b7 100644 --- a/src/agents/tool.py +++ b/src/agents/tool.py @@ -13,24 +13,28 @@ ) from openai.types.responses.response_output_item import LocalShellCall, McpApprovalRequest from openai.types.responses.tool_param import CodeInterpreter, ImageGeneration, Mcp +from openai.types.responses.web_search_tool import Filters as WebSearchToolFilters from openai.types.responses.web_search_tool_param import UserLocation -from pydantic import ValidationError +from pydantic import BaseModel, TypeAdapter, ValidationError, model_validator from typing_extensions import Concatenate, NotRequired, ParamSpec, TypedDict from . import _debug from .computer import AsyncComputer, Computer from .exceptions import ModelBehaviorError from .function_schema import DocstringStyle, function_schema -from .items import RunItem from .logger import logger from .run_context import RunContextWrapper +from .strict_schema import ensure_strict_json_schema from .tool_context import ToolContext +from .tool_guardrails import ToolInputGuardrail, ToolOutputGuardrail from .tracing import SpanError from .util import _error_tracing from .util._types import MaybeAwaitable if TYPE_CHECKING: from .agent import Agent, AgentBase + from .items import RunItem + ToolParams = ParamSpec("ToolParams") @@ -45,6 +49,86 @@ ] +class ToolOutputText(BaseModel): + """Represents a tool output that should be sent to the model as text.""" + + type: Literal["text"] = "text" + text: str + + +class ToolOutputTextDict(TypedDict, total=False): + """TypedDict variant for text tool outputs.""" + + type: Literal["text"] + text: str + + +class ToolOutputImage(BaseModel): + """Represents a tool output that should be sent to the model as an image. + + You can provide either an `image_url` (URL or data URL) or a `file_id` for previously uploaded + content. The optional `detail` can control vision detail. + """ + + type: Literal["image"] = "image" + image_url: str | None = None + file_id: str | None = None + detail: Literal["low", "high", "auto"] | None = None + + @model_validator(mode="after") + def check_at_least_one_required_field(self) -> ToolOutputImage: + """Validate that at least one of image_url or file_id is provided.""" + if self.image_url is None and self.file_id is None: + raise ValueError("At least one of image_url or file_id must be provided") + return self + + +class ToolOutputImageDict(TypedDict, total=False): + """TypedDict variant for image tool outputs.""" + + type: Literal["image"] + image_url: NotRequired[str] + file_id: NotRequired[str] + detail: NotRequired[Literal["low", "high", "auto"]] + + +class ToolOutputFileContent(BaseModel): + """Represents a tool output that should be sent to the model as a file. + + Provide one of `file_data` (base64), `file_url`, or `file_id`. You may also + provide an optional `filename` when using `file_data` to hint file name. + """ + + type: Literal["file"] = "file" + file_data: str | None = None + file_url: str | None = None + file_id: str | None = None + filename: str | None = None + + @model_validator(mode="after") + def check_at_least_one_required_field(self) -> ToolOutputFileContent: + """Validate that at least one of file_data, file_url, or file_id is provided.""" + if self.file_data is None and self.file_url is None and self.file_id is None: + raise ValueError("At least one of file_data, file_url, or file_id must be provided") + return self + + +class ToolOutputFileContentDict(TypedDict, total=False): + """TypedDict variant for file content tool outputs.""" + + type: Literal["file"] + file_data: NotRequired[str] + file_url: NotRequired[str] + file_id: NotRequired[str] + filename: NotRequired[str] + + +ValidToolOutputPydanticModels = Union[ToolOutputText, ToolOutputImage, ToolOutputFileContent] +ValidToolOutputPydanticModelsTypeAdapter: TypeAdapter[ValidToolOutputPydanticModels] = TypeAdapter( + ValidToolOutputPydanticModels +) + + @dataclass class FunctionToolResult: tool: FunctionTool @@ -78,7 +162,9 @@ class FunctionTool: 1. The tool run context. 2. The arguments from the LLM, as a JSON string. - You must return a string representation of the tool output, or something we can call `str()` on. + You must return a one of the structured tool output types (e.g. ToolOutputText, ToolOutputImage, + ToolOutputFileContent) or a string representation of the tool output, or a list of them, + or something we can call `str()` on. In case of errors, you can either raise an Exception (which will cause the run to fail) or return a string error message (which will be sent back to the LLM). """ @@ -92,6 +178,17 @@ class FunctionTool: and returns whether the tool is enabled. You can use this to dynamically enable/disable a tool based on your context/state.""" + # Tool-specific guardrails + tool_input_guardrails: list[ToolInputGuardrail[Any]] | None = None + """Optional list of input guardrails to run before invoking this tool.""" + + tool_output_guardrails: list[ToolOutputGuardrail[Any]] | None = None + """Optional list of output guardrails to run after invoking this tool.""" + + def __post_init__(self): + if self.strict_json_schema: + self.params_json_schema = ensure_strict_json_schema(self.params_json_schema) + @dataclass class FileSearchTool: @@ -128,12 +225,15 @@ class WebSearchTool: user_location: UserLocation | None = None """Optional location for the search. Lets you customize results to be relevant to a location.""" + filters: WebSearchToolFilters | None = None + """A filter to apply based on file attributes.""" + search_context_size: Literal["low", "medium", "high"] = "medium" """The amount of context to use for the search.""" @property def name(self): - return "web_search_preview" + return "web_search" @dataclass @@ -259,7 +359,11 @@ class LocalShellCommandRequest: @dataclass class LocalShellTool: - """A tool that allows the LLM to execute commands on a shell.""" + """A tool that allows the LLM to execute commands on a shell. + + For more details, see: + https://platform.openai.com/docs/guides/tools-local-shell + """ executor: LocalShellExecutor """A function that executes a command on a shell.""" diff --git a/src/agents/tool_context.py b/src/agents/tool_context.py index 16845badd..5b81239f6 100644 --- a/src/agents/tool_context.py +++ b/src/agents/tool_context.py @@ -14,6 +14,10 @@ def _assert_must_pass_tool_name() -> str: raise ValueError("tool_name must be passed to ToolContext") +def _assert_must_pass_tool_arguments() -> str: + raise ValueError("tool_arguments must be passed to ToolContext") + + @dataclass class ToolContext(RunContextWrapper[TContext]): """The context of a tool call.""" @@ -24,6 +28,9 @@ class ToolContext(RunContextWrapper[TContext]): tool_call_id: str = field(default_factory=_assert_must_pass_tool_call_id) """The ID of the tool call.""" + tool_arguments: str = field(default_factory=_assert_must_pass_tool_arguments) + """The raw arguments string of the tool call.""" + @classmethod def from_agent_context( cls, @@ -39,4 +46,10 @@ def from_agent_context( f.name: getattr(context, f.name) for f in fields(RunContextWrapper) if f.init } tool_name = tool_call.name if tool_call is not None else _assert_must_pass_tool_name() - return cls(tool_name=tool_name, tool_call_id=tool_call_id, **base_values) + tool_args = ( + tool_call.arguments if tool_call is not None else _assert_must_pass_tool_arguments() + ) + + return cls( + tool_name=tool_name, tool_call_id=tool_call_id, tool_arguments=tool_args, **base_values + ) diff --git a/src/agents/tool_guardrails.py b/src/agents/tool_guardrails.py new file mode 100644 index 000000000..545a11761 --- /dev/null +++ b/src/agents/tool_guardrails.py @@ -0,0 +1,279 @@ +from __future__ import annotations + +import inspect +from collections.abc import Awaitable +from dataclasses import dataclass, field +from typing import TYPE_CHECKING, Any, Callable, Generic, Literal, overload + +from typing_extensions import TypedDict, TypeVar + +from .exceptions import UserError +from .tool_context import ToolContext +from .util._types import MaybeAwaitable + +if TYPE_CHECKING: + from .agent import Agent + + +@dataclass +class ToolInputGuardrailResult: + """The result of a tool input guardrail run.""" + + guardrail: ToolInputGuardrail[Any] + """The guardrail that was run.""" + + output: ToolGuardrailFunctionOutput + """The output of the guardrail function.""" + + +@dataclass +class ToolOutputGuardrailResult: + """The result of a tool output guardrail run.""" + + guardrail: ToolOutputGuardrail[Any] + """The guardrail that was run.""" + + output: ToolGuardrailFunctionOutput + """The output of the guardrail function.""" + + +class RejectContentBehavior(TypedDict): + """Rejects the tool call/output but continues execution with a message to the model.""" + + type: Literal["reject_content"] + message: str + + +class RaiseExceptionBehavior(TypedDict): + """Raises an exception to halt execution.""" + + type: Literal["raise_exception"] + + +class AllowBehavior(TypedDict): + """Allows normal tool execution to continue.""" + + type: Literal["allow"] + + +@dataclass +class ToolGuardrailFunctionOutput: + """The output of a tool guardrail function.""" + + output_info: Any + """ + Optional data about checks performed. For example, the guardrail could include + information about the checks it performed and granular results. + """ + + behavior: RejectContentBehavior | RaiseExceptionBehavior | AllowBehavior = field( + default_factory=lambda: AllowBehavior(type="allow") + ) + """ + Defines how the system should respond when this guardrail result is processed. + - allow: Allow normal tool execution to continue without interference (default) + - reject_content: Reject the tool call/output but continue execution with a message to the model + - raise_exception: Halt execution by raising a ToolGuardrailTripwireTriggered exception + """ + + @classmethod + def allow(cls, output_info: Any = None) -> ToolGuardrailFunctionOutput: + """Create a guardrail output that allows the tool execution to continue normally. + + Args: + output_info: Optional data about checks performed. + + Returns: + ToolGuardrailFunctionOutput configured to allow normal execution. + """ + return cls(output_info=output_info, behavior=AllowBehavior(type="allow")) + + @classmethod + def reject_content(cls, message: str, output_info: Any = None) -> ToolGuardrailFunctionOutput: + """Create a guardrail output that rejects the tool call/output but continues execution. + + Args: + message: Message to send to the model instead of the tool result. + output_info: Optional data about checks performed. + + Returns: + ToolGuardrailFunctionOutput configured to reject the content. + """ + return cls( + output_info=output_info, + behavior=RejectContentBehavior(type="reject_content", message=message), + ) + + @classmethod + def raise_exception(cls, output_info: Any = None) -> ToolGuardrailFunctionOutput: + """Create a guardrail output that raises an exception to halt execution. + + Args: + output_info: Optional data about checks performed. + + Returns: + ToolGuardrailFunctionOutput configured to raise an exception. + """ + return cls(output_info=output_info, behavior=RaiseExceptionBehavior(type="raise_exception")) + + +@dataclass +class ToolInputGuardrailData: + """Input data passed to a tool input guardrail function.""" + + context: ToolContext[Any] + """ + The tool context containing information about the current tool execution. + """ + + agent: Agent[Any] + """ + The agent that is executing the tool. + """ + + +@dataclass +class ToolOutputGuardrailData(ToolInputGuardrailData): + """Input data passed to a tool output guardrail function. + + Extends input data with the tool's output. + """ + + output: Any + """ + The output produced by the tool function. + """ + + +TContext_co = TypeVar("TContext_co", bound=Any, covariant=True) + + +@dataclass +class ToolInputGuardrail(Generic[TContext_co]): + """A guardrail that runs before a function tool is invoked.""" + + guardrail_function: Callable[ + [ToolInputGuardrailData], MaybeAwaitable[ToolGuardrailFunctionOutput] + ] + """ + The function that implements the guardrail logic. + """ + + name: str | None = None + """ + Optional name for the guardrail. If not provided, uses the function name. + """ + + def get_name(self) -> str: + return self.name or self.guardrail_function.__name__ + + async def run(self, data: ToolInputGuardrailData) -> ToolGuardrailFunctionOutput: + if not callable(self.guardrail_function): + raise UserError(f"Guardrail function must be callable, got {self.guardrail_function}") + + result = self.guardrail_function(data) + if inspect.isawaitable(result): + return await result + return result + + +@dataclass +class ToolOutputGuardrail(Generic[TContext_co]): + """A guardrail that runs after a function tool is invoked.""" + + guardrail_function: Callable[ + [ToolOutputGuardrailData], MaybeAwaitable[ToolGuardrailFunctionOutput] + ] + """ + The function that implements the guardrail logic. + """ + + name: str | None = None + """ + Optional name for the guardrail. If not provided, uses the function name. + """ + + def get_name(self) -> str: + return self.name or self.guardrail_function.__name__ + + async def run(self, data: ToolOutputGuardrailData) -> ToolGuardrailFunctionOutput: + if not callable(self.guardrail_function): + raise UserError(f"Guardrail function must be callable, got {self.guardrail_function}") + + result = self.guardrail_function(data) + if inspect.isawaitable(result): + return await result + return result + + +# Decorators +_ToolInputFuncSync = Callable[[ToolInputGuardrailData], ToolGuardrailFunctionOutput] +_ToolInputFuncAsync = Callable[[ToolInputGuardrailData], Awaitable[ToolGuardrailFunctionOutput]] + + +@overload +def tool_input_guardrail(func: _ToolInputFuncSync): ... + + +@overload +def tool_input_guardrail(func: _ToolInputFuncAsync): ... + + +@overload +def tool_input_guardrail( + *, name: str | None = None +) -> Callable[[_ToolInputFuncSync | _ToolInputFuncAsync], ToolInputGuardrail[Any]]: ... + + +def tool_input_guardrail( + func: _ToolInputFuncSync | _ToolInputFuncAsync | None = None, + *, + name: str | None = None, +) -> ( + ToolInputGuardrail[Any] + | Callable[[_ToolInputFuncSync | _ToolInputFuncAsync], ToolInputGuardrail[Any]] +): + """Decorator to create a ToolInputGuardrail from a function.""" + + def decorator(f: _ToolInputFuncSync | _ToolInputFuncAsync) -> ToolInputGuardrail[Any]: + return ToolInputGuardrail(guardrail_function=f, name=name or f.__name__) + + if func is not None: + return decorator(func) + return decorator + + +_ToolOutputFuncSync = Callable[[ToolOutputGuardrailData], ToolGuardrailFunctionOutput] +_ToolOutputFuncAsync = Callable[[ToolOutputGuardrailData], Awaitable[ToolGuardrailFunctionOutput]] + + +@overload +def tool_output_guardrail(func: _ToolOutputFuncSync): ... + + +@overload +def tool_output_guardrail(func: _ToolOutputFuncAsync): ... + + +@overload +def tool_output_guardrail( + *, name: str | None = None +) -> Callable[[_ToolOutputFuncSync | _ToolOutputFuncAsync], ToolOutputGuardrail[Any]]: ... + + +def tool_output_guardrail( + func: _ToolOutputFuncSync | _ToolOutputFuncAsync | None = None, + *, + name: str | None = None, +) -> ( + ToolOutputGuardrail[Any] + | Callable[[_ToolOutputFuncSync | _ToolOutputFuncAsync], ToolOutputGuardrail[Any]] +): + """Decorator to create a ToolOutputGuardrail from a function.""" + + def decorator(f: _ToolOutputFuncSync | _ToolOutputFuncAsync) -> ToolOutputGuardrail[Any]: + return ToolOutputGuardrail(guardrail_function=f, name=name or f.__name__) + + if func is not None: + return decorator(func) + return decorator diff --git a/src/agents/tracing/create.py b/src/agents/tracing/create.py index ac451abf5..9e2b27ca3 100644 --- a/src/agents/tracing/create.py +++ b/src/agents/tracing/create.py @@ -50,8 +50,7 @@ def trace( group_id: Optional grouping identifier to link multiple traces from the same conversation or process. For instance, you might use a chat thread ID. metadata: Optional dictionary of additional metadata to attach to the trace. - disabled: If True, we will return a Trace but the Trace will not be recorded. This will - not be checked if there's an existing trace and `even_if_trace_running` is True. + disabled: If True, we will return a Trace but the Trace will not be recorded. Returns: The newly created trace object. diff --git a/src/agents/tracing/processor_interface.py b/src/agents/tracing/processor_interface.py index 0a05bcae2..d0f18bde3 100644 --- a/src/agents/tracing/processor_interface.py +++ b/src/agents/tracing/processor_interface.py @@ -7,52 +7,125 @@ class TracingProcessor(abc.ABC): - """Interface for processing spans.""" + """Interface for processing and monitoring traces and spans in the OpenAI Agents system. + + This abstract class defines the interface that all tracing processors must implement. + Processors receive notifications when traces and spans start and end, allowing them + to collect, process, and export tracing data. + + Example: + ```python + class CustomProcessor(TracingProcessor): + def __init__(self): + self.active_traces = {} + self.active_spans = {} + + def on_trace_start(self, trace): + self.active_traces[trace.trace_id] = trace + + def on_trace_end(self, trace): + # Process completed trace + del self.active_traces[trace.trace_id] + + def on_span_start(self, span): + self.active_spans[span.span_id] = span + + def on_span_end(self, span): + # Process completed span + del self.active_spans[span.span_id] + + def shutdown(self): + # Clean up resources + self.active_traces.clear() + self.active_spans.clear() + + def force_flush(self): + # Force processing of any queued items + pass + ``` + + Notes: + - All methods should be thread-safe + - Methods should not block for long periods + - Handle errors gracefully to prevent disrupting agent execution + """ @abc.abstractmethod def on_trace_start(self, trace: "Trace") -> None: - """Called when a trace is started. + """Called when a new trace begins execution. Args: - trace: The trace that started. + trace: The trace that started. Contains workflow name and metadata. + + Notes: + - Called synchronously on trace start + - Should return quickly to avoid blocking execution + - Any errors should be caught and handled internally """ pass @abc.abstractmethod def on_trace_end(self, trace: "Trace") -> None: - """Called when a trace is finished. + """Called when a trace completes execution. Args: - trace: The trace that finished. + trace: The completed trace containing all spans and results. + + Notes: + - Called synchronously when trace finishes + - Good time to export/process the complete trace + - Should handle cleanup of any trace-specific resources """ pass @abc.abstractmethod def on_span_start(self, span: "Span[Any]") -> None: - """Called when a span is started. + """Called when a new span begins execution. Args: - span: The span that started. + span: The span that started. Contains operation details and context. + + Notes: + - Called synchronously on span start + - Should return quickly to avoid blocking execution + - Spans are automatically nested under current trace/span """ pass @abc.abstractmethod def on_span_end(self, span: "Span[Any]") -> None: - """Called when a span is finished. Should not block or raise exceptions. + """Called when a span completes execution. Args: - span: The span that finished. + span: The completed span containing execution results. + + Notes: + - Called synchronously when span finishes + - Should not block or raise exceptions + - Good time to export/process the individual span """ pass @abc.abstractmethod def shutdown(self) -> None: - """Called when the application stops.""" + """Called when the application stops to clean up resources. + + Should perform any necessary cleanup like: + - Flushing queued traces/spans + - Closing connections + - Releasing resources + """ pass @abc.abstractmethod def force_flush(self) -> None: - """Forces an immediate flush of all queued spans/traces.""" + """Forces immediate processing of any queued traces/spans. + + Notes: + - Should process all queued items before returning + - Useful before shutdown or when immediate processing is needed + - May block while processing completes + """ pass diff --git a/src/agents/tracing/processors.py b/src/agents/tracing/processors.py index 73f733125..126c71498 100644 --- a/src/agents/tracing/processors.py +++ b/src/agents/tracing/processors.py @@ -22,7 +22,7 @@ class ConsoleSpanExporter(TracingExporter): def export(self, items: list[Trace | Span[Any]]) -> None: for item in items: if isinstance(item, Trace): - print(f"[Exporter] Export trace_id={item.trace_id}, name={item.name}, ") + print(f"[Exporter] Export trace_id={item.trace_id}, name={item.name}") else: print(f"[Exporter] Export span: {item.export()}") @@ -69,9 +69,12 @@ def set_api_key(self, api_key: str): api_key: The OpenAI API key to use. This is the same key used by the OpenAI Python client. """ - # We're specifically setting the underlying cached property as well + # Clear the cached property if it exists + if "api_key" in self.__dict__: + del self.__dict__["api_key"] + + # Update the private attribute self._api_key = api_key - self.api_key = api_key @cached_property def api_key(self): @@ -121,7 +124,7 @@ def export(self, items: list[Trace | Span[Any]]) -> None: logger.debug(f"Exported {len(items)} items") return - # If the response is a client error (4xx), we wont retry + # If the response is a client error (4xx), we won't retry if 400 <= response.status_code < 500: logger.error( f"[non-fatal] Tracing client error {response.status_code}: {response.text}" @@ -183,7 +186,7 @@ def __init__( self._shutdown_event = threading.Event() # The queue size threshold at which we export immediately. - self._export_trigger_size = int(max_queue_size * export_trigger_ratio) + self._export_trigger_size = max(1, int(max_queue_size * export_trigger_ratio)) # Track when we next *must* perform a scheduled export self._next_export_time = time.time() + self._schedule_delay @@ -269,8 +272,7 @@ def _run(self): def _export_batches(self, force: bool = False): """Drains the queue and exports in batches. If force=True, export everything. - Otherwise, export up to `max_batch_size` repeatedly until the queue is empty or below a - certain threshold. + Otherwise, export up to `max_batch_size` repeatedly until the queue is completely empty. """ while True: items_to_export: list[Span[Any] | Trace] = [] diff --git a/src/agents/tracing/provider.py b/src/agents/tracing/provider.py index 38d3b7ab3..9805a0b68 100644 --- a/src/agents/tracing/provider.py +++ b/src/agents/tracing/provider.py @@ -43,28 +43,40 @@ def on_trace_start(self, trace: Trace) -> None: Called when a trace is started. """ for processor in self._processors: - processor.on_trace_start(trace) + try: + processor.on_trace_start(trace) + except Exception as e: + logger.error(f"Error in trace processor {processor} during on_trace_start: {e}") def on_trace_end(self, trace: Trace) -> None: """ Called when a trace is finished. """ for processor in self._processors: - processor.on_trace_end(trace) + try: + processor.on_trace_end(trace) + except Exception as e: + logger.error(f"Error in trace processor {processor} during on_trace_end: {e}") def on_span_start(self, span: Span[Any]) -> None: """ Called when a span is started. """ for processor in self._processors: - processor.on_span_start(span) + try: + processor.on_span_start(span) + except Exception as e: + logger.error(f"Error in trace processor {processor} during on_span_start: {e}") def on_span_end(self, span: Span[Any]) -> None: """ Called when a span is finished. """ for processor in self._processors: - processor.on_span_end(span) + try: + processor.on_span_end(span) + except Exception as e: + logger.error(f"Error in trace processor {processor} during on_span_end: {e}") def shutdown(self) -> None: """ @@ -72,14 +84,20 @@ def shutdown(self) -> None: """ for processor in self._processors: logger.debug(f"Shutting down trace processor {processor}") - processor.shutdown() + try: + processor.shutdown() + except Exception as e: + logger.error(f"Error shutting down trace processor {processor}: {e}") def force_flush(self): """ Force the processors to flush their buffers. """ for processor in self._processors: - processor.force_flush() + try: + processor.force_flush() + except Exception as e: + logger.error(f"Error flushing trace processor {processor}: {e}") class TraceProvider(ABC): @@ -247,7 +265,7 @@ def create_span( current_trace = Scope.get_current_trace() if current_trace is None: logger.error( - "No active trace. Make sure to start a trace with `trace()` first" + "No active trace. Make sure to start a trace with `trace()` first " "Returning NoOpSpan." ) return NoOpSpan(span_data) diff --git a/src/agents/tracing/spans.py b/src/agents/tracing/spans.py index ee933e730..dbde6f9ec 100644 --- a/src/agents/tracing/spans.py +++ b/src/agents/tracing/spans.py @@ -16,24 +16,84 @@ class SpanError(TypedDict): + """Represents an error that occurred during span execution. + + Attributes: + message: A human-readable error description + data: Optional dictionary containing additional error context + """ + message: str data: dict[str, Any] | None class Span(abc.ABC, Generic[TSpanData]): + """Base class for representing traceable operations with timing and context. + + A span represents a single operation within a trace (e.g., an LLM call, tool execution, + or agent run). Spans track timing, relationships between operations, and operation-specific + data. + + Type Args: + TSpanData: The type of span-specific data this span contains. + + Example: + ```python + # Creating a custom span + with custom_span("database_query", { + "operation": "SELECT", + "table": "users" + }) as span: + results = await db.query("SELECT * FROM users") + span.set_output({"count": len(results)}) + + # Handling errors in spans + with custom_span("risky_operation") as span: + try: + result = perform_risky_operation() + except Exception as e: + span.set_error({ + "message": str(e), + "data": {"operation": "risky_operation"} + }) + raise + ``` + + Notes: + - Spans automatically nest under the current trace + - Use context managers for reliable start/finish + - Include relevant data but avoid sensitive information + - Handle errors properly using set_error() + """ + @property @abc.abstractmethod def trace_id(self) -> str: + """The ID of the trace this span belongs to. + + Returns: + str: Unique identifier of the parent trace. + """ pass @property @abc.abstractmethod def span_id(self) -> str: + """Unique identifier for this span. + + Returns: + str: The span's unique ID within its trace. + """ pass @property @abc.abstractmethod def span_data(self) -> TSpanData: + """Operation-specific data for this span. + + Returns: + TSpanData: Data specific to this type of span (e.g., LLM generation data). + """ pass @abc.abstractmethod @@ -67,6 +127,11 @@ def __exit__(self, exc_type, exc_val, exc_tb): @property @abc.abstractmethod def parent_id(self) -> str | None: + """ID of the parent span, if any. + + Returns: + str | None: The parent span's ID, or None if this is a root span. + """ pass @abc.abstractmethod @@ -76,6 +141,11 @@ def set_error(self, error: SpanError) -> None: @property @abc.abstractmethod def error(self) -> SpanError | None: + """Any error that occurred during span execution. + + Returns: + SpanError | None: Error details if an error occurred, None otherwise. + """ pass @abc.abstractmethod @@ -85,15 +155,33 @@ def export(self) -> dict[str, Any] | None: @property @abc.abstractmethod def started_at(self) -> str | None: + """When the span started execution. + + Returns: + str | None: ISO format timestamp of span start, None if not started. + """ pass @property @abc.abstractmethod def ended_at(self) -> str | None: + """When the span finished execution. + + Returns: + str | None: ISO format timestamp of span end, None if not finished. + """ pass class NoOpSpan(Span[TSpanData]): + """A no-op implementation of Span that doesn't record any data. + + Used when tracing is disabled but span operations still need to work. + + Args: + span_data: The operation-specific data for this span. + """ + __slots__ = ("_span_data", "_prev_span_token") def __init__(self, span_data: TSpanData): diff --git a/src/agents/tracing/traces.py b/src/agents/tracing/traces.py index 53d062846..ff286de4f 100644 --- a/src/agents/tracing/traces.py +++ b/src/agents/tracing/traces.py @@ -10,9 +10,36 @@ from .scope import Scope -class Trace: - """ - A trace is the root level object that tracing creates. It represents a logical "workflow". +class Trace(abc.ABC): + """A complete end-to-end workflow containing related spans and metadata. + + A trace represents a logical workflow or operation (e.g., "Customer Service Query" + or "Code Generation") and contains all the spans (individual operations) that occur + during that workflow. + + Example: + ```python + # Basic trace usage + with trace("Order Processing") as t: + validation_result = await Runner.run(validator, order_data) + if validation_result.approved: + await Runner.run(processor, order_data) + + # Trace with metadata and grouping + with trace( + "Customer Service", + group_id="chat_123", + metadata={"customer": "user_456"} + ) as t: + result = await Runner.run(support_agent, query) + ``` + + Notes: + - Use descriptive workflow names + - Group related traces with consistent group_ids + - Add relevant metadata for filtering/analysis + - Use context managers for reliable cleanup + - Consider privacy when adding trace data """ @abc.abstractmethod @@ -25,51 +52,92 @@ def __exit__(self, exc_type, exc_val, exc_tb): @abc.abstractmethod def start(self, mark_as_current: bool = False): - """ - Start the trace. + """Start the trace and optionally mark it as the current trace. Args: - mark_as_current: If true, the trace will be marked as the current trace. + mark_as_current: If true, marks this trace as the current trace + in the execution context. + + Notes: + - Must be called before any spans can be added + - Only one trace can be current at a time + - Thread-safe when using mark_as_current """ pass @abc.abstractmethod def finish(self, reset_current: bool = False): - """ - Finish the trace. + """Finish the trace and optionally reset the current trace. Args: - reset_current: If true, the trace will be reset as the current trace. + reset_current: If true, resets the current trace to the previous + trace in the execution context. + + Notes: + - Must be called to complete the trace + - Finalizes all open spans + - Thread-safe when using reset_current """ pass @property @abc.abstractmethod def trace_id(self) -> str: - """ - The trace ID. + """Get the unique identifier for this trace. + + Returns: + str: The trace's unique ID in the format 'trace_<32_alphanumeric>' + + Notes: + - IDs are globally unique + - Used to link spans to their parent trace + - Can be used to look up traces in the dashboard """ pass @property @abc.abstractmethod def name(self) -> str: - """ - The name of the workflow being traced. + """Get the human-readable name of this workflow trace. + + Returns: + str: The workflow name (e.g., "Customer Service", "Data Processing") + + Notes: + - Should be descriptive and meaningful + - Used for grouping and filtering in the dashboard + - Helps identify the purpose of the trace """ pass @abc.abstractmethod def export(self) -> dict[str, Any] | None: - """ - Export the trace as a dictionary. + """Export the trace data as a serializable dictionary. + + Returns: + dict | None: Dictionary containing trace data, or None if tracing is disabled. + + Notes: + - Includes all spans and their data + - Used for sending traces to backends + - May include metadata and group ID """ pass class NoOpTrace(Trace): - """ - A no-op trace that will not be recorded. + """A no-op implementation of Trace that doesn't record any data. + + Used when tracing is disabled but trace operations still need to work. + Maintains proper context management but doesn't store or export any data. + + Example: + ```python + # When tracing is disabled, traces become NoOpTrace + with trace("Disabled Workflow") as t: + # Operations still work but nothing is recorded + await Runner.run(agent, "query") + ``` """ def __init__(self): @@ -101,13 +169,28 @@ def finish(self, reset_current: bool = False): @property def trace_id(self) -> str: + """The trace's unique identifier. + + Returns: + str: A unique ID for this trace. + """ return "no-op" @property def name(self) -> str: + """The workflow name for this trace. + + Returns: + str: Human-readable name describing this workflow. + """ return "no-op" def export(self) -> dict[str, Any] | None: + """Export the trace data as a dictionary. + + Returns: + dict | None: Trace data in exportable format, or None if no data. + """ return None diff --git a/src/agents/usage.py b/src/agents/usage.py index 843f62937..3639cf944 100644 --- a/src/agents/usage.py +++ b/src/agents/usage.py @@ -1,6 +1,7 @@ -from dataclasses import dataclass, field +from dataclasses import field from openai.types.responses.response_usage import InputTokensDetails, OutputTokensDetails +from pydantic.dataclasses import dataclass @dataclass diff --git a/src/agents/util/_json.py b/src/agents/util/_json.py index 1e081f68b..0f9319656 100644 --- a/src/agents/util/_json.py +++ b/src/agents/util/_json.py @@ -1,6 +1,7 @@ from __future__ import annotations -from typing import Literal +from collections.abc import Iterable +from typing import Any, Literal from pydantic import TypeAdapter, ValidationError from typing_extensions import TypeVar @@ -29,3 +30,20 @@ def validate_json(json_str: str, type_adapter: TypeAdapter[T], partial: bool) -> raise ModelBehaviorError( f"Invalid JSON when parsing {json_str} for {type_adapter}; {e}" ) from e + + +def _to_dump_compatible(obj: Any) -> Any: + return _to_dump_compatible_internal(obj) + + +def _to_dump_compatible_internal(obj: Any) -> Any: + if isinstance(obj, dict): + return {k: _to_dump_compatible_internal(v) for k, v in obj.items()} + + if isinstance(obj, (list, tuple)): + return [_to_dump_compatible_internal(x) for x in obj] + + if isinstance(obj, Iterable) and not isinstance(obj, (str, bytes, bytearray)): + return [_to_dump_compatible_internal(x) for x in obj] + + return obj diff --git a/src/agents/util/_transforms.py b/src/agents/util/_transforms.py index b303074d6..2ab07f3de 100644 --- a/src/agents/util/_transforms.py +++ b/src/agents/util/_transforms.py @@ -1,11 +1,21 @@ import re +from ..logger import logger + def transform_string_function_style(name: str) -> str: # Replace spaces with underscores name = name.replace(" ", "_") # Replace non-alphanumeric characters with underscores - name = re.sub(r"[^a-zA-Z0-9]", "_", name) + transformed_name = re.sub(r"[^a-zA-Z0-9_]", "_", name) + + if transformed_name != name: + final_name = transformed_name.lower() + logger.warning( + f"Tool name {name!r} contains invalid characters for function calling and has been " + f"transformed to {final_name!r}. Please use only letters, digits, and underscores " + "to avoid potential naming conflicts." + ) - return name.lower() + return transformed_name.lower() diff --git a/src/agents/voice/input.py b/src/agents/voice/input.py index 8613d27ac..d59ceea21 100644 --- a/src/agents/voice/input.py +++ b/src/agents/voice/input.py @@ -13,7 +13,7 @@ def _buffer_to_audio_file( - buffer: npt.NDArray[np.int16 | np.float32], + buffer: npt.NDArray[np.int16 | np.float32 | np.float64], frame_rate: int = DEFAULT_SAMPLE_RATE, sample_width: int = 2, channels: int = 1, @@ -77,12 +77,13 @@ class StreamedAudioInput: """ def __init__(self): - self.queue: asyncio.Queue[npt.NDArray[np.int16 | np.float32]] = asyncio.Queue() + self.queue: asyncio.Queue[npt.NDArray[np.int16 | np.float32] | None] = asyncio.Queue() - async def add_audio(self, audio: npt.NDArray[np.int16 | np.float32]): + async def add_audio(self, audio: npt.NDArray[np.int16 | np.float32] | None): """Adds more audio data to the stream. Args: - audio: The audio data to add. Must be a numpy array of int16 or float32. + audio: The audio data to add. Must be a numpy array of int16 or float32 or None. + If None passed, it indicates the end of the stream. """ await self.queue.put(audio) diff --git a/src/agents/voice/models/openai_stt.py b/src/agents/voice/models/openai_stt.py index b1f1b6da7..7ac008428 100644 --- a/src/agents/voice/models/openai_stt.py +++ b/src/agents/voice/models/openai_stt.py @@ -88,7 +88,7 @@ def __init__( self._trace_include_sensitive_data = trace_include_sensitive_data self._trace_include_sensitive_audio_data = trace_include_sensitive_audio_data - self._input_queue: asyncio.Queue[npt.NDArray[np.int16 | np.float32]] = input.queue + self._input_queue: asyncio.Queue[npt.NDArray[np.int16 | np.float32] | None] = input.queue self._output_queue: asyncio.Queue[str | ErrorSentinel | SessionCompleteSentinel] = ( asyncio.Queue() ) @@ -122,7 +122,8 @@ def _end_turn(self, _transcript: str) -> None: return if self._tracing_span: - if self._trace_include_sensitive_audio_data: + # Only encode audio if tracing is enabled AND buffer is not empty + if self._trace_include_sensitive_audio_data and self._turn_audio_buffer: self._tracing_span.span_data.input = _audio_to_base64(self._turn_audio_buffer) self._tracing_span.span_data.input_format = "pcm" @@ -163,11 +164,16 @@ async def _configure_session(self) -> None: await self._websocket.send( json.dumps( { - "type": "transcription_session.update", + "type": "session.update", "session": { - "input_audio_format": "pcm16", - "input_audio_transcription": {"model": self._model}, - "turn_detection": self._turn_detection, + "type": "transcription", + "audio": { + "input": { + "format": {"type": "audio/pcm", "rate": 24000}, + "transcription": {"model": self._model}, + "turn_detection": self._turn_detection, + } + }, }, } ) @@ -226,7 +232,10 @@ async def _handle_events(self) -> None: break event_type = event.get("type", "unknown") - if event_type == "input_audio_transcription_completed": + if event_type in [ + "input_audio_transcription_completed", # legacy + "conversation.item.input_audio_transcription.completed", + ]: transcript = cast(str, event.get("transcript", "")) if len(transcript) > 0: self._end_turn(transcript) @@ -242,7 +251,7 @@ async def _handle_events(self) -> None: await self._output_queue.put(SessionCompleteSentinel()) async def _stream_audio( - self, audio_queue: asyncio.Queue[npt.NDArray[np.int16 | np.float32]] + self, audio_queue: asyncio.Queue[npt.NDArray[np.int16 | np.float32] | None] ) -> None: assert self._websocket is not None, "Websocket not initialized" self._start_turn() @@ -275,7 +284,6 @@ async def _process_websocket_connection(self) -> None: "wss://api.openai.com/v1/realtime?intent=transcription", additional_headers={ "Authorization": f"Bearer {self._client.api_key}", - "OpenAI-Beta": "realtime=v1", "OpenAI-Log-Session": "1", }, ) as ws: diff --git a/tests/conftest.py b/tests/conftest.py index b73d734d1..1e11e086a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -18,6 +18,17 @@ def setup_span_processor(): set_trace_processors([SPAN_PROCESSOR_TESTING]) +# Ensure a default OpenAI API key is present for tests that construct clients +# without explicitly configuring a key/client. Tests that need no key use +# monkeypatch.delenv("OPENAI_API_KEY", ...) to remove it locally. +@pytest.fixture(scope="session", autouse=True) +def ensure_openai_api_key(): + import os + + if not os.environ.get("OPENAI_API_KEY"): + os.environ["OPENAI_API_KEY"] = "test_key" + + # This fixture will run before each test @pytest.fixture(autouse=True) def clear_span_processor(): diff --git a/tests/extensions/memory/test_advanced_sqlite_session.py b/tests/extensions/memory/test_advanced_sqlite_session.py new file mode 100644 index 000000000..40edb99fe --- /dev/null +++ b/tests/extensions/memory/test_advanced_sqlite_session.py @@ -0,0 +1,988 @@ +"""Tests for AdvancedSQLiteSession functionality.""" + +from typing import Any, Optional, cast + +import pytest + +pytest.importorskip("sqlalchemy") # Skip tests if SQLAlchemy is not installed +from openai.types.responses.response_usage import InputTokensDetails, OutputTokensDetails + +from agents import Agent, Runner, TResponseInputItem, function_tool +from agents.extensions.memory import AdvancedSQLiteSession +from agents.result import RunResult +from agents.run_context import RunContextWrapper +from agents.usage import Usage +from tests.fake_model import FakeModel +from tests.test_responses import get_text_message + +# Mark all tests in this file as asyncio +pytestmark = pytest.mark.asyncio + + +@function_tool +async def test_tool(query: str) -> str: + """A test tool for testing tool call tracking.""" + return f"Tool result for: {query}" + + +@pytest.fixture +def agent() -> Agent: + """Fixture for a basic agent with a fake model.""" + return Agent(name="test", model=FakeModel(), tools=[test_tool]) + + +@pytest.fixture +def usage_data() -> Usage: + """Fixture for test usage data.""" + return Usage( + requests=1, + input_tokens=50, + output_tokens=30, + total_tokens=80, + input_tokens_details=InputTokensDetails(cached_tokens=10), + output_tokens_details=OutputTokensDetails(reasoning_tokens=5), + ) + + +def create_mock_run_result( + usage: Optional[Usage] = None, agent: Optional[Agent] = None +) -> RunResult: + """Helper function to create a mock RunResult for testing.""" + if agent is None: + agent = Agent(name="test", model=FakeModel()) + + if usage is None: + usage = Usage( + requests=1, + input_tokens=50, + output_tokens=30, + total_tokens=80, + input_tokens_details=InputTokensDetails(cached_tokens=10), + output_tokens_details=OutputTokensDetails(reasoning_tokens=5), + ) + + context_wrapper = RunContextWrapper(context=None, usage=usage) + + return RunResult( + input="test input", + new_items=[], + raw_responses=[], + final_output="test output", + input_guardrail_results=[], + output_guardrail_results=[], + tool_input_guardrail_results=[], + tool_output_guardrail_results=[], + context_wrapper=context_wrapper, + _last_agent=agent, + ) + + +async def test_advanced_session_basic_functionality(agent: Agent): + """Test basic AdvancedSQLiteSession functionality.""" + session_id = "advanced_test" + session = AdvancedSQLiteSession(session_id=session_id, create_tables=True) + + # Test basic session operations work + items: list[TResponseInputItem] = [ + {"role": "user", "content": "Hello"}, + {"role": "assistant", "content": "Hi there!"}, + ] + await session.add_items(items) + + # Get items and verify + retrieved = await session.get_items() + assert len(retrieved) == 2 + assert retrieved[0].get("content") == "Hello" + assert retrieved[1].get("content") == "Hi there!" + + session.close() + + +async def test_message_structure_tracking(agent: Agent): + """Test that message structure is properly tracked.""" + session_id = "structure_test" + session = AdvancedSQLiteSession(session_id=session_id, create_tables=True) + + # Add various types of messages + items: list[TResponseInputItem] = [ + {"role": "user", "content": "What's 2+2?"}, + {"type": "function_call", "name": "calculator", "arguments": '{"expression": "2+2"}'}, # type: ignore + {"type": "function_call_output", "output": "4"}, # type: ignore + {"role": "assistant", "content": "The answer is 4"}, + {"type": "reasoning", "summary": [{"text": "Simple math", "type": "summary_text"}]}, # type: ignore + ] + await session.add_items(items) + + # Get conversation structure + conversation_turns = await session.get_conversation_by_turns() + assert len(conversation_turns) == 1 # Should be one user turn + + turn_1_items = conversation_turns[1] + assert len(turn_1_items) == 5 + + # Verify item types are classified correctly + item_types = [item["type"] for item in turn_1_items] + assert "user" in item_types + assert "function_call" in item_types + assert "function_call_output" in item_types + assert "assistant" in item_types + assert "reasoning" in item_types + + session.close() + + +async def test_tool_usage_tracking(agent: Agent): + """Test tool usage tracking functionality.""" + session_id = "tools_test" + session = AdvancedSQLiteSession(session_id=session_id, create_tables=True) + + # Add items with tool calls + items: list[TResponseInputItem] = [ + {"role": "user", "content": "Search for cats"}, + {"type": "function_call", "name": "web_search", "arguments": '{"query": "cats"}'}, # type: ignore + {"type": "function_call_output", "output": "Found cat information"}, # type: ignore + {"type": "function_call", "name": "calculator", "arguments": '{"expression": "1+1"}'}, # type: ignore + {"type": "function_call_output", "output": "2"}, # type: ignore + {"role": "assistant", "content": "I found information about cats and calculated 1+1=2"}, + ] + await session.add_items(items) + + # Get tool usage + tool_usage = await session.get_tool_usage() + assert len(tool_usage) == 2 # Two different tools used + + tool_names = {usage[0] for usage in tool_usage} + assert "web_search" in tool_names + assert "calculator" in tool_names + + session.close() + + +async def test_branching_functionality(agent: Agent): + """Test branching functionality - create, switch, and delete branches.""" + session_id = "branching_test" + session = AdvancedSQLiteSession(session_id=session_id, create_tables=True) + + # Add multiple turns to main branch + turn_1_items: list[TResponseInputItem] = [ + {"role": "user", "content": "First question"}, + {"role": "assistant", "content": "First answer"}, + ] + await session.add_items(turn_1_items) + + turn_2_items: list[TResponseInputItem] = [ + {"role": "user", "content": "Second question"}, + {"role": "assistant", "content": "Second answer"}, + ] + await session.add_items(turn_2_items) + + turn_3_items: list[TResponseInputItem] = [ + {"role": "user", "content": "Third question"}, + {"role": "assistant", "content": "Third answer"}, + ] + await session.add_items(turn_3_items) + + # Verify all items are in main branch + all_items = await session.get_items() + assert len(all_items) == 6 + + # Create a branch from turn 2 + branch_name = await session.create_branch_from_turn(2, "test_branch") + assert branch_name == "test_branch" + + # Verify we're now on the new branch + assert session._current_branch_id == "test_branch" + + # Verify the branch has the same content up to turn 2 (copies messages before turn 2) + branch_items = await session.get_items() + assert len(branch_items) == 2 # Only first turn items (before turn 2) + assert branch_items[0].get("content") == "First question" + assert branch_items[1].get("content") == "First answer" + + # Switch back to main branch + await session.switch_to_branch("main") + assert session._current_branch_id == "main" + + # Verify main branch still has all items + main_items = await session.get_items() + assert len(main_items) == 6 + + # List branches + branches = await session.list_branches() + assert len(branches) == 2 + branch_ids = [b["branch_id"] for b in branches] + assert "main" in branch_ids + assert "test_branch" in branch_ids + + # Delete the test branch + await session.delete_branch("test_branch") + + # Verify branch is deleted + branches_after_delete = await session.list_branches() + assert len(branches_after_delete) == 1 + assert branches_after_delete[0]["branch_id"] == "main" + + session.close() + + +async def test_get_conversation_turns(): + """Test get_conversation_turns functionality.""" + session_id = "conversation_turns_test" + session = AdvancedSQLiteSession(session_id=session_id, create_tables=True) + + # Add multiple turns + turn_1_items: list[TResponseInputItem] = [ + {"role": "user", "content": "Hello there"}, + {"role": "assistant", "content": "Hi!"}, + ] + await session.add_items(turn_1_items) + + turn_2_items: list[TResponseInputItem] = [ + {"role": "user", "content": "How are you doing today?"}, + {"role": "assistant", "content": "I'm doing well, thanks!"}, + ] + await session.add_items(turn_2_items) + + # Get conversation turns + turns = await session.get_conversation_turns() + assert len(turns) == 2 + + # Verify turn structure + assert turns[0]["turn"] == 1 + assert turns[0]["content"] == "Hello there" + assert turns[0]["full_content"] == "Hello there" + assert turns[0]["can_branch"] is True + assert "timestamp" in turns[0] + + assert turns[1]["turn"] == 2 + assert turns[1]["content"] == "How are you doing today?" + assert turns[1]["full_content"] == "How are you doing today?" + assert turns[1]["can_branch"] is True + + session.close() + + +async def test_find_turns_by_content(): + """Test find_turns_by_content functionality.""" + session_id = "find_turns_test" + session = AdvancedSQLiteSession(session_id=session_id, create_tables=True) + + # Add multiple turns with different content + turn_1_items: list[TResponseInputItem] = [ + {"role": "user", "content": "Tell me about cats"}, + {"role": "assistant", "content": "Cats are great pets"}, + ] + await session.add_items(turn_1_items) + + turn_2_items: list[TResponseInputItem] = [ + {"role": "user", "content": "What about dogs?"}, + {"role": "assistant", "content": "Dogs are also great pets"}, + ] + await session.add_items(turn_2_items) + + turn_3_items: list[TResponseInputItem] = [ + {"role": "user", "content": "Tell me about cats again"}, + {"role": "assistant", "content": "Cats are wonderful companions"}, + ] + await session.add_items(turn_3_items) + + # Search for turns containing "cats" + cat_turns = await session.find_turns_by_content("cats") + assert len(cat_turns) == 2 + assert cat_turns[0]["turn"] == 1 + assert cat_turns[1]["turn"] == 3 + + # Search for turns containing "dogs" + dog_turns = await session.find_turns_by_content("dogs") + assert len(dog_turns) == 1 + assert dog_turns[0]["turn"] == 2 + + # Search for non-existent content + no_turns = await session.find_turns_by_content("elephants") + assert len(no_turns) == 0 + + session.close() + + +async def test_create_branch_from_content(): + """Test create_branch_from_content functionality.""" + session_id = "branch_from_content_test" + session = AdvancedSQLiteSession(session_id=session_id, create_tables=True) + + # Add multiple turns + turn_1_items: list[TResponseInputItem] = [ + {"role": "user", "content": "First question about math"}, + {"role": "assistant", "content": "Math answer"}, + ] + await session.add_items(turn_1_items) + + turn_2_items: list[TResponseInputItem] = [ + {"role": "user", "content": "Second question about science"}, + {"role": "assistant", "content": "Science answer"}, + ] + await session.add_items(turn_2_items) + + turn_3_items: list[TResponseInputItem] = [ + {"role": "user", "content": "Another math question"}, + {"role": "assistant", "content": "Another math answer"}, + ] + await session.add_items(turn_3_items) + + # Create branch from first occurrence of "math" + branch_name = await session.create_branch_from_content("math", "math_branch") + assert branch_name == "math_branch" + + # Verify we're on the new branch + assert session._current_branch_id == "math_branch" + + # Verify branch contains only items up to the first math turn (copies messages before turn 1) + branch_items = await session.get_items() + assert len(branch_items) == 0 # No messages before turn 1 + + # Test error case - search term not found + with pytest.raises(ValueError, match="No user turns found containing 'nonexistent'"): + await session.create_branch_from_content("nonexistent", "error_branch") + + session.close() + + +async def test_branch_specific_operations(): + """Test operations that work with specific branches.""" + session_id = "branch_specific_test" + session = AdvancedSQLiteSession(session_id=session_id, create_tables=True) + + # Add items to main branch + turn_1_items: list[TResponseInputItem] = [ + {"role": "user", "content": "Main branch question"}, + {"role": "assistant", "content": "Main branch answer"}, + ] + await session.add_items(turn_1_items) + + # Add usage data for main branch + usage_main = Usage(requests=1, input_tokens=50, output_tokens=30, total_tokens=80) + run_result_main = create_mock_run_result(usage_main) + await session.store_run_usage(run_result_main) + + # Create a branch from turn 1 (copies messages before turn 1, so empty) + await session.create_branch_from_turn(1, "test_branch") + + # Add items to the new branch + turn_2_items: list[TResponseInputItem] = [ + {"role": "user", "content": "Branch question"}, + {"role": "assistant", "content": "Branch answer"}, + ] + await session.add_items(turn_2_items) + + # Add usage data for branch + usage_branch = Usage(requests=1, input_tokens=40, output_tokens=20, total_tokens=60) + run_result_branch = create_mock_run_result(usage_branch) + await session.store_run_usage(run_result_branch) + + # Test get_items with branch_id parameter + main_items = await session.get_items(branch_id="main") + assert len(main_items) == 2 + assert main_items[0].get("content") == "Main branch question" + + current_items = await session.get_items() # Should get from current branch + assert len(current_items) == 2 # Only the items added to the branch (copied branch is empty) + + # Test get_conversation_turns with branch_id + main_turns = await session.get_conversation_turns(branch_id="main") + assert len(main_turns) == 1 + assert main_turns[0]["content"] == "Main branch question" + + current_turns = await session.get_conversation_turns() # Should get from current branch + assert len(current_turns) == 1 # Only one turn in the current branch + + # Test get_session_usage with branch_id + main_usage = await session.get_session_usage(branch_id="main") + assert main_usage is not None + assert main_usage["total_turns"] == 1 + + all_usage = await session.get_session_usage() # Should get from all branches + assert all_usage is not None + assert all_usage["total_turns"] == 2 # Main branch has 1, current branch has 1 + + session.close() + + +async def test_branch_error_handling(): + """Test error handling in branching operations.""" + session_id = "branch_error_test" + session = AdvancedSQLiteSession(session_id=session_id, create_tables=True) + + # Test creating branch from non-existent turn + with pytest.raises(ValueError, match="Turn 5 does not contain a user message"): + await session.create_branch_from_turn(5, "error_branch") + + # Test switching to non-existent branch + with pytest.raises(ValueError, match="Branch 'nonexistent' does not exist"): + await session.switch_to_branch("nonexistent") + + # Test deleting non-existent branch + with pytest.raises(ValueError, match="Branch 'nonexistent' does not exist"): + await session.delete_branch("nonexistent") + + # Test deleting main branch + with pytest.raises(ValueError, match="Cannot delete the 'main' branch"): + await session.delete_branch("main") + + # Test deleting empty branch ID + with pytest.raises(ValueError, match="Branch ID cannot be empty"): + await session.delete_branch("") + + # Test deleting empty branch ID (whitespace only) + with pytest.raises(ValueError, match="Branch ID cannot be empty"): + await session.delete_branch(" ") + + session.close() + + +async def test_branch_deletion_with_force(): + """Test branch deletion with force parameter.""" + session_id = "force_delete_test" + session = AdvancedSQLiteSession(session_id=session_id, create_tables=True) + + # Add items to main branch + await session.add_items([{"role": "user", "content": "Main question"}]) + await session.add_items([{"role": "user", "content": "Second question"}]) + + # Create and switch to a branch from turn 2 + await session.create_branch_from_turn(2, "temp_branch") + assert session._current_branch_id == "temp_branch" + + # Add some content to the branch so it exists + await session.add_items([{"role": "user", "content": "Branch question"}]) + + # Verify branch exists + branches = await session.list_branches() + branch_ids = [b["branch_id"] for b in branches] + assert "temp_branch" in branch_ids + + # Try to delete current branch without force (should fail) + with pytest.raises(ValueError, match="Cannot delete current branch"): + await session.delete_branch("temp_branch") + + # Delete current branch with force (should succeed and switch to main) + await session.delete_branch("temp_branch", force=True) + + # Verify we're back on main branch + assert session._current_branch_id == "main" + + # Verify branch is deleted + branches_after = await session.list_branches() + assert len(branches_after) == 1 + assert branches_after[0]["branch_id"] == "main" + + session.close() + + +async def test_get_items_with_parameters(): + """Test get_items with new parameters (include_inactive, branch_id).""" + session_id = "get_items_params_test" + session = AdvancedSQLiteSession(session_id=session_id, create_tables=True) + + # Add items to main branch + items: list[TResponseInputItem] = [ + {"role": "user", "content": "First question"}, + {"role": "assistant", "content": "First answer"}, + {"role": "user", "content": "Second question"}, + {"role": "assistant", "content": "Second answer"}, + ] + await session.add_items(items) + + # Test get_items with limit (gets most recent N items) + limited_items = await session.get_items(limit=2) + assert len(limited_items) == 2 + assert limited_items[0].get("content") == "Second question" # Most recent first + assert limited_items[1].get("content") == "Second answer" + + # Test get_items with branch_id + main_items = await session.get_items(branch_id="main") + assert len(main_items) == 4 + + # Test get_items (no longer has include_inactive parameter) + all_items = await session.get_items() + assert len(all_items) == 4 + + # Create a branch from turn 2 and test branch-specific get_items + await session.create_branch_from_turn(2, "test_branch") + + # Add items to branch + branch_items: list[TResponseInputItem] = [ + {"role": "user", "content": "Branch question"}, + {"role": "assistant", "content": "Branch answer"}, + ] + await session.add_items(branch_items) + + # Test getting items from specific branch (should include copied items + new items) + branch_items_result = await session.get_items(branch_id="test_branch") + assert len(branch_items_result) == 4 # 2 copied from main (before turn 2) + 2 new items + + # Test getting items from main branch while on different branch + main_items_from_branch = await session.get_items(branch_id="main") + assert len(main_items_from_branch) == 4 + + session.close() + + +async def test_usage_tracking_storage(agent: Agent, usage_data: Usage): + """Test usage data storage and retrieval.""" + session_id = "usage_test" + session = AdvancedSQLiteSession(session_id=session_id, create_tables=True) + + # Simulate adding items for turn 1 to increment turn counter + await session.add_items([{"role": "user", "content": "First turn"}]) + run_result_1 = create_mock_run_result(usage_data) + await session.store_run_usage(run_result_1) + + # Create different usage data for turn 2 + usage_data_2 = Usage( + requests=2, + input_tokens=75, + output_tokens=45, + total_tokens=120, + input_tokens_details=InputTokensDetails(cached_tokens=20), + output_tokens_details=OutputTokensDetails(reasoning_tokens=15), + ) + + # Simulate adding items for turn 2 to increment turn counter + await session.add_items([{"role": "user", "content": "Second turn"}]) + run_result_2 = create_mock_run_result(usage_data_2) + await session.store_run_usage(run_result_2) + + # Test session-level usage aggregation + session_usage = await session.get_session_usage() + assert session_usage is not None + assert session_usage["requests"] == 3 # 1 + 2 + assert session_usage["total_tokens"] == 200 # 80 + 120 + assert session_usage["input_tokens"] == 125 # 50 + 75 + assert session_usage["output_tokens"] == 75 # 30 + 45 + assert session_usage["total_turns"] == 2 + + # Test turn-level usage retrieval + turn_1_usage = await session.get_turn_usage(1) + assert isinstance(turn_1_usage, dict) + assert turn_1_usage["requests"] == 1 + assert turn_1_usage["total_tokens"] == 80 + assert turn_1_usage["input_tokens_details"]["cached_tokens"] == 10 + assert turn_1_usage["output_tokens_details"]["reasoning_tokens"] == 5 + + turn_2_usage = await session.get_turn_usage(2) + assert isinstance(turn_2_usage, dict) + assert turn_2_usage["requests"] == 2 + assert turn_2_usage["total_tokens"] == 120 + assert turn_2_usage["input_tokens_details"]["cached_tokens"] == 20 + assert turn_2_usage["output_tokens_details"]["reasoning_tokens"] == 15 + + # Test getting all turn usage + all_turn_usage = await session.get_turn_usage() + assert isinstance(all_turn_usage, list) + assert len(all_turn_usage) == 2 + assert all_turn_usage[0]["user_turn_number"] == 1 + assert all_turn_usage[1]["user_turn_number"] == 2 + + session.close() + + +async def test_runner_integration_with_usage_tracking(agent: Agent): + """Test integration with Runner and automatic usage tracking pattern.""" + session_id = "integration_test" + session = AdvancedSQLiteSession(session_id=session_id, create_tables=True) + + async def store_session_usage(result: Any, session: AdvancedSQLiteSession): + """Helper function to store usage after runner completes.""" + try: + await session.store_run_usage(result) + except Exception: + # Ignore errors in test helper + pass + + # Set up fake model responses + assert isinstance(agent.model, FakeModel) + fake_model = agent.model + fake_model.set_next_output([get_text_message("San Francisco")]) + + # First turn + result1 = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session, + ) + assert result1.final_output == "San Francisco" + await store_session_usage(result1, session) + + # Second turn + fake_model.set_next_output([get_text_message("California")]) + result2 = await Runner.run(agent, "What state is it in?", session=session) + assert result2.final_output == "California" + await store_session_usage(result2, session) + + # Verify conversation structure + conversation_turns = await session.get_conversation_by_turns() + assert len(conversation_turns) == 2 + + # Verify usage was tracked + session_usage = await session.get_session_usage() + assert session_usage is not None + assert session_usage["total_turns"] == 2 + # FakeModel doesn't generate realistic usage data, so we just check structure exists + assert "requests" in session_usage + assert "total_tokens" in session_usage + + session.close() + + +async def test_sequence_ordering(): + """Test that sequence ordering works correctly even with same timestamps.""" + session_id = "sequence_test" + session = AdvancedSQLiteSession(session_id=session_id, create_tables=True) + + # Add multiple items quickly to test sequence ordering + items: list[TResponseInputItem] = [ + {"role": "user", "content": "Message 1"}, + {"role": "assistant", "content": "Response 1"}, + {"role": "user", "content": "Message 2"}, + {"role": "assistant", "content": "Response 2"}, + ] + await session.add_items(items) + + # Get items and verify order is preserved + retrieved = await session.get_items() + assert len(retrieved) == 4 + assert retrieved[0].get("content") == "Message 1" + assert retrieved[1].get("content") == "Response 1" + assert retrieved[2].get("content") == "Message 2" + assert retrieved[3].get("content") == "Response 2" + + session.close() + + +async def test_conversation_structure_with_multiple_turns(): + """Test conversation structure tracking with multiple user turns.""" + session_id = "multi_turn_test" + session = AdvancedSQLiteSession(session_id=session_id, create_tables=True) + + # Turn 1 + turn_1: list[TResponseInputItem] = [ + {"role": "user", "content": "Hello"}, + {"role": "assistant", "content": "Hi!"}, + ] + await session.add_items(turn_1) + + # Turn 2 + turn_2: list[TResponseInputItem] = [ + {"role": "user", "content": "How are you?"}, + {"type": "function_call", "name": "mood_check", "arguments": "{}"}, # type: ignore + {"type": "function_call_output", "output": "I'm good"}, # type: ignore + {"role": "assistant", "content": "I'm doing well!"}, + ] + await session.add_items(turn_2) + + # Turn 3 + turn_3: list[TResponseInputItem] = [ + {"role": "user", "content": "Goodbye"}, + {"role": "assistant", "content": "See you later!"}, + ] + await session.add_items(turn_3) + + # Verify conversation structure + conversation_turns = await session.get_conversation_by_turns() + assert len(conversation_turns) == 3 + + # Turn 1 should have 2 items + assert len(conversation_turns[1]) == 2 + assert conversation_turns[1][0]["type"] == "user" + assert conversation_turns[1][1]["type"] == "assistant" + + # Turn 2 should have 4 items including tool calls + assert len(conversation_turns[2]) == 4 + turn_2_types = [item["type"] for item in conversation_turns[2]] + assert "user" in turn_2_types + assert "function_call" in turn_2_types + assert "function_call_output" in turn_2_types + assert "assistant" in turn_2_types + + # Turn 3 should have 2 items + assert len(conversation_turns[3]) == 2 + + session.close() + + +async def test_empty_session_operations(): + """Test operations on empty sessions.""" + session_id = "empty_test" + session = AdvancedSQLiteSession(session_id=session_id, create_tables=True) + + # Test getting items from empty session + items = await session.get_items() + assert len(items) == 0 + + # Test getting conversation from empty session + conversation = await session.get_conversation_by_turns() + assert len(conversation) == 0 + + # Test getting tool usage from empty session + tool_usage = await session.get_tool_usage() + assert len(tool_usage) == 0 + + # Test getting session usage from empty session + session_usage = await session.get_session_usage() + assert session_usage is None + + # Test getting turns from empty session + turns = await session.get_conversation_turns() + assert len(turns) == 0 + + session.close() + + +async def test_json_serialization_edge_cases(usage_data: Usage): + """Test edge cases in JSON serialization of usage data.""" + session_id = "json_test" + session = AdvancedSQLiteSession(session_id=session_id, create_tables=True) + + # Test with normal usage data (need to add user message first to create turn) + await session.add_items([{"role": "user", "content": "First test"}]) + run_result_1 = create_mock_run_result(usage_data) + await session.store_run_usage(run_result_1) + + # Test with None usage data + run_result_none = create_mock_run_result(None) + await session.store_run_usage(run_result_none) + + # Test with usage data missing details + minimal_usage = Usage( + requests=1, + input_tokens=10, + output_tokens=5, + total_tokens=15, + ) + await session.add_items([{"role": "user", "content": "Second test"}]) + run_result_2 = create_mock_run_result(minimal_usage) + await session.store_run_usage(run_result_2) + + # Verify we can retrieve the data + turn_1_usage = await session.get_turn_usage(1) + assert isinstance(turn_1_usage, dict) + assert turn_1_usage["requests"] == 1 + assert turn_1_usage["input_tokens_details"]["cached_tokens"] == 10 + + turn_2_usage = await session.get_turn_usage(2) + assert isinstance(turn_2_usage, dict) + assert turn_2_usage["requests"] == 1 + # Should have default values for minimal data (Usage class provides defaults) + assert turn_2_usage["input_tokens_details"]["cached_tokens"] == 0 + assert turn_2_usage["output_tokens_details"]["reasoning_tokens"] == 0 + + session.close() + + +async def test_session_isolation(): + """Test that different session IDs maintain separate data.""" + session1 = AdvancedSQLiteSession(session_id="session_1", create_tables=True) + session2 = AdvancedSQLiteSession(session_id="session_2", create_tables=True) + + # Add data to session 1 + await session1.add_items([{"role": "user", "content": "Session 1 message"}]) + + # Add data to session 2 + await session2.add_items([{"role": "user", "content": "Session 2 message"}]) + + # Verify isolation + session1_items = await session1.get_items() + session2_items = await session2.get_items() + + assert len(session1_items) == 1 + assert len(session2_items) == 1 + assert session1_items[0].get("content") == "Session 1 message" + assert session2_items[0].get("content") == "Session 2 message" + + # Test conversation structure isolation + session1_turns = await session1.get_conversation_by_turns() + session2_turns = await session2.get_conversation_by_turns() + + assert len(session1_turns) == 1 + assert len(session2_turns) == 1 + + session1.close() + session2.close() + + +async def test_error_handling_in_usage_tracking(usage_data: Usage): + """Test that usage tracking errors don't break the main flow.""" + session_id = "error_test" + session = AdvancedSQLiteSession(session_id=session_id, create_tables=True) + + # Test normal operation + run_result = create_mock_run_result(usage_data) + await session.store_run_usage(run_result) + + # Close the session to simulate database errors + session.close() + + # This should not raise an exception (error should be caught) + await session.store_run_usage(run_result) + + +async def test_advanced_tool_name_extraction(): + """Test advanced tool name extraction for different tool types.""" + session_id = "advanced_tool_names_test" + session = AdvancedSQLiteSession(session_id=session_id, create_tables=True) + + # Add items with various tool types and naming patterns + items: list[TResponseInputItem] = [ + {"role": "user", "content": "Use various tools"}, + # MCP tools with server labels + {"type": "mcp_call", "server_label": "filesystem", "name": "read_file", "arguments": "{}"}, # type: ignore + { + "type": "mcp_approval_request", + "server_label": "database", + "name": "execute_query", + "arguments": "{}", + }, # type: ignore + # Built-in tool types + {"type": "computer_call", "arguments": "{}"}, # type: ignore + {"type": "file_search_call", "arguments": "{}"}, # type: ignore + {"type": "web_search_call", "arguments": "{}"}, # type: ignore + {"type": "code_interpreter_call", "arguments": "{}"}, # type: ignore + # Regular function calls + {"type": "function_call", "name": "calculator", "arguments": "{}"}, # type: ignore + {"type": "custom_tool_call", "name": "custom_tool", "arguments": "{}"}, # type: ignore + ] + await session.add_items(items) + + # Get conversation structure and verify tool names + conversation_turns = await session.get_conversation_by_turns() + turn_items = conversation_turns[1] + + tool_items = [item for item in turn_items if item["tool_name"]] + tool_names = [item["tool_name"] for item in tool_items] + + # Verify MCP tools get server_label.name format + assert "filesystem.read_file" in tool_names + assert "database.execute_query" in tool_names + + # Verify built-in tools use their type as name + assert "computer_call" in tool_names + assert "file_search_call" in tool_names + assert "web_search_call" in tool_names + assert "code_interpreter_call" in tool_names + + # Verify regular function calls use their name + assert "calculator" in tool_names + assert "custom_tool" in tool_names + + session.close() + + +async def test_branch_usage_tracking(): + """Test usage tracking across different branches.""" + session_id = "branch_usage_test" + session = AdvancedSQLiteSession(session_id=session_id, create_tables=True) + + # Add items and usage to main branch + await session.add_items([{"role": "user", "content": "Main question"}]) + usage_main = Usage(requests=1, input_tokens=50, output_tokens=30, total_tokens=80) + run_result_main = create_mock_run_result(usage_main) + await session.store_run_usage(run_result_main) + + # Create a branch and add usage there + await session.create_branch_from_turn(1, "usage_branch") + await session.add_items([{"role": "user", "content": "Branch question"}]) + usage_branch = Usage(requests=2, input_tokens=100, output_tokens=60, total_tokens=160) + run_result_branch = create_mock_run_result(usage_branch) + await session.store_run_usage(run_result_branch) + + # Test branch-specific usage + main_usage = await session.get_session_usage(branch_id="main") + assert main_usage is not None + assert main_usage["requests"] == 1 + assert main_usage["total_tokens"] == 80 + assert main_usage["total_turns"] == 1 + + branch_usage = await session.get_session_usage(branch_id="usage_branch") + assert branch_usage is not None + assert branch_usage["requests"] == 2 + assert branch_usage["total_tokens"] == 160 + assert branch_usage["total_turns"] == 1 + + # Test total usage across all branches + total_usage = await session.get_session_usage() + assert total_usage is not None + assert total_usage["requests"] == 3 # 1 + 2 + assert total_usage["total_tokens"] == 240 # 80 + 160 + assert total_usage["total_turns"] == 2 + + # Test turn usage for specific branch + branch_turn_usage = await session.get_turn_usage(branch_id="usage_branch") + assert isinstance(branch_turn_usage, list) + assert len(branch_turn_usage) == 1 + assert branch_turn_usage[0]["requests"] == 2 + + session.close() + + +async def test_tool_name_extraction(): + """Test that tool names are correctly extracted from different item types.""" + session_id = "tool_names_test" + session = AdvancedSQLiteSession(session_id=session_id, create_tables=True) + + # Add items with different ways of specifying tool names + items: list[TResponseInputItem] = [ + {"role": "user", "content": "Use tools please"}, # Need user message to create turn + {"type": "function_call", "name": "search_web", "arguments": "{}"}, # type: ignore + {"type": "function_call_output", "tool_name": "search_web", "output": "result"}, # type: ignore + {"type": "function_call", "name": "calculator", "arguments": "{}"}, # type: ignore + ] + await session.add_items(items) + + # Get conversation structure and verify tool names + conversation_turns = await session.get_conversation_by_turns() + turn_items = conversation_turns[1] + + tool_items = [item for item in turn_items if item["tool_name"]] + tool_names = [item["tool_name"] for item in tool_items] + + assert "search_web" in tool_names + assert "calculator" in tool_names + + session.close() + + +async def test_tool_execution_integration(agent: Agent): + """Test integration with actual tool execution.""" + session_id = "tool_integration_test" + session = AdvancedSQLiteSession(session_id=session_id, create_tables=True) + + # Set up the fake model to trigger a tool call + fake_model = cast(FakeModel, agent.model) + fake_model.set_next_output( + [ + { # type: ignore + "type": "function_call", + "name": "test_tool", + "arguments": '{"query": "test query"}', + "call_id": "call_123", + } + ] + ) + + # Then set the final response + fake_model.set_next_output([get_text_message("Tool executed successfully")]) + + # Run the agent + result = await Runner.run( + agent, + "Please use the test tool", + session=session, + ) + + # Verify the tool was executed + assert "Tool result for: test query" in str(result.new_items) + + # Verify tool usage was tracked + tool_usage = await session.get_tool_usage() + assert len(tool_usage) > 0 + + session.close() diff --git a/tests/extensions/memory/test_encrypt_session.py b/tests/extensions/memory/test_encrypt_session.py new file mode 100644 index 000000000..5eb1d9b53 --- /dev/null +++ b/tests/extensions/memory/test_encrypt_session.py @@ -0,0 +1,333 @@ +from __future__ import annotations + +import tempfile +import time +from pathlib import Path + +import pytest + +pytest.importorskip("cryptography") # Skip tests if cryptography is not installed + +from cryptography.fernet import Fernet + +from agents import Agent, Runner, SQLiteSession, TResponseInputItem +from agents.extensions.memory.encrypt_session import EncryptedSession +from tests.fake_model import FakeModel +from tests.test_responses import get_text_message + +# Mark all tests in this file as asyncio +pytestmark = pytest.mark.asyncio + + +@pytest.fixture +def agent() -> Agent: + """Fixture for a basic agent with a fake model.""" + return Agent(name="test", model=FakeModel()) + + +@pytest.fixture +def encryption_key() -> str: + """Fixture for a valid Fernet encryption key.""" + return str(Fernet.generate_key().decode("utf-8")) + + +@pytest.fixture +def underlying_session(): + """Fixture for an underlying SQLite session.""" + temp_dir = tempfile.mkdtemp() + db_path = Path(temp_dir) / "test_encrypt.db" + return SQLiteSession("test_session", db_path) + + +async def test_encrypted_session_basic_functionality( + agent: Agent, encryption_key: str, underlying_session: SQLiteSession +): + """Test basic encryption/decryption functionality.""" + session = EncryptedSession( + session_id="test_session", + underlying_session=underlying_session, + encryption_key=encryption_key, + ttl=600, + ) + + items: list[TResponseInputItem] = [ + {"role": "user", "content": "Hello"}, + {"role": "assistant", "content": "Hi there!"}, + ] + await session.add_items(items) + + retrieved = await session.get_items() + assert len(retrieved) == 2 + assert retrieved[0].get("content") == "Hello" + assert retrieved[1].get("content") == "Hi there!" + + encrypted_items = await underlying_session.get_items() + assert encrypted_items[0].get("__enc__") == 1 + assert "payload" in encrypted_items[0] + assert encrypted_items[0].get("content") != "Hello" + + underlying_session.close() + + +async def test_encrypted_session_with_runner( + agent: Agent, encryption_key: str, underlying_session: SQLiteSession +): + """Test that EncryptedSession works with Runner.""" + session = EncryptedSession( + session_id="test_session", + underlying_session=underlying_session, + encryption_key=encryption_key, + ) + + assert isinstance(agent.model, FakeModel) + agent.model.set_next_output([get_text_message("San Francisco")]) + result1 = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session, + ) + assert result1.final_output == "San Francisco" + + agent.model.set_next_output([get_text_message("California")]) + result2 = await Runner.run(agent, "What state is it in?", session=session) + assert result2.final_output == "California" + + last_input = agent.model.last_turn_args["input"] + assert len(last_input) > 1 + assert any("Golden Gate Bridge" in str(item.get("content", "")) for item in last_input) + + underlying_session.close() + + +async def test_encrypted_session_pop_item(encryption_key: str, underlying_session: SQLiteSession): + """Test pop_item functionality.""" + session = EncryptedSession( + session_id="test_session", + underlying_session=underlying_session, + encryption_key=encryption_key, + ) + + items: list[TResponseInputItem] = [ + {"role": "user", "content": "First"}, + {"role": "assistant", "content": "Second"}, + ] + await session.add_items(items) + + popped = await session.pop_item() + assert popped is not None + assert popped.get("content") == "Second" + + remaining = await session.get_items() + assert len(remaining) == 1 + assert remaining[0].get("content") == "First" + + underlying_session.close() + + +async def test_encrypted_session_clear(encryption_key: str, underlying_session: SQLiteSession): + """Test clear_session functionality.""" + session = EncryptedSession( + session_id="test_session", + underlying_session=underlying_session, + encryption_key=encryption_key, + ) + + await session.add_items([{"role": "user", "content": "Test"}]) + await session.clear_session() + + items = await session.get_items() + assert len(items) == 0 + + underlying_session.close() + + +async def test_encrypted_session_ttl_expiration( + encryption_key: str, underlying_session: SQLiteSession +): + """Test TTL expiration - expired items are silently skipped.""" + session = EncryptedSession( + session_id="test_session", + underlying_session=underlying_session, + encryption_key=encryption_key, + ttl=1, # 1 second TTL + ) + + items: list[TResponseInputItem] = [ + {"role": "user", "content": "Hello"}, + {"role": "assistant", "content": "Hi"}, + ] + await session.add_items(items) + + time.sleep(2) + + retrieved = await session.get_items() + assert len(retrieved) == 0 + + underlying_items = await underlying_session.get_items() + assert len(underlying_items) == 2 + + underlying_session.close() + + +async def test_encrypted_session_pop_expired( + encryption_key: str, underlying_session: SQLiteSession +): + """Test pop_item with expired data.""" + session = EncryptedSession( + session_id="test_session", + underlying_session=underlying_session, + encryption_key=encryption_key, + ttl=1, + ) + + await session.add_items([{"role": "user", "content": "Test"}]) + time.sleep(2) + + popped = await session.pop_item() + assert popped is None + + underlying_session.close() + + +async def test_encrypted_session_pop_mixed_expired_valid( + encryption_key: str, underlying_session: SQLiteSession +): + """Test pop_item auto-retry with mixed expired and valid items.""" + session = EncryptedSession( + session_id="test_session", + underlying_session=underlying_session, + encryption_key=encryption_key, + ttl=2, # 2 second TTL + ) + + await session.add_items( + [ + {"role": "user", "content": "Old message 1"}, + {"role": "assistant", "content": "Old response 1"}, + ] + ) + + time.sleep(3) + + await session.add_items( + [ + {"role": "user", "content": "New message"}, + {"role": "assistant", "content": "New response"}, + ] + ) + + popped = await session.pop_item() + assert popped is not None + assert popped.get("content") == "New response" + + popped2 = await session.pop_item() + assert popped2 is not None + assert popped2.get("content") == "New message" + + popped3 = await session.pop_item() + assert popped3 is None + + underlying_session.close() + + +async def test_encrypted_session_raw_string_key(underlying_session: SQLiteSession): + """Test using raw string as encryption key (not base64).""" + session = EncryptedSession( + session_id="test_session", + underlying_session=underlying_session, + encryption_key="my-secret-password", # Raw string, not Fernet key + ) + + await session.add_items([{"role": "user", "content": "Test"}]) + items = await session.get_items() + assert len(items) == 1 + assert items[0].get("content") == "Test" + + underlying_session.close() + + +async def test_encrypted_session_get_items_limit( + encryption_key: str, underlying_session: SQLiteSession +): + """Test get_items with limit parameter.""" + session = EncryptedSession( + session_id="test_session", + underlying_session=underlying_session, + encryption_key=encryption_key, + ) + + items: list[TResponseInputItem] = [ + {"role": "user", "content": f"Message {i}"} for i in range(5) + ] + await session.add_items(items) + + limited = await session.get_items(limit=2) + assert len(limited) == 2 + assert limited[0].get("content") == "Message 3" # Latest 2 + assert limited[1].get("content") == "Message 4" + + underlying_session.close() + + +async def test_encrypted_session_unicode_content( + encryption_key: str, underlying_session: SQLiteSession +): + """Test encryption of international text content.""" + session = EncryptedSession( + session_id="test_session", + underlying_session=underlying_session, + encryption_key=encryption_key, + ) + + items: list[TResponseInputItem] = [ + {"role": "user", "content": "Hello world"}, + {"role": "assistant", "content": "Special chars: áéíóú"}, + {"role": "user", "content": "Numbers and symbols: 123!@#"}, + ] + await session.add_items(items) + + retrieved = await session.get_items() + assert retrieved[0].get("content") == "Hello world" + assert retrieved[1].get("content") == "Special chars: áéíóú" + assert retrieved[2].get("content") == "Numbers and symbols: 123!@#" + + underlying_session.close() + + +class CustomSession(SQLiteSession): + """Mock custom session with additional methods for testing delegation.""" + + def get_stats(self) -> dict[str, int]: + """Custom method that should be accessible through delegation.""" + return {"custom_method_calls": 42, "test_value": 123} + + async def custom_async_method(self) -> str: + """Custom async method for testing delegation.""" + return "custom_async_result" + + +async def test_encrypted_session_delegation(): + """Test that custom methods on underlying session are accessible through delegation.""" + temp_dir = tempfile.mkdtemp() + db_path = Path(temp_dir) / "test_delegation.db" + underlying_session = CustomSession("test_session", db_path) + + encryption_key = str(Fernet.generate_key().decode("utf-8")) + session = EncryptedSession( + session_id="test_session", + underlying_session=underlying_session, + encryption_key=encryption_key, + ) + + stats = session.get_stats() + assert stats == {"custom_method_calls": 42, "test_value": 123} + + result = await session.custom_async_method() + assert result == "custom_async_result" + + await session.add_items([{"role": "user", "content": "Test delegation"}]) + items = await session.get_items() + assert len(items) == 1 + assert items[0].get("content") == "Test delegation" + + underlying_session.close() diff --git a/tests/extensions/memory/test_redis_session.py b/tests/extensions/memory/test_redis_session.py new file mode 100644 index 000000000..b513a28fc --- /dev/null +++ b/tests/extensions/memory/test_redis_session.py @@ -0,0 +1,796 @@ +from __future__ import annotations + +from typing import cast + +import pytest + +pytest.importorskip("redis") # Skip tests if Redis is not installed + +from agents import Agent, Runner, TResponseInputItem +from agents.extensions.memory.redis_session import RedisSession +from tests.fake_model import FakeModel +from tests.test_responses import get_text_message + +# Mark all tests in this file as asyncio +pytestmark = pytest.mark.asyncio + +# Try to use fakeredis for in-memory testing, fall back to real Redis if not available +try: + import fakeredis.aioredis + from redis.asyncio import Redis + + # Use the actual Redis type annotation, but cast the FakeRedis implementation + fake_redis_instance = fakeredis.aioredis.FakeRedis() + fake_redis: Redis = cast("Redis", fake_redis_instance) + USE_FAKE_REDIS = True +except ImportError: + fake_redis = None # type: ignore[assignment] + USE_FAKE_REDIS = False + +if not USE_FAKE_REDIS: + # Fallback to real Redis for tests that need it + REDIS_URL = "redis://localhost:6379/15" # Using database 15 for tests + + +async def _safe_rpush(client: Redis, key: str, value: str) -> None: + """Safely handle rpush operations that might be sync or async in fakeredis.""" + result = client.rpush(key, value) + if hasattr(result, "__await__"): + await result + + +@pytest.fixture +def agent() -> Agent: + """Fixture for a basic agent with a fake model.""" + return Agent(name="test", model=FakeModel()) + + +async def _create_redis_session( + session_id: str, key_prefix: str = "test:", ttl: int | None = None +) -> RedisSession: + """Helper to create a Redis session with consistent configuration.""" + if USE_FAKE_REDIS: + # Use in-memory fake Redis for testing + return RedisSession( + session_id=session_id, + redis_client=fake_redis, + key_prefix=key_prefix, + ttl=ttl, + ) + else: + session = RedisSession.from_url(https://github.com/session_id,%20url=REDIS_URL,%20key_prefix=key_prefix,%20ttl=ttl) + # Ensure we can connect + if not await session.ping(): + await session.close() + pytest.skip("Redis server not available") + return session + + +async def _create_test_session(session_id: str | None = None) -> RedisSession: + """Helper to create a test session with cleanup.""" + import uuid + + if session_id is None: + session_id = f"test_session_{uuid.uuid4().hex[:8]}" + + if USE_FAKE_REDIS: + # Use in-memory fake Redis for testing + session = RedisSession(session_id=session_id, redis_client=fake_redis, key_prefix="test:") + else: + session = RedisSession.from_url(https://github.com/session_id,%20url=REDIS_URL) + + # Ensure we can connect + if not await session.ping(): + await session.close() + pytest.skip("Redis server not available") + + # Clean up any existing data + await session.clear_session() + + return session + + +async def test_redis_session_direct_ops(): + """Test direct database operations of RedisSession.""" + session = await _create_test_session() + + try: + # 1. Add items + items: list[TResponseInputItem] = [ + {"role": "user", "content": "Hello"}, + {"role": "assistant", "content": "Hi there!"}, + ] + await session.add_items(items) + + # 2. Get items and verify + retrieved = await session.get_items() + assert len(retrieved) == 2 + assert retrieved[0].get("content") == "Hello" + assert retrieved[1].get("content") == "Hi there!" + + # 3. Pop item + popped = await session.pop_item() + assert popped is not None + assert popped.get("content") == "Hi there!" + retrieved_after_pop = await session.get_items() + assert len(retrieved_after_pop) == 1 + assert retrieved_after_pop[0].get("content") == "Hello" + + # 4. Clear session + await session.clear_session() + retrieved_after_clear = await session.get_items() + assert len(retrieved_after_clear) == 0 + + finally: + await session.close() + + +async def test_runner_integration(agent: Agent): + """Test that RedisSession works correctly with the agent Runner.""" + session = await _create_test_session() + + try: + # First turn + assert isinstance(agent.model, FakeModel) + agent.model.set_next_output([get_text_message("San Francisco")]) + result1 = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session, + ) + assert result1.final_output == "San Francisco" + + # Second turn + agent.model.set_next_output([get_text_message("California")]) + result2 = await Runner.run(agent, "What state is it in?", session=session) + assert result2.final_output == "California" + + # Verify history was passed to the model on the second turn + last_input = agent.model.last_turn_args["input"] + assert len(last_input) > 1 + assert any("Golden Gate Bridge" in str(item.get("content", "")) for item in last_input) + + finally: + await session.close() + + +async def test_session_isolation(): + """Test that different session IDs result in isolated conversation histories.""" + session1 = await _create_redis_session("session_1") + session2 = await _create_redis_session("session_2") + + try: + agent = Agent(name="test", model=FakeModel()) + + # Clean up any existing data + await session1.clear_session() + await session2.clear_session() + + # Interact with session 1 + assert isinstance(agent.model, FakeModel) + agent.model.set_next_output([get_text_message("I like cats.")]) + await Runner.run(agent, "I like cats.", session=session1) + + # Interact with session 2 + agent.model.set_next_output([get_text_message("I like dogs.")]) + await Runner.run(agent, "I like dogs.", session=session2) + + # Go back to session 1 and check its memory + agent.model.set_next_output([get_text_message("You said you like cats.")]) + result = await Runner.run(agent, "What animal did I say I like?", session=session1) + assert "cats" in result.final_output.lower() + assert "dogs" not in result.final_output.lower() + finally: + try: + await session1.clear_session() + await session2.clear_session() + except Exception: + pass # Ignore cleanup errors + await session1.close() + await session2.close() + + +async def test_get_items_with_limit(): + """Test the limit parameter in get_items.""" + session = await _create_test_session() + + try: + items: list[TResponseInputItem] = [ + {"role": "user", "content": "1"}, + {"role": "assistant", "content": "2"}, + {"role": "user", "content": "3"}, + {"role": "assistant", "content": "4"}, + ] + await session.add_items(items) + + # Get last 2 items + latest_2 = await session.get_items(limit=2) + assert len(latest_2) == 2 + assert latest_2[0].get("content") == "3" + assert latest_2[1].get("content") == "4" + + # Get all items + all_items = await session.get_items() + assert len(all_items) == 4 + + # Get more than available + more_than_all = await session.get_items(limit=10) + assert len(more_than_all) == 4 + + # Get 0 items + zero_items = await session.get_items(limit=0) + assert len(zero_items) == 0 + + finally: + await session.close() + + +async def test_pop_from_empty_session(): + """Test that pop_item returns None on an empty session.""" + session = await _create_redis_session("empty_session") + try: + await session.clear_session() + popped = await session.pop_item() + assert popped is None + finally: + await session.close() + + +async def test_add_empty_items_list(): + """Test that adding an empty list of items is a no-op.""" + session = await _create_test_session() + + try: + initial_items = await session.get_items() + assert len(initial_items) == 0 + + await session.add_items([]) + + items_after_add = await session.get_items() + assert len(items_after_add) == 0 + + finally: + await session.close() + + +async def test_unicode_content(): + """Test that session correctly stores and retrieves unicode/non-ASCII content.""" + session = await _create_test_session() + + try: + # Add unicode content to the session + items: list[TResponseInputItem] = [ + {"role": "user", "content": "こんにちは"}, + {"role": "assistant", "content": "😊👍"}, + {"role": "user", "content": "Привет"}, + ] + await session.add_items(items) + + # Retrieve items and verify unicode content + retrieved = await session.get_items() + assert retrieved[0].get("content") == "こんにちは" + assert retrieved[1].get("content") == "😊👍" + assert retrieved[2].get("content") == "Привет" + + finally: + await session.close() + + +async def test_special_characters_and_json_safety(): + """Test that session safely stores and retrieves items with special characters.""" + session = await _create_test_session() + + try: + # Add items with special characters and JSON-problematic content + items: list[TResponseInputItem] = [ + {"role": "user", "content": "O'Reilly"}, + {"role": "assistant", "content": '{"nested": "json"}'}, + {"role": "user", "content": 'Quote: "Hello world"'}, + {"role": "assistant", "content": "Line1\nLine2\tTabbed"}, + {"role": "user", "content": "Normal message"}, + ] + await session.add_items(items) + + # Retrieve all items and verify they are stored correctly + retrieved = await session.get_items() + assert len(retrieved) == len(items) + assert retrieved[0].get("content") == "O'Reilly" + assert retrieved[1].get("content") == '{"nested": "json"}' + assert retrieved[2].get("content") == 'Quote: "Hello world"' + assert retrieved[3].get("content") == "Line1\nLine2\tTabbed" + assert retrieved[4].get("content") == "Normal message" + + finally: + await session.close() + + +async def test_data_integrity_with_problematic_strings(): + """Test that session preserves data integrity with strings that could break parsers.""" + session = await _create_test_session() + + try: + # Add items with various problematic string patterns that could break JSON parsing, + # string escaping, or other serialization mechanisms + items: list[TResponseInputItem] = [ + {"role": "user", "content": "O'Reilly"}, # Single quote + {"role": "assistant", "content": "DROP TABLE sessions;"}, # SQL-like command + {"role": "user", "content": '"SELECT * FROM users WHERE name = "admin";"'}, + {"role": "assistant", "content": "Robert'); DROP TABLE students;--"}, + {"role": "user", "content": '{"malicious": "json"}'}, # JSON-like string + {"role": "assistant", "content": "\\n\\t\\r Special escapes"}, # Escape sequences + {"role": "user", "content": "Normal message"}, # Control case + ] + await session.add_items(items) + + # Retrieve all items and verify they are stored exactly as provided + # This ensures the storage layer doesn't modify, escape, or corrupt data + retrieved = await session.get_items() + assert len(retrieved) == len(items) + assert retrieved[0].get("content") == "O'Reilly" + assert retrieved[1].get("content") == "DROP TABLE sessions;" + assert retrieved[2].get("content") == '"SELECT * FROM users WHERE name = "admin";"' + assert retrieved[3].get("content") == "Robert'); DROP TABLE students;--" + assert retrieved[4].get("content") == '{"malicious": "json"}' + assert retrieved[5].get("content") == "\\n\\t\\r Special escapes" + assert retrieved[6].get("content") == "Normal message" + + finally: + await session.close() + + +async def test_concurrent_access(): + """Test concurrent access to the same session to verify data integrity.""" + import asyncio + + session = await _create_test_session("concurrent_test") + + try: + # Prepare items for concurrent writing + async def add_messages(start_idx: int, count: int): + items: list[TResponseInputItem] = [ + {"role": "user", "content": f"Message {start_idx + i}"} for i in range(count) + ] + await session.add_items(items) + + # Run multiple concurrent add operations + tasks = [ + add_messages(0, 5), # Messages 0-4 + add_messages(5, 5), # Messages 5-9 + add_messages(10, 5), # Messages 10-14 + ] + + await asyncio.gather(*tasks) + + # Verify all items were added + retrieved = await session.get_items() + assert len(retrieved) == 15 + + # Extract message numbers and verify all are present + contents = [item.get("content") for item in retrieved] + expected_messages = [f"Message {i}" for i in range(15)] + + # Check that all expected messages are present (order may vary due to concurrency) + for expected in expected_messages: + assert expected in contents + + finally: + await session.close() + + +async def test_redis_connectivity(): + """Test Redis connectivity methods.""" + session = await _create_redis_session("connectivity_test") + try: + # Test ping - should work with both real and fake Redis + is_connected = await session.ping() + assert is_connected is True + finally: + await session.close() + + +async def test_ttl_functionality(): + """Test TTL (time-to-live) functionality.""" + session = await _create_redis_session("ttl_test", ttl=1) # 1 second TTL + + try: + await session.clear_session() + + # Add items with TTL + items: list[TResponseInputItem] = [ + {"role": "user", "content": "This should expire"}, + ] + await session.add_items(items) + + # Verify items exist immediately + retrieved = await session.get_items() + assert len(retrieved) == 1 + + # Note: We don't test actual expiration in unit tests as it would require + # waiting and make tests slow. The TTL setting is tested by verifying + # the Redis commands are called correctly. + finally: + try: + await session.clear_session() + except Exception: + pass # Ignore cleanup errors + await session.close() + + +async def test_from_url_constructor(): + """Test the from_url constructor method.""" + # This test specifically validates the from_url class method which parses + # Redis connection URLs and creates real Redis connections. Since fakeredis + # doesn't support URL-based connection strings in the same way, this test + # must use a real Redis server to properly validate URL parsing functionality. + if USE_FAKE_REDIS: + pytest.skip("from_url constructor test requires real Redis server") + + # Test standard Redis URL + session = RedisSession.from_url("https://github.com/url_test%22,%20url=%22redis://localhost:6379/15") + try: + if not await session.ping(): + pytest.skip("Redis server not available") + + assert session.session_id == "url_test" + assert await session.ping() is True + finally: + await session.close() + + +async def test_key_prefix_isolation(): + """Test that different key prefixes isolate sessions.""" + session1 = await _create_redis_session("same_id", key_prefix="app1") + session2 = await _create_redis_session("same_id", key_prefix="app2") + + try: + # Clean up + await session1.clear_session() + await session2.clear_session() + + # Add different items to each session + await session1.add_items([{"role": "user", "content": "app1 message"}]) + await session2.add_items([{"role": "user", "content": "app2 message"}]) + + # Verify isolation + items1 = await session1.get_items() + items2 = await session2.get_items() + + assert len(items1) == 1 + assert len(items2) == 1 + assert items1[0].get("content") == "app1 message" + assert items2[0].get("content") == "app2 message" + + finally: + try: + await session1.clear_session() + await session2.clear_session() + except Exception: + pass # Ignore cleanup errors + await session1.close() + await session2.close() + + +async def test_external_client_not_closed(): + """Test that external Redis clients are not closed when session.close() is called.""" + if not USE_FAKE_REDIS: + pytest.skip("This test requires fakeredis for client state verification") + + # Create a shared Redis client + shared_client = fake_redis + + # Create session with external client + session = RedisSession( + session_id="external_client_test", + redis_client=shared_client, + key_prefix="test:", + ) + + try: + # Add some data to verify the client is working + await session.add_items([{"role": "user", "content": "test message"}]) + items = await session.get_items() + assert len(items) == 1 + + # Verify client is working before close + assert await shared_client.ping() is True + + # Close the session + await session.close() + + # Verify the shared client is still usable after session.close() + # This would fail if we incorrectly closed the external client + assert await shared_client.ping() is True + + # Should still be able to use the client for other operations + await shared_client.set("test_key", "test_value") + value = await shared_client.get("test_key") + assert value.decode("utf-8") == "test_value" + + finally: + # Clean up + try: + await session.clear_session() + except Exception: + pass # Ignore cleanup errors if connection is already closed + + +async def test_internal_client_ownership(): + """Test that clients created via from_url are properly managed.""" + if USE_FAKE_REDIS: + pytest.skip("This test requires real Redis to test from_url behavior") + + # Create session using from_url (internal client) + session = RedisSession.from_url("https://github.com/internal_client_test%22,%20url=%22redis://localhost:6379/15") + + try: + if not await session.ping(): + pytest.skip("Redis server not available") + + # Add some data + await session.add_items([{"role": "user", "content": "test message"}]) + items = await session.get_items() + assert len(items) == 1 + + # The session should properly manage its own client + # Note: We can't easily test that the client is actually closed + # without risking breaking the test, but we can verify the + # session was created with internal client ownership + assert hasattr(session, "_owns_client") + assert session._owns_client is True + + finally: + # This should properly close the internal client + await session.close() + + +async def test_decode_responses_client_compatibility(): + """Test that RedisSession works with Redis clients configured with decode_responses=True.""" + if not USE_FAKE_REDIS: + pytest.skip("This test requires fakeredis for client configuration testing") + + # Create a Redis client with decode_responses=True + import fakeredis.aioredis + + decoded_client = fakeredis.aioredis.FakeRedis(decode_responses=True) + + # Create session with the decoded client + session = RedisSession( + session_id="decode_test", + redis_client=decoded_client, + key_prefix="test:", + ) + + try: + # Test that we can add and retrieve items even when Redis returns strings + test_items: list[TResponseInputItem] = [ + {"role": "user", "content": "Hello with decoded responses"}, + {"role": "assistant", "content": "Response with unicode: 🚀"}, + ] + + await session.add_items(test_items) + + # get_items should work with string responses + retrieved = await session.get_items() + assert len(retrieved) == 2 + assert retrieved[0].get("content") == "Hello with decoded responses" + assert retrieved[1].get("content") == "Response with unicode: 🚀" + + # pop_item should also work with string responses + popped = await session.pop_item() + assert popped is not None + assert popped.get("content") == "Response with unicode: 🚀" + + # Verify one item remains + remaining = await session.get_items() + assert len(remaining) == 1 + assert remaining[0].get("content") == "Hello with decoded responses" + + finally: + try: + await session.clear_session() + except Exception: + pass # Ignore cleanup errors + await session.close() + + +async def test_real_redis_decode_responses_compatibility(): + """Test RedisSession with a real Redis client configured with decode_responses=True.""" + if USE_FAKE_REDIS: + pytest.skip("This test requires real Redis to test decode_responses behavior") + + import redis.asyncio as redis + + # Create a Redis client with decode_responses=True + decoded_client = redis.Redis.from_url("/service/redis://localhost:6379/15%22,%20decode_responses=True) + + session = RedisSession( + session_id="real_decode_test", + redis_client=decoded_client, + key_prefix="test:", + ) + + try: + if not await session.ping(): + pytest.skip("Redis server not available") + + await session.clear_session() + + # Test with decode_responses=True client + test_items: list[TResponseInputItem] = [ + {"role": "user", "content": "Real Redis with decode_responses=True"}, + {"role": "assistant", "content": "Unicode test: 🎯"}, + ] + + await session.add_items(test_items) + + # Should work even though Redis returns strings instead of bytes + retrieved = await session.get_items() + assert len(retrieved) == 2 + assert retrieved[0].get("content") == "Real Redis with decode_responses=True" + assert retrieved[1].get("content") == "Unicode test: 🎯" + + # pop_item should also work + popped = await session.pop_item() + assert popped is not None + assert popped.get("content") == "Unicode test: 🎯" + + finally: + try: + await session.clear_session() + except Exception: + pass + await session.close() + + +async def test_get_next_id_method(): + """Test the _get_next_id atomic counter functionality.""" + session = await _create_test_session("counter_test") + + try: + await session.clear_session() + + # Test atomic counter increment + id1 = await session._get_next_id() + id2 = await session._get_next_id() + id3 = await session._get_next_id() + + # IDs should be sequential + assert id1 == 1 + assert id2 == 2 + assert id3 == 3 + + # Test that counter persists across session instances with same session_id + if USE_FAKE_REDIS: + session2 = RedisSession( + session_id="counter_test", + redis_client=fake_redis, + key_prefix="test:", + ) + else: + session2 = RedisSession.from_url("https://github.com/counter_test%22,%20url=REDIS_URL,%20key_prefix=%22test:") + + try: + id4 = await session2._get_next_id() + assert id4 == 4 # Should continue from previous session's counter + finally: + await session2.close() + + finally: + await session.close() + + +async def test_corrupted_data_handling(): + """Test that corrupted JSON data is handled gracefully.""" + if not USE_FAKE_REDIS: + pytest.skip("This test requires fakeredis for direct data manipulation") + + session = await _create_test_session("corruption_test") + + try: + await session.clear_session() + + # Add some valid data first + await session.add_items([{"role": "user", "content": "valid message"}]) + + # Inject corrupted data directly into Redis + messages_key = "test:corruption_test:messages" + + # Add invalid JSON directly using the typed Redis client + await _safe_rpush(fake_redis, messages_key, "invalid json data") + await _safe_rpush(fake_redis, messages_key, "{incomplete json") + + # get_items should skip corrupted data and return valid items + items = await session.get_items() + assert len(items) == 1 # Only the original valid item + + # Now add a properly formatted valid item using the session's serialization + valid_item: TResponseInputItem = {"role": "user", "content": "valid after corruption"} + await session.add_items([valid_item]) + + # Should now have 2 valid items (corrupted ones skipped) + items = await session.get_items() + assert len(items) == 2 + assert items[0].get("content") == "valid message" + assert items[1].get("content") == "valid after corruption" + + # Test pop_item with corrupted data at the end + await _safe_rpush(fake_redis, messages_key, "corrupted at end") + + # The corrupted item should be handled gracefully + # Since it's at the end, pop_item will encounter it first and return None + # But first, let's pop the valid items to get to the corrupted one + popped1 = await session.pop_item() + assert popped1 is not None + assert popped1.get("content") == "valid after corruption" + + popped2 = await session.pop_item() + assert popped2 is not None + assert popped2.get("content") == "valid message" + + # Now we should hit the corrupted data - this should gracefully handle it + # by returning None (and removing the corrupted item) + popped_corrupted = await session.pop_item() + assert popped_corrupted is None + + finally: + await session.close() + + +async def test_ping_connection_failure(): + """Test ping method when Redis connection fails.""" + if not USE_FAKE_REDIS: + pytest.skip("This test requires fakeredis for connection mocking") + + import unittest.mock + + session = await _create_test_session("ping_failure_test") + + try: + # First verify ping works normally + assert await session.ping() is True + + # Mock the ping method to raise an exception + with unittest.mock.patch.object( + session._redis, "ping", side_effect=Exception("Connection failed") + ): + # ping should return False when connection fails + assert await session.ping() is False + + finally: + await session.close() + + +async def test_close_method_coverage(): + """Test complete coverage of close() method behavior.""" + if not USE_FAKE_REDIS: + pytest.skip("This test requires fakeredis for client state verification") + + # Test 1: External client (should NOT be closed) + external_client = fake_redis + assert external_client is not None # Type assertion for mypy + session1 = RedisSession( + session_id="close_test_1", + redis_client=external_client, + key_prefix="test:", + ) + + # Verify _owns_client is False for external client + assert session1._owns_client is False + + # Close should not close the external client + await session1.close() + + # Verify external client is still usable + assert await external_client.ping() is True + + # Test 2: Internal client (should be closed) + # Create a session that owns its client + session2 = RedisSession( + session_id="close_test_2", + redis_client=fake_redis, + key_prefix="test:", + ) + session2._owns_client = True # Simulate ownership + + # This should trigger the close path for owned clients + await session2.close() diff --git a/tests/extensions/memory/test_sqlalchemy_session.py b/tests/extensions/memory/test_sqlalchemy_session.py new file mode 100644 index 000000000..0a498c189 --- /dev/null +++ b/tests/extensions/memory/test_sqlalchemy_session.py @@ -0,0 +1,446 @@ +from __future__ import annotations + +import json +from collections.abc import Iterable, Sequence +from contextlib import asynccontextmanager +from datetime import datetime, timedelta +from typing import Any, cast + +import pytest +from openai.types.responses.response_output_message_param import ResponseOutputMessageParam +from openai.types.responses.response_output_text_param import ResponseOutputTextParam +from openai.types.responses.response_reasoning_item_param import ( + ResponseReasoningItemParam, + Summary, +) +from sqlalchemy import select, text, update +from sqlalchemy.ext.asyncio import AsyncEngine, create_async_engine +from sqlalchemy.sql import Select + +pytest.importorskip("sqlalchemy") # Skip tests if SQLAlchemy is not installed + +from agents import Agent, Runner, TResponseInputItem +from agents.extensions.memory.sqlalchemy_session import SQLAlchemySession +from tests.fake_model import FakeModel +from tests.test_responses import get_text_message + +# Mark all tests in this file as asyncio +pytestmark = pytest.mark.asyncio + +# Use in-memory SQLite for tests +DB_URL = "sqlite+aiosqlite:///:memory:" + + +def _make_message_item(item_id: str, text_value: str) -> TResponseInputItem: + content: ResponseOutputTextParam = { + "type": "output_text", + "text": text_value, + "annotations": [], + } + message: ResponseOutputMessageParam = { + "id": item_id, + "type": "message", + "role": "assistant", + "status": "completed", + "content": [content], + } + return cast(TResponseInputItem, message) + + +def _make_reasoning_item(item_id: str, summary_text: str) -> TResponseInputItem: + summary: Summary = {"type": "summary_text", "text": summary_text} + reasoning: ResponseReasoningItemParam = { + "id": item_id, + "type": "reasoning", + "summary": [summary], + } + return cast(TResponseInputItem, reasoning) + + +def _item_ids(items: Sequence[TResponseInputItem]) -> list[str]: + result: list[str] = [] + for item in items: + item_dict = cast(dict[str, Any], item) + result.append(cast(str, item_dict["id"])) + return result + + +@pytest.fixture +def agent() -> Agent: + """Fixture for a basic agent with a fake model.""" + return Agent(name="test", model=FakeModel()) + + +async def test_sqlalchemy_session_direct_ops(agent: Agent): + """Test direct database operations of SQLAlchemySession.""" + session_id = "direct_ops_test" + session = SQLAlchemySession.from_url(https://github.com/session_id,%20url=DB_URL,%20create_tables=True) + + # 1. Add items + items: list[TResponseInputItem] = [ + {"role": "user", "content": "Hello"}, + {"role": "assistant", "content": "Hi there!"}, + ] + await session.add_items(items) + + # 2. Get items and verify + retrieved = await session.get_items() + assert len(retrieved) == 2 + assert retrieved[0].get("content") == "Hello" + assert retrieved[1].get("content") == "Hi there!" + + # 3. Pop item + popped = await session.pop_item() + assert popped is not None + assert popped.get("content") == "Hi there!" + retrieved_after_pop = await session.get_items() + assert len(retrieved_after_pop) == 1 + assert retrieved_after_pop[0].get("content") == "Hello" + + # 4. Clear session + await session.clear_session() + retrieved_after_clear = await session.get_items() + assert len(retrieved_after_clear) == 0 + + +async def test_runner_integration(agent: Agent): + """Test that SQLAlchemySession works correctly with the agent Runner.""" + session_id = "runner_integration_test" + session = SQLAlchemySession.from_url(https://github.com/session_id,%20url=DB_URL,%20create_tables=True) + + # First turn + assert isinstance(agent.model, FakeModel) + agent.model.set_next_output([get_text_message("San Francisco")]) + result1 = await Runner.run( + agent, + "What city is the Golden Gate Bridge in?", + session=session, + ) + assert result1.final_output == "San Francisco" + + # Second turn + agent.model.set_next_output([get_text_message("California")]) + result2 = await Runner.run(agent, "What state is it in?", session=session) + assert result2.final_output == "California" + + # Verify history was passed to the model on the second turn + last_input = agent.model.last_turn_args["input"] + assert len(last_input) > 1 + assert any("Golden Gate Bridge" in str(item.get("content", "")) for item in last_input) + + +async def test_session_isolation(agent: Agent): + """Test that different session IDs result in isolated conversation histories.""" + session_id_1 = "session_1" + session1 = SQLAlchemySession.from_url(https://github.com/session_id_1,%20url=DB_URL,%20create_tables=True) + + session_id_2 = "session_2" + session2 = SQLAlchemySession.from_url(https://github.com/session_id_2,%20url=DB_URL,%20create_tables=True) + + # Interact with session 1 + assert isinstance(agent.model, FakeModel) + agent.model.set_next_output([get_text_message("I like cats.")]) + await Runner.run(agent, "I like cats.", session=session1) + + # Interact with session 2 + agent.model.set_next_output([get_text_message("I like dogs.")]) + await Runner.run(agent, "I like dogs.", session=session2) + + # Go back to session 1 and check its memory + agent.model.set_next_output([get_text_message("You said you like cats.")]) + result = await Runner.run(agent, "What animal did I say I like?", session=session1) + assert "cats" in result.final_output.lower() + assert "dogs" not in result.final_output.lower() + + +async def test_get_items_with_limit(agent: Agent): + """Test the limit parameter in get_items.""" + session_id = "limit_test" + session = SQLAlchemySession.from_url(https://github.com/session_id,%20url=DB_URL,%20create_tables=True) + + items: list[TResponseInputItem] = [ + {"role": "user", "content": "1"}, + {"role": "assistant", "content": "2"}, + {"role": "user", "content": "3"}, + {"role": "assistant", "content": "4"}, + ] + await session.add_items(items) + + # Get last 2 items + latest_2 = await session.get_items(limit=2) + assert len(latest_2) == 2 + assert latest_2[0].get("content") == "3" + assert latest_2[1].get("content") == "4" + + # Get all items + all_items = await session.get_items() + assert len(all_items) == 4 + + # Get more than available + more_than_all = await session.get_items(limit=10) + assert len(more_than_all) == 4 + + +async def test_pop_from_empty_session(): + """Test that pop_item returns None on an empty session.""" + session = SQLAlchemySession.from_url("https://github.com/empty_session%22,%20url=DB_URL,%20create_tables=True) + popped = await session.pop_item() + assert popped is None + + +async def test_add_empty_items_list(): + """Test that adding an empty list of items is a no-op.""" + session_id = "add_empty_test" + session = SQLAlchemySession.from_url(https://github.com/session_id,%20url=DB_URL,%20create_tables=True) + + initial_items = await session.get_items() + assert len(initial_items) == 0 + + await session.add_items([]) + + items_after_add = await session.get_items() + assert len(items_after_add) == 0 + + +async def test_get_items_same_timestamp_consistent_order(): + """Test that items with identical timestamps keep insertion order.""" + session_id = "same_timestamp_test" + session = SQLAlchemySession.from_url(https://github.com/session_id,%20url=DB_URL,%20create_tables=True) + + older_item = _make_message_item("older_same_ts", "old") + reasoning_item = _make_reasoning_item("rs_same_ts", "...") + message_item = _make_message_item("msg_same_ts", "...") + await session.add_items([older_item]) + await session.add_items([reasoning_item, message_item]) + + async with session._session_factory() as sess: + rows = await sess.execute( + select(session._messages.c.id, session._messages.c.message_data).where( + session._messages.c.session_id == session.session_id + ) + ) + id_map = { + json.loads(message_json)["id"]: row_id for row_id, message_json in rows.fetchall() + } + shared = datetime(2025, 10, 15, 17, 26, 39, 132483) + older = shared - timedelta(milliseconds=1) + await sess.execute( + update(session._messages) + .where( + session._messages.c.id.in_( + [ + id_map["rs_same_ts"], + id_map["msg_same_ts"], + ] + ) + ) + .values(created_at=shared) + ) + await sess.execute( + update(session._messages) + .where(session._messages.c.id == id_map["older_same_ts"]) + .values(created_at=older) + ) + await sess.commit() + + real_factory = session._session_factory + + class FakeResult: + def __init__(self, rows: Iterable[Any]): + self._rows = list(rows) + + def all(self) -> list[Any]: + return list(self._rows) + + def needs_shuffle(statement: Any) -> bool: + if not isinstance(statement, Select): + return False + orderings = list(statement._order_by_clause) + if not orderings: + return False + id_asc = session._messages.c.id.asc() + id_desc = session._messages.c.id.desc() + + def references_id(clause) -> bool: + try: + return bool(clause.compare(id_asc) or clause.compare(id_desc)) + except AttributeError: + return False + + if any(references_id(clause) for clause in orderings): + return False + # Only shuffle queries that target the messages table. + target_tables: set[str] = set() + for from_clause in statement.get_final_froms(): + name_attr = getattr(from_clause, "name", None) + if isinstance(name_attr, str): + target_tables.add(name_attr) + table_name_obj = getattr(session._messages, "name", "") + table_name = table_name_obj if isinstance(table_name_obj, str) else "" + return bool(table_name in target_tables) + + @asynccontextmanager + async def shuffled_session(): + async with real_factory() as inner: + original_execute = inner.execute + + async def execute_with_shuffle(statement: Any, *args: Any, **kwargs: Any) -> Any: + result = await original_execute(statement, *args, **kwargs) + if needs_shuffle(statement): + rows = result.all() + shuffled = list(rows) + shuffled.reverse() + return FakeResult(shuffled) + return result + + cast(Any, inner).execute = execute_with_shuffle + try: + yield inner + finally: + cast(Any, inner).execute = original_execute + + session._session_factory = cast(Any, shuffled_session) + try: + retrieved = await session.get_items() + assert _item_ids(retrieved) == ["older_same_ts", "rs_same_ts", "msg_same_ts"] + + latest_two = await session.get_items(limit=2) + assert _item_ids(latest_two) == ["rs_same_ts", "msg_same_ts"] + finally: + session._session_factory = real_factory + + +async def test_pop_item_same_timestamp_returns_latest(): + """Test that pop_item returns the newest item when timestamps tie.""" + session_id = "same_timestamp_pop_test" + session = SQLAlchemySession.from_url(https://github.com/session_id,%20url=DB_URL,%20create_tables=True) + + reasoning_item = _make_reasoning_item("rs_pop_same_ts", "...") + message_item = _make_message_item("msg_pop_same_ts", "...") + await session.add_items([reasoning_item, message_item]) + + async with session._session_factory() as sess: + await sess.execute( + text( + "UPDATE agent_messages SET created_at = :created_at WHERE session_id = :session_id" + ), + { + "created_at": "2025-10-15 17:26:39.132483", + "session_id": session.session_id, + }, + ) + await sess.commit() + + popped = await session.pop_item() + assert popped is not None + assert cast(dict[str, Any], popped)["id"] == "msg_pop_same_ts" + + remaining = await session.get_items() + assert _item_ids(remaining) == ["rs_pop_same_ts"] + + +async def test_get_items_orders_by_id_for_ties(): + """Test that get_items adds id ordering to break timestamp ties.""" + session_id = "order_by_id_test" + session = SQLAlchemySession.from_url(https://github.com/session_id,%20url=DB_URL,%20create_tables=True) + + await session.add_items( + [ + _make_reasoning_item("rs_first", "..."), + _make_message_item("msg_second", "..."), + ] + ) + + real_factory = session._session_factory + recorded: list[Any] = [] + + @asynccontextmanager + async def wrapped_session(): + async with real_factory() as inner: + original_execute = inner.execute + + async def recording_execute(statement: Any, *args: Any, **kwargs: Any) -> Any: + recorded.append(statement) + return await original_execute(statement, *args, **kwargs) + + cast(Any, inner).execute = recording_execute + try: + yield inner + finally: + cast(Any, inner).execute = original_execute + + session._session_factory = cast(Any, wrapped_session) + try: + retrieved_full = await session.get_items() + retrieved_limited = await session.get_items(limit=2) + finally: + session._session_factory = real_factory + + assert len(recorded) >= 2 + orderings_full = [str(clause) for clause in recorded[0]._order_by_clause] + assert orderings_full == [ + "agent_messages.created_at ASC", + "agent_messages.id ASC", + ] + + orderings_limited = [str(clause) for clause in recorded[1]._order_by_clause] + assert orderings_limited == [ + "agent_messages.created_at DESC", + "agent_messages.id DESC", + ] + + assert _item_ids(retrieved_full) == ["rs_first", "msg_second"] + assert _item_ids(retrieved_limited) == ["rs_first", "msg_second"] + + +async def test_engine_property_from_url(): + """Test that the engine property returns the AsyncEngine from from_url.""" + session_id = "engine_property_test" + session = SQLAlchemySession.from_url(https://github.com/session_id,%20url=DB_URL,%20create_tables=True) + + # Verify engine property returns an AsyncEngine instance + assert isinstance(session.engine, AsyncEngine) + + # Verify we can use the engine for advanced operations + # For example, check pool status + assert session.engine.pool is not None + + # Verify we can manually dispose the engine + await session.engine.dispose() + + +async def test_engine_property_from_external_engine(): + """Test that the engine property returns the external engine.""" + session_id = "external_engine_test" + + # Create engine externally + external_engine = create_async_engine(DB_URL) + + # Create session with external engine + session = SQLAlchemySession(session_id, engine=external_engine, create_tables=True) + + # Verify engine property returns the same engine instance + assert session.engine is external_engine + + # Verify we can use the engine + assert isinstance(session.engine, AsyncEngine) + + # Clean up - user is responsible for disposing external engine + await external_engine.dispose() + + +async def test_engine_property_is_read_only(): + """Test that the engine property cannot be modified.""" + session_id = "readonly_engine_test" + session = SQLAlchemySession.from_url(https://github.com/session_id,%20url=DB_URL,%20create_tables=True) + + # Verify engine property exists + assert hasattr(session, "engine") + + # Verify it's a property (read-only, cannot be set) + # Type ignore needed because mypy correctly detects this is read-only + with pytest.raises(AttributeError): + session.engine = create_async_engine(DB_URL) # type: ignore[misc] + + # Clean up + await session.engine.dispose() diff --git a/tests/fake_model.py b/tests/fake_model.py index 6c1377e6d..6e13a02a4 100644 --- a/tests/fake_model.py +++ b/tests/fake_model.py @@ -3,7 +3,33 @@ from collections.abc import AsyncIterator from typing import Any -from openai.types.responses import Response, ResponseCompletedEvent, ResponseUsage +from openai.types.responses import ( + Response, + ResponseCompletedEvent, + ResponseContentPartAddedEvent, + ResponseContentPartDoneEvent, + ResponseCreatedEvent, + ResponseFunctionCallArgumentsDeltaEvent, + ResponseFunctionCallArgumentsDoneEvent, + ResponseFunctionToolCall, + ResponseInProgressEvent, + ResponseOutputItemAddedEvent, + ResponseOutputItemDoneEvent, + ResponseOutputMessage, + ResponseOutputText, + ResponseReasoningSummaryPartAddedEvent, + ResponseReasoningSummaryPartDoneEvent, + ResponseReasoningSummaryTextDeltaEvent, + ResponseReasoningSummaryTextDoneEvent, + ResponseTextDeltaEvent, + ResponseTextDoneEvent, + ResponseUsage, +) +from openai.types.responses.response_reasoning_item import ResponseReasoningItem +from openai.types.responses.response_reasoning_summary_part_added_event import ( + Part as AddedEventPart, +) +from openai.types.responses.response_reasoning_summary_part_done_event import Part as DoneEventPart from openai.types.responses.response_usage import InputTokensDetails, OutputTokensDetails from agents.agent_output import AgentOutputSchemaBase @@ -34,6 +60,7 @@ def __init__( ) self.tracing_enabled = tracing_enabled self.last_turn_args: dict[str, Any] = {} + self.first_turn_args: dict[str, Any] | None = None self.hardcoded_usage: Usage | None = None def set_hardcoded_usage(self, usage: Usage): @@ -61,17 +88,24 @@ async def get_response( tracing: ModelTracing, *, previous_response_id: str | None, + conversation_id: str | None, prompt: Any | None, ) -> ModelResponse: - self.last_turn_args = { + turn_args = { "system_instructions": system_instructions, "input": input, "model_settings": model_settings, "tools": tools, "output_schema": output_schema, "previous_response_id": previous_response_id, + "conversation_id": conversation_id, } + if self.first_turn_args is None: + self.first_turn_args = turn_args.copy() + + self.last_turn_args = turn_args + with generation_span(disabled=not self.tracing_enabled) as span: output = self.get_next_output() @@ -90,7 +124,7 @@ async def get_response( return ModelResponse( output=output, usage=self.hardcoded_usage or Usage(), - response_id=None, + response_id="resp-789", ) async def stream_response( @@ -103,17 +137,24 @@ async def stream_response( handoffs: list[Handoff], tracing: ModelTracing, *, - previous_response_id: str | None, - prompt: Any | None, + previous_response_id: str | None = None, + conversation_id: str | None = None, + prompt: Any | None = None, ) -> AsyncIterator[TResponseStreamEvent]: - self.last_turn_args = { + turn_args = { "system_instructions": system_instructions, "input": input, "model_settings": model_settings, "tools": tools, "output_schema": output_schema, "previous_response_id": previous_response_id, + "conversation_id": conversation_id, } + + if self.first_turn_args is None: + self.first_turn_args = turn_args.copy() + + self.last_turn_args = turn_args with generation_span(disabled=not self.tracing_enabled) as span: output = self.get_next_output() if isinstance(output, Exception): @@ -128,10 +169,152 @@ async def stream_response( ) raise output + response = get_response_obj(output, usage=self.hardcoded_usage) + sequence_number = 0 + + yield ResponseCreatedEvent( + type="response.created", + response=response, + sequence_number=sequence_number, + ) + sequence_number += 1 + + yield ResponseInProgressEvent( + type="response.in_progress", + response=response, + sequence_number=sequence_number, + ) + sequence_number += 1 + + for output_index, output_item in enumerate(output): + yield ResponseOutputItemAddedEvent( + type="response.output_item.added", + item=output_item, + output_index=output_index, + sequence_number=sequence_number, + ) + sequence_number += 1 + + if isinstance(output_item, ResponseReasoningItem): + if output_item.summary: + for summary_index, summary in enumerate(output_item.summary): + yield ResponseReasoningSummaryPartAddedEvent( + type="response.reasoning_summary_part.added", + item_id=output_item.id, + output_index=output_index, + summary_index=summary_index, + part=AddedEventPart(text=summary.text, type=summary.type), + sequence_number=sequence_number, + ) + sequence_number += 1 + + yield ResponseReasoningSummaryTextDeltaEvent( + type="response.reasoning_summary_text.delta", + item_id=output_item.id, + output_index=output_index, + summary_index=summary_index, + delta=summary.text, + sequence_number=sequence_number, + ) + sequence_number += 1 + + yield ResponseReasoningSummaryTextDoneEvent( + type="response.reasoning_summary_text.done", + item_id=output_item.id, + output_index=output_index, + summary_index=summary_index, + text=summary.text, + sequence_number=sequence_number, + ) + sequence_number += 1 + + yield ResponseReasoningSummaryPartDoneEvent( + type="response.reasoning_summary_part.done", + item_id=output_item.id, + output_index=output_index, + summary_index=summary_index, + part=DoneEventPart(text=summary.text, type=summary.type), + sequence_number=sequence_number, + ) + sequence_number += 1 + + elif isinstance(output_item, ResponseFunctionToolCall): + yield ResponseFunctionCallArgumentsDeltaEvent( + type="response.function_call_arguments.delta", + item_id=output_item.call_id, + output_index=output_index, + delta=output_item.arguments, + sequence_number=sequence_number, + ) + sequence_number += 1 + + yield ResponseFunctionCallArgumentsDoneEvent( + type="response.function_call_arguments.done", + item_id=output_item.call_id, + output_index=output_index, + arguments=output_item.arguments, + name=output_item.name, + sequence_number=sequence_number, + ) + sequence_number += 1 + + elif isinstance(output_item, ResponseOutputMessage): + for content_index, content_part in enumerate(output_item.content): + if isinstance(content_part, ResponseOutputText): + yield ResponseContentPartAddedEvent( + type="response.content_part.added", + item_id=output_item.id, + output_index=output_index, + content_index=content_index, + part=content_part, + sequence_number=sequence_number, + ) + sequence_number += 1 + + yield ResponseTextDeltaEvent( + type="response.output_text.delta", + item_id=output_item.id, + output_index=output_index, + content_index=content_index, + delta=content_part.text, + logprobs=[], + sequence_number=sequence_number, + ) + sequence_number += 1 + + yield ResponseTextDoneEvent( + type="response.output_text.done", + item_id=output_item.id, + output_index=output_index, + content_index=content_index, + text=content_part.text, + logprobs=[], + sequence_number=sequence_number, + ) + sequence_number += 1 + + yield ResponseContentPartDoneEvent( + type="response.content_part.done", + item_id=output_item.id, + output_index=output_index, + content_index=content_index, + part=content_part, + sequence_number=sequence_number, + ) + sequence_number += 1 + + yield ResponseOutputItemDoneEvent( + type="response.output_item.done", + item=output_item, + output_index=output_index, + sequence_number=sequence_number, + ) + sequence_number += 1 + yield ResponseCompletedEvent( type="response.completed", - response=get_response_obj(output, usage=self.hardcoded_usage), - sequence_number=0, + response=response, + sequence_number=sequence_number, ) @@ -141,7 +324,7 @@ def get_response_obj( usage: Usage | None = None, ) -> Response: return Response( - id=response_id or "123", + id=response_id or "resp-789", created_at=123, model="test_model", object="response", diff --git a/tests/fastapi/test_streaming_context.py b/tests/fastapi/test_streaming_context.py index ee13045e4..f2b890394 100644 --- a/tests/fastapi/test_streaming_context.py +++ b/tests/fastapi/test_streaming_context.py @@ -25,5 +25,17 @@ async def test_streaming_context(): body = (await r.aread()).decode("utf-8") lines = [line for line in body.splitlines() if line] assert lines == snapshot( - ["agent_updated_stream_event", "raw_response_event", "run_item_stream_event"] + [ + "agent_updated_stream_event", + "raw_response_event", # ResponseCreatedEvent + "raw_response_event", # ResponseInProgressEvent + "raw_response_event", # ResponseOutputItemAddedEvent + "raw_response_event", # ResponseContentPartAddedEvent + "raw_response_event", # ResponseTextDeltaEvent + "raw_response_event", # ResponseTextDoneEvent + "raw_response_event", # ResponseContentPartDoneEvent + "raw_response_event", # ResponseOutputItemDoneEvent + "raw_response_event", # ResponseCompletedEvent + "run_item_stream_event", # MessageOutputItem + ] ) diff --git a/tests/mcp/helpers.py b/tests/mcp/helpers.py index 31d43c228..dec713bf6 100644 --- a/tests/mcp/helpers.py +++ b/tests/mcp/helpers.py @@ -4,7 +4,14 @@ from typing import Any from mcp import Tool as MCPTool -from mcp.types import CallToolResult, GetPromptResult, ListPromptsResult, PromptMessage, TextContent +from mcp.types import ( + CallToolResult, + Content, + GetPromptResult, + ListPromptsResult, + PromptMessage, + TextContent, +) from agents.mcp import MCPServer from agents.mcp.server import _MCPServerWithClientSession @@ -61,11 +68,13 @@ def __init__( tool_filter: ToolFilter = None, server_name: str = "fake_mcp_server", ): + super().__init__(use_structured_content=False) self.tools: list[MCPTool] = tools or [] self.tool_calls: list[str] = [] self.tool_results: list[str] = [] self.tool_filter = tool_filter self._server_name = server_name + self._custom_content: list[Content] | None = None def add_tool(self, name: str, input_schema: dict[str, Any]): self.tools.append(MCPTool(name=name, inputSchema=input_schema)) @@ -90,6 +99,11 @@ async def list_tools(self, run_context=None, agent=None): async def call_tool(self, tool_name: str, arguments: dict[str, Any] | None) -> CallToolResult: self.tool_calls.append(tool_name) self.tool_results.append(f"result_{tool_name}_{json.dumps(arguments)}") + + # Allow testing custom content scenarios + if self._custom_content is not None: + return CallToolResult(content=self._custom_content) + return CallToolResult( content=[TextContent(text=self.tool_results[-1], type="text")], ) diff --git a/tests/mcp/test_client_session_retries.py b/tests/mcp/test_client_session_retries.py new file mode 100644 index 000000000..4cc292a3a --- /dev/null +++ b/tests/mcp/test_client_session_retries.py @@ -0,0 +1,64 @@ +from typing import cast + +import pytest +from mcp import ClientSession, Tool as MCPTool +from mcp.types import CallToolResult, ListToolsResult + +from agents.mcp.server import _MCPServerWithClientSession + + +class DummySession: + def __init__(self, fail_call_tool: int = 0, fail_list_tools: int = 0): + self.fail_call_tool = fail_call_tool + self.fail_list_tools = fail_list_tools + self.call_tool_attempts = 0 + self.list_tools_attempts = 0 + + async def call_tool(self, tool_name, arguments): + self.call_tool_attempts += 1 + if self.call_tool_attempts <= self.fail_call_tool: + raise RuntimeError("call_tool failure") + return CallToolResult(content=[]) + + async def list_tools(self): + self.list_tools_attempts += 1 + if self.list_tools_attempts <= self.fail_list_tools: + raise RuntimeError("list_tools failure") + return ListToolsResult(tools=[MCPTool(name="tool", inputSchema={})]) + + +class DummyServer(_MCPServerWithClientSession): + def __init__(self, session: DummySession, retries: int): + super().__init__( + cache_tools_list=False, + client_session_timeout_seconds=None, + max_retry_attempts=retries, + retry_backoff_seconds_base=0, + ) + self.session = cast(ClientSession, session) + + def create_streams(self): + raise NotImplementedError + + @property + def name(self) -> str: + return "dummy" + + +@pytest.mark.asyncio +async def test_call_tool_retries_until_success(): + session = DummySession(fail_call_tool=2) + server = DummyServer(session=session, retries=2) + result = await server.call_tool("tool", None) + assert isinstance(result, CallToolResult) + assert session.call_tool_attempts == 3 + + +@pytest.mark.asyncio +async def test_list_tools_unlimited_retries(): + session = DummySession(fail_list_tools=3) + server = DummyServer(session=session, retries=-1) + tools = await server.list_tools() + assert len(tools) == 1 + assert tools[0].name == "tool" + assert session.list_tools_attempts == 4 diff --git a/tests/mcp/test_mcp_tracing.py b/tests/mcp/test_mcp_tracing.py index 54575dcb5..33dfa5ea1 100644 --- a/tests/mcp/test_mcp_tracing.py +++ b/tests/mcp/test_mcp_tracing.py @@ -62,7 +62,7 @@ async def test_mcp_tracing(): "data": { "name": "test_tool_1", "input": "", - "output": '{"type":"text","text":"result_test_tool_1_{}","annotations":null}', # noqa: E501 + "output": '{"type":"text","text":"result_test_tool_1_{}","annotations":null,"meta":null}', # noqa: E501 "mcp_data": {"server": "fake_mcp_server"}, }, }, @@ -133,7 +133,7 @@ async def test_mcp_tracing(): "data": { "name": "test_tool_2", "input": "", - "output": '{"type":"text","text":"result_test_tool_2_{}","annotations":null}', # noqa: E501 + "output": '{"type":"text","text":"result_test_tool_2_{}","annotations":null,"meta":null}', # noqa: E501 "mcp_data": {"server": "fake_mcp_server"}, }, }, @@ -197,7 +197,7 @@ async def test_mcp_tracing(): "data": { "name": "test_tool_3", "input": "", - "output": '{"type":"text","text":"result_test_tool_3_{}","annotations":null}', # noqa: E501 + "output": '{"type":"text","text":"result_test_tool_3_{}","annotations":null,"meta":null}', # noqa: E501 "mcp_data": {"server": "fake_mcp_server"}, }, }, diff --git a/tests/mcp/test_mcp_util.py b/tests/mcp/test_mcp_util.py index 3230e63dd..e434f7542 100644 --- a/tests/mcp/test_mcp_util.py +++ b/tests/mcp/test_mcp_util.py @@ -3,7 +3,7 @@ import pytest from inline_snapshot import snapshot -from mcp.types import Tool as MCPTool +from mcp.types import CallToolResult, TextContent, Tool as MCPTool from pydantic import BaseModel, TypeAdapter from agents import Agent, FunctionTool, RunContextWrapper @@ -234,6 +234,60 @@ async def test_agent_convert_schemas_false(): assert baz_tool.strict_json_schema is False, "Shouldn't be converted unless specified" +@pytest.mark.asyncio +async def test_mcp_fastmcp_behavior_verification(): + """Test that verifies the exact FastMCP _convert_to_content behavior we observed. + + Based on our testing, FastMCP's _convert_to_content function behaves as follows: + - None → content=[] → MCPUtil returns "[]" + - [] → content=[] → MCPUtil returns "[]" + - {} → content=[TextContent(text="{}")] → MCPUtil returns full JSON + - [{}] → content=[TextContent(text="{}")] → MCPUtil returns full JSON (flattened) + - [[]] → content=[] → MCPUtil returns "[]" (recursive empty) + """ + + from mcp.types import TextContent + + server = FakeMCPServer() + server.add_tool("test_tool", {}) + + ctx = RunContextWrapper(context=None) + tool = MCPTool(name="test_tool", inputSchema={}) + + # Case 1: None -> "[]". + server._custom_content = [] + result = await MCPUtil.invoke_mcp_tool(server, tool, ctx, "") + assert result == "[]", f"None should return '[]', got {result}" + + # Case 2: [] -> "[]". + server._custom_content = [] + result = await MCPUtil.invoke_mcp_tool(server, tool, ctx, "") + assert result == "[]", f"[] should return '[]', got {result}" + + # Case 3: {} -> {"type":"text","text":"{}","annotations":null,"meta":null}. + server._custom_content = [TextContent(text="{}", type="text")] + result = await MCPUtil.invoke_mcp_tool(server, tool, ctx, "") + expected = '{"type":"text","text":"{}","annotations":null,"meta":null}' + assert result == expected, f"{{}} should return {expected}, got {result}" + + # Case 4: [{}] -> {"type":"text","text":"{}","annotations":null,"meta":null}. + server._custom_content = [TextContent(text="{}", type="text")] + result = await MCPUtil.invoke_mcp_tool(server, tool, ctx, "") + expected = '{"type":"text","text":"{}","annotations":null,"meta":null}' + assert result == expected, f"[{{}}] should return {expected}, got {result}" + + # Case 5: [[]] -> "[]". + server._custom_content = [] + result = await MCPUtil.invoke_mcp_tool(server, tool, ctx, "") + assert result == "[]", f"[[]] should return '[]', got {result}" + + # Case 6: String values work normally. + server._custom_content = [TextContent(text="hello", type="text")] + result = await MCPUtil.invoke_mcp_tool(server, tool, ctx, "") + expected = '{"type":"text","text":"hello","annotations":null,"meta":null}' + assert result == expected, f"String should return {expected}, got {result}" + + @pytest.mark.asyncio async def test_agent_convert_schemas_unset(): """Test that leaving convert_schemas_to_strict unset (defaulting to False) leaves tool schemas @@ -297,3 +351,327 @@ async def test_util_adds_properties(): assert tool.params_json_schema == snapshot( {"type": "object", "description": "Test tool", "properties": {}} ) + + +class StructuredContentTestServer(FakeMCPServer): + """Test server that allows setting both content and structured content for testing.""" + + def __init__(self, use_structured_content: bool = False, **kwargs): + super().__init__(**kwargs) + self.use_structured_content = use_structured_content + self._test_content: list[Any] = [] + self._test_structured_content: dict[str, Any] | None = None + + def set_test_result(self, content: list[Any], structured_content: dict[str, Any] | None = None): + """Set the content and structured content that will be returned by call_tool.""" + self._test_content = content + self._test_structured_content = structured_content + + async def call_tool(self, tool_name: str, arguments: dict[str, Any] | None) -> CallToolResult: + """Return test result with specified content and structured content.""" + self.tool_calls.append(tool_name) + + return CallToolResult( + content=self._test_content, structuredContent=self._test_structured_content + ) + + +@pytest.mark.parametrize( + "use_structured_content,content,structured_content,expected_output", + [ + # Scenario 1: use_structured_content=True with structured content available + # Should return only structured content + ( + True, + [TextContent(text="text content", type="text")], + {"data": "structured_value", "type": "structured"}, + '{"data": "structured_value", "type": "structured"}', + ), + # Scenario 2: use_structured_content=False with structured content available + # Should return text content only (structured content ignored) + ( + False, + [TextContent(text="text content", type="text")], + {"data": "structured_value", "type": "structured"}, + '{"type":"text","text":"text content","annotations":null,"meta":null}', + ), + # Scenario 3: use_structured_content=True but no structured content + # Should fall back to text content + ( + True, + [TextContent(text="fallback text", type="text")], + None, + '{"type":"text","text":"fallback text","annotations":null,"meta":null}', + ), + # Scenario 4: use_structured_content=True with empty structured content (falsy) + # Should fall back to text content + ( + True, + [TextContent(text="fallback text", type="text")], + {}, + '{"type":"text","text":"fallback text","annotations":null,"meta":null}', + ), + # Scenario 5: use_structured_content=True, structured content available, empty text content + # Should return structured content + (True, [], {"message": "only structured"}, '{"message": "only structured"}'), + # Scenario 6: use_structured_content=False, multiple text content items + # Should return JSON array of text content + ( + False, + [TextContent(text="first", type="text"), TextContent(text="second", type="text")], + {"ignored": "structured"}, + '[{"type": "text", "text": "first", "annotations": null, "meta": null}, ' + '{"type": "text", "text": "second", "annotations": null, "meta": null}]', + ), + # Scenario 7: use_structured_content=True, multiple text content, with structured content + # Should return only structured content (text content ignored) + ( + True, + [ + TextContent(text="ignored first", type="text"), + TextContent(text="ignored second", type="text"), + ], + {"priority": "structured"}, + '{"priority": "structured"}', + ), + # Scenario 8: use_structured_content=False, empty content + # Should return empty array + (False, [], None, "[]"), + # Scenario 9: use_structured_content=True, empty content, no structured content + # Should return empty array + (True, [], None, "[]"), + ], +) +@pytest.mark.asyncio +async def test_structured_content_handling( + use_structured_content: bool, + content: list[Any], + structured_content: dict[str, Any] | None, + expected_output: str, +): + """Test that structured content handling works correctly with various scenarios. + + This test verifies the fix for the MCP tool output logic where: + - When use_structured_content=True and structured content exists, it's used exclusively + - When use_structured_content=False or no structured content, falls back to text content + - The old unreachable code path has been fixed + """ + + server = StructuredContentTestServer(use_structured_content=use_structured_content) + server.add_tool("test_tool", {}) + server.set_test_result(content, structured_content) + + ctx = RunContextWrapper(context=None) + tool = MCPTool(name="test_tool", inputSchema={}) + + result = await MCPUtil.invoke_mcp_tool(server, tool, ctx, "{}") + assert result == expected_output + + +@pytest.mark.asyncio +async def test_structured_content_priority_over_text(): + """Test that when use_structured_content=True, structured content takes priority. + + This verifies the core fix: structured content should be used exclusively when available + and requested, not concatenated with text content. + """ + + server = StructuredContentTestServer(use_structured_content=True) + server.add_tool("priority_test", {}) + + # Set both text and structured content + text_content = [TextContent(text="This should be ignored", type="text")] + structured_content = {"important": "This should be returned", "value": 42} + server.set_test_result(text_content, structured_content) + + ctx = RunContextWrapper(context=None) + tool = MCPTool(name="priority_test", inputSchema={}) + + result = await MCPUtil.invoke_mcp_tool(server, tool, ctx, "{}") + + # Should return only structured content + import json + + parsed_result = json.loads(result) + assert parsed_result == structured_content + assert "This should be ignored" not in result + + +@pytest.mark.asyncio +async def test_structured_content_fallback_behavior(): + """Test fallback behavior when structured content is requested but not available. + + This verifies that the logic properly falls back to text content processing + when use_structured_content=True but no structured content is provided. + """ + + server = StructuredContentTestServer(use_structured_content=True) + server.add_tool("fallback_test", {}) + + # Set only text content, no structured content + text_content = [TextContent(text="Fallback content", type="text")] + server.set_test_result(text_content, None) + + ctx = RunContextWrapper(context=None) + tool = MCPTool(name="fallback_test", inputSchema={}) + + result = await MCPUtil.invoke_mcp_tool(server, tool, ctx, "{}") + + # Should fall back to text content + import json + + parsed_result = json.loads(result) + assert parsed_result["text"] == "Fallback content" + assert parsed_result["type"] == "text" + + +@pytest.mark.asyncio +async def test_backwards_compatibility_unchanged(): + """Test that default behavior (use_structured_content=False) remains unchanged. + + This ensures the fix doesn't break existing behavior for servers that don't use + structured content or have it disabled. + """ + + server = StructuredContentTestServer(use_structured_content=False) + server.add_tool("compat_test", {}) + + # Set both text and structured content + text_content = [TextContent(text="Traditional text output", type="text")] + structured_content = {"modern": "structured output"} + server.set_test_result(text_content, structured_content) + + ctx = RunContextWrapper(context=None) + tool = MCPTool(name="compat_test", inputSchema={}) + + result = await MCPUtil.invoke_mcp_tool(server, tool, ctx, "{}") + + # Should return only text content (structured content ignored) + import json + + parsed_result = json.loads(result) + assert parsed_result["text"] == "Traditional text output" + assert "modern" not in result + + +@pytest.mark.asyncio +async def test_empty_structured_content_fallback(): + """Test that empty structured content (falsy values) falls back to text content. + + This tests the condition: if server.use_structured_content and result.structuredContent + where empty dict {} should be falsy and trigger fallback. + """ + + server = StructuredContentTestServer(use_structured_content=True) + server.add_tool("empty_structured_test", {}) + + # Set text content and empty structured content + text_content = [TextContent(text="Should use this text", type="text")] + empty_structured: dict[str, Any] = {} # This should be falsy + server.set_test_result(text_content, empty_structured) + + ctx = RunContextWrapper(context=None) + tool = MCPTool(name="empty_structured_test", inputSchema={}) + + result = await MCPUtil.invoke_mcp_tool(server, tool, ctx, "{}") + + # Should fall back to text content because empty dict is falsy + import json + + parsed_result = json.loads(result) + assert parsed_result["text"] == "Should use this text" + assert parsed_result["type"] == "text" + + +@pytest.mark.asyncio +async def test_complex_structured_content(): + """Test handling of complex structured content with nested objects and arrays.""" + + server = StructuredContentTestServer(use_structured_content=True) + server.add_tool("complex_test", {}) + + # Set complex structured content + complex_structured = { + "results": [ + {"id": 1, "name": "Item 1", "metadata": {"tags": ["a", "b"]}}, + {"id": 2, "name": "Item 2", "metadata": {"tags": ["c", "d"]}}, + ], + "pagination": {"page": 1, "total": 2}, + "status": "success", + } + + server.set_test_result([], complex_structured) + + ctx = RunContextWrapper(context=None) + tool = MCPTool(name="complex_test", inputSchema={}) + + result = await MCPUtil.invoke_mcp_tool(server, tool, ctx, "{}") + + # Should return the complex structured content as-is + import json + + parsed_result = json.loads(result) + assert parsed_result == complex_structured + assert len(parsed_result["results"]) == 2 + assert parsed_result["pagination"]["total"] == 2 + + +@pytest.mark.asyncio +async def test_multiple_content_items_with_structured(): + """Test that multiple text content items are ignored when structured content is available. + + This verifies that the new logic prioritizes structured content over multiple text items, + which was one of the scenarios that had unclear behavior in the old implementation. + """ + + server = StructuredContentTestServer(use_structured_content=True) + server.add_tool("multi_content_test", {}) + + # Set multiple text content items and structured content + text_content = [ + TextContent(text="First text item", type="text"), + TextContent(text="Second text item", type="text"), + TextContent(text="Third text item", type="text"), + ] + structured_content = {"chosen": "structured over multiple text items"} + server.set_test_result(text_content, structured_content) + + ctx = RunContextWrapper(context=None) + tool = MCPTool(name="multi_content_test", inputSchema={}) + + result = await MCPUtil.invoke_mcp_tool(server, tool, ctx, "{}") + + # Should return only structured content, ignoring all text items + import json + + parsed_result = json.loads(result) + assert parsed_result == structured_content + assert "First text item" not in result + assert "Second text item" not in result + assert "Third text item" not in result + + +@pytest.mark.asyncio +async def test_multiple_content_items_without_structured(): + """Test that multiple text content items are properly handled when no structured content.""" + + server = StructuredContentTestServer(use_structured_content=True) + server.add_tool("multi_text_test", {}) + + # Set multiple text content items without structured content + text_content = [TextContent(text="First", type="text"), TextContent(text="Second", type="text")] + server.set_test_result(text_content, None) + + ctx = RunContextWrapper(context=None) + tool = MCPTool(name="multi_text_test", inputSchema={}) + + result = await MCPUtil.invoke_mcp_tool(server, tool, ctx, "{}") + + # Should return JSON array of text content items + import json + + parsed_result = json.loads(result) + assert isinstance(parsed_result, list) + assert len(parsed_result) == 2 + assert parsed_result[0]["text"] == "First" + assert parsed_result[1]["text"] == "Second" diff --git a/tests/mcp/test_message_handler.py b/tests/mcp/test_message_handler.py new file mode 100644 index 000000000..82ac1e214 --- /dev/null +++ b/tests/mcp/test_message_handler.py @@ -0,0 +1,128 @@ +import contextlib + +import anyio +import pytest +from mcp.client.session import MessageHandlerFnT +from mcp.shared.message import SessionMessage +from mcp.shared.session import RequestResponder +from mcp.types import ( + ClientResult, + Implementation, + InitializeResult, + ServerCapabilities, + ServerNotification, + ServerRequest, +) + +from agents.mcp.server import ( + MCPServerSse, + MCPServerStdio, + MCPServerStreamableHttp, + _MCPServerWithClientSession, +) + +HandlerMessage = RequestResponder[ServerRequest, ClientResult] | ServerNotification | Exception + + +class _StubClientSession: + """Stub ClientSession that records the configured message handler.""" + + def __init__( + self, + read_stream, + write_stream, + read_timeout_seconds, + *, + message_handler=None, + **_: object, + ) -> None: + self.message_handler = message_handler + + async def __aenter__(self): + return self + + async def __aexit__(self, exc_type, exc, tb): + return False + + async def initialize(self) -> InitializeResult: + capabilities = ServerCapabilities.model_construct() + server_info = Implementation.model_construct(name="stub", version="1.0") + return InitializeResult( + protocolVersion="2024-11-05", + capabilities=capabilities, + serverInfo=server_info, + ) + + +class _MessageHandlerTestServer(_MCPServerWithClientSession): + def __init__(self, handler: MessageHandlerFnT | None): + super().__init__( + cache_tools_list=False, + client_session_timeout_seconds=None, + message_handler=handler, + ) + + def create_streams(self): + @contextlib.asynccontextmanager + async def _streams(): + send_stream, recv_stream = anyio.create_memory_object_stream[ + SessionMessage | Exception + ](1) + try: + yield recv_stream, send_stream, None + finally: + await recv_stream.aclose() + await send_stream.aclose() + + return _streams() + + @property + def name(self) -> str: + return "test-server" + + +@pytest.mark.asyncio +async def test_client_session_receives_message_handler(monkeypatch): + captured: dict[str, object] = {} + + def _recording_client_session(*args, **kwargs): + session = _StubClientSession(*args, **kwargs) + captured["message_handler"] = session.message_handler + return session + + monkeypatch.setattr("agents.mcp.server.ClientSession", _recording_client_session) + + class _AsyncHandler: + async def __call__(self, message: HandlerMessage) -> None: + del message + + handler: MessageHandlerFnT = _AsyncHandler() + + server = _MessageHandlerTestServer(handler) + + try: + await server.connect() + finally: + await server.cleanup() + + assert captured["message_handler"] is handler + + +@pytest.mark.parametrize( + "server_cls, params", + [ + (MCPServerSse, {"url": "https://example.com/"}), + (MCPServerStreamableHttp, {"url": "https://example.com/"}), + (MCPServerStdio, {"command": "python"}), + ], +) +def test_message_handler_propagates_to_server_base(server_cls, params): + class _AsyncHandler: + async def __call__(self, message: HandlerMessage) -> None: + del message + + handler: MessageHandlerFnT = _AsyncHandler() + + server = server_cls(params, message_handler=handler) + + assert server.message_handler is handler diff --git a/tests/mcp/test_streamable_http_client_factory.py b/tests/mcp/test_streamable_http_client_factory.py new file mode 100644 index 000000000..f78807c13 --- /dev/null +++ b/tests/mcp/test_streamable_http_client_factory.py @@ -0,0 +1,247 @@ +"""Tests for MCPServerStreamableHttp httpx_client_factory functionality.""" + +from unittest.mock import MagicMock, patch + +import httpx +import pytest + +from agents.mcp import MCPServerStreamableHttp + + +class TestMCPServerStreamableHttpClientFactory: + """Test cases for custom httpx_client_factory parameter.""" + + @pytest.mark.asyncio + async def test_default_httpx_client_factory(self): + """Test that default behavior works when no custom factory is provided.""" + # Mock the streamablehttp_client to avoid actual network calls + with patch("agents.mcp.server.streamablehttp_client") as mock_client: + mock_client.return_value = MagicMock() + + server = MCPServerStreamableHttp( + params={ + "url": "http://localhost:8000/mcp", + "headers": {"Authorization": "Bearer token"}, + "timeout": 10, + } + ) + + # Create streams should not pass httpx_client_factory when not provided + server.create_streams() + + # Verify streamablehttp_client was called with correct parameters + mock_client.assert_called_once_with( + url="http://localhost:8000/mcp", + headers={"Authorization": "Bearer token"}, + timeout=10, + sse_read_timeout=300, # Default value + terminate_on_close=True, # Default value + # httpx_client_factory should not be passed when not provided + ) + + @pytest.mark.asyncio + async def test_custom_httpx_client_factory(self): + """Test that custom httpx_client_factory is passed correctly.""" + + # Create a custom factory function + def custom_factory( + headers: dict[str, str] | None = None, + timeout: httpx.Timeout | None = None, + auth: httpx.Auth | None = None, + ) -> httpx.AsyncClient: + return httpx.AsyncClient( + verify=False, # Disable SSL verification for testing + timeout=httpx.Timeout(60.0), + headers={"X-Custom-Header": "test"}, + ) + + # Mock the streamablehttp_client to avoid actual network calls + with patch("agents.mcp.server.streamablehttp_client") as mock_client: + mock_client.return_value = MagicMock() + + server = MCPServerStreamableHttp( + params={ + "url": "http://localhost:8000/mcp", + "headers": {"Authorization": "Bearer token"}, + "timeout": 10, + "httpx_client_factory": custom_factory, + } + ) + + # Create streams should pass the custom factory + server.create_streams() + + # Verify streamablehttp_client was called with the custom factory + mock_client.assert_called_once_with( + url="http://localhost:8000/mcp", + headers={"Authorization": "Bearer token"}, + timeout=10, + sse_read_timeout=300, # Default value + terminate_on_close=True, # Default value + httpx_client_factory=custom_factory, + ) + + @pytest.mark.asyncio + async def test_custom_httpx_client_factory_with_ssl_cert(self): + """Test custom factory with SSL certificate configuration.""" + + def ssl_cert_factory( + headers: dict[str, str] | None = None, + timeout: httpx.Timeout | None = None, + auth: httpx.Auth | None = None, + ) -> httpx.AsyncClient: + return httpx.AsyncClient( + verify="/path/to/cert.pem", # Custom SSL certificate + timeout=httpx.Timeout(120.0), + ) + + with patch("agents.mcp.server.streamablehttp_client") as mock_client: + mock_client.return_value = MagicMock() + + server = MCPServerStreamableHttp( + params={ + "url": "https://secure-server.com/mcp", + "timeout": 30, + "httpx_client_factory": ssl_cert_factory, + } + ) + + server.create_streams() + + mock_client.assert_called_once_with( + url="https://secure-server.com/mcp", + headers=None, + timeout=30, + sse_read_timeout=300, + terminate_on_close=True, + httpx_client_factory=ssl_cert_factory, + ) + + @pytest.mark.asyncio + async def test_custom_httpx_client_factory_with_proxy(self): + """Test custom factory with proxy configuration.""" + + def proxy_factory( + headers: dict[str, str] | None = None, + timeout: httpx.Timeout | None = None, + auth: httpx.Auth | None = None, + ) -> httpx.AsyncClient: + return httpx.AsyncClient( + proxy="http://proxy.example.com:8080/", + timeout=httpx.Timeout(60.0), + ) + + with patch("agents.mcp.server.streamablehttp_client") as mock_client: + mock_client.return_value = MagicMock() + + server = MCPServerStreamableHttp( + params={ + "url": "http://localhost:8000/mcp", + "httpx_client_factory": proxy_factory, + } + ) + + server.create_streams() + + mock_client.assert_called_once_with( + url="http://localhost:8000/mcp", + headers=None, + timeout=5, # Default value + sse_read_timeout=300, + terminate_on_close=True, + httpx_client_factory=proxy_factory, + ) + + @pytest.mark.asyncio + async def test_custom_httpx_client_factory_with_retry_logic(self): + """Test custom factory with retry logic configuration.""" + + def retry_factory( + headers: dict[str, str] | None = None, + timeout: httpx.Timeout | None = None, + auth: httpx.Auth | None = None, + ) -> httpx.AsyncClient: + return httpx.AsyncClient( + timeout=httpx.Timeout(30.0), + # Note: httpx doesn't have built-in retry, but this shows how + # a custom factory could be used to configure retry behavior + # through middleware or other mechanisms + ) + + with patch("agents.mcp.server.streamablehttp_client") as mock_client: + mock_client.return_value = MagicMock() + + server = MCPServerStreamableHttp( + params={ + "url": "http://localhost:8000/mcp", + "httpx_client_factory": retry_factory, + } + ) + + server.create_streams() + + mock_client.assert_called_once_with( + url="http://localhost:8000/mcp", + headers=None, + timeout=5, + sse_read_timeout=300, + terminate_on_close=True, + httpx_client_factory=retry_factory, + ) + + def test_httpx_client_factory_type_annotation(self): + """Test that the type annotation is correct for httpx_client_factory.""" + from agents.mcp.server import MCPServerStreamableHttpParams + + # This test ensures the type annotation is properly set + # We can't easily test the TypedDict at runtime, but we can verify + # that the import works and the type is available + assert hasattr(MCPServerStreamableHttpParams, "__annotations__") + + # Verify that the httpx_client_factory parameter is in the annotations + annotations = MCPServerStreamableHttpParams.__annotations__ + assert "httpx_client_factory" in annotations + + # The annotation should contain the string representation of the type + annotation_str = str(annotations["httpx_client_factory"]) + assert "HttpClientFactory" in annotation_str + + @pytest.mark.asyncio + async def test_all_parameters_with_custom_factory(self): + """Test that all parameters work together with custom factory.""" + + def comprehensive_factory( + headers: dict[str, str] | None = None, + timeout: httpx.Timeout | None = None, + auth: httpx.Auth | None = None, + ) -> httpx.AsyncClient: + return httpx.AsyncClient( + verify=False, + timeout=httpx.Timeout(90.0), + headers={"X-Test": "value"}, + ) + + with patch("agents.mcp.server.streamablehttp_client") as mock_client: + mock_client.return_value = MagicMock() + + server = MCPServerStreamableHttp( + params={ + "url": "https://api.example.com/mcp", + "headers": {"Authorization": "Bearer token"}, + "timeout": 45, + "sse_read_timeout": 600, + "terminate_on_close": False, + "httpx_client_factory": comprehensive_factory, + } + ) + + server.create_streams() + + mock_client.assert_called_once_with( + url="https://api.example.com/mcp", + headers={"Authorization": "Bearer token"}, + timeout=45, + sse_read_timeout=600, + terminate_on_close=False, + httpx_client_factory=comprehensive_factory, + ) diff --git a/tests/model_settings/test_serialization.py b/tests/model_settings/test_serialization.py index 6e8c65180..f099a1a31 100644 --- a/tests/model_settings/test_serialization.py +++ b/tests/model_settings/test_serialization.py @@ -58,6 +58,8 @@ def test_all_fields_serialization() -> None: store=False, include_usage=False, response_include=["reasoning.encrypted_content"], + top_logprobs=1, + verbosity="low", extra_query={"foo": "bar"}, extra_body={"foo": "bar"}, extra_headers={"foo": "bar"}, @@ -164,6 +166,7 @@ def test_pydantic_serialization() -> None: metadata={"foo": "bar"}, store=False, include_usage=False, + top_logprobs=1, extra_query={"foo": "bar"}, extra_body={"foo": "bar"}, extra_headers={"foo": "bar"}, diff --git a/tests/models/test_default_models.py b/tests/models/test_default_models.py new file mode 100644 index 000000000..ae8abdda5 --- /dev/null +++ b/tests/models/test_default_models.py @@ -0,0 +1,75 @@ +import os +from unittest.mock import patch + +from agents import Agent +from agents.model_settings import ModelSettings +from agents.models import ( + get_default_model, + get_default_model_settings, + gpt_5_reasoning_settings_required, + is_gpt_5_default, +) + + +def test_default_model_is_gpt_4_1(): + assert get_default_model() == "gpt-4.1" + assert is_gpt_5_default() is False + assert gpt_5_reasoning_settings_required(get_default_model()) is False + assert get_default_model_settings().reasoning is None + + +@patch.dict(os.environ, {"OPENAI_DEFAULT_MODEL": "gpt-5"}) +def test_default_model_env_gpt_5(): + assert get_default_model() == "gpt-5" + assert is_gpt_5_default() is True + assert gpt_5_reasoning_settings_required(get_default_model()) is True + assert get_default_model_settings().reasoning.effort == "low" # type: ignore[union-attr] + + +@patch.dict(os.environ, {"OPENAI_DEFAULT_MODEL": "gpt-5-mini"}) +def test_default_model_env_gpt_5_mini(): + assert get_default_model() == "gpt-5-mini" + assert is_gpt_5_default() is True + assert gpt_5_reasoning_settings_required(get_default_model()) is True + assert get_default_model_settings().reasoning.effort == "low" # type: ignore[union-attr] + + +@patch.dict(os.environ, {"OPENAI_DEFAULT_MODEL": "gpt-5-nano"}) +def test_default_model_env_gpt_5_nano(): + assert get_default_model() == "gpt-5-nano" + assert is_gpt_5_default() is True + assert gpt_5_reasoning_settings_required(get_default_model()) is True + assert get_default_model_settings().reasoning.effort == "low" # type: ignore[union-attr] + + +@patch.dict(os.environ, {"OPENAI_DEFAULT_MODEL": "gpt-5-chat-latest"}) +def test_default_model_env_gpt_5_chat_latest(): + assert get_default_model() == "gpt-5-chat-latest" + assert is_gpt_5_default() is False + assert gpt_5_reasoning_settings_required(get_default_model()) is False + assert get_default_model_settings().reasoning is None + + +@patch.dict(os.environ, {"OPENAI_DEFAULT_MODEL": "gpt-4o"}) +def test_default_model_env_gpt_4o(): + assert get_default_model() == "gpt-4o" + assert is_gpt_5_default() is False + assert gpt_5_reasoning_settings_required(get_default_model()) is False + assert get_default_model_settings().reasoning is None + + +@patch.dict(os.environ, {"OPENAI_DEFAULT_MODEL": "gpt-5"}) +def test_agent_uses_gpt_5_default_model_settings(): + """Agent should inherit GPT-5 default model settings.""" + agent = Agent(name="test") + assert agent.model is None + assert agent.model_settings.reasoning.effort == "low" # type: ignore[union-attr] + assert agent.model_settings.verbosity == "low" + + +@patch.dict(os.environ, {"OPENAI_DEFAULT_MODEL": "gpt-5"}) +def test_agent_resets_model_settings_for_non_gpt_5_models(): + """Agent should reset default GPT-5 settings when using a non-GPT-5 model.""" + agent = Agent(name="test", model="gpt-4o") + assert agent.model == "gpt-4o" + assert agent.model_settings == ModelSettings() diff --git a/tests/models/test_kwargs_functionality.py b/tests/models/test_kwargs_functionality.py index 210610a02..31c166ecc 100644 --- a/tests/models/test_kwargs_functionality.py +++ b/tests/models/test_kwargs_functionality.py @@ -47,6 +47,7 @@ async def fake_acompletion(model, messages=None, **kwargs): handoffs=[], tracing=ModelTracing.DISABLED, previous_response_id=None, + conversation_id=None, ) # Verify that all kwargs were passed through @@ -175,3 +176,41 @@ async def fake_acompletion(model, messages=None, **kwargs): # Should work without error and include regular parameters assert captured["temperature"] == 0.3 + + +@pytest.mark.allow_call_model_methods +@pytest.mark.asyncio +async def test_reasoning_effort_falls_back_to_extra_args(monkeypatch): + """ + Ensure reasoning_effort from extra_args is promoted when reasoning settings are missing. + """ + captured: dict[str, object] = {} + + async def fake_acompletion(model, messages=None, **kwargs): + captured.update(kwargs) + msg = Message(role="assistant", content="test response") + choice = Choices(index=0, message=msg) + return ModelResponse(choices=[choice], usage=Usage(0, 0, 0)) + + monkeypatch.setattr(litellm, "acompletion", fake_acompletion) + + # GitHub issue context: https://github.com/openai/openai-agents-python/issues/1764. + settings = ModelSettings( + extra_args={"reasoning_effort": "none", "custom_param": "custom_value"} + ) + model = LitellmModel(model="test-model") + + await model.get_response( + system_instructions=None, + input="test input", + model_settings=settings, + tools=[], + output_schema=None, + handoffs=[], + tracing=ModelTracing.DISABLED, + previous_response_id=None, + ) + + assert captured["reasoning_effort"] == "none" + assert captured["custom_param"] == "custom_value" + assert settings.extra_args == {"reasoning_effort": "none", "custom_param": "custom_value"} diff --git a/tests/models/test_litellm_chatcompletions_stream.py b/tests/models/test_litellm_chatcompletions_stream.py index cd342e444..d8b79d542 100644 --- a/tests/models/test_litellm_chatcompletions_stream.py +++ b/tests/models/test_litellm_chatcompletions_stream.py @@ -90,6 +90,7 @@ async def patched_fetch_response(self, *args, **kwargs): handoffs=[], tracing=ModelTracing.DISABLED, previous_response_id=None, + conversation_id=None, prompt=None, ): output_events.append(event) @@ -183,6 +184,7 @@ async def patched_fetch_response(self, *args, **kwargs): handoffs=[], tracing=ModelTracing.DISABLED, previous_response_id=None, + conversation_id=None, prompt=None, ): output_events.append(event) @@ -214,17 +216,18 @@ async def test_stream_response_yields_events_for_tool_call(monkeypatch) -> None: the model is streaming a function/tool call instead of plain text. The function call will be split across two chunks. """ - # Simulate a single tool call whose ID stays constant and function name/args built over chunks. + # Simulate a single tool call with complete function name in first chunk + # and arguments split across chunks (reflecting real API behavior) tool_call_delta1 = ChoiceDeltaToolCall( index=0, id="tool-id", - function=ChoiceDeltaToolCallFunction(name="my_", arguments="arg1"), + function=ChoiceDeltaToolCallFunction(name="my_func", arguments="arg1"), type="function", ) tool_call_delta2 = ChoiceDeltaToolCall( index=0, id="tool-id", - function=ChoiceDeltaToolCallFunction(name="func", arguments="arg2"), + function=ChoiceDeltaToolCallFunction(name=None, arguments="arg2"), type="function", ) chunk1 = ChatCompletionChunk( @@ -272,6 +275,7 @@ async def patched_fetch_response(self, *args, **kwargs): handoffs=[], tracing=ModelTracing.DISABLED, previous_response_id=None, + conversation_id=None, prompt=None, ): output_events.append(event) @@ -284,18 +288,132 @@ async def patched_fetch_response(self, *args, **kwargs): # The added item should be a ResponseFunctionToolCall. added_fn = output_events[1].item assert isinstance(added_fn, ResponseFunctionToolCall) - assert added_fn.name == "my_func" # Name should be concatenation of both chunks. - assert added_fn.arguments == "arg1arg2" + assert added_fn.name == "my_func" # Name should be complete from first chunk + assert added_fn.arguments == "" # Arguments start empty assert output_events[2].type == "response.function_call_arguments.delta" - assert output_events[2].delta == "arg1arg2" - assert output_events[3].type == "response.output_item.done" - assert output_events[4].type == "response.completed" - assert output_events[2].delta == "arg1arg2" - assert output_events[3].type == "response.output_item.done" - assert output_events[4].type == "response.completed" - assert added_fn.name == "my_func" # Name should be concatenation of both chunks. - assert added_fn.arguments == "arg1arg2" - assert output_events[2].type == "response.function_call_arguments.delta" - assert output_events[2].delta == "arg1arg2" - assert output_events[3].type == "response.output_item.done" - assert output_events[4].type == "response.completed" + assert output_events[2].delta == "arg1" # First argument chunk + assert output_events[3].type == "response.function_call_arguments.delta" + assert output_events[3].delta == "arg2" # Second argument chunk + assert output_events[4].type == "response.output_item.done" + assert output_events[5].type == "response.completed" + # Final function call should have complete arguments + final_fn = output_events[4].item + assert isinstance(final_fn, ResponseFunctionToolCall) + assert final_fn.name == "my_func" + assert final_fn.arguments == "arg1arg2" + + +@pytest.mark.allow_call_model_methods +@pytest.mark.asyncio +async def test_stream_response_yields_real_time_function_call_arguments(monkeypatch) -> None: + """ + Validate that LiteLLM `stream_response` also emits function call arguments in real-time + as they are received, ensuring consistent behavior across model providers. + """ + # Simulate realistic chunks: name first, then arguments incrementally + tool_call_delta1 = ChoiceDeltaToolCall( + index=0, + id="litellm-call-456", + function=ChoiceDeltaToolCallFunction(name="generate_code", arguments=""), + type="function", + ) + tool_call_delta2 = ChoiceDeltaToolCall( + index=0, + function=ChoiceDeltaToolCallFunction(arguments='{"language": "'), + type="function", + ) + tool_call_delta3 = ChoiceDeltaToolCall( + index=0, + function=ChoiceDeltaToolCallFunction(arguments='python", "task": "'), + type="function", + ) + tool_call_delta4 = ChoiceDeltaToolCall( + index=0, + function=ChoiceDeltaToolCallFunction(arguments='hello world"}'), + type="function", + ) + + chunk1 = ChatCompletionChunk( + id="chunk-id", + created=1, + model="fake", + object="chat.completion.chunk", + choices=[Choice(index=0, delta=ChoiceDelta(tool_calls=[tool_call_delta1]))], + ) + chunk2 = ChatCompletionChunk( + id="chunk-id", + created=1, + model="fake", + object="chat.completion.chunk", + choices=[Choice(index=0, delta=ChoiceDelta(tool_calls=[tool_call_delta2]))], + ) + chunk3 = ChatCompletionChunk( + id="chunk-id", + created=1, + model="fake", + object="chat.completion.chunk", + choices=[Choice(index=0, delta=ChoiceDelta(tool_calls=[tool_call_delta3]))], + ) + chunk4 = ChatCompletionChunk( + id="chunk-id", + created=1, + model="fake", + object="chat.completion.chunk", + choices=[Choice(index=0, delta=ChoiceDelta(tool_calls=[tool_call_delta4]))], + usage=CompletionUsage(completion_tokens=1, prompt_tokens=1, total_tokens=2), + ) + + async def fake_stream() -> AsyncIterator[ChatCompletionChunk]: + for c in (chunk1, chunk2, chunk3, chunk4): + yield c + + async def patched_fetch_response(self, *args, **kwargs): + resp = Response( + id="resp-id", + created_at=0, + model="fake-model", + object="response", + output=[], + tool_choice="none", + tools=[], + parallel_tool_calls=False, + ) + return resp, fake_stream() + + monkeypatch.setattr(LitellmModel, "_fetch_response", patched_fetch_response) + model = LitellmProvider().get_model("gpt-4") + output_events = [] + async for event in model.stream_response( + system_instructions=None, + input="", + model_settings=ModelSettings(), + tools=[], + output_schema=None, + handoffs=[], + tracing=ModelTracing.DISABLED, + previous_response_id=None, + conversation_id=None, + prompt=None, + ): + output_events.append(event) + + # Extract events by type + function_args_delta_events = [ + e for e in output_events if e.type == "response.function_call_arguments.delta" + ] + output_item_added_events = [e for e in output_events if e.type == "response.output_item.added"] + + # Verify we got real-time streaming (3 argument delta events) + assert len(function_args_delta_events) == 3 + assert len(output_item_added_events) == 1 + + # Verify the deltas were streamed correctly + expected_deltas = ['{"language": "', 'python", "task": "', 'hello world"}'] + for i, delta_event in enumerate(function_args_delta_events): + assert delta_event.delta == expected_deltas[i] + + # Verify function call metadata + added_event = output_item_added_events[0] + assert isinstance(added_event.item, ResponseFunctionToolCall) + assert added_event.item.name == "generate_code" + assert added_event.item.call_id == "litellm-call-456" diff --git a/tests/models/test_litellm_extra_body.py b/tests/models/test_litellm_extra_body.py index 3c83b0607..c33e09da6 100644 --- a/tests/models/test_litellm_extra_body.py +++ b/tests/models/test_litellm_extra_body.py @@ -42,3 +42,116 @@ async def fake_acompletion(model, messages=None, **kwargs): ) assert {"cached_content": "some_cache", "foo": 123}.items() <= captured.items() + + +@pytest.mark.allow_call_model_methods +@pytest.mark.asyncio +async def test_extra_body_reasoning_effort_is_promoted(monkeypatch): + """ + Ensure reasoning_effort from extra_body is promoted to the top-level parameter. + """ + captured: dict[str, object] = {} + + async def fake_acompletion(model, messages=None, **kwargs): + captured.update(kwargs) + msg = Message(role="assistant", content="ok") + choice = Choices(index=0, message=msg) + return ModelResponse(choices=[choice], usage=Usage(0, 0, 0)) + + monkeypatch.setattr(litellm, "acompletion", fake_acompletion) + # GitHub issue context: https://github.com/openai/openai-agents-python/issues/1764. + settings = ModelSettings( + extra_body={"reasoning_effort": "none", "cached_content": "some_cache"} + ) + model = LitellmModel(model="test-model") + + await model.get_response( + system_instructions=None, + input=[], + model_settings=settings, + tools=[], + output_schema=None, + handoffs=[], + tracing=ModelTracing.DISABLED, + previous_response_id=None, + ) + + assert captured["reasoning_effort"] == "none" + assert captured["cached_content"] == "some_cache" + assert settings.extra_body == {"reasoning_effort": "none", "cached_content": "some_cache"} + + +@pytest.mark.allow_call_model_methods +@pytest.mark.asyncio +async def test_reasoning_effort_prefers_model_settings(monkeypatch): + """ + Verify explicit ModelSettings.reasoning takes precedence over extra_body entries. + """ + from openai.types.shared import Reasoning + + captured: dict[str, object] = {} + + async def fake_acompletion(model, messages=None, **kwargs): + captured.update(kwargs) + msg = Message(role="assistant", content="ok") + choice = Choices(index=0, message=msg) + return ModelResponse(choices=[choice], usage=Usage(0, 0, 0)) + + monkeypatch.setattr(litellm, "acompletion", fake_acompletion) + settings = ModelSettings( + reasoning=Reasoning(effort="low"), + extra_body={"reasoning_effort": "high"}, + ) + model = LitellmModel(model="test-model") + + await model.get_response( + system_instructions=None, + input=[], + model_settings=settings, + tools=[], + output_schema=None, + handoffs=[], + tracing=ModelTracing.DISABLED, + previous_response_id=None, + ) + + assert captured["reasoning_effort"] == "low" + assert settings.extra_body == {"reasoning_effort": "high"} + + +@pytest.mark.allow_call_model_methods +@pytest.mark.asyncio +async def test_extra_body_reasoning_effort_overrides_extra_args(monkeypatch): + """ + Ensure extra_body reasoning_effort wins over extra_args when both are provided. + """ + captured: dict[str, object] = {} + + async def fake_acompletion(model, messages=None, **kwargs): + captured.update(kwargs) + msg = Message(role="assistant", content="ok") + choice = Choices(index=0, message=msg) + return ModelResponse(choices=[choice], usage=Usage(0, 0, 0)) + + monkeypatch.setattr(litellm, "acompletion", fake_acompletion) + # GitHub issue context: https://github.com/openai/openai-agents-python/issues/1764. + settings = ModelSettings( + extra_body={"reasoning_effort": "none"}, + extra_args={"reasoning_effort": "low", "custom_param": "custom"}, + ) + model = LitellmModel(model="test-model") + + await model.get_response( + system_instructions=None, + input=[], + model_settings=settings, + tools=[], + output_schema=None, + handoffs=[], + tracing=ModelTracing.DISABLED, + previous_response_id=None, + ) + + assert captured["reasoning_effort"] == "none" + assert captured["custom_param"] == "custom" + assert settings.extra_args == {"reasoning_effort": "low", "custom_param": "custom"} diff --git a/tests/models/test_litellm_user_agent.py b/tests/models/test_litellm_user_agent.py new file mode 100644 index 000000000..edce2c7ba --- /dev/null +++ b/tests/models/test_litellm_user_agent.py @@ -0,0 +1,89 @@ +from __future__ import annotations + +from typing import Any + +import pytest + +from agents import ModelSettings, ModelTracing, __version__ +from agents.models.chatcmpl_helpers import HEADERS_OVERRIDE + + +@pytest.mark.allow_call_model_methods +@pytest.mark.asyncio +@pytest.mark.parametrize("override_ua", [None, "test_user_agent"]) +async def test_user_agent_header_litellm(override_ua: str | None, monkeypatch): + called_kwargs: dict[str, Any] = {} + expected_ua = override_ua or f"Agents/Python {__version__}" + + import importlib + import sys + import types as pytypes + + litellm_fake: Any = pytypes.ModuleType("litellm") + + class DummyMessage: + role = "assistant" + content = "Hello" + tool_calls: list[Any] | None = None + + def get(self, _key, _default=None): + return None + + def model_dump(self): + return {"role": self.role, "content": self.content} + + class Choices: # noqa: N801 - mimic litellm naming + def __init__(self): + self.message = DummyMessage() + + class DummyModelResponse: + def __init__(self): + self.choices = [Choices()] + + async def acompletion(**kwargs): + nonlocal called_kwargs + called_kwargs = kwargs + return DummyModelResponse() + + utils_ns = pytypes.SimpleNamespace() + utils_ns.Choices = Choices + utils_ns.ModelResponse = DummyModelResponse + + litellm_types = pytypes.SimpleNamespace( + utils=utils_ns, + llms=pytypes.SimpleNamespace(openai=pytypes.SimpleNamespace(ChatCompletionAnnotation=dict)), + ) + litellm_fake.acompletion = acompletion + litellm_fake.types = litellm_types + + monkeypatch.setitem(sys.modules, "litellm", litellm_fake) + + litellm_mod = importlib.import_module("agents.extensions.models.litellm_model") + monkeypatch.setattr(litellm_mod, "litellm", litellm_fake, raising=True) + LitellmModel = litellm_mod.LitellmModel + + model = LitellmModel(model="gpt-4") + + if override_ua is not None: + token = HEADERS_OVERRIDE.set({"User-Agent": override_ua}) + else: + token = None + try: + await model.get_response( + system_instructions=None, + input="hi", + model_settings=ModelSettings(), + tools=[], + output_schema=None, + handoffs=[], + tracing=ModelTracing.DISABLED, + previous_response_id=None, + conversation_id=None, + prompt=None, + ) + finally: + if token is not None: + HEADERS_OVERRIDE.reset(token) + + assert "extra_headers" in called_kwargs + assert called_kwargs["extra_headers"]["User-Agent"] == expected_ua diff --git a/tests/realtime/test_agent.py b/tests/realtime/test_agent.py index aae8bc47c..7f1dc3ea3 100644 --- a/tests/realtime/test_agent.py +++ b/tests/realtime/test_agent.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import pytest from agents import RunContextWrapper diff --git a/tests/realtime/test_audio_formats_unit.py b/tests/realtime/test_audio_formats_unit.py new file mode 100644 index 000000000..5c621d462 --- /dev/null +++ b/tests/realtime/test_audio_formats_unit.py @@ -0,0 +1,28 @@ +from openai.types.realtime.realtime_audio_formats import AudioPCM + +from agents.realtime.audio_formats import to_realtime_audio_format + + +def test_to_realtime_audio_format_from_strings(): + assert to_realtime_audio_format("pcm").type == "audio/pcm" # type: ignore[union-attr] + assert to_realtime_audio_format("pcm16").type == "audio/pcm" # type: ignore[union-attr] + assert to_realtime_audio_format("audio/pcm").type == "audio/pcm" # type: ignore[union-attr] + assert to_realtime_audio_format("pcmu").type == "audio/pcmu" # type: ignore[union-attr] + assert to_realtime_audio_format("audio/pcmu").type == "audio/pcmu" # type: ignore[union-attr] + assert to_realtime_audio_format("g711_ulaw").type == "audio/pcmu" # type: ignore[union-attr] + assert to_realtime_audio_format("pcma").type == "audio/pcma" # type: ignore[union-attr] + assert to_realtime_audio_format("audio/pcma").type == "audio/pcma" # type: ignore[union-attr] + assert to_realtime_audio_format("g711_alaw").type == "audio/pcma" # type: ignore[union-attr] + + +def test_to_realtime_audio_format_passthrough_and_unknown_logs(): + fmt = AudioPCM(type="audio/pcm", rate=24000) + # Passing a RealtimeAudioFormats should return the same instance + assert to_realtime_audio_format(fmt) is fmt + + # Unknown string returns None (and logs at debug level internally) + assert to_realtime_audio_format("something_else") is None + + +def test_to_realtime_audio_format_none(): + assert to_realtime_audio_format(None) is None diff --git a/tests/realtime/test_conversion_helpers.py b/tests/realtime/test_conversion_helpers.py new file mode 100644 index 000000000..535621f13 --- /dev/null +++ b/tests/realtime/test_conversion_helpers.py @@ -0,0 +1,380 @@ +from __future__ import annotations + +import base64 +from unittest.mock import Mock + +import pytest +from openai.types.realtime.conversation_item_create_event import ConversationItemCreateEvent +from openai.types.realtime.conversation_item_truncate_event import ConversationItemTruncateEvent +from openai.types.realtime.input_audio_buffer_append_event import InputAudioBufferAppendEvent +from openai.types.realtime.realtime_conversation_item_function_call_output import ( + RealtimeConversationItemFunctionCallOutput, +) +from pydantic import ValidationError + +from agents.realtime.config import RealtimeModelTracingConfig +from agents.realtime.model_inputs import ( + RealtimeModelSendAudio, + RealtimeModelSendRawMessage, + RealtimeModelSendToolOutput, + RealtimeModelSendUserInput, + RealtimeModelUserInputMessage, +) +from agents.realtime.openai_realtime import _ConversionHelper + + +class TestConversionHelperTryConvertRawMessage: + """Test suite for _ConversionHelper.try_convert_raw_message method.""" + + def test_try_convert_raw_message_valid_session_update(self): + """Test converting a valid session.update raw message.""" + raw_message = RealtimeModelSendRawMessage( + message={ + "type": "session.update", + "other_data": { + "session": { + "model": "gpt-realtime", + "type": "realtime", + "modalities": ["text", "audio"], + "voice": "ash", + } + }, + } + ) + + result = _ConversionHelper.try_convert_raw_message(raw_message) + + assert result is not None + assert result.type == "session.update" + + def test_try_convert_raw_message_valid_response_create(self): + """Test converting a valid response.create raw message.""" + raw_message = RealtimeModelSendRawMessage( + message={ + "type": "response.create", + "other_data": {}, + } + ) + + result = _ConversionHelper.try_convert_raw_message(raw_message) + + assert result is not None + assert result.type == "response.create" + + def test_try_convert_raw_message_invalid_type(self): + """Test converting an invalid message type returns None.""" + raw_message = RealtimeModelSendRawMessage( + message={ + "type": "invalid.message.type", + "other_data": {}, + } + ) + + result = _ConversionHelper.try_convert_raw_message(raw_message) + + assert result is None + + def test_try_convert_raw_message_malformed_data(self): + """Test converting malformed message data returns None.""" + raw_message = RealtimeModelSendRawMessage( + message={ + "type": "session.update", + "other_data": { + "session": "invalid_session_data" # Should be dict + }, + } + ) + + result = _ConversionHelper.try_convert_raw_message(raw_message) + + assert result is None + + def test_try_convert_raw_message_missing_type(self): + """Test converting message without type returns None.""" + raw_message = RealtimeModelSendRawMessage( + message={ + "type": "missing.type.test", + "other_data": {"some": "data"}, + } + ) + + result = _ConversionHelper.try_convert_raw_message(raw_message) + + assert result is None + + +class TestConversionHelperTracingConfig: + """Test suite for _ConversionHelper.convert_tracing_config method.""" + + def test_convert_tracing_config_none(self): + """Test converting None tracing config.""" + result = _ConversionHelper.convert_tracing_config(None) + assert result is None + + def test_convert_tracing_config_auto(self): + """Test converting 'auto' tracing config.""" + result = _ConversionHelper.convert_tracing_config("auto") + assert result == "auto" + + def test_convert_tracing_config_dict_full(self): + """Test converting full tracing config dict.""" + tracing_config: RealtimeModelTracingConfig = { + "group_id": "test-group", + "metadata": {"env": "test"}, + "workflow_name": "test-workflow", + } + + result = _ConversionHelper.convert_tracing_config(tracing_config) + + assert result is not None + assert result != "auto" + assert result.group_id == "test-group" + assert result.metadata == {"env": "test"} + assert result.workflow_name == "test-workflow" + + def test_convert_tracing_config_dict_partial(self): + """Test converting partial tracing config dict.""" + tracing_config: RealtimeModelTracingConfig = { + "group_id": "test-group", + } + + result = _ConversionHelper.convert_tracing_config(tracing_config) + + assert result is not None + assert result != "auto" + assert result.group_id == "test-group" + assert result.metadata is None + assert result.workflow_name is None + + def test_convert_tracing_config_empty_dict(self): + """Test converting empty tracing config dict.""" + tracing_config: RealtimeModelTracingConfig = {} + + result = _ConversionHelper.convert_tracing_config(tracing_config) + + assert result is not None + assert result != "auto" + assert result.group_id is None + assert result.metadata is None + assert result.workflow_name is None + + +class TestConversionHelperUserInput: + """Test suite for _ConversionHelper user input conversion methods.""" + + def test_convert_user_input_to_conversation_item_string(self): + """Test converting string user input to conversation item.""" + event = RealtimeModelSendUserInput(user_input="Hello, world!") + + result = _ConversionHelper.convert_user_input_to_conversation_item(event) + + assert result.type == "message" + assert result.role == "user" + assert result.content is not None + assert len(result.content) == 1 + assert result.content[0].type == "input_text" + assert result.content[0].text == "Hello, world!" + + def test_convert_user_input_to_conversation_item_dict(self): + """Test converting dict user input to conversation item.""" + user_input_dict: RealtimeModelUserInputMessage = { + "type": "message", + "role": "user", + "content": [ + {"type": "input_text", "text": "Hello"}, + {"type": "input_text", "text": "World"}, + ], + } + event = RealtimeModelSendUserInput(user_input=user_input_dict) + + result = _ConversionHelper.convert_user_input_to_conversation_item(event) + + assert result.type == "message" + assert result.role == "user" + assert result.content is not None + assert len(result.content) == 2 + assert result.content[0].type == "input_text" + assert result.content[0].text == "Hello" + assert result.content[1].type == "input_text" + assert result.content[1].text == "World" + + def test_convert_user_input_to_conversation_item_dict_empty_content(self): + """Test converting dict user input with empty content.""" + user_input_dict: RealtimeModelUserInputMessage = { + "type": "message", + "role": "user", + "content": [], + } + event = RealtimeModelSendUserInput(user_input=user_input_dict) + + result = _ConversionHelper.convert_user_input_to_conversation_item(event) + + assert result.type == "message" + assert result.role == "user" + assert result.content is not None + assert len(result.content) == 0 + + def test_convert_user_input_to_item_create(self): + """Test converting user input to item create event.""" + event = RealtimeModelSendUserInput(user_input="Test message") + + result = _ConversionHelper.convert_user_input_to_item_create(event) + + assert isinstance(result, ConversationItemCreateEvent) + assert result.type == "conversation.item.create" + assert result.item.type == "message" + assert result.item.role == "user" + + +class TestConversionHelperAudio: + """Test suite for _ConversionHelper.convert_audio_to_input_audio_buffer_append.""" + + def test_convert_audio_to_input_audio_buffer_append(self): + """Test converting audio data to input audio buffer append event.""" + audio_data = b"test audio data" + event = RealtimeModelSendAudio(audio=audio_data, commit=False) + + result = _ConversionHelper.convert_audio_to_input_audio_buffer_append(event) + + assert isinstance(result, InputAudioBufferAppendEvent) + assert result.type == "input_audio_buffer.append" + + # Verify base64 encoding + expected_b64 = base64.b64encode(audio_data).decode("utf-8") + assert result.audio == expected_b64 + + def test_convert_audio_to_input_audio_buffer_append_empty(self): + """Test converting empty audio data.""" + audio_data = b"" + event = RealtimeModelSendAudio(audio=audio_data, commit=True) + + result = _ConversionHelper.convert_audio_to_input_audio_buffer_append(event) + + assert isinstance(result, InputAudioBufferAppendEvent) + assert result.type == "input_audio_buffer.append" + assert result.audio == "" + + def test_convert_audio_to_input_audio_buffer_append_large_data(self): + """Test converting large audio data.""" + audio_data = b"x" * 10000 # Large audio buffer + event = RealtimeModelSendAudio(audio=audio_data, commit=False) + + result = _ConversionHelper.convert_audio_to_input_audio_buffer_append(event) + + assert isinstance(result, InputAudioBufferAppendEvent) + assert result.type == "input_audio_buffer.append" + + # Verify it can be decoded back + decoded = base64.b64decode(result.audio) + assert decoded == audio_data + + +class TestConversionHelperToolOutput: + """Test suite for _ConversionHelper.convert_tool_output method.""" + + def test_convert_tool_output(self): + """Test converting tool output to conversation item create event.""" + mock_tool_call = Mock() + mock_tool_call.call_id = "call_123" + + event = RealtimeModelSendToolOutput( + tool_call=mock_tool_call, + output="Function executed successfully", + start_response=False, + ) + + result = _ConversionHelper.convert_tool_output(event) + + assert isinstance(result, ConversationItemCreateEvent) + assert result.type == "conversation.item.create" + assert result.item.type == "function_call_output" + assert isinstance(result.item, RealtimeConversationItemFunctionCallOutput) + tool_output_item = result.item + assert tool_output_item.output == "Function executed successfully" + assert tool_output_item.call_id == "call_123" + + def test_convert_tool_output_no_call_id(self): + """Test converting tool output with None call_id.""" + mock_tool_call = Mock() + mock_tool_call.call_id = None + + event = RealtimeModelSendToolOutput( + tool_call=mock_tool_call, + output="Output without call ID", + start_response=False, + ) + + with pytest.raises( + ValidationError, + match="1 validation error for RealtimeConversationItemFunctionCallOutput", + ): + _ConversionHelper.convert_tool_output(event) + + def test_convert_tool_output_empty_output(self): + """Test converting tool output with empty output.""" + mock_tool_call = Mock() + mock_tool_call.call_id = "call_456" + + event = RealtimeModelSendToolOutput( + tool_call=mock_tool_call, + output="", + start_response=True, + ) + + result = _ConversionHelper.convert_tool_output(event) + + assert isinstance(result, ConversationItemCreateEvent) + assert result.type == "conversation.item.create" + assert isinstance(result.item, RealtimeConversationItemFunctionCallOutput) + assert result.item.output == "" + assert result.item.call_id == "call_456" + + +class TestConversionHelperInterrupt: + """Test suite for _ConversionHelper.convert_interrupt method.""" + + def test_convert_interrupt(self): + """Test converting interrupt parameters to conversation item truncate event.""" + current_item_id = "item_789" + current_audio_content_index = 2 + elapsed_time_ms = 1500 + + result = _ConversionHelper.convert_interrupt( + current_item_id, current_audio_content_index, elapsed_time_ms + ) + + assert isinstance(result, ConversationItemTruncateEvent) + assert result.type == "conversation.item.truncate" + assert result.item_id == "item_789" + assert result.content_index == 2 + assert result.audio_end_ms == 1500 + + def test_convert_interrupt_zero_time(self): + """Test converting interrupt with zero elapsed time.""" + result = _ConversionHelper.convert_interrupt("item_1", 0, 0) + + assert isinstance(result, ConversationItemTruncateEvent) + assert result.type == "conversation.item.truncate" + assert result.item_id == "item_1" + assert result.content_index == 0 + assert result.audio_end_ms == 0 + + def test_convert_interrupt_large_values(self): + """Test converting interrupt with large values.""" + result = _ConversionHelper.convert_interrupt("item_xyz", 99, 999999) + + assert isinstance(result, ConversationItemTruncateEvent) + assert result.type == "conversation.item.truncate" + assert result.item_id == "item_xyz" + assert result.content_index == 99 + assert result.audio_end_ms == 999999 + + def test_convert_interrupt_empty_item_id(self): + """Test converting interrupt with empty item ID.""" + result = _ConversionHelper.convert_interrupt("", 1, 100) + + assert isinstance(result, ConversationItemTruncateEvent) + assert result.type == "conversation.item.truncate" + assert result.item_id == "" + assert result.content_index == 1 + assert result.audio_end_ms == 100 diff --git a/tests/realtime/test_ga_session_update_normalization.py b/tests/realtime/test_ga_session_update_normalization.py new file mode 100644 index 000000000..7056e8c96 --- /dev/null +++ b/tests/realtime/test_ga_session_update_normalization.py @@ -0,0 +1,35 @@ +from __future__ import annotations + +from typing import Any, cast + +import pytest +from websockets.asyncio.client import ClientConnection + +from agents.realtime.openai_realtime import OpenAIRealtimeWebSocketModel + + +class _DummyWS: + def __init__(self) -> None: + self.sent: list[str] = [] + + async def send(self, data: str) -> None: + self.sent.append(data) + + +@pytest.mark.asyncio +async def test_no_auto_interrupt_on_vad_speech_started(monkeypatch: Any) -> None: + model = OpenAIRealtimeWebSocketModel() + + called = {"interrupt": False} + + async def _fake_interrupt(event: Any) -> None: + called["interrupt"] = True + + # Prevent network use; _websocket only needed for other paths + model._websocket = cast(ClientConnection, _DummyWS()) + monkeypatch.setattr(model, "_send_interrupt", _fake_interrupt) + + # This event previously triggered an interrupt; now it should be ignored + await model._handle_ws_event({"type": "input_audio_buffer.speech_started"}) + + assert called["interrupt"] is False diff --git a/tests/realtime/test_item_parsing.py b/tests/realtime/test_item_parsing.py index ba128f7fd..e8484a58f 100644 --- a/tests/realtime/test_item_parsing.py +++ b/tests/realtime/test_item_parsing.py @@ -1,5 +1,15 @@ -from openai.types.beta.realtime.conversation_item import ConversationItem -from openai.types.beta.realtime.conversation_item_content import ConversationItemContent +from openai.types.realtime.realtime_conversation_item_assistant_message import ( + Content as AssistantMessageContent, + RealtimeConversationItemAssistantMessage, +) +from openai.types.realtime.realtime_conversation_item_system_message import ( + Content as SystemMessageContent, + RealtimeConversationItemSystemMessage, +) +from openai.types.realtime.realtime_conversation_item_user_message import ( + Content as UserMessageContent, + RealtimeConversationItemUserMessage, +) from agents.realtime.items import ( AssistantMessageItem, @@ -11,14 +21,12 @@ def test_user_message_conversion() -> None: - item = ConversationItem( + item = RealtimeConversationItemUserMessage( id="123", type="message", role="user", content=[ - ConversationItemContent( - id=None, audio=None, text=None, transcript=None, type="input_text" - ) + UserMessageContent(type="input_text", text=None), ], ) @@ -28,14 +36,12 @@ def test_user_message_conversion() -> None: assert isinstance(converted, UserMessageItem) - item = ConversationItem( + item = RealtimeConversationItemUserMessage( id="123", type="message", role="user", content=[ - ConversationItemContent( - id=None, audio=None, text=None, transcript=None, type="input_audio" - ) + UserMessageContent(type="input_audio", audio=None), ], ) @@ -45,13 +51,11 @@ def test_user_message_conversion() -> None: def test_assistant_message_conversion() -> None: - item = ConversationItem( + item = RealtimeConversationItemAssistantMessage( id="123", type="message", role="assistant", - content=[ - ConversationItemContent(id=None, audio=None, text=None, transcript=None, type="text") - ], + content=[AssistantMessageContent(type="output_text", text=None)], ) converted: RealtimeMessageItem = _ConversionHelper.conversation_item_to_realtime_message_item( @@ -62,15 +66,11 @@ def test_assistant_message_conversion() -> None: def test_system_message_conversion() -> None: - item = ConversationItem( + item = RealtimeConversationItemSystemMessage( id="123", type="message", role="system", - content=[ - ConversationItemContent( - id=None, audio=None, text=None, transcript=None, type="input_text" - ) - ], + content=[SystemMessageContent(type="input_text", text=None)], ) converted: RealtimeMessageItem = _ConversionHelper.conversation_item_to_realtime_message_item( diff --git a/tests/realtime/test_openai_realtime.py b/tests/realtime/test_openai_realtime.py index 9ecc433ca..85297ec62 100644 --- a/tests/realtime/test_openai_realtime.py +++ b/tests/realtime/test_openai_realtime.py @@ -1,16 +1,26 @@ -from datetime import datetime -from typing import Any +import json +from types import SimpleNamespace +from typing import Any, cast from unittest.mock import AsyncMock, Mock, patch import pytest import websockets +from agents import Agent from agents.exceptions import UserError +from agents.handoffs import handoff from agents.realtime.model_events import ( RealtimeModelAudioEvent, RealtimeModelErrorEvent, RealtimeModelToolCallEvent, ) +from agents.realtime.model_inputs import ( + RealtimeModelSendAudio, + RealtimeModelSendInterrupt, + RealtimeModelSendSessionUpdate, + RealtimeModelSendToolOutput, + RealtimeModelSendUserInput, +) from agents.realtime.openai_realtime import OpenAIRealtimeWebSocketModel @@ -78,15 +88,134 @@ def mock_create_task_func(coro): assert ( call_args[1]["additional_headers"]["Authorization"] == "Bearer test-api-key-123" ) - assert call_args[1]["additional_headers"]["OpenAI-Beta"] == "realtime=v1" + assert call_args[1]["additional_headers"].get("OpenAI-Beta") is None # Verify task was created for message listening mock_create_task.assert_called_once() # Verify internal state assert model._websocket == mock_websocket - assert model._websocket_task is not None - assert model.model == "gpt-4o-realtime-preview" + assert model._websocket_task is not None + assert model.model == "gpt-4o-realtime-preview" + + @pytest.mark.asyncio + async def test_session_update_includes_noise_reduction(self, model, mock_websocket): + """Session.update should pass through input_audio_noise_reduction config.""" + config = { + "api_key": "test-api-key-123", + "initial_model_settings": { + "model_name": "gpt-4o-realtime-preview", + "input_audio_noise_reduction": {"type": "near_field"}, + }, + } + + sent_messages: list[dict[str, Any]] = [] + + async def async_websocket(*args, **kwargs): + async def send(payload: str): + sent_messages.append(json.loads(payload)) + return None + + mock_websocket.send.side_effect = send + return mock_websocket + + with patch("websockets.connect", side_effect=async_websocket): + with patch("asyncio.create_task") as mock_create_task: + mock_task = AsyncMock() + + def mock_create_task_func(coro): + coro.close() + return mock_task + + mock_create_task.side_effect = mock_create_task_func + await model.connect(config) + + # Find the session.update events + session_updates = [m for m in sent_messages if m.get("type") == "session.update"] + assert len(session_updates) >= 1 + # Verify the last session.update contains the noise_reduction field + session = session_updates[-1]["session"] + assert session.get("audio", {}).get("input", {}).get("noise_reduction") == { + "type": "near_field" + } + + @pytest.mark.asyncio + async def test_session_update_omits_noise_reduction_when_not_provided( + self, model, mock_websocket + ): + """Session.update should omit input_audio_noise_reduction when not provided.""" + config = { + "api_key": "test-api-key-123", + "initial_model_settings": { + "model_name": "gpt-4o-realtime-preview", + }, + } + + sent_messages: list[dict[str, Any]] = [] + + async def async_websocket(*args, **kwargs): + async def send(payload: str): + sent_messages.append(json.loads(payload)) + return None + + mock_websocket.send.side_effect = send + return mock_websocket + + with patch("websockets.connect", side_effect=async_websocket): + with patch("asyncio.create_task") as mock_create_task: + mock_task = AsyncMock() + + def mock_create_task_func(coro): + coro.close() + return mock_task + + mock_create_task.side_effect = mock_create_task_func + await model.connect(config) + + # Find the session.update events + session_updates = [m for m in sent_messages if m.get("type") == "session.update"] + assert len(session_updates) >= 1 + # Verify the last session.update omits the noise_reduction field + session = session_updates[-1]["session"] + assert "audio" in session and "input" in session["audio"] + assert "noise_reduction" not in session["audio"]["input"] + + @pytest.mark.asyncio + async def test_connect_with_custom_headers_overrides_defaults(self, model, mock_websocket): + """If custom headers are provided, use them verbatim without adding defaults.""" + # Even when custom headers are provided, the implementation still requires api_key. + config = { + "api_key": "unused-because-headers-override", + "headers": {"api-key": "azure-key", "x-custom": "1"}, + "url": "wss://custom.example.com/realtime?model=custom", + # Use a valid realtime model name for session.update to validate. + "initial_model_settings": {"model_name": "gpt-4o-realtime-preview"}, + } + + async def async_websocket(*args, **kwargs): + return mock_websocket + + with patch("websockets.connect", side_effect=async_websocket) as mock_connect: + with patch("asyncio.create_task") as mock_create_task: + mock_task = AsyncMock() + + def mock_create_task_func(coro): + coro.close() + return mock_task + + mock_create_task.side_effect = mock_create_task_func + + await model.connect(config) + + # Verify WebSocket connection used the provided URL + called_url = mock_connect.call_args[0][0] + assert called_url == "wss://custom.example.com/realtime?model=custom" + + # Verify headers are exactly as provided and no defaults were injected + headers = mock_connect.call_args.kwargs["additional_headers"] + assert headers == {"api-key": "azure-key", "x-custom": "1"} + assert "Authorization" not in headers + assert "OpenAI-Beta" not in headers @pytest.mark.asyncio async def test_connect_with_callable_api_key(self, model, mock_websocket): @@ -181,9 +310,9 @@ async def test_handle_malformed_json_logs_error_continues(self, model): # Malformed JSON should not crash the handler await model._handle_ws_event("invalid json {") - # Should emit error event to listeners - mock_listener.on_event.assert_called_once() - error_event = mock_listener.on_event.call_args[0][0] + # Should emit raw server event and error event to listeners + assert mock_listener.on_event.call_count == 2 + error_event = mock_listener.on_event.call_args_list[1][0][0] assert error_event.type == "error" @pytest.mark.asyncio @@ -192,13 +321,13 @@ async def test_handle_invalid_event_schema_logs_error(self, model): mock_listener = AsyncMock() model.add_listener(mock_listener) - invalid_event = {"type": "response.audio.delta"} # Missing required fields + invalid_event = {"type": "response.output_audio.delta"} # Missing required fields await model._handle_ws_event(invalid_event) - # Should emit error event to listeners - mock_listener.on_event.assert_called_once() - error_event = mock_listener.on_event.call_args[0][0] + # Should emit raw server event and error event to listeners + assert mock_listener.on_event.call_count == 2 + error_event = mock_listener.on_event.call_args_list[1][0][0] assert error_event.type == "error" @pytest.mark.asyncio @@ -226,9 +355,12 @@ async def test_handle_audio_delta_event_success(self, model): mock_listener = AsyncMock() model.add_listener(mock_listener) + # Set up audio format on the tracker before testing + model._audio_state_tracker.set_audio_format("pcm16") + # Valid audio delta event (minimal required fields for OpenAI spec) audio_event = { - "type": "response.audio.delta", + "type": "response.output_audio.delta", "event_id": "event_123", "response_id": "resp_123", "item_id": "item_456", @@ -237,23 +369,230 @@ async def test_handle_audio_delta_event_success(self, model): "delta": "dGVzdCBhdWRpbw==", # base64 encoded "test audio" } - with patch("agents.realtime.openai_realtime.datetime") as mock_datetime: - mock_now = datetime(2024, 1, 1, 12, 0, 0) - mock_datetime.now.return_value = mock_now + await model._handle_ws_event(audio_event) + + # Should emit raw server event and audio event to listeners + assert mock_listener.on_event.call_count == 2 + emitted_event = mock_listener.on_event.call_args_list[1][0][0] + assert isinstance(emitted_event, RealtimeModelAudioEvent) + assert emitted_event.response_id == "resp_123" + assert emitted_event.data == b"test audio" # decoded from base64 + + # Should update internal audio tracking state + assert model._current_item_id == "item_456" + + # Test that audio state is tracked in the tracker + audio_state = model._audio_state_tracker.get_state("item_456", 0) + assert audio_state is not None + assert audio_state.audio_length_ms > 0 # Should have some audio length + + @pytest.mark.asyncio + async def test_backward_compat_output_item_added_and_done(self, model): + """response.output_item.added/done paths emit item updates.""" + listener = AsyncMock() + model.add_listener(listener) + + msg_added = { + "type": "response.output_item.added", + "item": { + "id": "m1", + "type": "message", + "role": "assistant", + "content": [ + {"type": "text", "text": "hello"}, + {"type": "audio", "audio": "...", "transcript": "hi"}, + ], + }, + } + await model._handle_ws_event(msg_added) + + msg_done = { + "type": "response.output_item.done", + "item": { + "id": "m1", + "type": "message", + "role": "assistant", + "content": [{"type": "text", "text": "bye"}], + }, + } + await model._handle_ws_event(msg_done) + + # Ensure we emitted item_updated events for both cases + types = [c[0][0].type for c in listener.on_event.call_args_list] + assert types.count("item_updated") >= 2 - await model._handle_ws_event(audio_event) + # Note: response.created/done require full OpenAI response payload which is + # out-of-scope for unit tests here; covered indirectly via other branches. - # Should emit audio event to listeners - mock_listener.on_event.assert_called_once() - emitted_event = mock_listener.on_event.call_args[0][0] - assert isinstance(emitted_event, RealtimeModelAudioEvent) - assert emitted_event.response_id == "resp_123" - assert emitted_event.data == b"test audio" # decoded from base64 + @pytest.mark.asyncio + async def test_transcription_related_and_timeouts_and_speech_started(self, model, monkeypatch): + listener = AsyncMock() + model.add_listener(listener) + + # Prepare tracker state to simulate ongoing audio + model._audio_state_tracker.set_audio_format("pcm16") + model._audio_state_tracker.on_audio_delta("i1", 0, b"aaaa") + model._ongoing_response = True + + # Patch sending to avoid websocket dependency + monkeypatch.setattr( + model, + "_send_raw_message", + AsyncMock(), + ) + + # Speech started should emit interrupted and cancel the response + await model._handle_ws_event( + { + "type": "input_audio_buffer.speech_started", + "event_id": "es1", + "item_id": "i1", + "audio_start_ms": 0, + "audio_end_ms": 1, + } + ) + + # Output transcript delta + await model._handle_ws_event( + { + "type": "response.output_audio_transcript.delta", + "event_id": "e3", + "item_id": "i3", + "response_id": "r3", + "output_index": 0, + "content_index": 0, + "delta": "abc", + } + ) - # Should update internal audio tracking state - assert model._current_item_id == "item_456" - assert model._current_audio_content_index == 0 - assert model._audio_start_time == mock_now + # Timeout triggered + await model._handle_ws_event( + { + "type": "input_audio_buffer.timeout_triggered", + "event_id": "e4", + "item_id": "i4", + "audio_start_ms": 0, + "audio_end_ms": 100, + } + ) + + # raw + interrupted, raw + transcript delta, raw + timeout + assert listener.on_event.call_count >= 6 + types = [call[0][0].type for call in listener.on_event.call_args_list] + assert "audio_interrupted" in types + assert "transcript_delta" in types + assert "input_audio_timeout_triggered" in types + + +class TestSendEventAndConfig(TestOpenAIRealtimeWebSocketModel): + @pytest.mark.asyncio + async def test_send_event_dispatch(self, model, monkeypatch): + send_raw = AsyncMock() + monkeypatch.setattr(model, "_send_raw_message", send_raw) + + await model.send_event(RealtimeModelSendUserInput(user_input="hi")) + await model.send_event(RealtimeModelSendAudio(audio=b"a", commit=False)) + await model.send_event(RealtimeModelSendAudio(audio=b"a", commit=True)) + await model.send_event( + RealtimeModelSendToolOutput( + tool_call=RealtimeModelToolCallEvent(name="t", call_id="c", arguments="{}"), + output="ok", + start_response=True, + ) + ) + await model.send_event(RealtimeModelSendInterrupt()) + await model.send_event(RealtimeModelSendSessionUpdate(session_settings={"voice": "nova"})) + + # user_input -> 2 raw messages (item.create + response.create) + # audio append -> 1, commit -> +1 + # tool output -> 1 + # interrupt -> 1 + # session update -> 1 + assert send_raw.await_count == 8 + + @pytest.mark.asyncio + async def test_interrupt_force_cancel_overrides_auto_cancellation(self, model, monkeypatch): + """Interrupt should send response.cancel even when auto cancel is enabled.""" + model._audio_state_tracker.set_audio_format("pcm16") + model._audio_state_tracker.on_audio_delta("item_1", 0, b"\x00" * 4800) + model._ongoing_response = True + model._created_session = SimpleNamespace( + audio=SimpleNamespace( + input=SimpleNamespace(turn_detection=SimpleNamespace(interrupt_response=True)) + ) + ) + + send_raw = AsyncMock() + emit_event = AsyncMock() + monkeypatch.setattr(model, "_send_raw_message", send_raw) + monkeypatch.setattr(model, "_emit_event", emit_event) + + await model._send_interrupt(RealtimeModelSendInterrupt(force_response_cancel=True)) + + assert send_raw.await_count == 2 + payload_types = {call.args[0].type for call in send_raw.call_args_list} + assert payload_types == {"conversation.item.truncate", "response.cancel"} + assert model._ongoing_response is False + assert model._audio_state_tracker.get_last_audio_item() is None + + @pytest.mark.asyncio + async def test_interrupt_respects_auto_cancellation_when_not_forced(self, model, monkeypatch): + """Interrupt should avoid sending response.cancel when relying on automatic cancellation.""" + model._audio_state_tracker.set_audio_format("pcm16") + model._audio_state_tracker.on_audio_delta("item_1", 0, b"\x00" * 4800) + model._ongoing_response = True + model._created_session = SimpleNamespace( + audio=SimpleNamespace( + input=SimpleNamespace(turn_detection=SimpleNamespace(interrupt_response=True)) + ) + ) + + send_raw = AsyncMock() + emit_event = AsyncMock() + monkeypatch.setattr(model, "_send_raw_message", send_raw) + monkeypatch.setattr(model, "_emit_event", emit_event) + + await model._send_interrupt(RealtimeModelSendInterrupt()) + + assert send_raw.await_count == 1 + assert send_raw.call_args_list[0].args[0].type == "conversation.item.truncate" + assert all(call.args[0].type != "response.cancel" for call in send_raw.call_args_list) + assert model._ongoing_response is True + + def test_add_remove_listener_and_tools_conversion(self, model): + listener = AsyncMock() + model.add_listener(listener) + model.add_listener(listener) + assert len(model._listeners) == 1 + model.remove_listener(listener) + assert len(model._listeners) == 0 + + # tools conversion rejects non function tools and includes handoffs + with pytest.raises(UserError): + from agents.tool import Tool + + class X: + name = "x" + + model._tools_to_session_tools(cast(list[Tool], [X()]), []) + + h = handoff(Agent(name="a")) + out = model._tools_to_session_tools([], [h]) + assert out[0].name.startswith("transfer_to_") + + def test_get_and_update_session_config(self, model): + settings = { + "model_name": "gpt-realtime", + "voice": "verse", + "output_audio_format": "g711_ulaw", + "modalities": ["audio"], + "input_audio_format": "pcm16", + "input_audio_transcription": {"model": "gpt-4o-mini-transcribe"}, + "turn_detection": {"type": "semantic_vad", "interrupt_response": True}, + } + cfg = model._get_session_config(settings) + assert cfg.audio is not None and cfg.audio.output is not None + assert cfg.audio.output.voice == "verse" @pytest.mark.asyncio async def test_handle_error_event_success(self, model): @@ -273,9 +612,9 @@ async def test_handle_error_event_success(self, model): await model._handle_ws_event(error_event) - # Should emit error event to listeners - mock_listener.on_event.assert_called_once() - emitted_event = mock_listener.on_event.call_args[0][0] + # Should emit raw server event and error event to listeners + assert mock_listener.on_event.call_count == 2 + emitted_event = mock_listener.on_event.call_args_list[1][0][0] assert isinstance(emitted_event, RealtimeModelErrorEvent) @pytest.mark.asyncio @@ -292,6 +631,7 @@ async def test_handle_tool_call_event_success(self, model): "output_index": 0, "item": { "id": "call_123", + "call_id": "call_123", "type": "function_call", "status": "completed", "name": "get_weather", @@ -301,12 +641,12 @@ async def test_handle_tool_call_event_success(self, model): await model._handle_ws_event(tool_call_event) - # Should emit both item updated and tool call events - assert mock_listener.on_event.call_count == 2 + # Should emit raw server event, item updated, and tool call events + assert mock_listener.on_event.call_count == 3 - # First should be item updated, second should be tool call + # First should be raw server event, second should be item updated, third should be tool call calls = mock_listener.on_event.call_args_list - tool_call_emitted = calls[1][0][0] + tool_call_emitted = calls[2][0][0] assert isinstance(tool_call_emitted, RealtimeModelToolCallEvent) assert tool_call_emitted.name == "get_weather" assert tool_call_emitted.arguments == '{"location": "San Francisco"}' @@ -318,10 +658,13 @@ async def test_audio_timing_calculation_accuracy(self, model): mock_listener = AsyncMock() model.add_listener(mock_listener) + # Set up audio format on the tracker before testing + model._audio_state_tracker.set_audio_format("pcm16") + # Send multiple audio deltas to test cumulative timing audio_deltas = [ { - "type": "response.audio.delta", + "type": "response.output_audio.delta", "event_id": "event_1", "response_id": "resp_1", "item_id": "item_1", @@ -330,7 +673,7 @@ async def test_audio_timing_calculation_accuracy(self, model): "delta": "dGVzdA==", # 4 bytes -> "test" }, { - "type": "response.audio.delta", + "type": "response.output_audio.delta", "event_id": "event_2", "response_id": "resp_1", "item_id": "item_1", @@ -343,21 +686,34 @@ async def test_audio_timing_calculation_accuracy(self, model): for event in audio_deltas: await model._handle_ws_event(event) - # Should accumulate audio length: 8 bytes / 24 / 2 = ~0.167ms per byte - # Total: 8 bytes / 24 / 2 = 0.167ms - expected_length = 8 / 24 / 2 - assert abs(model._audio_length_ms - expected_length) < 0.001 + # Should accumulate audio length: 8 bytes / 24 / 2 * 1000 = milliseconds + # Total: 8 bytes / 24 / 2 * 1000 + expected_length = (8 / 24 / 2) * 1000 + + # Test through the actual audio state tracker + audio_state = model._audio_state_tracker.get_state("item_1", 0) + assert audio_state is not None + assert abs(audio_state.audio_length_ms - expected_length) < 0.001 def test_calculate_audio_length_ms_pure_function(self, model): """Test the pure audio length calculation function.""" - # Test various audio buffer sizes - assert model._calculate_audio_length_ms(b"test") == 4 / 24 / 2 # 4 bytes - assert model._calculate_audio_length_ms(b"") == 0 # empty - assert model._calculate_audio_length_ms(b"a" * 48) == 1.0 # exactly 1ms worth + from agents.realtime._util import calculate_audio_length_ms + + # Test various audio buffer sizes for pcm16 format + assert calculate_audio_length_ms("pcm16", b"test") == (4 / 24 / 2) * 1000 # 4 bytes + assert calculate_audio_length_ms("pcm16", b"") == 0 # empty + assert calculate_audio_length_ms("pcm16", b"a" * 48) == 1000.0 # exactly 1000ms worth + + # Test g711 format + assert calculate_audio_length_ms("g711_ulaw", b"test") == (4 / 8000) * 1000 # 4 bytes + assert calculate_audio_length_ms("g711_alaw", b"a" * 8) == (8 / 8000) * 1000 # 8 bytes @pytest.mark.asyncio async def test_handle_audio_delta_state_management(self, model): """Test that _handle_audio_delta properly manages internal state.""" + # Set up audio format on the tracker before testing + model._audio_state_tracker.set_audio_format("pcm16") + # Create mock parsed event mock_parsed = Mock() mock_parsed.content_index = 5 @@ -365,14 +721,16 @@ async def test_handle_audio_delta_state_management(self, model): mock_parsed.delta = "dGVzdA==" # "test" in base64 mock_parsed.response_id = "resp_123" - with patch("agents.realtime.openai_realtime.datetime") as mock_datetime: - mock_now = datetime(2024, 1, 1, 12, 0, 0) - mock_datetime.now.return_value = mock_now + await model._handle_audio_delta(mock_parsed) + + # Check state was updated correctly + assert model._current_item_id == "test_item" - await model._handle_audio_delta(mock_parsed) + # Test that audio state is tracked correctly + audio_state = model._audio_state_tracker.get_state("test_item", 5) + assert audio_state is not None + assert audio_state.audio_length_ms == (4 / 24 / 2) * 1000 # 4 bytes in milliseconds - # Check state was updated correctly - assert model._current_audio_content_index == 5 - assert model._current_item_id == "test_item" - assert model._audio_start_time == mock_now - assert model._audio_length_ms == 4 / 24 / 2 # 4 bytes + # Test that last audio item is tracked + last_item = model._audio_state_tracker.get_last_audio_item() + assert last_item == ("test_item", 5) diff --git a/tests/realtime/test_openai_realtime_conversions.py b/tests/realtime/test_openai_realtime_conversions.py new file mode 100644 index 000000000..2597b7dce --- /dev/null +++ b/tests/realtime/test_openai_realtime_conversions.py @@ -0,0 +1,103 @@ +from typing import cast + +import pytest +from openai.types.realtime.realtime_conversation_item_user_message import ( + RealtimeConversationItemUserMessage, +) +from openai.types.realtime.realtime_tracing_config import ( + TracingConfiguration, +) + +from agents import Agent +from agents.exceptions import UserError +from agents.handoffs import handoff +from agents.realtime.config import RealtimeModelTracingConfig +from agents.realtime.model_inputs import ( + RealtimeModelSendRawMessage, + RealtimeModelSendUserInput, + RealtimeModelUserInputMessage, +) +from agents.realtime.openai_realtime import ( + OpenAIRealtimeWebSocketModel, + _ConversionHelper, + get_api_key, +) +from agents.tool import Tool + + +@pytest.mark.asyncio +async def test_get_api_key_from_env(monkeypatch): + monkeypatch.setenv("OPENAI_API_KEY", "env-key") + assert await get_api_key(None) == "env-key" + + +@pytest.mark.asyncio +async def test_get_api_key_from_callable_async(): + async def f(): + return "k" + + assert await get_api_key(f) == "k" + + +def test_try_convert_raw_message_invalid_returns_none(): + msg = RealtimeModelSendRawMessage(message={"type": "invalid.event", "other_data": {}}) + assert _ConversionHelper.try_convert_raw_message(msg) is None + + +def test_convert_user_input_to_conversation_item_dict_and_str(): + # Dict with mixed, including unknown parts (silently skipped) + dict_input_any = { + "type": "message", + "role": "user", + "content": [ + {"type": "input_text", "text": "hello"}, + {"type": "input_image", "image_url": "http://x/y.png", "detail": "auto"}, + {"type": "bogus", "x": 1}, + ], + } + event = RealtimeModelSendUserInput( + user_input=cast(RealtimeModelUserInputMessage, dict_input_any) + ) + item_any = _ConversionHelper.convert_user_input_to_conversation_item(event) + item = cast(RealtimeConversationItemUserMessage, item_any) + assert item.role == "user" + + # String input becomes input_text + event2 = RealtimeModelSendUserInput(user_input="hi") + item2_any = _ConversionHelper.convert_user_input_to_conversation_item(event2) + item2 = cast(RealtimeConversationItemUserMessage, item2_any) + assert item2.content[0].type == "input_text" + + +def test_convert_tracing_config_variants(): + from agents.realtime.openai_realtime import _ConversionHelper as CH + + assert CH.convert_tracing_config(None) is None + assert CH.convert_tracing_config("auto") == "auto" + cfg: RealtimeModelTracingConfig = { + "group_id": "g", + "metadata": {"k": "v"}, + "workflow_name": "wf", + } + oc_any = CH.convert_tracing_config(cfg) + oc = cast(TracingConfiguration, oc_any) + assert oc.group_id == "g" + assert oc.workflow_name == "wf" + + +def test_tools_to_session_tools_raises_on_non_function_tool(): + class NotFunctionTool: + def __init__(self): + self.name = "x" + + m = OpenAIRealtimeWebSocketModel() + with pytest.raises(UserError): + m._tools_to_session_tools(cast(list[Tool], [NotFunctionTool()]), []) + + +def test_tools_to_session_tools_includes_handoffs(): + a = Agent(name="a") + h = handoff(a) + m = OpenAIRealtimeWebSocketModel() + out = m._tools_to_session_tools([], [h]) + assert out[0].name is not None and out[0].name.startswith("transfer_to_") diff --git a/tests/realtime/test_playback_tracker.py b/tests/realtime/test_playback_tracker.py new file mode 100644 index 000000000..c0bfba468 --- /dev/null +++ b/tests/realtime/test_playback_tracker.py @@ -0,0 +1,112 @@ +from unittest.mock import AsyncMock + +import pytest + +from agents.realtime._default_tracker import ModelAudioTracker +from agents.realtime.model import RealtimePlaybackTracker +from agents.realtime.model_inputs import RealtimeModelSendInterrupt +from agents.realtime.openai_realtime import OpenAIRealtimeWebSocketModel + + +class TestPlaybackTracker: + """Test playback tracker functionality for interrupt timing.""" + + @pytest.fixture + def model(self): + """Create a fresh model instance for each test.""" + return OpenAIRealtimeWebSocketModel() + + @pytest.mark.asyncio + async def test_interrupt_timing_with_custom_playback_tracker(self, model): + """Test interrupt uses custom playback tracker elapsed time instead of default timing.""" + + # Create custom tracker and set elapsed time + custom_tracker = RealtimePlaybackTracker() + custom_tracker.set_audio_format("pcm16") + custom_tracker.on_play_ms("item_1", 1, 500.0) # content_index 1, 500ms played + + # Set up model with custom tracker directly + model._playback_tracker = custom_tracker + + # Mock send_raw_message to capture interrupt + model._send_raw_message = AsyncMock() + + # Send interrupt + + await model._send_interrupt(RealtimeModelSendInterrupt()) + + # Should use custom tracker's 500ms elapsed time + model._send_raw_message.assert_called_once() + call_args = model._send_raw_message.call_args[0][0] + assert call_args.audio_end_ms == 500 + + @pytest.mark.asyncio + async def test_interrupt_skipped_when_no_audio_playing(self, model): + """Test interrupt returns early when no audio is currently playing.""" + model._send_raw_message = AsyncMock() + + # No audio playing (default state) + + await model._send_interrupt(RealtimeModelSendInterrupt()) + + # Should not send any interrupt message + model._send_raw_message.assert_not_called() + + def test_audio_state_accumulation_across_deltas(self): + """Test ModelAudioTracker accumulates audio length across multiple deltas.""" + + tracker = ModelAudioTracker() + tracker.set_audio_format("pcm16") + + # Send multiple deltas for same item + tracker.on_audio_delta("item_1", 0, b"test") # 4 bytes + tracker.on_audio_delta("item_1", 0, b"more") # 4 bytes + + state = tracker.get_state("item_1", 0) + assert state is not None + # Should accumulate: 8 bytes / 24 / 2 * 1000 = 166.67ms + expected_length = (8 / 24 / 2) * 1000 + assert abs(state.audio_length_ms - expected_length) < 0.01 + + def test_state_cleanup_on_interruption(self): + """Test both trackers properly reset state on interruption.""" + + # Test ModelAudioTracker cleanup + model_tracker = ModelAudioTracker() + model_tracker.set_audio_format("pcm16") + model_tracker.on_audio_delta("item_1", 0, b"test") + assert model_tracker.get_last_audio_item() == ("item_1", 0) + + model_tracker.on_interrupted() + assert model_tracker.get_last_audio_item() is None + + # Test RealtimePlaybackTracker cleanup + playback_tracker = RealtimePlaybackTracker() + playback_tracker.on_play_ms("item_1", 0, 100.0) + + state = playback_tracker.get_state() + assert state["current_item_id"] == "item_1" + assert state["elapsed_ms"] == 100.0 + + playback_tracker.on_interrupted() + state = playback_tracker.get_state() + assert state["current_item_id"] is None + assert state["elapsed_ms"] is None + + def test_audio_length_calculation_with_different_formats(self): + """Test calculate_audio_length_ms handles g711 and PCM formats correctly.""" + from agents.realtime._util import calculate_audio_length_ms + + # Test g711 format (8kHz) + g711_bytes = b"12345678" # 8 bytes + g711_length = calculate_audio_length_ms("g711_ulaw", g711_bytes) + assert g711_length == 1 # (8 / 8000) * 1000 + + # Test PCM format (24kHz, default) + pcm_bytes = b"test" # 4 bytes + pcm_length = calculate_audio_length_ms("pcm16", pcm_bytes) + assert pcm_length == (4 / 24 / 2) * 1000 # ~83.33ms + + # Test None format (defaults to PCM) + none_length = calculate_audio_length_ms(None, pcm_bytes) + assert none_length == pcm_length diff --git a/tests/realtime/test_playback_tracker_manual_unit.py b/tests/realtime/test_playback_tracker_manual_unit.py new file mode 100644 index 000000000..35adc1264 --- /dev/null +++ b/tests/realtime/test_playback_tracker_manual_unit.py @@ -0,0 +1,23 @@ +from agents.realtime.model import RealtimePlaybackTracker + + +def test_playback_tracker_on_play_bytes_and_state(): + tr = RealtimePlaybackTracker() + tr.set_audio_format("pcm16") # PCM path + + # 48k bytes -> (48000 / 24 / 2) * 1000 = 1,000,000ms per current util + tr.on_play_bytes("item1", 0, b"x" * 48000) + st = tr.get_state() + assert st["current_item_id"] == "item1" + assert st["elapsed_ms"] and abs(st["elapsed_ms"] - 1_000_000.0) < 1e-6 + + # Subsequent play on same item accumulates + tr.on_play_ms("item1", 0, 500.0) + st2 = tr.get_state() + assert st2["elapsed_ms"] and abs(st2["elapsed_ms"] - 1_000_500.0) < 1e-6 + + # Interruption clears state + tr.on_interrupted() + st3 = tr.get_state() + assert st3["current_item_id"] is None + assert st3["elapsed_ms"] is None diff --git a/tests/realtime/test_realtime_handoffs.py b/tests/realtime/test_realtime_handoffs.py new file mode 100644 index 000000000..7ada3db40 --- /dev/null +++ b/tests/realtime/test_realtime_handoffs.py @@ -0,0 +1,146 @@ +"""Tests for realtime handoff functionality.""" + +from typing import Any +from unittest.mock import Mock + +import pytest + +from agents import Agent +from agents.exceptions import ModelBehaviorError, UserError +from agents.realtime import RealtimeAgent, realtime_handoff +from agents.run_context import RunContextWrapper + + +def test_realtime_handoff_creation(): + """Test basic realtime handoff creation.""" + realtime_agent = RealtimeAgent(name="test_agent") + handoff_obj = realtime_handoff(realtime_agent) + + assert handoff_obj.agent_name == "test_agent" + assert handoff_obj.tool_name == "transfer_to_test_agent" + assert handoff_obj.input_filter is None # Should not support input filters + assert handoff_obj.is_enabled is True + + +def test_realtime_handoff_with_custom_params(): + """Test realtime handoff with custom parameters.""" + realtime_agent = RealtimeAgent( + name="helper_agent", + handoff_description="Helps with general tasks", + ) + + handoff_obj = realtime_handoff( + realtime_agent, + tool_name_override="custom_handoff", + tool_description_override="Custom handoff description", + is_enabled=False, + ) + + assert handoff_obj.agent_name == "helper_agent" + assert handoff_obj.tool_name == "custom_handoff" + assert handoff_obj.tool_description == "Custom handoff description" + assert handoff_obj.is_enabled is False + + +@pytest.mark.asyncio +async def test_realtime_handoff_execution(): + """Test that realtime handoff returns the correct agent.""" + realtime_agent = RealtimeAgent(name="target_agent") + handoff_obj = realtime_handoff(realtime_agent) + + # Mock context + mock_context = Mock() + + # Execute handoff + result = await handoff_obj.on_invoke_handoff(mock_context, "") + + assert result is realtime_agent + assert isinstance(result, RealtimeAgent) + + +def test_realtime_handoff_with_on_handoff_callback(): + """Test realtime handoff with custom on_handoff callback.""" + realtime_agent = RealtimeAgent(name="callback_agent") + callback_called = [] + + def on_handoff_callback(ctx): + callback_called.append(True) + + handoff_obj = realtime_handoff( + realtime_agent, + on_handoff=on_handoff_callback, + ) + + assert handoff_obj.agent_name == "callback_agent" + + +def test_regular_agent_handoff_still_works(): + """Test that regular Agent handoffs still work with the new generic types.""" + from agents import handoff + + regular_agent = Agent(name="regular_agent") + handoff_obj = handoff(regular_agent) + + assert handoff_obj.agent_name == "regular_agent" + assert handoff_obj.tool_name == "transfer_to_regular_agent" + # Regular agent handoffs should support input filters + assert hasattr(handoff_obj, "input_filter") + + +def test_type_annotations_work(): + """Test that type annotations work correctly.""" + from agents.handoffs import Handoff + from agents.realtime.handoffs import realtime_handoff + + realtime_agent = RealtimeAgent(name="typed_agent") + handoff_obj = realtime_handoff(realtime_agent) + + # This should be typed as Handoff[Any, RealtimeAgent[Any]] + assert isinstance(handoff_obj, Handoff) + + +def test_realtime_handoff_invalid_param_counts_raise(): + rt = RealtimeAgent(name="x") + + # on_handoff with input_type but wrong param count + def bad2(a): # only one parameter + return None + + with pytest.raises(UserError): + realtime_handoff(rt, on_handoff=bad2, input_type=int) # type: ignore[arg-type] + + # on_handoff without input but wrong param count + def bad1(a, b): # two parameters + return None + + with pytest.raises(UserError): + realtime_handoff(rt, on_handoff=bad1) # type: ignore[arg-type] + + +@pytest.mark.asyncio +async def test_realtime_handoff_missing_input_json_raises_model_error(): + rt = RealtimeAgent(name="x") + + async def with_input(ctx: RunContextWrapper[Any], data: int): # simple non-object type + return None + + h = realtime_handoff(rt, on_handoff=with_input, input_type=int) + + with pytest.raises(ModelBehaviorError): + await h.on_invoke_handoff(RunContextWrapper(None), "null") + + +@pytest.mark.asyncio +async def test_realtime_handoff_is_enabled_async(monkeypatch): + rt = RealtimeAgent(name="x") + + async def is_enabled(ctx, agent): + return True + + h = realtime_handoff(rt, is_enabled=is_enabled) + + from collections.abc import Awaitable + from typing import cast as _cast + + assert callable(h.is_enabled) + assert await _cast(Awaitable[bool], h.is_enabled(RunContextWrapper(None), rt)) diff --git a/tests/realtime/test_runner.py b/tests/realtime/test_runner.py index aabdff140..1e6eccbae 100644 --- a/tests/realtime/test_runner.py +++ b/tests/realtime/test_runner.py @@ -1,18 +1,21 @@ from unittest.mock import AsyncMock, Mock, patch import pytest -from inline_snapshot import snapshot from agents.realtime.agent import RealtimeAgent from agents.realtime.config import RealtimeRunConfig, RealtimeSessionModelSettings from agents.realtime.model import RealtimeModel, RealtimeModelConfig from agents.realtime.runner import RealtimeRunner from agents.realtime.session import RealtimeSession +from agents.tool import function_tool class MockRealtimeModel(RealtimeModel): + def __init__(self): + self.connect_args = None + async def connect(self, options=None): - pass + self.connect_args = options def add_listener(self, listener): pass @@ -53,7 +56,9 @@ def mock_model(): @pytest.mark.asyncio -async def test_run_creates_session_with_no_settings(mock_agent, mock_model): +async def test_run_creates_session_with_no_settings( + mock_agent: Mock, mock_model: MockRealtimeModel +): """Test that run() creates a session correctly if no settings are provided""" runner = RealtimeRunner(mock_agent, model=mock_model) @@ -71,22 +76,17 @@ async def test_run_creates_session_with_no_settings(mock_agent, mock_model): assert call_args[1]["agent"] == mock_agent assert call_args[1]["context"] is None - # Verify model_config contains expected settings from agent + # With no settings provided, model_config should be None model_config = call_args[1]["model_config"] - assert model_config == snapshot( - { - "initial_model_settings": { - "instructions": "Test instructions", - "tools": [{"type": "function", "name": "test_tool"}], - } - } - ) + assert model_config is None assert session == mock_session @pytest.mark.asyncio -async def test_run_creates_session_with_settings_only_in_init(mock_agent, mock_model): +async def test_run_creates_session_with_settings_only_in_init( + mock_agent: Mock, mock_model: MockRealtimeModel +): """Test that it creates a session with the right settings if they are provided only in init""" config = RealtimeRunConfig( model_settings=RealtimeSessionModelSettings(model_name="gpt-4o-realtime", voice="nova") @@ -99,28 +99,19 @@ async def test_run_creates_session_with_settings_only_in_init(mock_agent, mock_m _ = await runner.run() - # Verify session was created with config overrides + # Verify session was created - runner no longer processes settings call_args = mock_session_class.call_args model_config = call_args[1]["model_config"] - # Should have agent settings plus config overrides - assert model_config == snapshot( - { - "initial_model_settings": { - "instructions": "Test instructions", - "tools": [{"type": "function", "name": "test_tool"}], - "model_name": "gpt-4o-realtime", - "voice": "nova", - } - } - ) + # Runner should pass None for model_config when none provided to run() + assert model_config is None @pytest.mark.asyncio async def test_run_creates_session_with_settings_in_both_init_and_run_overrides( - mock_agent, mock_model + mock_agent: Mock, mock_model: MockRealtimeModel ): - """Test settings in both init and run() - init should override run()""" + """Test settings provided in run() parameter are passed through""" init_config = RealtimeRunConfig( model_settings=RealtimeSessionModelSettings(model_name="gpt-4o-realtime", voice="nova") ) @@ -138,26 +129,18 @@ async def test_run_creates_session_with_settings_in_both_init_and_run_overrides( _ = await runner.run(model_config=run_model_config) - # Verify run() settings override init settings + # Verify run() model_config is passed through as-is call_args = mock_session_class.call_args model_config = call_args[1]["model_config"] - # Should have agent settings, then init config, then run config overrides - assert model_config == snapshot( - { - "initial_model_settings": { - "voice": "nova", - "input_audio_format": "pcm16", - "instructions": "Test instructions", - "tools": [{"type": "function", "name": "test_tool"}], - "model_name": "gpt-4o-realtime", - } - } - ) + # Runner should pass the model_config from run() parameter directly + assert model_config == run_model_config @pytest.mark.asyncio -async def test_run_creates_session_with_settings_only_in_run(mock_agent, mock_model): +async def test_run_creates_session_with_settings_only_in_run( + mock_agent: Mock, mock_model: MockRealtimeModel +): """Test settings provided only in run()""" runner = RealtimeRunner(mock_agent, model=mock_model) @@ -173,26 +156,16 @@ async def test_run_creates_session_with_settings_only_in_run(mock_agent, mock_mo _ = await runner.run(model_config=run_model_config) - # Verify run() settings are applied + # Verify run() model_config is passed through as-is call_args = mock_session_class.call_args model_config = call_args[1]["model_config"] - # Should have agent settings plus run() settings - assert model_config == snapshot( - { - "initial_model_settings": { - "model_name": "gpt-4o-realtime-preview", - "voice": "shimmer", - "modalities": ["text", "audio"], - "instructions": "Test instructions", - "tools": [{"type": "function", "name": "test_tool"}], - } - } - ) + # Runner should pass the model_config from run() parameter directly + assert model_config == run_model_config @pytest.mark.asyncio -async def test_run_with_context_parameter(mock_agent, mock_model): +async def test_run_with_context_parameter(mock_agent: Mock, mock_model: MockRealtimeModel): """Test that context parameter is passed through to session""" runner = RealtimeRunner(mock_agent, model=mock_model) test_context = {"user_id": "test123"} @@ -208,17 +181,69 @@ async def test_run_with_context_parameter(mock_agent, mock_model): @pytest.mark.asyncio -async def test_get_model_settings_with_none_values(mock_model): - """Test _get_model_settings handles None values from agent properly""" +async def test_run_with_none_values_from_agent_does_not_crash(mock_model: MockRealtimeModel): + """Test that runner handles agents with None values without crashing""" agent = Mock(spec=RealtimeAgent) agent.get_system_prompt = AsyncMock(return_value=None) agent.get_all_tools = AsyncMock(return_value=None) runner = RealtimeRunner(agent, model=mock_model) - with patch("agents.realtime.runner.RealtimeSession"): - await runner.run() + with patch("agents.realtime.runner.RealtimeSession") as mock_session_class: + mock_session = Mock(spec=RealtimeSession) + mock_session_class.return_value = mock_session + + session = await runner.run() + + # Should not crash and return session + assert session == mock_session + # Runner no longer calls agent methods directly - session does that + agent.get_system_prompt.assert_not_called() + agent.get_all_tools.assert_not_called() + + +@pytest.mark.asyncio +async def test_tool_and_handoffs_are_correct(mock_model: MockRealtimeModel): + @function_tool + def tool_one(): + return "result_one" + + agent_1 = RealtimeAgent( + name="one", + instructions="instr_one", + ) + agent_2 = RealtimeAgent( + name="two", + instructions="instr_two", + tools=[tool_one], + handoffs=[agent_1], + ) + + session = RealtimeSession( + model=mock_model, + agent=agent_2, + context=None, + model_config=None, + run_config=None, + ) + + async with session: + pass - # Should not crash and agent methods should be called - agent.get_system_prompt.assert_called_once() - agent.get_all_tools.assert_called_once() + # Assert that the model.connect() was called with the correct settings + connect_args = mock_model.connect_args + assert connect_args is not None + assert isinstance(connect_args, dict) + initial_model_settings = connect_args["initial_model_settings"] + assert initial_model_settings is not None + assert isinstance(initial_model_settings, dict) + assert initial_model_settings["instructions"] == "instr_two" + assert len(initial_model_settings["tools"]) == 1 + tool = initial_model_settings["tools"][0] + assert tool.name == "tool_one" + + handoffs = initial_model_settings["handoffs"] + assert len(handoffs) == 1 + handoff = handoffs[0] + assert handoff.tool_name == "transfer_to_one" + assert handoff.agent_name == "one" diff --git a/tests/realtime/test_session.py b/tests/realtime/test_session.py index 4cc0dae6b..8280de61c 100644 --- a/tests/realtime/test_session.py +++ b/tests/realtime/test_session.py @@ -1,12 +1,14 @@ -from typing import cast -from unittest.mock import AsyncMock, Mock +import asyncio +from typing import Any, cast +from unittest.mock import AsyncMock, Mock, PropertyMock, patch import pytest +from agents.exceptions import UserError from agents.guardrail import GuardrailFunctionOutput, OutputGuardrail from agents.handoffs import Handoff from agents.realtime.agent import RealtimeAgent -from agents.realtime.config import RealtimeRunConfig +from agents.realtime.config import RealtimeRunConfig, RealtimeSessionModelSettings from agents.realtime.events import ( RealtimeAgentEndEvent, RealtimeAgentStartEvent, @@ -22,6 +24,7 @@ RealtimeToolStart, ) from agents.realtime.items import ( + AssistantAudio, AssistantMessageItem, AssistantText, InputAudio, @@ -29,7 +32,7 @@ RealtimeItem, UserMessageItem, ) -from agents.realtime.model import RealtimeModel +from agents.realtime.model import RealtimeModel, RealtimeModelConfig from agents.realtime.model_events import ( RealtimeModelAudioDoneEvent, RealtimeModelAudioEvent, @@ -45,11 +48,202 @@ RealtimeModelTurnEndedEvent, RealtimeModelTurnStartedEvent, ) +from agents.realtime.model_inputs import ( + RealtimeModelSendAudio, + RealtimeModelSendInterrupt, + RealtimeModelSendSessionUpdate, + RealtimeModelSendUserInput, +) from agents.realtime.session import RealtimeSession from agents.tool import FunctionTool from agents.tool_context import ToolContext +class _DummyModel(RealtimeModel): + def __init__(self) -> None: + super().__init__() + self.events: list[Any] = [] + self.listeners: list[Any] = [] + + async def connect(self, options=None): # pragma: no cover - not used here + pass + + async def close(self): # pragma: no cover - not used here + pass + + async def send_event(self, event): + self.events.append(event) + + def add_listener(self, listener): + self.listeners.append(listener) + + def remove_listener(self, listener): + if listener in self.listeners: + self.listeners.remove(listener) + + +@pytest.mark.asyncio +async def test_property_and_send_helpers_and_enter_alias(): + model = _DummyModel() + agent = RealtimeAgent(name="agent") + session = RealtimeSession(model, agent, None) + + # property + assert session.model is model + + # enter alias calls __aenter__ + async with await session.enter(): + # send helpers + await session.send_message("hi") + await session.send_audio(b"abc", commit=True) + await session.interrupt() + + # verify sent events + assert any(isinstance(e, RealtimeModelSendUserInput) for e in model.events) + assert any(isinstance(e, RealtimeModelSendAudio) and e.commit for e in model.events) + assert any(isinstance(e, RealtimeModelSendInterrupt) for e in model.events) + + +@pytest.mark.asyncio +async def test_aiter_cancel_breaks_loop_gracefully(): + model = _DummyModel() + agent = RealtimeAgent(name="agent") + session = RealtimeSession(model, agent, None) + + async def consume(): + async for _ in session: + pass + + consumer = asyncio.create_task(consume()) + await asyncio.sleep(0.01) + consumer.cancel() + # The iterator swallows CancelledError internally and exits cleanly + await consumer + + +@pytest.mark.asyncio +async def test_transcription_completed_adds_new_user_item(): + model = _DummyModel() + agent = RealtimeAgent(name="agent") + session = RealtimeSession(model, agent, None) + + event = RealtimeModelInputAudioTranscriptionCompletedEvent(item_id="item1", transcript="hello") + await session.on_event(event) + + # Should have appended a new user item + assert len(session._history) == 1 + assert session._history[0].type == "message" + assert session._history[0].role == "user" + + +class _FakeAudio: + # Looks like an audio part but is not an InputAudio/AssistantAudio instance + type = "audio" + transcript = None + + +@pytest.mark.asyncio +async def test_item_updated_merge_exception_path_logs_error(monkeypatch): + model = _DummyModel() + agent = RealtimeAgent(name="agent") + session = RealtimeSession(model, agent, None) + + # existing assistant message with transcript to preserve + existing = AssistantMessageItem( + item_id="a1", role="assistant", content=[AssistantAudio(audio=None, transcript="t")] + ) + session._history = [existing] + + # incoming message with a deliberately bogus content entry to trigger assertion path + incoming = AssistantMessageItem( + item_id="a1", role="assistant", content=[AssistantAudio(audio=None, transcript=None)] + ) + incoming.content[0] = cast(Any, _FakeAudio()) + + with patch("agents.realtime.session.logger") as mock_logger: + await session.on_event(RealtimeModelItemUpdatedEvent(item=incoming)) + # error branch should be hit + assert mock_logger.error.called + + +@pytest.mark.asyncio +async def test_handle_tool_call_handoff_invalid_result_raises(): + model = _DummyModel() + target = RealtimeAgent(name="target") + + bad_handoff = Handoff( + tool_name="switch", + tool_description="", + input_json_schema={}, + on_invoke_handoff=AsyncMock(return_value=123), # invalid return + input_filter=None, + agent_name=target.name, + is_enabled=True, + ) + + agent = RealtimeAgent(name="agent", handoffs=[bad_handoff]) + session = RealtimeSession(model, agent, None) + + with pytest.raises(UserError): + await session._handle_tool_call( + RealtimeModelToolCallEvent(name="switch", call_id="c1", arguments="{}") + ) + + +@pytest.mark.asyncio +async def test_on_guardrail_task_done_emits_error_event(): + model = _DummyModel() + agent = RealtimeAgent(name="agent") + session = RealtimeSession(model, agent, None) + + async def failing_task(): + raise ValueError("task failed") + + task = asyncio.create_task(failing_task()) + # Wait for it to finish so exception() is available + try: + await task + except Exception: # noqa: S110 + pass + + session._on_guardrail_task_done(task) + + # Allow event task to enqueue + await asyncio.sleep(0.01) + + # Should have a RealtimeError queued + err = await session._event_queue.get() + assert isinstance(err, RealtimeError) + + +@pytest.mark.asyncio +async def test_get_handoffs_async_is_enabled(monkeypatch): + # Agent includes both a direct Handoff and a RealtimeAgent (auto-converted) + target = RealtimeAgent(name="target") + other = RealtimeAgent(name="other") + + async def is_enabled(ctx, agent): + return True + + # direct handoff with async is_enabled + direct = Handoff( + tool_name="to_target", + tool_description="", + input_json_schema={}, + on_invoke_handoff=AsyncMock(return_value=target), + input_filter=None, + agent_name=target.name, + is_enabled=is_enabled, + ) + + a = RealtimeAgent(name="a", handoffs=[direct, other]) + session = RealtimeSession(_DummyModel(), a, None) + + enabled = await RealtimeSession._get_handoffs(a, session._context_wrapper) + # Both should be enabled + assert len(enabled) == 2 + + class MockRealtimeModel(RealtimeModel): def __init__(self): super().__init__() @@ -101,6 +295,9 @@ async def close(self): def mock_agent(): agent = Mock(spec=RealtimeAgent) agent.get_all_tools = AsyncMock(return_value=[]) + + type(agent).handoffs = PropertyMock(return_value=[]) + type(agent).output_guardrails = PropertyMock(return_value=[]) return agent @@ -155,15 +352,17 @@ async def test_audio_events_transformation(self, mock_model, mock_agent): session = RealtimeSession(mock_model, mock_agent, None) # Test audio event - audio_event = RealtimeModelAudioEvent(data=b"audio_data", response_id="resp_1") + audio_event = RealtimeModelAudioEvent( + data=b"audio_data", response_id="resp_1", item_id="item_1", content_index=0 + ) await session.on_event(audio_event) # Test audio interrupted event - interrupted_event = RealtimeModelAudioInterruptedEvent() + interrupted_event = RealtimeModelAudioInterruptedEvent(item_id="item_1", content_index=0) await session.on_event(interrupted_event) # Test audio done event - done_event = RealtimeModelAudioDoneEvent() + done_event = RealtimeModelAudioDoneEvent(item_id="item_1", content_index=0) await session.on_event(done_event) # Should have 6 events total (2 per event: raw + transformed) @@ -293,7 +492,7 @@ async def test_item_updated_event_updates_existing_item(self, mock_model, mock_a # Check that item was updated assert len(session._history) == 1 updated_item = cast(AssistantMessageItem, session._history[0]) - assert updated_item.content[0].text == "Updated" + assert updated_item.content[0].text == "Updated" # type: ignore # Should have 2 events: raw + history updated (not added) assert session._event_queue.qsize() == 2 @@ -362,8 +561,13 @@ async def test_ignored_events_only_generate_raw_events(self, mock_model, mock_ag @pytest.mark.asyncio async def test_function_call_event_triggers_tool_handling(self, mock_model, mock_agent): - """Test that function_call events trigger tool call handling""" - session = RealtimeSession(mock_model, mock_agent, None) + """Test that function_call events trigger tool call handling synchronously when disabled""" + session = RealtimeSession( + mock_model, + mock_agent, + None, + run_config={"async_tool_calls": False}, + ) # Create function call event function_call_event = RealtimeModelToolCallEvent( @@ -379,7 +583,9 @@ async def test_function_call_event_triggers_tool_handling(self, mock_model, mock await session.on_event(function_call_event) # Should have called the tool handler - handle_tool_call_mock.assert_called_once_with(function_call_event) + handle_tool_call_mock.assert_called_once_with( + function_call_event, agent_snapshot=mock_agent + ) # Should still have raw event assert session._event_queue.qsize() == 1 @@ -387,6 +593,36 @@ async def test_function_call_event_triggers_tool_handling(self, mock_model, mock assert isinstance(raw_event, RealtimeRawModelEvent) assert raw_event.data == function_call_event + @pytest.mark.asyncio + async def test_function_call_event_runs_async_by_default(self, mock_model, mock_agent): + """Function call handling should be scheduled asynchronously by default""" + session = RealtimeSession(mock_model, mock_agent, None) + + function_call_event = RealtimeModelToolCallEvent( + name="test_function", + call_id="call_async", + arguments='{"param": "value"}', + ) + + with pytest.MonkeyPatch().context() as m: + handle_tool_call_mock = AsyncMock() + m.setattr(session, "_handle_tool_call", handle_tool_call_mock) + + await session.on_event(function_call_event) + + # Let the background task run + await asyncio.sleep(0) + + handle_tool_call_mock.assert_awaited_once_with( + function_call_event, agent_snapshot=mock_agent + ) + + # Raw event still enqueued + assert session._event_queue.qsize() == 1 + raw_event = await session._event_queue.get() + assert isinstance(raw_event, RealtimeRawModelEvent) + assert raw_event.data == function_call_event + class TestHistoryManagement: """Test suite for history management and audio transcription in @@ -524,7 +760,7 @@ def test_update_existing_item_by_id(self): # Item should be updated result_item = cast(AssistantMessageItem, new_history[0]) assert result_item.item_id == "item_1" - assert result_item.content[0].text == "Updated" + assert result_item.content[0].text == "Updated" # type: ignore def test_update_existing_item_preserves_order(self): """Test that updating existing item preserves its position in history""" @@ -557,13 +793,13 @@ def test_update_existing_item_preserves_order(self): # Middle item should be updated updated_result = cast(AssistantMessageItem, new_history[1]) - assert updated_result.content[0].text == "Updated Second" + assert updated_result.content[0].text == "Updated Second" # type: ignore # Other items should be unchanged item1_result = cast(AssistantMessageItem, new_history[0]) item3_result = cast(AssistantMessageItem, new_history[2]) - assert item1_result.content[0].text == "First" - assert item3_result.content[0].text == "Third" + assert item1_result.content[0].text == "First" # type: ignore + assert item3_result.content[0].text == "Third" # type: ignore def test_insert_new_item_after_previous_item(self): """Test inserting new item after specified previous_item_id""" @@ -598,7 +834,7 @@ def test_insert_new_item_after_previous_item(self): # Content should be correct item2_result = cast(AssistantMessageItem, new_history[1]) - assert item2_result.content[0].text == "Second" + assert item2_result.content[0].text == "Second" # type: ignore def test_insert_new_item_after_nonexistent_previous_item(self): """Test that item with nonexistent previous_item_id gets added to end""" @@ -701,7 +937,7 @@ def test_complex_insertion_scenario(self): assert len(history) == 4 assert [item.item_id for item in history] == ["A", "B", "D", "C"] itemB_result = cast(AssistantMessageItem, history[1]) - assert itemB_result.content[0].text == "Updated B" + assert itemB_result.content[0].text == "Updated B" # type: ignore # Test 3: Tool call execution flow (_handle_tool_call method) @@ -794,30 +1030,26 @@ async def test_function_tool_with_multiple_tools_available(self, mock_model, moc assert sent_output == "result_two" @pytest.mark.asyncio - async def test_handoff_tool_handling(self, mock_model, mock_agent, mock_handoff): - """Test that handoff tools are properly handled""" - from unittest.mock import AsyncMock - - from agents.realtime.agent import RealtimeAgent - - # Create a mock new agent to be returned by handoff - mock_new_agent = Mock(spec=RealtimeAgent) - mock_new_agent.name = "new_agent" - mock_new_agent.instructions = "New agent instructions" - mock_new_agent.get_all_tools = AsyncMock(return_value=[]) - mock_new_agent.get_system_prompt = AsyncMock(return_value="New agent system prompt") - - # Set up handoff to return the new agent - mock_handoff.on_invoke_handoff = AsyncMock(return_value=mock_new_agent) - mock_handoff.name = "test_handoff" + async def test_handoff_tool_handling(self, mock_model): + first_agent = RealtimeAgent( + name="first_agent", + instructions="first_agent_instructions", + tools=[], + handoffs=[], + ) + second_agent = RealtimeAgent( + name="second_agent", + instructions="second_agent_instructions", + tools=[], + handoffs=[], + ) - # Set up agent to return handoff tool - mock_agent.get_all_tools.return_value = [mock_handoff] + first_agent.handoffs = [second_agent] - session = RealtimeSession(mock_model, mock_agent, None) + session = RealtimeSession(mock_model, first_agent, None) tool_call_event = RealtimeModelToolCallEvent( - name="test_handoff", call_id="call_789", arguments="{}" + name=Handoff.default_tool_name(second_agent), call_id="call_789", arguments="{}" ) await session._handle_tool_call(tool_call_event) @@ -829,7 +1061,7 @@ async def test_handoff_tool_handling(self, mock_model, mock_agent, mock_handoff) assert session._event_queue.qsize() >= 1 # Verify agent was updated - assert session._current_agent == mock_new_agent + assert session._current_agent == second_agent @pytest.mark.asyncio async def test_unknown_tool_handling(self, mock_model, mock_agent, mock_function_tool): @@ -1048,7 +1280,6 @@ async def test_transcript_delta_triggers_guardrail_at_threshold( await self._wait_for_guardrail_tasks(session) # Should have triggered guardrail and interrupted - assert session._interrupted_by_guardrail is True assert mock_model.interrupts_called == 1 assert len(mock_model.sent_messages) == 1 assert "triggered_guardrail" in mock_model.sent_messages[0] @@ -1062,6 +1293,37 @@ async def test_transcript_delta_triggers_guardrail_at_threshold( assert len(guardrail_events) == 1 assert guardrail_events[0].message == "this is more than ten characters" + @pytest.mark.asyncio + async def test_agent_and_run_config_guardrails_not_run_twice(self, mock_model): + """Guardrails shared by agent and run config should execute once.""" + + call_count = 0 + + def guardrail_func(context, agent, output): + nonlocal call_count + call_count += 1 + return GuardrailFunctionOutput(output_info={}, tripwire_triggered=False) + + shared_guardrail = OutputGuardrail( + guardrail_function=guardrail_func, name="shared_guardrail" + ) + + agent = RealtimeAgent(name="agent", output_guardrails=[shared_guardrail]) + run_config: RealtimeRunConfig = { + "output_guardrails": [shared_guardrail], + "guardrails_settings": {"debounce_text_length": 5}, + } + + session = RealtimeSession(mock_model, agent, None, run_config=run_config) + + await session.on_event( + RealtimeModelTranscriptDeltaEvent(item_id="item_1", delta="hello", response_id="resp_1") + ) + + await self._wait_for_guardrail_tasks(session) + + assert call_count == 1 + @pytest.mark.asyncio async def test_transcript_delta_multiple_thresholds_same_item( self, mock_model, mock_agent, triggered_guardrail @@ -1154,14 +1416,12 @@ async def test_turn_ended_clears_guardrail_state( # Wait for async guardrail tasks to complete await self._wait_for_guardrail_tasks(session) - assert session._interrupted_by_guardrail is True assert len(session._item_transcripts) == 1 # End turn await session.on_event(RealtimeModelTurnEndedEvent()) # State should be cleared - assert session._interrupted_by_guardrail is False assert len(session._item_transcripts) == 0 assert len(session._item_guardrail_run_counts) == 0 @@ -1208,3 +1468,493 @@ def guardrail_func(context, agent, output): guardrail_events = [e for e in events if isinstance(e, RealtimeGuardrailTripped)] assert len(guardrail_events) == 1 assert len(guardrail_events[0].guardrail_results) == 2 + + @pytest.mark.asyncio + async def test_agent_output_guardrails_triggered(self, mock_model, triggered_guardrail): + """Test that guardrails defined on the agent are executed.""" + agent = RealtimeAgent(name="agent", output_guardrails=[triggered_guardrail]) + run_config: RealtimeRunConfig = { + "guardrails_settings": {"debounce_text_length": 10}, + } + + session = RealtimeSession(mock_model, agent, None, run_config=run_config) + + transcript_event = RealtimeModelTranscriptDeltaEvent( + item_id="item_1", delta="this is more than ten characters", response_id="resp_1" + ) + + await session.on_event(transcript_event) + await self._wait_for_guardrail_tasks(session) + + assert mock_model.interrupts_called == 1 + assert len(mock_model.sent_messages) == 1 + assert "triggered_guardrail" in mock_model.sent_messages[0] + + events = [] + while not session._event_queue.empty(): + events.append(await session._event_queue.get()) + + guardrail_events = [e for e in events if isinstance(e, RealtimeGuardrailTripped)] + assert len(guardrail_events) == 1 + assert guardrail_events[0].message == "this is more than ten characters" + + @pytest.mark.asyncio + async def test_concurrent_guardrail_tasks_interrupt_once_per_response(self, mock_model): + """Even if multiple guardrail tasks trigger concurrently for the same response_id, + only the first should interrupt and send a message.""" + import asyncio + + # Barrier to release both guardrail tasks at the same time + start_event = asyncio.Event() + + async def async_trigger_guardrail(context, agent, output): + await start_event.wait() + return GuardrailFunctionOutput( + output_info={"reason": "concurrent"}, tripwire_triggered=True + ) + + concurrent_guardrail = OutputGuardrail( + guardrail_function=async_trigger_guardrail, name="concurrent_trigger" + ) + + run_config: RealtimeRunConfig = { + "output_guardrails": [concurrent_guardrail], + "guardrails_settings": {"debounce_text_length": 5}, + } + + # Use a minimal agent (guardrails from run_config) + agent = RealtimeAgent(name="agent") + session = RealtimeSession(mock_model, agent, None, run_config=run_config) + + # Two deltas for same item and response to enqueue two guardrail tasks + await session.on_event( + RealtimeModelTranscriptDeltaEvent( + item_id="item_1", delta="12345", response_id="resp_same" + ) + ) + await session.on_event( + RealtimeModelTranscriptDeltaEvent( + item_id="item_1", delta="67890", response_id="resp_same" + ) + ) + + # Wait until both tasks are enqueued + for _ in range(50): + if len(session._guardrail_tasks) >= 2: + break + await asyncio.sleep(0.01) + + # Release both tasks concurrently + start_event.set() + + # Wait for completion + if session._guardrail_tasks: + await asyncio.gather(*session._guardrail_tasks, return_exceptions=True) + + # Only one interrupt and one message should be sent + assert mock_model.interrupts_called == 1 + assert len(mock_model.sent_messages) == 1 + + +class TestModelSettingsIntegration: + """Test suite for model settings integration in RealtimeSession.""" + + @pytest.mark.asyncio + async def test_session_gets_model_settings_from_agent_during_connection(self): + """Test that session properly gets model settings from agent during __aenter__.""" + # Create mock model that records the config passed to connect() + mock_model = Mock(spec=RealtimeModel) + mock_model.connect = AsyncMock() + mock_model.add_listener = Mock() + + # Create agent with specific settings + agent = Mock(spec=RealtimeAgent) + agent.get_system_prompt = AsyncMock(return_value="Test agent instructions") + agent.get_all_tools = AsyncMock(return_value=[{"type": "function", "name": "test_tool"}]) + agent.handoffs = [] + + session = RealtimeSession(mock_model, agent, None) + + # Connect the session + await session.__aenter__() + + # Verify model.connect was called with settings from agent + mock_model.connect.assert_called_once() + connect_config = mock_model.connect.call_args[0][0] + + initial_settings = connect_config["initial_model_settings"] + assert initial_settings["instructions"] == "Test agent instructions" + assert initial_settings["tools"] == [{"type": "function", "name": "test_tool"}] + assert initial_settings["handoffs"] == [] + + await session.__aexit__(None, None, None) + + @pytest.mark.asyncio + async def test_model_config_overrides_model_settings_not_agent(self): + """Test that initial_model_settings from model_config override model settings + but not agent-derived settings.""" + mock_model = Mock(spec=RealtimeModel) + mock_model.connect = AsyncMock() + mock_model.add_listener = Mock() + + agent = Mock(spec=RealtimeAgent) + agent.get_system_prompt = AsyncMock(return_value="Agent instructions") + agent.get_all_tools = AsyncMock(return_value=[{"type": "function", "name": "agent_tool"}]) + agent.handoffs = [] + + # Provide model config with settings + model_config: RealtimeModelConfig = { + "initial_model_settings": { + "voice": "nova", + "model_name": "gpt-4o-realtime", + } + } + + session = RealtimeSession(mock_model, agent, None, model_config=model_config) + + await session.__aenter__() + + # Verify model config settings were applied + connect_config = mock_model.connect.call_args[0][0] + initial_settings = connect_config["initial_model_settings"] + + # Agent-derived settings should come from agent + assert initial_settings["instructions"] == "Agent instructions" + assert initial_settings["tools"] == [{"type": "function", "name": "agent_tool"}] + # Model config settings should be applied + assert initial_settings["voice"] == "nova" + assert initial_settings["model_name"] == "gpt-4o-realtime" + + await session.__aexit__(None, None, None) + + @pytest.mark.asyncio + async def test_handoffs_are_included_in_model_settings(self): + """Test that handoffs from agent are properly processed into model settings.""" + mock_model = Mock(spec=RealtimeModel) + mock_model.connect = AsyncMock() + mock_model.add_listener = Mock() + + # Create agent with handoffs + agent = Mock(spec=RealtimeAgent) + agent.get_system_prompt = AsyncMock(return_value="Agent with handoffs") + agent.get_all_tools = AsyncMock(return_value=[]) + + # Create a mock handoff + handoff_agent = Mock(spec=RealtimeAgent) + handoff_agent.name = "handoff_target" + + mock_handoff = Mock(spec=Handoff) + mock_handoff.tool_name = "transfer_to_specialist" + mock_handoff.is_enabled = True + + agent.handoffs = [handoff_agent] # Agent handoff + + # Mock the _get_handoffs method since it's complex + with pytest.MonkeyPatch().context() as m: + + async def mock_get_handoffs(cls, agent, context_wrapper): + return [mock_handoff] + + m.setattr("agents.realtime.session.RealtimeSession._get_handoffs", mock_get_handoffs) + + session = RealtimeSession(mock_model, agent, None) + + await session.__aenter__() + + # Verify handoffs were included + connect_config = mock_model.connect.call_args[0][0] + initial_settings = connect_config["initial_model_settings"] + + assert initial_settings["handoffs"] == [mock_handoff] + + await session.__aexit__(None, None, None) + + +# Test: Model settings precedence +class TestModelSettingsPrecedence: + """Test suite for model settings precedence in RealtimeSession""" + + @pytest.mark.asyncio + async def test_model_settings_precedence_order(self): + """Test that model settings follow correct precedence: + run_config -> agent -> model_config""" + + # Create a test agent + agent = RealtimeAgent(name="test_agent", instructions="agent_instructions") + agent.handoffs = [] + + # Mock the agent methods to return known values + agent.get_system_prompt = AsyncMock(return_value="agent_system_prompt") # type: ignore + agent.get_all_tools = AsyncMock(return_value=[]) # type: ignore + + # Mock model + mock_model = Mock(spec=RealtimeModel) + mock_model.connect = AsyncMock() + + # Define settings at each level with different values + run_config_settings: RealtimeSessionModelSettings = { + "voice": "run_config_voice", + "modalities": ["text"], + } + + model_config_initial_settings: RealtimeSessionModelSettings = { + "voice": "model_config_voice", # Should override run_config + "tool_choice": "auto", # New setting not in run_config + } + + run_config: RealtimeRunConfig = {"model_settings": run_config_settings} + + model_config: RealtimeModelConfig = { + "initial_model_settings": model_config_initial_settings + } + + # Create session with both configs + session = RealtimeSession( + model=mock_model, + agent=agent, + context=None, + model_config=model_config, + run_config=run_config, + ) + + # Mock the _get_handoffs method + async def mock_get_handoffs(cls, agent, context_wrapper): + return [] + + with pytest.MonkeyPatch().context() as m: + m.setattr("agents.realtime.session.RealtimeSession._get_handoffs", mock_get_handoffs) + + # Test the method directly + model_settings = await session._get_updated_model_settings_from_agent( + starting_settings=model_config_initial_settings, agent=agent + ) + + # Verify precedence order: + # 1. Agent settings should always be set (highest precedence for these) + assert model_settings["instructions"] == "agent_system_prompt" + assert model_settings["tools"] == [] + assert model_settings["handoffs"] == [] + + # 2. model_config settings should override run_config settings + assert model_settings["voice"] == "model_config_voice" # model_config wins + + # 3. run_config settings should be preserved when not overridden + assert model_settings["modalities"] == ["text"] # only in run_config + + # 4. model_config-only settings should be present + assert model_settings["tool_choice"] == "auto" # only in model_config + + @pytest.mark.asyncio + async def test_model_settings_with_run_config_only(self): + """Test that run_config model_settings are used when no model_config provided""" + + agent = RealtimeAgent(name="test_agent", instructions="test") + agent.handoffs = [] + agent.get_system_prompt = AsyncMock(return_value="test_prompt") # type: ignore + agent.get_all_tools = AsyncMock(return_value=[]) # type: ignore + + mock_model = Mock(spec=RealtimeModel) + + run_config_settings: RealtimeSessionModelSettings = { + "voice": "run_config_only_voice", + "modalities": ["text", "audio"], + "input_audio_format": "pcm16", + } + + session = RealtimeSession( + model=mock_model, + agent=agent, + context=None, + model_config=None, # No model config + run_config={"model_settings": run_config_settings}, + ) + + async def mock_get_handoffs(cls, agent, context_wrapper): + return [] + + with pytest.MonkeyPatch().context() as m: + m.setattr("agents.realtime.session.RealtimeSession._get_handoffs", mock_get_handoffs) + + model_settings = await session._get_updated_model_settings_from_agent( + starting_settings=None, # No initial settings + agent=agent, + ) + + # Agent settings should be present + assert model_settings["instructions"] == "test_prompt" + assert model_settings["tools"] == [] + assert model_settings["handoffs"] == [] + + # All run_config settings should be preserved (no overrides) + assert model_settings["voice"] == "run_config_only_voice" + assert model_settings["modalities"] == ["text", "audio"] + assert model_settings["input_audio_format"] == "pcm16" + + @pytest.mark.asyncio + async def test_model_settings_with_model_config_only(self): + """Test that model_config settings are used when no run_config model_settings""" + + agent = RealtimeAgent(name="test_agent", instructions="test") + agent.handoffs = [] + agent.get_system_prompt = AsyncMock(return_value="test_prompt") # type: ignore + agent.get_all_tools = AsyncMock(return_value=[]) # type: ignore + + mock_model = Mock(spec=RealtimeModel) + + model_config_settings: RealtimeSessionModelSettings = { + "voice": "model_config_only_voice", + "tool_choice": "required", + "output_audio_format": "g711_ulaw", + } + + session = RealtimeSession( + model=mock_model, + agent=agent, + context=None, + model_config={"initial_model_settings": model_config_settings}, + run_config={}, # No model_settings in run_config + ) + + async def mock_get_handoffs(cls, agent, context_wrapper): + return [] + + with pytest.MonkeyPatch().context() as m: + m.setattr("agents.realtime.session.RealtimeSession._get_handoffs", mock_get_handoffs) + + model_settings = await session._get_updated_model_settings_from_agent( + starting_settings=model_config_settings, agent=agent + ) + + # Agent settings should be present + assert model_settings["instructions"] == "test_prompt" + assert model_settings["tools"] == [] + assert model_settings["handoffs"] == [] + + # All model_config settings should be preserved + assert model_settings["voice"] == "model_config_only_voice" + assert model_settings["tool_choice"] == "required" + assert model_settings["output_audio_format"] == "g711_ulaw" + + @pytest.mark.asyncio + async def test_model_settings_preserve_initial_settings_on_updates(self): + """Initial model settings should persist when we recompute settings for updates.""" + + agent = RealtimeAgent(name="test_agent", instructions="test") + agent.handoffs = [] + agent.get_system_prompt = AsyncMock(return_value="test_prompt") # type: ignore + agent.get_all_tools = AsyncMock(return_value=[]) # type: ignore + + mock_model = Mock(spec=RealtimeModel) + + initial_settings: RealtimeSessionModelSettings = { + "voice": "initial_voice", + "output_audio_format": "pcm16", + } + + session = RealtimeSession( + model=mock_model, + agent=agent, + context=None, + model_config={"initial_model_settings": initial_settings}, + run_config={}, + ) + + async def mock_get_handoffs(cls, agent, context_wrapper): + return [] + + with pytest.MonkeyPatch().context() as m: + m.setattr( + "agents.realtime.session.RealtimeSession._get_handoffs", + mock_get_handoffs, + ) + + model_settings = await session._get_updated_model_settings_from_agent( + starting_settings=None, + agent=agent, + ) + + assert model_settings["voice"] == "initial_voice" + assert model_settings["output_audio_format"] == "pcm16" + + +class TestUpdateAgentFunctionality: + """Tests for update agent functionality in RealtimeSession""" + + @pytest.mark.asyncio + async def test_update_agent_creates_handoff_and_session_update_event(self, mock_model): + first_agent = RealtimeAgent(name="first", instructions="first", tools=[], handoffs=[]) + second_agent = RealtimeAgent(name="second", instructions="second", tools=[], handoffs=[]) + + session = RealtimeSession(mock_model, first_agent, None) + + await session.update_agent(second_agent) + + # Should have sent session update + session_update_event = mock_model.sent_events[0] + assert isinstance(session_update_event, RealtimeModelSendSessionUpdate) + assert session_update_event.session_settings["instructions"] == "second" + + # Check that the current agent and session settings are updated + assert session._current_agent == second_agent + + +class TestTranscriptPreservation: + """Tests ensuring assistant transcripts are preserved across updates.""" + + @pytest.mark.asyncio + async def test_assistant_transcript_preserved_on_item_update(self, mock_model, mock_agent): + session = RealtimeSession(mock_model, mock_agent, None) + + # Initial assistant message with audio transcript present (e.g., from first turn) + initial_item = AssistantMessageItem( + item_id="assist_1", + role="assistant", + content=[AssistantAudio(audio=None, transcript="Hello there")], + ) + session._history = [initial_item] + + # Later, the platform retrieves/updates the same item but without transcript populated + updated_without_transcript = AssistantMessageItem( + item_id="assist_1", + role="assistant", + content=[AssistantAudio(audio=None, transcript=None)], + ) + + await session.on_event(RealtimeModelItemUpdatedEvent(item=updated_without_transcript)) + + # Transcript should be preserved from existing history + assert len(session._history) == 1 + preserved_item = cast(AssistantMessageItem, session._history[0]) + assert isinstance(preserved_item.content[0], AssistantAudio) + assert preserved_item.content[0].transcript == "Hello there" + + @pytest.mark.asyncio + async def test_assistant_transcript_can_fallback_to_deltas(self, mock_model, mock_agent): + session = RealtimeSession(mock_model, mock_agent, None) + + # Simulate transcript deltas accumulated for an assistant item during generation + await session.on_event( + RealtimeModelTranscriptDeltaEvent( + item_id="assist_2", delta="partial transcript", response_id="resp_2" + ) + ) + + # Add initial assistant message without transcript + initial_item = AssistantMessageItem( + item_id="assist_2", + role="assistant", + content=[AssistantAudio(audio=None, transcript=None)], + ) + await session.on_event(RealtimeModelItemUpdatedEvent(item=initial_item)) + + # Later update still lacks transcript; merge should fallback to accumulated deltas + update_again = AssistantMessageItem( + item_id="assist_2", + role="assistant", + content=[AssistantAudio(audio=None, transcript=None)], + ) + await session.on_event(RealtimeModelItemUpdatedEvent(item=update_again)) + + preserved_item = cast(AssistantMessageItem, session._history[0]) + assert isinstance(preserved_item.content[0], AssistantAudio) + assert preserved_item.content[0].transcript == "partial transcript" diff --git a/tests/realtime/test_session_payload_and_formats.py b/tests/realtime/test_session_payload_and_formats.py new file mode 100644 index 000000000..f3e72ae13 --- /dev/null +++ b/tests/realtime/test_session_payload_and_formats.py @@ -0,0 +1,93 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, cast + +import pydantic +from openai.types.realtime.realtime_audio_config import RealtimeAudioConfig +from openai.types.realtime.realtime_audio_formats import ( + AudioPCM, + AudioPCMA, + AudioPCMU, +) +from openai.types.realtime.realtime_session_create_request import ( + RealtimeSessionCreateRequest, +) +from openai.types.realtime.realtime_transcription_session_create_request import ( + RealtimeTranscriptionSessionCreateRequest, +) + +from agents.realtime.openai_realtime import OpenAIRealtimeWebSocketModel as Model + + +class _DummyModel(pydantic.BaseModel): + type: str + + +def _session_with_output(fmt: Any | None) -> RealtimeSessionCreateRequest: + if fmt is None: + return RealtimeSessionCreateRequest(type="realtime", model="gpt-realtime") + return RealtimeSessionCreateRequest( + type="realtime", + model="gpt-realtime", + # Use dict for output to avoid importing non-exported symbols in tests + audio=RealtimeAudioConfig(output=cast(Any, {"format": fmt})), + ) + + +def test_normalize_session_payload_variants() -> None: + # Passthrough: already a realtime session model + rt = _session_with_output(AudioPCM(type="audio/pcm")) + assert Model._normalize_session_payload(rt) is rt + + # Transcription session instance should be ignored + ts = RealtimeTranscriptionSessionCreateRequest(type="transcription") + assert Model._normalize_session_payload(ts) is None + + # Transcription-like mapping should be ignored + transcription_mapping: Mapping[str, object] = {"type": "transcription"} + assert Model._normalize_session_payload(transcription_mapping) is None + + # Valid realtime mapping should be converted to model + realtime_mapping: Mapping[str, object] = {"type": "realtime", "model": "gpt-realtime"} + as_model = Model._normalize_session_payload(realtime_mapping) + assert isinstance(as_model, RealtimeSessionCreateRequest) + assert as_model.type == "realtime" + + # Invalid mapping returns None + invalid_mapping: Mapping[str, object] = {"type": "bogus"} + assert Model._normalize_session_payload(invalid_mapping) is None + + +def test_extract_audio_format_from_session_objects() -> None: + # Known OpenAI audio format models -> normalized names + s_pcm = _session_with_output(AudioPCM(type="audio/pcm")) + assert Model._extract_audio_format(s_pcm) == "pcm16" + + s_ulaw = _session_with_output(AudioPCMU(type="audio/pcmu")) + assert Model._extract_audio_format(s_ulaw) == "g711_ulaw" + + s_alaw = _session_with_output(AudioPCMA(type="audio/pcma")) + assert Model._extract_audio_format(s_alaw) == "g711_alaw" + + # Missing/None output format -> None + s_none = _session_with_output(None) + assert Model._extract_audio_format(s_none) is None + + +def test_normalize_audio_format_fallbacks() -> None: + # String passthrough + assert Model._normalize_audio_format("pcm24") == "pcm24" + + # Mapping with type field + assert Model._normalize_audio_format({"type": "g711_ulaw"}) == "g711_ulaw" + + # Pydantic model with type field + assert Model._normalize_audio_format(_DummyModel(type="custom")) == "custom" + + # Object with attribute 'type' + class HasType: + def __init__(self) -> None: + self.type = "weird" + + assert Model._normalize_audio_format(HasType()) == "weird" diff --git a/tests/realtime/test_tracing.py b/tests/realtime/test_tracing.py index 4cff46c49..60004ab0b 100644 --- a/tests/realtime/test_tracing.py +++ b/tests/realtime/test_tracing.py @@ -1,8 +1,16 @@ -from unittest.mock import AsyncMock, patch +from typing import cast +from unittest.mock import AsyncMock, Mock, patch import pytest +from openai.types.realtime.realtime_session_create_request import ( + RealtimeSessionCreateRequest, +) +from openai.types.realtime.realtime_tracing_config import TracingConfiguration +from agents.realtime.agent import RealtimeAgent +from agents.realtime.model import RealtimeModel from agents.realtime.openai_realtime import OpenAIRealtimeWebSocketModel +from agents.realtime.session import RealtimeSession class TestRealtimeTracingIntegration: @@ -92,29 +100,25 @@ async def async_websocket(*args, **kwargs): session_created_event = { "type": "session.created", "event_id": "event_123", - "session": {"id": "session_456"}, + "session": {"id": "session_456", "type": "realtime", "model": "gpt-realtime"}, } with patch.object(model, "_send_raw_message") as mock_send_raw_message: await model._handle_ws_event(session_created_event) # Should send session.update with tracing config - from agents.realtime.model_inputs import RealtimeModelSendRawMessage - - expected_event = RealtimeModelSendRawMessage( - message={ - "type": "session.update", - "other_data": { - "session": { - "tracing": { - "workflow_name": "test_workflow", - "group_id": "group_123", - } - } - }, - } + from openai.types.realtime.session_update_event import ( + SessionUpdateEvent, ) - mock_send_raw_message.assert_called_once_with(expected_event) + + mock_send_raw_message.assert_called_once() + call_args = mock_send_raw_message.call_args[0][0] + assert isinstance(call_args, SessionUpdateEvent) + assert call_args.type == "session.update" + session_req = cast(RealtimeSessionCreateRequest, call_args.session) + assert isinstance(session_req.tracing, TracingConfiguration) + assert session_req.tracing.workflow_name == "test_workflow" + assert session_req.tracing.group_id == "group_123" @pytest.mark.asyncio async def test_send_tracing_config_auto_mode(self, model, mock_websocket): @@ -137,22 +141,21 @@ async def async_websocket(*args, **kwargs): session_created_event = { "type": "session.created", "event_id": "event_123", - "session": {"id": "session_456"}, + "session": {"id": "session_456", "type": "realtime", "model": "gpt-realtime"}, } with patch.object(model, "_send_raw_message") as mock_send_raw_message: await model._handle_ws_event(session_created_event) # Should send session.update with "auto" - from agents.realtime.model_inputs import RealtimeModelSendRawMessage + from openai.types.realtime.session_update_event import SessionUpdateEvent - expected_event = RealtimeModelSendRawMessage( - message={ - "type": "session.update", - "other_data": {"session": {"tracing": "auto"}}, - } - ) - mock_send_raw_message.assert_called_once_with(expected_event) + mock_send_raw_message.assert_called_once() + call_args = mock_send_raw_message.call_args[0][0] + assert isinstance(call_args, SessionUpdateEvent) + assert call_args.type == "session.update" + session_req = cast(RealtimeSessionCreateRequest, call_args.session) + assert session_req.tracing == "auto" @pytest.mark.asyncio async def test_tracing_config_none_skips_session_update(self, model, mock_websocket): @@ -163,7 +166,7 @@ async def test_tracing_config_none_skips_session_update(self, model, mock_websoc session_created_event = { "type": "session.created", "event_id": "event_123", - "session": {"id": "session_456"}, + "session": {"id": "session_456", "type": "realtime", "model": "gpt-realtime"}, } with patch.object(model, "send_event") as mock_send_event: @@ -202,63 +205,49 @@ async def async_websocket(*args, **kwargs): session_created_event = { "type": "session.created", "event_id": "event_123", - "session": {"id": "session_456"}, + "session": {"id": "session_456", "type": "realtime", "model": "gpt-realtime"}, } with patch.object(model, "_send_raw_message") as mock_send_raw_message: await model._handle_ws_event(session_created_event) # Should send session.update with complete tracing config including metadata - from agents.realtime.model_inputs import RealtimeModelSendRawMessage - - expected_event = RealtimeModelSendRawMessage( - message={ - "type": "session.update", - "other_data": { - "session": { - "tracing": { - "workflow_name": "complex_workflow", - "metadata": complex_metadata, - } - } - }, - } + from openai.types.realtime.session_update_event import ( + SessionUpdateEvent, ) - mock_send_raw_message.assert_called_once_with(expected_event) + + mock_send_raw_message.assert_called_once() + call_args = mock_send_raw_message.call_args[0][0] + assert isinstance(call_args, SessionUpdateEvent) + assert call_args.type == "session.update" + session_req = cast(RealtimeSessionCreateRequest, call_args.session) + assert isinstance(session_req.tracing, TracingConfiguration) + assert session_req.tracing.workflow_name == "complex_workflow" + assert session_req.tracing.metadata == complex_metadata @pytest.mark.asyncio async def test_tracing_disabled_prevents_tracing(self, mock_websocket): """Test that tracing_disabled=True prevents tracing configuration.""" - from agents.realtime.agent import RealtimeAgent - from agents.realtime.runner import RealtimeRunner - # Create a test agent and runner with tracing disabled + # Create a test agent and mock model agent = RealtimeAgent(name="test_agent", instructions="test") + agent.handoffs = [] - runner = RealtimeRunner(starting_agent=agent, config={"tracing_disabled": True}) + mock_model = Mock(spec=RealtimeModel) - # Test the _get_model_settings method directly since that's where the logic is - model_settings = await runner._get_model_settings( + # Create session with tracing disabled + session = RealtimeSession( + model=mock_model, agent=agent, - disable_tracing=True, # This should come from config["tracing_disabled"] - initial_settings=None, - overrides=None, + context=None, + model_config=None, + run_config={"tracing_disabled": True}, + ) + + # Test the _get_updated_model_settings_from_agent method directly + model_settings = await session._get_updated_model_settings_from_agent( + starting_settings=None, agent=agent ) # When tracing is disabled, model settings should have tracing=None assert model_settings["tracing"] is None - - # Also test that the runner passes disable_tracing=True correctly - with patch.object(runner, "_get_model_settings") as mock_get_settings: - mock_get_settings.return_value = {"tracing": None} - - with patch("agents.realtime.session.RealtimeSession") as mock_session_class: - mock_session = AsyncMock() - mock_session_class.return_value = mock_session - - await runner.run() - - # Verify that _get_model_settings was called with disable_tracing=True - mock_get_settings.assert_called_once_with( - agent=agent, disable_tracing=True, initial_settings=None, overrides=None - ) diff --git a/tests/test_agent_as_tool.py b/tests/test_agent_as_tool.py new file mode 100644 index 000000000..1b8b99682 --- /dev/null +++ b/tests/test_agent_as_tool.py @@ -0,0 +1,390 @@ +from __future__ import annotations + +from typing import Any + +import pytest +from openai.types.responses import ResponseOutputMessage, ResponseOutputText +from pydantic import BaseModel + +from agents import ( + Agent, + AgentBase, + FunctionTool, + MessageOutputItem, + RunConfig, + RunContextWrapper, + RunHooks, + Runner, + Session, + TResponseInputItem, +) +from agents.tool_context import ToolContext + + +class BoolCtx(BaseModel): + enable_tools: bool + + +@pytest.mark.asyncio +async def test_agent_as_tool_is_enabled_bool(): + """Test that agent.as_tool() respects static boolean is_enabled parameter.""" + # Create a simple agent + agent = Agent( + name="test_agent", + instructions="You are a test agent that says hello.", + ) + + # Create tool with is_enabled=False + disabled_tool = agent.as_tool( + tool_name="disabled_agent_tool", + tool_description="A disabled agent tool", + is_enabled=False, + ) + + # Create tool with is_enabled=True (default) + enabled_tool = agent.as_tool( + tool_name="enabled_agent_tool", + tool_description="An enabled agent tool", + is_enabled=True, + ) + + # Create another tool with default is_enabled (should be True) + default_tool = agent.as_tool( + tool_name="default_agent_tool", + tool_description="A default agent tool", + ) + + # Create test agent that uses these tools + orchestrator = Agent( + name="orchestrator", + instructions="You orchestrate other agents.", + tools=[disabled_tool, enabled_tool, default_tool], + ) + + # Test with any context + context = RunContextWrapper(BoolCtx(enable_tools=True)) + + # Get all tools - should filter out the disabled one + tools = await orchestrator.get_all_tools(context) + tool_names = [tool.name for tool in tools] + + assert "enabled_agent_tool" in tool_names + assert "default_agent_tool" in tool_names + assert "disabled_agent_tool" not in tool_names + + +@pytest.mark.asyncio +async def test_agent_as_tool_is_enabled_callable(): + """Test that agent.as_tool() respects callable is_enabled parameter.""" + # Create a simple agent + agent = Agent( + name="test_agent", + instructions="You are a test agent that says hello.", + ) + + # Create tool with callable is_enabled + async def cond_enabled(ctx: RunContextWrapper[BoolCtx], agent: AgentBase) -> bool: + return ctx.context.enable_tools + + conditional_tool = agent.as_tool( + tool_name="conditional_agent_tool", + tool_description="A conditionally enabled agent tool", + is_enabled=cond_enabled, + ) + + # Create tool with lambda is_enabled + lambda_tool = agent.as_tool( + tool_name="lambda_agent_tool", + tool_description="A lambda enabled agent tool", + is_enabled=lambda ctx, agent: ctx.context.enable_tools, + ) + + # Create test agent that uses these tools + orchestrator = Agent( + name="orchestrator", + instructions="You orchestrate other agents.", + tools=[conditional_tool, lambda_tool], + ) + + # Test with enable_tools=False + context_disabled = RunContextWrapper(BoolCtx(enable_tools=False)) + tools_disabled = await orchestrator.get_all_tools(context_disabled) + assert len(tools_disabled) == 0 + + # Test with enable_tools=True + context_enabled = RunContextWrapper(BoolCtx(enable_tools=True)) + tools_enabled = await orchestrator.get_all_tools(context_enabled) + tool_names = [tool.name for tool in tools_enabled] + + assert len(tools_enabled) == 2 + assert "conditional_agent_tool" in tool_names + assert "lambda_agent_tool" in tool_names + + +@pytest.mark.asyncio +async def test_agent_as_tool_is_enabled_mixed(): + """Test agent.as_tool() with mixed enabled/disabled tools.""" + # Create a simple agent + agent = Agent( + name="test_agent", + instructions="You are a test agent that says hello.", + ) + + # Create various tools with different is_enabled configurations + always_enabled = agent.as_tool( + tool_name="always_enabled", + tool_description="Always enabled tool", + is_enabled=True, + ) + + always_disabled = agent.as_tool( + tool_name="always_disabled", + tool_description="Always disabled tool", + is_enabled=False, + ) + + conditionally_enabled = agent.as_tool( + tool_name="conditionally_enabled", + tool_description="Conditionally enabled tool", + is_enabled=lambda ctx, agent: ctx.context.enable_tools, + ) + + default_enabled = agent.as_tool( + tool_name="default_enabled", + tool_description="Default enabled tool", + ) + + # Create test agent that uses these tools + orchestrator = Agent( + name="orchestrator", + instructions="You orchestrate other agents.", + tools=[always_enabled, always_disabled, conditionally_enabled, default_enabled], + ) + + # Test with enable_tools=False + context_disabled = RunContextWrapper(BoolCtx(enable_tools=False)) + tools_disabled = await orchestrator.get_all_tools(context_disabled) + tool_names_disabled = [tool.name for tool in tools_disabled] + + assert len(tools_disabled) == 2 + assert "always_enabled" in tool_names_disabled + assert "default_enabled" in tool_names_disabled + assert "always_disabled" not in tool_names_disabled + assert "conditionally_enabled" not in tool_names_disabled + + # Test with enable_tools=True + context_enabled = RunContextWrapper(BoolCtx(enable_tools=True)) + tools_enabled = await orchestrator.get_all_tools(context_enabled) + tool_names_enabled = [tool.name for tool in tools_enabled] + + assert len(tools_enabled) == 3 + assert "always_enabled" in tool_names_enabled + assert "default_enabled" in tool_names_enabled + assert "conditionally_enabled" in tool_names_enabled + assert "always_disabled" not in tool_names_enabled + + +@pytest.mark.asyncio +async def test_agent_as_tool_is_enabled_preserves_other_params(): + """Test that is_enabled parameter doesn't interfere with other agent.as_tool() parameters.""" + # Create a simple agent + agent = Agent( + name="test_agent", + instructions="You are a test agent that returns a greeting.", + ) + + # Custom output extractor + async def custom_extractor(result): + return f"CUSTOM: {result.new_items[-1].text if result.new_items else 'No output'}" + + # Create tool with all parameters including is_enabled + tool = agent.as_tool( + tool_name="custom_tool_name", + tool_description="A custom tool with all parameters", + custom_output_extractor=custom_extractor, + is_enabled=True, + ) + + # Verify the tool was created with correct properties + assert tool.name == "custom_tool_name" + assert isinstance(tool, FunctionTool) + assert tool.description == "A custom tool with all parameters" + assert tool.is_enabled is True + + # Verify tool is included when enabled + orchestrator = Agent( + name="orchestrator", + instructions="You orchestrate other agents.", + tools=[tool], + ) + + context = RunContextWrapper(BoolCtx(enable_tools=True)) + tools = await orchestrator.get_all_tools(context) + assert len(tools) == 1 + assert tools[0].name == "custom_tool_name" + + +@pytest.mark.asyncio +async def test_agent_as_tool_returns_concatenated_text(monkeypatch: pytest.MonkeyPatch) -> None: + """Agent tool should use default text aggregation when no custom extractor is provided.""" + + agent = Agent(name="storyteller") + + message = ResponseOutputMessage( + id="msg_1", + role="assistant", + status="completed", + type="message", + content=[ + ResponseOutputText( + annotations=[], + text="Hello world", + type="output_text", + logprobs=None, + ) + ], + ) + + result = type( + "DummyResult", + (), + {"new_items": [MessageOutputItem(agent=agent, raw_item=message)]}, + )() + + async def fake_run( + cls, + starting_agent, + input, + *, + context, + max_turns, + hooks, + run_config, + previous_response_id, + conversation_id, + session, + ): + assert starting_agent is agent + assert input == "hello" + return result + + monkeypatch.setattr(Runner, "run", classmethod(fake_run)) + + tool = agent.as_tool( + tool_name="story_tool", + tool_description="Tell a short story", + is_enabled=True, + ) + + assert isinstance(tool, FunctionTool) + tool_context = ToolContext( + context=None, + tool_name="story_tool", + tool_call_id="call_1", + tool_arguments='{"input": "hello"}', + ) + output = await tool.on_invoke_tool(tool_context, '{"input": "hello"}') + + assert output == "Hello world" + + +@pytest.mark.asyncio +async def test_agent_as_tool_custom_output_extractor(monkeypatch: pytest.MonkeyPatch) -> None: + """Custom output extractors should receive the RunResult from Runner.run.""" + + agent = Agent(name="summarizer") + + message = ResponseOutputMessage( + id="msg_2", + role="assistant", + status="completed", + type="message", + content=[ + ResponseOutputText( + annotations=[], + text="Original text", + type="output_text", + logprobs=None, + ) + ], + ) + + class DummySession(Session): + session_id = "sess_123" + + async def get_items(self, limit: int | None = None) -> list[TResponseInputItem]: + return [] + + async def add_items(self, items: list[TResponseInputItem]) -> None: + return None + + async def pop_item(self) -> TResponseInputItem | None: + return None + + async def clear_session(self) -> None: + return None + + dummy_session = DummySession() + + class DummyResult: + def __init__(self, items: list[MessageOutputItem]) -> None: + self.new_items = items + + run_result = DummyResult([MessageOutputItem(agent=agent, raw_item=message)]) + + async def fake_run( + cls, + starting_agent, + input, + *, + context, + max_turns, + hooks, + run_config, + previous_response_id, + conversation_id, + session, + ): + assert starting_agent is agent + assert input == "summarize this" + assert context is None + assert max_turns == 7 + assert hooks is hooks_obj + assert run_config is run_config_obj + assert previous_response_id == "resp_1" + assert conversation_id == "conv_1" + assert session is dummy_session + return run_result + + monkeypatch.setattr(Runner, "run", classmethod(fake_run)) + + async def extractor(result) -> str: + assert result is run_result + return "custom output" + + hooks_obj = RunHooks[Any]() + run_config_obj = RunConfig(model="gpt-4.1-mini") + + tool = agent.as_tool( + tool_name="summary_tool", + tool_description="Summarize input", + custom_output_extractor=extractor, + is_enabled=True, + run_config=run_config_obj, + max_turns=7, + hooks=hooks_obj, + previous_response_id="resp_1", + conversation_id="conv_1", + session=dummy_session, + ) + + assert isinstance(tool, FunctionTool) + tool_context = ToolContext( + context=None, + tool_name="summary_tool", + tool_call_id="call_2", + tool_arguments='{"input": "summarize this"}', + ) + output = await tool.on_invoke_tool(tool_context, '{"input": "summarize this"}') + + assert output == "custom output" diff --git a/tests/test_agent_clone_shallow_copy.py b/tests/test_agent_clone_shallow_copy.py new file mode 100644 index 000000000..44b41bd3d --- /dev/null +++ b/tests/test_agent_clone_shallow_copy.py @@ -0,0 +1,32 @@ +from agents import Agent, function_tool, handoff + + +@function_tool +def greet(name: str) -> str: + return f"Hello, {name}!" + + +def test_agent_clone_shallow_copy(): + """Test that clone creates shallow copy with tools.copy() workaround""" + target_agent = Agent(name="Target") + original = Agent( + name="Original", + instructions="Testing clone shallow copy", + tools=[greet], + handoffs=[handoff(target_agent)], + ) + + cloned = original.clone( + name="Cloned", tools=original.tools.copy(), handoffs=original.handoffs.copy() + ) + + # Basic assertions + assert cloned is not original + assert cloned.name == "Cloned" + assert cloned.instructions == original.instructions + + # Shallow copy assertions + assert cloned.tools is not original.tools, "Tools should be different list" + assert cloned.tools[0] is original.tools[0], "Tool objects should be same instance" + assert cloned.handoffs is not original.handoffs, "Handoffs should be different list" + assert cloned.handoffs[0] is original.handoffs[0], "Handoff objects should be same instance" diff --git a/tests/test_agent_config.py b/tests/test_agent_config.py index a985fd60d..5b633b70b 100644 --- a/tests/test_agent_config.py +++ b/tests/test_agent_config.py @@ -2,6 +2,8 @@ from pydantic import BaseModel from agents import Agent, AgentOutputSchema, Handoff, RunContextWrapper, handoff +from agents.lifecycle import AgentHooksBase +from agents.model_settings import ModelSettings from agents.run import AgentRunner @@ -167,3 +169,58 @@ async def test_agent_final_output(): assert schema.is_strict_json_schema() is True assert schema.json_schema() is not None assert not schema.is_plain_text() + + +class TestAgentValidation: + """Essential validation tests for Agent __post_init__""" + + def test_name_validation_critical_cases(self): + """Test name validation - the original issue that started this PR""" + # This was the original failing case that caused JSON serialization errors + with pytest.raises(TypeError, match="Agent name must be a string, got int"): + Agent(name=1) # type: ignore + + with pytest.raises(TypeError, match="Agent name must be a string, got NoneType"): + Agent(name=None) # type: ignore + + def test_tool_use_behavior_dict_validation(self): + """Test tool_use_behavior accepts StopAtTools dict - fixes existing test failures""" + # This test ensures the existing failing tests now pass + Agent(name="test", tool_use_behavior={"stop_at_tool_names": ["tool1"]}) + + # Invalid cases that should fail + with pytest.raises(TypeError, match="Agent tool_use_behavior must be"): + Agent(name="test", tool_use_behavior=123) # type: ignore + + def test_hooks_validation_python39_compatibility(self): + """Test hooks validation works with Python 3.9 - fixes generic type issues""" + + class MockHooks(AgentHooksBase): + pass + + # Valid case + Agent(name="test", hooks=MockHooks()) # type: ignore + + # Invalid case + with pytest.raises(TypeError, match="Agent hooks must be an AgentHooks instance"): + Agent(name="test", hooks="invalid") # type: ignore + + def test_list_field_validation(self): + """Test critical list fields that commonly get wrong types""" + # These are the most common mistakes users make + with pytest.raises(TypeError, match="Agent tools must be a list"): + Agent(name="test", tools="not_a_list") # type: ignore + + with pytest.raises(TypeError, match="Agent handoffs must be a list"): + Agent(name="test", handoffs="not_a_list") # type: ignore + + def test_model_settings_validation(self): + """Test model_settings validation - prevents runtime errors""" + # Valid case + Agent(name="test", model_settings=ModelSettings()) + + # Invalid case that could cause runtime issues + with pytest.raises( + TypeError, match="Agent model_settings must be a ModelSettings instance" + ): + Agent(name="test", model_settings={}) # type: ignore diff --git a/tests/test_agent_instructions_signature.py b/tests/test_agent_instructions_signature.py new file mode 100644 index 000000000..604eb5189 --- /dev/null +++ b/tests/test_agent_instructions_signature.py @@ -0,0 +1,119 @@ +from unittest.mock import Mock + +import pytest + +from agents import Agent, RunContextWrapper + + +class TestInstructionsSignatureValidation: + """Test suite for instructions function signature validation""" + + @pytest.fixture + def mock_run_context(self): + """Create a mock RunContextWrapper for testing""" + return Mock(spec=RunContextWrapper) + + @pytest.mark.asyncio + async def test_valid_async_signature_passes(self, mock_run_context): + """Test that async function with correct signature works""" + + async def valid_instructions(context, agent): + return "Valid async instructions" + + agent = Agent(name="test_agent", instructions=valid_instructions) + result = await agent.get_system_prompt(mock_run_context) + assert result == "Valid async instructions" + + @pytest.mark.asyncio + async def test_valid_sync_signature_passes(self, mock_run_context): + """Test that sync function with correct signature works""" + + def valid_instructions(context, agent): + return "Valid sync instructions" + + agent = Agent(name="test_agent", instructions=valid_instructions) + result = await agent.get_system_prompt(mock_run_context) + assert result == "Valid sync instructions" + + @pytest.mark.asyncio + async def test_one_parameter_raises_error(self, mock_run_context): + """Test that function with only one parameter raises TypeError""" + + def invalid_instructions(context): + return "Should fail" + + agent = Agent(name="test_agent", instructions=invalid_instructions) # type: ignore[arg-type] + + with pytest.raises(TypeError) as exc_info: + await agent.get_system_prompt(mock_run_context) + + assert "must accept exactly 2 arguments" in str(exc_info.value) + assert "but got 1" in str(exc_info.value) + + @pytest.mark.asyncio + async def test_three_parameters_raises_error(self, mock_run_context): + """Test that function with three parameters raises TypeError""" + + def invalid_instructions(context, agent, extra): + return "Should fail" + + agent = Agent(name="test_agent", instructions=invalid_instructions) # type: ignore[arg-type] + + with pytest.raises(TypeError) as exc_info: + await agent.get_system_prompt(mock_run_context) + + assert "must accept exactly 2 arguments" in str(exc_info.value) + assert "but got 3" in str(exc_info.value) + + @pytest.mark.asyncio + async def test_zero_parameters_raises_error(self, mock_run_context): + """Test that function with no parameters raises TypeError""" + + def invalid_instructions(): + return "Should fail" + + agent = Agent(name="test_agent", instructions=invalid_instructions) # type: ignore[arg-type] + + with pytest.raises(TypeError) as exc_info: + await agent.get_system_prompt(mock_run_context) + + assert "must accept exactly 2 arguments" in str(exc_info.value) + assert "but got 0" in str(exc_info.value) + + @pytest.mark.asyncio + async def test_function_with_args_kwargs_fails(self, mock_run_context): + """Test that function with *args/**kwargs fails validation""" + + def flexible_instructions(context, agent, *args, **kwargs): + return "Flexible instructions" + + agent = Agent(name="test_agent", instructions=flexible_instructions) + + with pytest.raises(TypeError) as exc_info: + await agent.get_system_prompt(mock_run_context) + + assert "must accept exactly 2 arguments" in str(exc_info.value) + assert "but got" in str(exc_info.value) + + @pytest.mark.asyncio + async def test_string_instructions_still_work(self, mock_run_context): + """Test that string instructions continue to work""" + agent = Agent(name="test_agent", instructions="Static string instructions") + result = await agent.get_system_prompt(mock_run_context) + assert result == "Static string instructions" + + @pytest.mark.asyncio + async def test_none_instructions_return_none(self, mock_run_context): + """Test that None instructions return None""" + agent = Agent(name="test_agent", instructions=None) + result = await agent.get_system_prompt(mock_run_context) + assert result is None + + @pytest.mark.asyncio + async def test_non_callable_instructions_raises_error(self, mock_run_context): + """Test that non-callable instructions raise a TypeError during initialization""" + with pytest.raises(TypeError) as exc_info: + Agent(name="test_agent", instructions=123) # type: ignore[arg-type] + + assert "Agent instructions must be a string, callable, or None" in str(exc_info.value) + assert "got int" in str(exc_info.value) diff --git a/tests/test_agent_llm_hooks.py b/tests/test_agent_llm_hooks.py new file mode 100644 index 000000000..2eb2cfb03 --- /dev/null +++ b/tests/test_agent_llm_hooks.py @@ -0,0 +1,130 @@ +from collections import defaultdict +from typing import Any, Optional + +import pytest + +from agents.agent import Agent +from agents.items import ItemHelpers, ModelResponse, TResponseInputItem +from agents.lifecycle import AgentHooks +from agents.run import Runner +from agents.run_context import RunContextWrapper, TContext +from agents.tool import Tool + +from .fake_model import FakeModel +from .test_responses import ( + get_function_tool, + get_text_message, +) + + +class AgentHooksForTests(AgentHooks): + def __init__(self): + self.events: dict[str, int] = defaultdict(int) + + def reset(self): + self.events.clear() + + async def on_start(self, context: RunContextWrapper[TContext], agent: Agent[TContext]) -> None: + self.events["on_start"] += 1 + + async def on_end( + self, context: RunContextWrapper[TContext], agent: Agent[TContext], output: Any + ) -> None: + self.events["on_end"] += 1 + + async def on_handoff( + self, context: RunContextWrapper[TContext], agent: Agent[TContext], source: Agent[TContext] + ) -> None: + self.events["on_handoff"] += 1 + + async def on_tool_start( + self, context: RunContextWrapper[TContext], agent: Agent[TContext], tool: Tool + ) -> None: + self.events["on_tool_start"] += 1 + + async def on_tool_end( + self, + context: RunContextWrapper[TContext], + agent: Agent[TContext], + tool: Tool, + result: str, + ) -> None: + self.events["on_tool_end"] += 1 + + # NEW: LLM hooks + async def on_llm_start( + self, + context: RunContextWrapper[TContext], + agent: Agent[TContext], + system_prompt: Optional[str], + input_items: list[TResponseInputItem], + ) -> None: + self.events["on_llm_start"] += 1 + + async def on_llm_end( + self, + context: RunContextWrapper[TContext], + agent: Agent[TContext], + response: ModelResponse, + ) -> None: + self.events["on_llm_end"] += 1 + + +# Example test using the above hooks: +@pytest.mark.asyncio +async def test_async_agent_hooks_with_llm(): + hooks = AgentHooksForTests() + model = FakeModel() + agent = Agent( + name="A", model=model, tools=[get_function_tool("f", "res")], handoffs=[], hooks=hooks + ) + # Simulate a single LLM call producing an output: + model.set_next_output([get_text_message("hello")]) + await Runner.run(agent, input="hello") + # Expect one on_start, one on_llm_start, one on_llm_end, and one on_end + assert hooks.events == {"on_start": 1, "on_llm_start": 1, "on_llm_end": 1, "on_end": 1} + + +# test_sync_agent_hook_with_llm() +def test_sync_agent_hook_with_llm(): + hooks = AgentHooksForTests() + model = FakeModel() + agent = Agent( + name="A", model=model, tools=[get_function_tool("f", "res")], handoffs=[], hooks=hooks + ) + # Simulate a single LLM call producing an output: + model.set_next_output([get_text_message("hello")]) + Runner.run_sync(agent, input="hello") + # Expect one on_start, one on_llm_start, one on_llm_end, and one on_end + assert hooks.events == {"on_start": 1, "on_llm_start": 1, "on_llm_end": 1, "on_end": 1} + + +# test_streamed_agent_hooks_with_llm(): +@pytest.mark.asyncio +async def test_streamed_agent_hooks_with_llm(): + hooks = AgentHooksForTests() + model = FakeModel() + agent = Agent( + name="A", model=model, tools=[get_function_tool("f", "res")], handoffs=[], hooks=hooks + ) + # Simulate a single LLM call producing an output: + model.set_next_output([get_text_message("hello")]) + stream = Runner.run_streamed(agent, input="hello") + + async for event in stream.stream_events(): + if event.type == "raw_response_event": + continue + if event.type == "agent_updated_stream_event": + print(f"[EVENT] agent_updated → {event.new_agent.name}") + elif event.type == "run_item_stream_event": + item = event.item + if item.type == "tool_call_item": + print("[EVENT] tool_call_item") + elif item.type == "tool_call_output_item": + print(f"[EVENT] tool_call_output_item → {item.output}") + elif item.type == "message_output_item": + text = ItemHelpers.text_message_output(item) + print(f"[EVENT] message_output_item → {text}") + + # Expect one on_start, one on_llm_start, one on_llm_end, and one on_end + assert hooks.events == {"on_start": 1, "on_llm_start": 1, "on_llm_end": 1, "on_end": 1} diff --git a/tests/test_agent_prompt.py b/tests/test_agent_prompt.py index 010717d66..3d5ed5a3f 100644 --- a/tests/test_agent_prompt.py +++ b/tests/test_agent_prompt.py @@ -24,6 +24,7 @@ async def get_response( tracing, *, previous_response_id, + conversation_id, prompt, ): # Record the prompt that the agent resolved and passed in. @@ -37,6 +38,7 @@ async def get_response( handoffs, tracing, previous_response_id=previous_response_id, + conversation_id=conversation_id, prompt=prompt, ) diff --git a/tests/test_agent_runner.py b/tests/test_agent_runner.py index 77eb8019e..441054dd4 100644 --- a/tests/test_agent_runner.py +++ b/tests/test_agent_runner.py @@ -1,7 +1,11 @@ from __future__ import annotations +import asyncio import json -from typing import Any +import tempfile +from pathlib import Path +from typing import Any, cast +from unittest.mock import patch import pytest from typing_extensions import TypedDict @@ -20,6 +24,7 @@ RunConfig, RunContextWrapper, Runner, + SQLiteSession, UserError, handoff, ) @@ -35,6 +40,7 @@ get_text_input_item, get_text_message, ) +from .utils.simple_session import SimpleListSession @pytest.mark.asyncio @@ -192,11 +198,13 @@ async def test_structured_output(): [get_function_tool_call("foo", json.dumps({"bar": "baz"}))], # Second turn: a message and a handoff [get_text_message("a_message"), get_handoff_tool_call(agent_1)], - # Third turn: tool call and structured output + # Third turn: tool call with preamble message [ + get_text_message(json.dumps(Foo(bar="preamble"))), get_function_tool_call("bar", json.dumps({"bar": "baz"})), - get_final_output_message(json.dumps(Foo(bar="baz"))), ], + # Fourth turn: structured output + [get_final_output_message(json.dumps(Foo(bar="baz")))], ] ) @@ -209,10 +217,10 @@ async def test_structured_output(): ) assert result.final_output == Foo(bar="baz") - assert len(result.raw_responses) == 3, "should have three model responses" - assert len(result.to_input_list()) == 10, ( + assert len(result.raw_responses) == 4, "should have four model responses" + assert len(result.to_input_list()) == 11, ( "should have input: 2 orig inputs, function call, function call result, message, handoff, " - "handoff output, tool call, tool call result, final output message" + "handoff output, preamble message, tool call, tool call result, final output" ) assert result.last_agent == agent_1, "should have handed off to agent_1" @@ -224,6 +232,7 @@ def remove_new_items(handoff_input_data: HandoffInputData) -> HandoffInputData: input_history=handoff_input_data.input_history, pre_handoff_items=(), new_items=(), + run_context=handoff_input_data.run_context, ) @@ -262,7 +271,7 @@ async def test_handoff_filters(): @pytest.mark.asyncio -async def test_async_input_filter_fails(): +async def test_async_input_filter_supported(): # DO NOT rename this without updating pyproject.toml model = FakeModel() @@ -274,7 +283,7 @@ async def test_async_input_filter_fails(): async def on_invoke_handoff(_ctx: RunContextWrapper[Any], _input: str) -> Agent[Any]: return agent_1 - async def invalid_input_filter(data: HandoffInputData) -> HandoffInputData: + async def async_input_filter(data: HandoffInputData) -> HandoffInputData: return data # pragma: no cover agent_2 = Agent[None]( @@ -287,8 +296,7 @@ async def invalid_input_filter(data: HandoffInputData) -> HandoffInputData: input_json_schema={}, on_invoke_handoff=on_invoke_handoff, agent_name=agent_1.name, - # Purposely ignoring the type error here to simulate invalid input - input_filter=invalid_input_filter, # type: ignore + input_filter=async_input_filter, ) ], ) @@ -300,8 +308,8 @@ async def invalid_input_filter(data: HandoffInputData) -> HandoffInputData: ] ) - with pytest.raises(UserError): - await Runner.run(agent_2, input="user_message") + result = await Runner.run(agent_2, input="user_message") + assert result.final_output == "last" @pytest.mark.asyncio @@ -536,6 +544,40 @@ def guardrail_function( await Runner.run(agent, input="user_message") +@pytest.mark.asyncio +async def test_input_guardrail_tripwire_does_not_save_assistant_message_to_session(): + async def guardrail_function( + context: RunContextWrapper[Any], agent: Agent[Any], input: Any + ) -> GuardrailFunctionOutput: + # Delay to ensure the agent has time to produce output before the guardrail finishes. + await asyncio.sleep(0.01) + return GuardrailFunctionOutput( + output_info=None, + tripwire_triggered=True, + ) + + session = SimpleListSession() + + model = FakeModel() + model.set_next_output([get_text_message("should_not_be_saved")]) + + agent = Agent( + name="test", + model=model, + input_guardrails=[InputGuardrail(guardrail_function=guardrail_function)], + ) + + with pytest.raises(InputGuardrailTripwireTriggered): + await Runner.run(agent, input="user_message", session=session) + + items = await session.get_items() + + assert len(items) == 1 + first_item = cast(dict[str, Any], items[0]) + assert "role" in first_item + assert first_item["role"] == "user" + + @pytest.mark.asyncio async def test_output_guardrail_tripwire_triggered_causes_exception(): def guardrail_function( @@ -698,7 +740,7 @@ async def test_multi_turn_previous_response_id_passed_between_runs(): assert model.last_turn_args.get("previous_response_id") is None await Runner.run(agent, input="test", previous_response_id="resp-test-123") - assert model.last_turn_args.get("previous_response_id") == "resp-test-123" + assert model.last_turn_args.get("previous_response_id") == "resp-789" @pytest.mark.asyncio @@ -744,7 +786,343 @@ async def test_previous_response_id_passed_between_runs_streamed_multi_turn(): async for _ in result.stream_events(): pass - assert model.last_turn_args.get("previous_response_id") == "resp-stream-test" + assert model.last_turn_args.get("previous_response_id") == "resp-789" + + +@pytest.mark.asyncio +async def test_conversation_id_only_sends_new_items_multi_turn(): + """Test that conversation_id mode only sends new items on subsequent turns.""" + model = FakeModel() + agent = Agent( + name="test", + model=model, + tools=[get_function_tool("test_func", "tool_result")], + ) + + model.add_multiple_turn_outputs( + [ + # First turn: a message and tool call + [get_text_message("a_message"), get_function_tool_call("test_func", '{"arg": "foo"}')], + # Second turn: another message and tool call + [get_text_message("b_message"), get_function_tool_call("test_func", '{"arg": "bar"}')], + # Third turn: final text message + [get_text_message("done")], + ] + ) + + result = await Runner.run(agent, input="user_message", conversation_id="conv-test-123") + assert result.final_output == "done" + + # Check the first call - it should include the original input since generated_items is empty + assert model.first_turn_args is not None + first_input = model.first_turn_args["input"] + + # First call should include the original user input + assert isinstance(first_input, list) + assert len(first_input) == 1 # Should contain the user message + + # The input should be the user message + user_message = first_input[0] + assert user_message.get("role") == "user" + assert user_message.get("content") == "user_message" + + # Check the input from the last turn (third turn after function execution) + last_input = model.last_turn_args["input"] + + # In conversation_id mode, the third turn should only contain the tool output + assert isinstance(last_input, list) + assert len(last_input) == 1 + + # The single item should be a tool result + tool_result_item = last_input[0] + assert tool_result_item.get("type") == "function_call_output" + assert tool_result_item.get("call_id") is not None + + +@pytest.mark.asyncio +async def test_conversation_id_only_sends_new_items_multi_turn_streamed(): + """Test that conversation_id mode only sends new items on subsequent turns (streamed mode).""" + model = FakeModel() + agent = Agent( + name="test", + model=model, + tools=[get_function_tool("test_func", "tool_result")], + ) + + model.add_multiple_turn_outputs( + [ + # First turn: a message and tool call + [get_text_message("a_message"), get_function_tool_call("test_func", '{"arg": "foo"}')], + # Second turn: another message and tool call + [get_text_message("b_message"), get_function_tool_call("test_func", '{"arg": "bar"}')], + # Third turn: final text message + [get_text_message("done")], + ] + ) + + result = Runner.run_streamed(agent, input="user_message", conversation_id="conv-test-123") + async for _ in result.stream_events(): + pass + + assert result.final_output == "done" + + # Check the first call - it should include the original input since generated_items is empty + assert model.first_turn_args is not None + first_input = model.first_turn_args["input"] + + # First call should include the original user input + assert isinstance(first_input, list) + assert len(first_input) == 1 # Should contain the user message + + # The input should be the user message + user_message = first_input[0] + assert user_message.get("role") == "user" + assert user_message.get("content") == "user_message" + + # Check the input from the last turn (third turn after function execution) + last_input = model.last_turn_args["input"] + + # In conversation_id mode, the third turn should only contain the tool output + assert isinstance(last_input, list) + assert len(last_input) == 1 + + # The single item should be a tool result + tool_result_item = last_input[0] + assert tool_result_item.get("type") == "function_call_output" + assert tool_result_item.get("call_id") is not None + + +@pytest.mark.asyncio +async def test_previous_response_id_only_sends_new_items_multi_turn(): + """Test that previous_response_id mode only sends new items and updates + previous_response_id between turns.""" + model = FakeModel() + agent = Agent( + name="test", + model=model, + tools=[get_function_tool("test_func", "tool_result")], + ) + + model.add_multiple_turn_outputs( + [ + # First turn: a message and tool call + [get_text_message("a_message"), get_function_tool_call("test_func", '{"arg": "foo"}')], + # Second turn: final text message + [get_text_message("done")], + ] + ) + + result = await Runner.run( + agent, input="user_message", previous_response_id="initial-response-123" + ) + assert result.final_output == "done" + + # Check the first call - it should include the original input since generated_items is empty + assert model.first_turn_args is not None + first_input = model.first_turn_args["input"] + + # First call should include the original user input + assert isinstance(first_input, list) + assert len(first_input) == 1 # Should contain the user message + + # The input should be the user message + user_message = first_input[0] + assert user_message.get("role") == "user" + assert user_message.get("content") == "user_message" + + # Check the input from the last turn (second turn after function execution) + last_input = model.last_turn_args["input"] + + # In previous_response_id mode, the third turn should only contain the tool output + assert isinstance(last_input, list) + assert len(last_input) == 1 # Only the function result + + # The single item should be a tool result + tool_result_item = last_input[0] + assert tool_result_item.get("type") == "function_call_output" + assert tool_result_item.get("call_id") is not None + + # Verify that previous_response_id is modified according to fake_model behavior + assert model.last_turn_args.get("previous_response_id") == "resp-789" + + +@pytest.mark.asyncio +async def test_previous_response_id_only_sends_new_items_multi_turn_streamed(): + """Test that previous_response_id mode only sends new items and updates + previous_response_id between turns (streamed mode).""" + model = FakeModel() + agent = Agent( + name="test", + model=model, + tools=[get_function_tool("test_func", "tool_result")], + ) + + model.add_multiple_turn_outputs( + [ + # First turn: a message and tool call + [get_text_message("a_message"), get_function_tool_call("test_func", '{"arg": "foo"}')], + # Second turn: final text message + [get_text_message("done")], + ] + ) + + result = Runner.run_streamed( + agent, input="user_message", previous_response_id="initial-response-123" + ) + async for _ in result.stream_events(): + pass + + assert result.final_output == "done" + + # Check the first call - it should include the original input since generated_items is empty + assert model.first_turn_args is not None + first_input = model.first_turn_args["input"] + + # First call should include the original user input + assert isinstance(first_input, list) + assert len(first_input) == 1 # Should contain the user message + + # The input should be the user message + user_message = first_input[0] + assert user_message.get("role") == "user" + assert user_message.get("content") == "user_message" + + # Check the input from the last turn (second turn after function execution) + last_input = model.last_turn_args["input"] + + # In previous_response_id mode, the third turn should only contain the tool output + assert isinstance(last_input, list) + assert len(last_input) == 1 # Only the function result + + # The single item should be a tool result + tool_result_item = last_input[0] + assert tool_result_item.get("type") == "function_call_output" + assert tool_result_item.get("call_id") is not None + + # Verify that previous_response_id is modified according to fake_model behavior + assert model.last_turn_args.get("previous_response_id") == "resp-789" + + +@pytest.mark.asyncio +async def test_default_send_all_items(): + """Test that without conversation_id or previous_response_id, all items are sent.""" + model = FakeModel() + agent = Agent( + name="test", + model=model, + tools=[get_function_tool("test_func", "tool_result")], + ) + + model.add_multiple_turn_outputs( + [ + # First turn: a message and tool call + [get_text_message("a_message"), get_function_tool_call("test_func", '{"arg": "foo"}')], + # Second turn: final text message + [get_text_message("done")], + ] + ) + + result = await Runner.run( + agent, input="user_message" + ) # No conversation_id or previous_response_id + assert result.final_output == "done" + + # Check the input from the last turn (second turn after function execution) + last_input = model.last_turn_args["input"] + + # In defaul, the second turn should contain ALL items: + # 1. Original user message + # 2. Assistant response message + # 3. Function call + # 4. Function result + assert isinstance(last_input, list) + assert ( + len(last_input) == 4 + ) # User message + assistant message + function call + function result + + # Verify the items are in the expected order + user_message = last_input[0] + assistant_message = last_input[1] + function_call = last_input[2] + function_result = last_input[3] + + # Check user message + assert user_message.get("role") == "user" + assert user_message.get("content") == "user_message" + + # Check assistant message + assert assistant_message.get("role") == "assistant" + + # Check function call + assert function_call.get("name") == "test_func" + assert function_call.get("arguments") == '{"arg": "foo"}' + + # Check function result + assert function_result.get("type") == "function_call_output" + assert function_result.get("call_id") is not None + + +@pytest.mark.asyncio +async def test_default_send_all_items_streamed(): + """Test that without conversation_id or previous_response_id, all items are sent + (streamed mode).""" + model = FakeModel() + agent = Agent( + name="test", + model=model, + tools=[get_function_tool("test_func", "tool_result")], + ) + + model.add_multiple_turn_outputs( + [ + # First turn: a message and tool call + [get_text_message("a_message"), get_function_tool_call("test_func", '{"arg": "foo"}')], + # Second turn: final text message + [get_text_message("done")], + ] + ) + + result = Runner.run_streamed( + agent, input="user_message" + ) # No conversation_id or previous_response_id + async for _ in result.stream_events(): + pass + + assert result.final_output == "done" + + # Check the input from the last turn (second turn after function execution) + last_input = model.last_turn_args["input"] + + # In default mode, the second turn should contain ALL items: + # 1. Original user message + # 2. Assistant response message + # 3. Function call + # 4. Function result + assert isinstance(last_input, list) + assert ( + len(last_input) == 4 + ) # User message + assistant message + function call + function result + + # Verify the items are in the expected order + user_message = last_input[0] + assistant_message = last_input[1] + function_call = last_input[2] + function_result = last_input[3] + + # Check user message + assert user_message.get("role") == "user" + assert user_message.get("content") == "user_message" + + # Check assistant message + assert assistant_message.get("role") == "assistant" + + # Check function call + assert function_call.get("name") == "test_func" + assert function_call.get("arguments") == '{"arg": "foo"}' + + # Check function result + assert function_result.get("type") == "function_call_output" + assert function_result.get("call_id") is not None @pytest.mark.asyncio @@ -780,3 +1158,96 @@ async def add_tool() -> str: assert executed["called"] is True assert result.final_output == "done" + + +@pytest.mark.asyncio +async def test_session_add_items_called_multiple_times_for_multi_turn_completion(): + """Test that SQLiteSession.add_items is called multiple times + during a multi-turn agent completion. + + """ + with tempfile.TemporaryDirectory() as temp_dir: + db_path = Path(temp_dir) / "test_agent_runner_session_multi_turn_calls.db" + session_id = "runner_session_multi_turn_calls" + session = SQLiteSession(session_id, db_path) + + # Define a tool that will be called by the orchestrator agent + @function_tool + async def echo_tool(text: str) -> str: + return f"Echo: {text}" + + # Orchestrator agent that calls the tool multiple times in one completion + orchestrator_agent = Agent( + name="orchestrator_agent", + instructions=( + "Call echo_tool twice with inputs of 'foo' and 'bar', then return a summary." + ), + tools=[echo_tool], + ) + + # Patch the model to simulate two tool calls and a final message + model = FakeModel() + orchestrator_agent.model = model + model.add_multiple_turn_outputs( + [ + # First turn: tool call + [get_function_tool_call("echo_tool", json.dumps({"text": "foo"}), call_id="1")], + # Second turn: tool call + [get_function_tool_call("echo_tool", json.dumps({"text": "bar"}), call_id="2")], + # Third turn: final output + [get_final_output_message("Summary: Echoed foo and bar")], + ] + ) + + # Patch add_items to count calls + with patch.object(SQLiteSession, "add_items", wraps=session.add_items) as mock_add_items: + result = await Runner.run(orchestrator_agent, input="foo and bar", session=session) + + expected_items = [ + {"content": "foo and bar", "role": "user"}, + { + "arguments": '{"text": "foo"}', + "call_id": "1", + "name": "echo_tool", + "type": "function_call", + "id": "1", + }, + {"call_id": "1", "output": "Echo: foo", "type": "function_call_output"}, + { + "arguments": '{"text": "bar"}', + "call_id": "2", + "name": "echo_tool", + "type": "function_call", + "id": "1", + }, + {"call_id": "2", "output": "Echo: bar", "type": "function_call_output"}, + { + "id": "1", + "content": [ + { + "annotations": [], + "text": "Summary: Echoed foo and bar", + "type": "output_text", + } + ], + "role": "assistant", + "status": "completed", + "type": "message", + }, + ] + + expected_calls = [ + # First call is the initial input + (([expected_items[0]],),), + # Second call is the first tool call and its result + (([expected_items[1], expected_items[2]],),), + # Third call is the second tool call and its result + (([expected_items[3], expected_items[4]],),), + # Fourth call is the final output + (([expected_items[5]],),), + ] + assert mock_add_items.call_args_list == expected_calls + assert result.final_output == "Summary: Echoed foo and bar" + assert (await session.get_items()) == expected_items + + session.close() diff --git a/tests/test_agent_runner_streamed.py b/tests/test_agent_runner_streamed.py index 31fe2979b..eca23464b 100644 --- a/tests/test_agent_runner_streamed.py +++ b/tests/test_agent_runner_streamed.py @@ -1,7 +1,8 @@ from __future__ import annotations +import asyncio import json -from typing import Any +from typing import Any, cast import pytest from typing_extensions import TypedDict @@ -34,6 +35,7 @@ get_text_input_item, get_text_message, ) +from .utils.simple_session import SimpleListSession @pytest.mark.asyncio @@ -207,11 +209,13 @@ async def test_structured_output(): [get_function_tool_call("foo", json.dumps({"bar": "baz"}))], # Second turn: a message and a handoff [get_text_message("a_message"), get_handoff_tool_call(agent_1)], - # Third turn: tool call and structured output + # Third turn: tool call with preamble message [ + get_text_message(json.dumps(Foo(bar="preamble"))), get_function_tool_call("bar", json.dumps({"bar": "baz"})), - get_final_output_message(json.dumps(Foo(bar="baz"))), ], + # Fourth turn: structured output + [get_final_output_message(json.dumps(Foo(bar="baz")))], ] ) @@ -226,10 +230,10 @@ async def test_structured_output(): pass assert result.final_output == Foo(bar="baz") - assert len(result.raw_responses) == 3, "should have three model responses" - assert len(result.to_input_list()) == 10, ( + assert len(result.raw_responses) == 4, "should have four model responses" + assert len(result.to_input_list()) == 11, ( "should have input: 2 orig inputs, function call, function call result, message, handoff, " - "handoff output, tool call, tool call result, final output" + "handoff output, preamble message, tool call, tool call result, final output" ) assert result.last_agent == agent_1, "should have handed off to agent_1" @@ -241,6 +245,7 @@ def remove_new_items(handoff_input_data: HandoffInputData) -> HandoffInputData: input_history=handoff_input_data.input_history, pre_handoff_items=(), new_items=(), + run_context=handoff_input_data.run_context, ) @@ -281,7 +286,7 @@ async def test_handoff_filters(): @pytest.mark.asyncio -async def test_async_input_filter_fails(): +async def test_async_input_filter_supported(): # DO NOT rename this without updating pyproject.toml model = FakeModel() @@ -293,7 +298,7 @@ async def test_async_input_filter_fails(): async def on_invoke_handoff(_ctx: RunContextWrapper[Any], _input: str) -> Agent[Any]: return agent_1 - async def invalid_input_filter(data: HandoffInputData) -> HandoffInputData: + async def async_input_filter(data: HandoffInputData) -> HandoffInputData: return data # pragma: no cover agent_2 = Agent[None]( @@ -306,8 +311,7 @@ async def invalid_input_filter(data: HandoffInputData) -> HandoffInputData: input_json_schema={}, on_invoke_handoff=on_invoke_handoff, agent_name=agent_1.name, - # Purposely ignoring the type error here to simulate invalid input - input_filter=invalid_input_filter, # type: ignore + input_filter=async_input_filter, ) ], ) @@ -319,10 +323,9 @@ async def invalid_input_filter(data: HandoffInputData) -> HandoffInputData: ] ) - with pytest.raises(UserError): - result = Runner.run_streamed(agent_2, input="user_message") - async for _ in result.stream_events(): - pass + result = Runner.run_streamed(agent_2, input="user_message") + async for _ in result.stream_events(): + pass @pytest.mark.asyncio @@ -522,6 +525,67 @@ def guardrail_function( pass +@pytest.mark.asyncio +async def test_input_guardrail_streamed_does_not_save_assistant_message_to_session(): + async def guardrail_function( + context: RunContextWrapper[Any], agent: Agent[Any], input: Any + ) -> GuardrailFunctionOutput: + await asyncio.sleep(0.01) + return GuardrailFunctionOutput(output_info=None, tripwire_triggered=True) + + session = SimpleListSession() + + model = FakeModel() + model.set_next_output([get_text_message("should_not_be_saved")]) + + agent = Agent( + name="test", + model=model, + input_guardrails=[InputGuardrail(guardrail_function=guardrail_function)], + ) + + with pytest.raises(InputGuardrailTripwireTriggered): + result = Runner.run_streamed(agent, input="user_message", session=session) + async for _ in result.stream_events(): + pass + + items = await session.get_items() + + assert len(items) == 1 + first_item = cast(dict[str, Any], items[0]) + assert "role" in first_item + assert first_item["role"] == "user" + + +@pytest.mark.asyncio +async def test_slow_input_guardrail_still_raises_exception_streamed(): + async def guardrail_function( + context: RunContextWrapper[Any], agent: Agent[Any], input: Any + ) -> GuardrailFunctionOutput: + # Simulate a slow guardrail that completes after model streaming ends. + await asyncio.sleep(0.05) + return GuardrailFunctionOutput( + output_info=None, + tripwire_triggered=True, + ) + + model = FakeModel() + # Ensure the model finishes streaming quickly. + model.set_next_output([get_text_message("ok")]) + + agent = Agent( + name="test", + input_guardrails=[InputGuardrail(guardrail_function=guardrail_function)], + model=model, + ) + + # Even though the guardrail is slower than the model stream, the exception should still raise. + with pytest.raises(InputGuardrailTripwireTriggered): + result = Runner.run_streamed(agent, input="user_message") + async for _ in result.stream_events(): + pass + + @pytest.mark.asyncio async def test_output_guardrail_tripwire_triggered_causes_exception_streamed(): def guardrail_function( @@ -625,11 +689,10 @@ async def test_streaming_events(): [get_function_tool_call("foo", json.dumps({"bar": "baz"}))], # Second turn: a message and a handoff [get_text_message("a_message"), get_handoff_tool_call(agent_1)], - # Third turn: tool call and structured output - [ - get_function_tool_call("bar", json.dumps({"bar": "baz"})), - get_final_output_message(json.dumps(Foo(bar="baz"))), - ], + # Third turn: tool call + [get_function_tool_call("bar", json.dumps({"bar": "baz"}))], + # Fourth turn: structured output + [get_final_output_message(json.dumps(Foo(bar="baz")))], ] ) @@ -653,7 +716,7 @@ async def test_streaming_events(): agent_data.append(event) assert result.final_output == Foo(bar="baz") - assert len(result.raw_responses) == 3, "should have three model responses" + assert len(result.raw_responses) == 4, "should have four model responses" assert len(result.to_input_list()) == 10, ( "should have input: 2 orig inputs, function call, function call result, message, handoff, " "handoff output, tool call, tool call result, final output" @@ -665,11 +728,16 @@ async def test_streaming_events(): # Now lets check the events expected_item_type_map = { - "tool_call": 2, + # 3 tool_call_item events: + # 1. get_function_tool_call("foo", ...) + # 2. get_handoff_tool_call(agent_1) because handoffs are implemented via tool calls too + # 3. get_function_tool_call("bar", ...) + "tool_call": 3, + # Only 2 outputs, handoff tool call doesn't have corresponding tool_call_output event "tool_call_output": 2, - "message": 2, - "handoff": 1, - "handoff_output": 1, + "message": 2, # get_text_message("a_message") + get_final_output_message(...) + "handoff": 1, # get_handoff_tool_call(agent_1) + "handoff_output": 1, # handoff_output_item } total_expected_item_count = sum(expected_item_type_map.values()) diff --git a/tests/test_anthropic_thinking_blocks.py b/tests/test_anthropic_thinking_blocks.py new file mode 100644 index 000000000..8fbc59833 --- /dev/null +++ b/tests/test_anthropic_thinking_blocks.py @@ -0,0 +1,244 @@ +""" +Test for Anthropic thinking blocks in conversation history. + +This test validates the fix for issue #1704: +- Thinking blocks are properly preserved from Anthropic responses +- Reasoning items are stored in session but not sent back in conversation history +- Non-reasoning models are unaffected +- Token usage is not increased for non-reasoning scenarios +""" + +from __future__ import annotations + +from typing import Any, cast + +from openai.types.chat import ChatCompletionMessageToolCall +from openai.types.chat.chat_completion_message_tool_call import Function + +from agents.extensions.models.litellm_model import InternalChatCompletionMessage +from agents.models.chatcmpl_converter import Converter + + +def create_mock_anthropic_response_with_thinking() -> InternalChatCompletionMessage: + """Create a mock Anthropic response with thinking blocks (like real response).""" + message = InternalChatCompletionMessage( + role="assistant", + content="I'll check the weather in Paris for you.", + reasoning_content="I need to call the weather function for Paris", + thinking_blocks=[ + { + "type": "thinking", + "thinking": "I need to call the weather function for Paris", + "signature": "EqMDCkYIBxgCKkBAFZO8EyZwN1hiLctq0YjZnP0KeKgprr+C0PzgDv4GSggnFwrPQHIZ9A5s+paH+DrQBI1+Vnfq3mLAU5lJnoetEgzUEWx/Cv1022ieAvcaDCXdmg1XkMK0tZ8uCCIwURYAAX0uf2wFdnWt9n8whkhmy8ARQD5G2za4R8X5vTqBq8jpJ15T3c1Jcf3noKMZKooCWFVf0/W5VQqpZTgwDkqyTau7XraS+u48YlmJGSfyWMPO8snFLMZLGaGmVJgHfEI5PILhOEuX/R2cEeLuC715f51LMVuxTNzlOUV/037JV6P2ten7D66FnWU9JJMMJJov+DjMb728yQFHwHz4roBJ5ePHaaFP6mDwpqYuG/hai6pVv2TAK1IdKUui/oXrYtU+0gxb6UF2kS1bspqDuN++R8JdL7CMSU5l28pQ8TsH1TpVF4jZpsFbp1Du4rQIULFsCFFg+Edf9tPgyKZOq6xcskIjT7oylAPO37/jhdNknDq2S82PaSKtke3ViOigtM5uJfG521ZscBJQ1K3kwoI/repIdV9PatjOYdsYAQ==", # noqa: E501 + } + ], + ) + return message + + +def test_converter_skips_reasoning_items(): + """ + Unit test to verify that reasoning items are skipped when converting items to messages. + """ + # Create test items including a reasoning item + test_items: list[dict[str, Any]] = [ + {"role": "user", "content": "Hello"}, + { + "id": "reasoning_123", + "type": "reasoning", + "summary": [{"text": "User said hello", "type": "summary_text"}], + }, + { + "id": "msg_123", + "type": "message", + "role": "assistant", + "content": [{"type": "output_text", "text": "Hi there!"}], + "status": "completed", + }, + ] + + # Convert to messages + messages = Converter.items_to_messages(test_items) # type: ignore[arg-type] + + # Should have user message and assistant message, but no reasoning content + assert len(messages) == 2 + assert messages[0]["role"] == "user" + assert messages[1]["role"] == "assistant" + + # Verify no thinking blocks in assistant message + assistant_msg = messages[1] + content = assistant_msg.get("content") + if isinstance(content, list): + for part in content: + assert part.get("type") != "thinking" + + +def test_reasoning_items_preserved_in_message_conversion(): + """ + Test that reasoning content and thinking blocks are properly extracted + from Anthropic responses and stored in reasoning items. + """ + # Create mock message with thinking blocks + mock_message = create_mock_anthropic_response_with_thinking() + + # Convert to output items + output_items = Converter.message_to_output_items(mock_message) + + # Should have reasoning item, message item, and tool call items + reasoning_items = [ + item for item in output_items if hasattr(item, "type") and item.type == "reasoning" + ] + assert len(reasoning_items) == 1 + + reasoning_item = reasoning_items[0] + assert reasoning_item.summary[0].text == "I need to call the weather function for Paris" + + # Verify thinking blocks are stored if we preserve them + if ( + hasattr(reasoning_item, "content") + and reasoning_item.content + and len(reasoning_item.content) > 0 + ): + thinking_block = reasoning_item.content[0] + assert thinking_block.type == "reasoning_text" + assert thinking_block.text == "I need to call the weather function for Paris" + + +def test_anthropic_thinking_blocks_with_tool_calls(): + """ + Test for models with extended thinking and interleaved thinking with tool calls. + + This test verifies the Anthropic's API's requirements for thinking blocks + to be the first content in assistant messages when reasoning is enabled and tool + calls are present. + """ + # Create a message with reasoning, thinking blocks and tool calls + message = InternalChatCompletionMessage( + role="assistant", + content="I'll check the weather for you.", + reasoning_content="The user wants weather information, I need to call the weather function", + thinking_blocks=[ + { + "type": "thinking", + "thinking": ( + "The user is asking about weather. " + "Let me use the weather tool to get this information." + ), + "signature": "TestSignature123", + }, + { + "type": "thinking", + "thinking": ("We should use the city Tokyo as the city."), + "signature": "TestSignature456", + }, + ], + tool_calls=[ + ChatCompletionMessageToolCall( + id="call_123", + type="function", + function=Function(name="get_weather", arguments='{"city": "Tokyo"}'), + ) + ], + ) + + # Step 1: Convert message to output items + output_items = Converter.message_to_output_items(message) + + # Verify reasoning item exists and contains thinking blocks + reasoning_items = [ + item for item in output_items if hasattr(item, "type") and item.type == "reasoning" + ] + assert len(reasoning_items) == 1, "Should have exactly two reasoning items" + + reasoning_item = reasoning_items[0] + + # Verify thinking text is stored in content + assert hasattr(reasoning_item, "content") and reasoning_item.content, ( + "Reasoning item should have content" + ) + assert reasoning_item.content[0].type == "reasoning_text", ( + "Content should be reasoning_text type" + ) + + # Verify signature is stored in encrypted_content + assert hasattr(reasoning_item, "encrypted_content"), ( + "Reasoning item should have encrypted_content" + ) + assert reasoning_item.encrypted_content == "TestSignature123\nTestSignature456", ( + "Signature should be preserved" + ) + + # Verify tool calls are present + tool_call_items = [ + item for item in output_items if hasattr(item, "type") and item.type == "function_call" + ] + assert len(tool_call_items) == 1, "Should have exactly one tool call" + + # Step 2: Convert output items back to messages + # Convert items to dicts for the converter (simulating serialization/deserialization) + items_as_dicts: list[dict[str, Any]] = [] + for item in output_items: + if hasattr(item, "model_dump"): + items_as_dicts.append(item.model_dump()) + else: + items_as_dicts.append(cast(dict[str, Any], item)) + + messages = Converter.items_to_messages(items_as_dicts, preserve_thinking_blocks=True) # type: ignore[arg-type] + + # Find the assistant message with tool calls + assistant_messages = [ + msg for msg in messages if msg.get("role") == "assistant" and msg.get("tool_calls") + ] + assert len(assistant_messages) == 1, "Should have exactly one assistant message with tool calls" + + assistant_msg = assistant_messages[0] + + # Content must start with thinking blocks, not text + content = assistant_msg.get("content") + assert content is not None, "Assistant message should have content" + + assert isinstance(content, list) and len(content) > 0, ( + "Assistant message content should be a non-empty list" + ) + + first_content = content[0] + assert first_content.get("type") == "thinking", ( + f"First content must be 'thinking' type for Anthropic compatibility, " + f"but got '{first_content.get('type')}'" + ) + expected_thinking = ( + "The user is asking about weather. Let me use the weather tool to get this information." + ) + assert first_content.get("thinking") == expected_thinking, ( + "Thinking content should be preserved" + ) + # Signature should also be preserved + assert first_content.get("signature") == "TestSignature123", ( + "Signature should be preserved in thinking block" + ) + + second_content = content[1] + assert second_content.get("type") == "thinking", ( + f"Second content must be 'thinking' type for Anthropic compatibility, " + f"but got '{second_content.get('type')}'" + ) + expected_thinking = "We should use the city Tokyo as the city." + assert second_content.get("thinking") == expected_thinking, ( + "Thinking content should be preserved" + ) + # Signature should also be preserved + assert second_content.get("signature") == "TestSignature456", ( + "Signature should be preserved in thinking block" + ) + + last_content = content[2] + assert last_content.get("type") == "text", ( + f"First content must be 'text' type but got '{last_content.get('type')}'" + ) + expected_text = "I'll check the weather for you." + assert last_content.get("text") == expected_text, "Content text should be preserved" + + # Verify tool calls are preserved + tool_calls = assistant_msg.get("tool_calls", []) + assert len(cast(list[Any], tool_calls)) == 1, "Tool calls should be preserved" + assert cast(list[Any], tool_calls)[0]["function"]["name"] == "get_weather" diff --git a/tests/test_call_model_input_filter.py b/tests/test_call_model_input_filter.py new file mode 100644 index 000000000..be2dc28e6 --- /dev/null +++ b/tests/test_call_model_input_filter.py @@ -0,0 +1,79 @@ +from __future__ import annotations + +from typing import Any + +import pytest + +from agents import Agent, RunConfig, Runner, UserError +from agents.run import CallModelData, ModelInputData + +from .fake_model import FakeModel +from .test_responses import get_text_input_item, get_text_message + + +@pytest.mark.asyncio +async def test_call_model_input_filter_sync_non_streamed() -> None: + model = FakeModel() + agent = Agent(name="test", model=model) + + # Prepare model output + model.set_next_output([get_text_message("ok")]) + + def filter_fn(data: CallModelData[Any]) -> ModelInputData: + mi = data.model_data + new_input = list(mi.input) + [get_text_input_item("added-sync")] + return ModelInputData(input=new_input, instructions="filtered-sync") + + await Runner.run( + agent, + input="start", + run_config=RunConfig(call_model_input_filter=filter_fn), + ) + + assert model.last_turn_args["system_instructions"] == "filtered-sync" + assert isinstance(model.last_turn_args["input"], list) + assert len(model.last_turn_args["input"]) == 2 + assert model.last_turn_args["input"][-1]["content"] == "added-sync" + + +@pytest.mark.asyncio +async def test_call_model_input_filter_async_streamed() -> None: + model = FakeModel() + agent = Agent(name="test", model=model) + + # Prepare model output + model.set_next_output([get_text_message("ok")]) + + async def filter_fn(data: CallModelData[Any]) -> ModelInputData: + mi = data.model_data + new_input = list(mi.input) + [get_text_input_item("added-async")] + return ModelInputData(input=new_input, instructions="filtered-async") + + result = Runner.run_streamed( + agent, + input="start", + run_config=RunConfig(call_model_input_filter=filter_fn), + ) + async for _ in result.stream_events(): + pass + + assert model.last_turn_args["system_instructions"] == "filtered-async" + assert isinstance(model.last_turn_args["input"], list) + assert len(model.last_turn_args["input"]) == 2 + assert model.last_turn_args["input"][-1]["content"] == "added-async" + + +@pytest.mark.asyncio +async def test_call_model_input_filter_invalid_return_type_raises() -> None: + model = FakeModel() + agent = Agent(name="test", model=model) + + def invalid_filter(_data: CallModelData[Any]): + return "bad" + + with pytest.raises(UserError): + await Runner.run( + agent, + input="start", + run_config=RunConfig(call_model_input_filter=invalid_filter), + ) diff --git a/tests/test_call_model_input_filter_unit.py b/tests/test_call_model_input_filter_unit.py new file mode 100644 index 000000000..7cf3a00a9 --- /dev/null +++ b/tests/test_call_model_input_filter_unit.py @@ -0,0 +1,107 @@ +from __future__ import annotations + +import sys +from pathlib import Path +from typing import Any + +import pytest +from openai.types.responses import ResponseOutputMessage, ResponseOutputText + +# Make the repository tests helpers importable from this unit test +sys.path.insert(0, str(Path(__file__).resolve().parent.parent / "tests")) +from fake_model import FakeModel # type: ignore + +# Import directly from submodules to avoid heavy __init__ side effects +from agents.agent import Agent +from agents.exceptions import UserError +from agents.run import CallModelData, ModelInputData, RunConfig, Runner + + +@pytest.mark.asyncio +async def test_call_model_input_filter_sync_non_streamed_unit() -> None: + model = FakeModel() + agent = Agent(name="test", model=model) + + model.set_next_output( + [ + ResponseOutputMessage( + id="1", + type="message", + role="assistant", + content=[ResponseOutputText(text="ok", type="output_text", annotations=[])], + status="completed", + ) + ] + ) + + def filter_fn(data: CallModelData[Any]) -> ModelInputData: + mi = data.model_data + new_input = list(mi.input) + [ + {"content": "added-sync", "role": "user"} + ] # pragma: no cover - trivial + return ModelInputData(input=new_input, instructions="filtered-sync") + + await Runner.run( + agent, + input="start", + run_config=RunConfig(call_model_input_filter=filter_fn), + ) + + assert model.last_turn_args["system_instructions"] == "filtered-sync" + assert isinstance(model.last_turn_args["input"], list) + assert len(model.last_turn_args["input"]) == 2 + assert model.last_turn_args["input"][-1]["content"] == "added-sync" + + +@pytest.mark.asyncio +async def test_call_model_input_filter_async_streamed_unit() -> None: + model = FakeModel() + agent = Agent(name="test", model=model) + + model.set_next_output( + [ + ResponseOutputMessage( + id="1", + type="message", + role="assistant", + content=[ResponseOutputText(text="ok", type="output_text", annotations=[])], + status="completed", + ) + ] + ) + + async def filter_fn(data: CallModelData[Any]) -> ModelInputData: + mi = data.model_data + new_input = list(mi.input) + [ + {"content": "added-async", "role": "user"} + ] # pragma: no cover - trivial + return ModelInputData(input=new_input, instructions="filtered-async") + + result = Runner.run_streamed( + agent, + input="start", + run_config=RunConfig(call_model_input_filter=filter_fn), + ) + async for _ in result.stream_events(): + pass + + assert model.last_turn_args["system_instructions"] == "filtered-async" + assert isinstance(model.last_turn_args["input"], list) + assert len(model.last_turn_args["input"]) == 2 + assert model.last_turn_args["input"][-1]["content"] == "added-async" + + +@pytest.mark.asyncio +async def test_call_model_input_filter_invalid_return_type_raises_unit() -> None: + model = FakeModel() + agent = Agent(name="test", model=model) + + def invalid_filter(_data: CallModelData[Any]): + return "bad" + + with pytest.raises(UserError): + await Runner.run( + agent, + input="start", + run_config=RunConfig(call_model_input_filter=invalid_filter), + ) diff --git a/tests/test_cancel_streaming.py b/tests/test_cancel_streaming.py index 3417a3c5d..ddf603f9f 100644 --- a/tests/test_cancel_streaming.py +++ b/tests/test_cancel_streaming.py @@ -114,3 +114,20 @@ async def test_cancel_cleans_up_resources(): assert result._input_guardrail_queue.empty(), ( "Input guardrail queue should be empty after cancel." ) + + +@pytest.mark.asyncio +async def test_cancel_immediate_mode_explicit(): + """Test explicit immediate mode behaves same as default.""" + model = FakeModel() + agent = Agent(name="Joker", model=model) + + result = Runner.run_streamed(agent, input="Please tell me 5 jokes.") + + async for _ in result.stream_events(): + result.cancel(mode="immediate") + break + + assert result.is_complete + assert result._event_queue.empty() + assert result._cancel_mode == "immediate" diff --git a/tests/test_debug.py b/tests/test_debug.py new file mode 100644 index 000000000..f9e0ea21e --- /dev/null +++ b/tests/test_debug.py @@ -0,0 +1,54 @@ +import os +from unittest.mock import patch + +from agents._debug import _load_dont_log_model_data, _load_dont_log_tool_data + + +@patch.dict(os.environ, {}) +def test_dont_log_model_data(): + assert _load_dont_log_model_data() is True + + +@patch.dict(os.environ, {"OPENAI_AGENTS_DONT_LOG_MODEL_DATA": "0"}) +def test_dont_log_model_data_0(): + assert _load_dont_log_model_data() is False + + +@patch.dict(os.environ, {"OPENAI_AGENTS_DONT_LOG_MODEL_DATA": "1"}) +def test_dont_log_model_data_1(): + assert _load_dont_log_model_data() is True + + +@patch.dict(os.environ, {"OPENAI_AGENTS_DONT_LOG_MODEL_DATA": "true"}) +def test_dont_log_model_data_true(): + assert _load_dont_log_model_data() is True + + +@patch.dict(os.environ, {"OPENAI_AGENTS_DONT_LOG_MODEL_DATA": "false"}) +def test_dont_log_model_data_false(): + assert _load_dont_log_model_data() is False + + +@patch.dict(os.environ, {}) +def test_dont_log_tool_data(): + assert _load_dont_log_tool_data() is True + + +@patch.dict(os.environ, {"OPENAI_AGENTS_DONT_LOG_TOOL_DATA": "0"}) +def test_dont_log_tool_data_0(): + assert _load_dont_log_tool_data() is False + + +@patch.dict(os.environ, {"OPENAI_AGENTS_DONT_LOG_TOOL_DATA": "1"}) +def test_dont_log_tool_data_1(): + assert _load_dont_log_tool_data() is True + + +@patch.dict(os.environ, {"OPENAI_AGENTS_DONT_LOG_TOOL_DATA": "true"}) +def test_dont_log_tool_data_true(): + assert _load_dont_log_tool_data() is True + + +@patch.dict(os.environ, {"OPENAI_AGENTS_DONT_LOG_TOOL_DATA": "false"}) +def test_dont_log_tool_data_false(): + assert _load_dont_log_tool_data() is False diff --git a/tests/test_extended_thinking_message_order.py b/tests/test_extended_thinking_message_order.py new file mode 100644 index 000000000..3bc525623 --- /dev/null +++ b/tests/test_extended_thinking_message_order.py @@ -0,0 +1,293 @@ +"""Tests for the extended thinking message order bug fix in LitellmModel.""" + +from __future__ import annotations + +from openai.types.chat import ChatCompletionMessageParam + +from agents.extensions.models.litellm_model import LitellmModel + + +class TestExtendedThinkingMessageOrder: + """Test the _fix_tool_message_ordering method.""" + + def test_basic_reordering_tool_result_before_call(self): + """Test that a tool result appearing before its tool call gets reordered correctly.""" + messages: list[ChatCompletionMessageParam] = [ + {"role": "user", "content": "Hello"}, + {"role": "tool", "tool_call_id": "call_123", "content": "Result for call_123"}, + { + "role": "assistant", + "tool_calls": [ + { + "id": "call_123", + "type": "function", + "function": {"name": "test", "arguments": "{}"}, + } + ], + }, + {"role": "user", "content": "Thanks"}, + ] + + model = LitellmModel("test-model") + result = model._fix_tool_message_ordering(messages) + + # Should reorder to: user, assistant+tool_call, tool_result, user + assert len(result) == 4 + assert result[0]["role"] == "user" + assert result[1]["role"] == "assistant" + assert result[1]["tool_calls"][0]["id"] == "call_123" # type: ignore + assert result[2]["role"] == "tool" + assert result[2]["tool_call_id"] == "call_123" + assert result[3]["role"] == "user" + + def test_consecutive_tool_calls_get_separated(self): + """Test that consecutive assistant messages with tool calls get properly paired with results.""" # noqa: E501 + messages: list[ChatCompletionMessageParam] = [ + {"role": "user", "content": "Hello"}, + { + "role": "assistant", + "tool_calls": [ + { + "id": "call_1", + "type": "function", + "function": {"name": "test1", "arguments": "{}"}, + } + ], + }, + { + "role": "assistant", + "tool_calls": [ + { + "id": "call_2", + "type": "function", + "function": {"name": "test2", "arguments": "{}"}, + } + ], + }, + {"role": "tool", "tool_call_id": "call_1", "content": "Result 1"}, + {"role": "tool", "tool_call_id": "call_2", "content": "Result 2"}, + ] + + model = LitellmModel("test-model") + result = model._fix_tool_message_ordering(messages) + + # Should pair each tool call with its result immediately + assert len(result) == 5 + assert result[0]["role"] == "user" + assert result[1]["role"] == "assistant" + assert result[1]["tool_calls"][0]["id"] == "call_1" # type: ignore + assert result[2]["role"] == "tool" + assert result[2]["tool_call_id"] == "call_1" + assert result[3]["role"] == "assistant" + assert result[3]["tool_calls"][0]["id"] == "call_2" # type: ignore + assert result[4]["role"] == "tool" + assert result[4]["tool_call_id"] == "call_2" + + def test_unmatched_tool_results_preserved(self): + """Test that tool results without matching tool calls are preserved.""" + messages: list[ChatCompletionMessageParam] = [ + {"role": "user", "content": "Hello"}, + { + "role": "assistant", + "tool_calls": [ + { + "id": "call_1", + "type": "function", + "function": {"name": "test", "arguments": "{}"}, + } + ], + }, + {"role": "tool", "tool_call_id": "call_1", "content": "Matched result"}, + {"role": "tool", "tool_call_id": "call_orphan", "content": "Orphaned result"}, + {"role": "user", "content": "End"}, + ] + + model = LitellmModel("test-model") + result = model._fix_tool_message_ordering(messages) + + # Should preserve the orphaned tool result + assert len(result) == 5 + assert result[0]["role"] == "user" + assert result[1]["role"] == "assistant" + assert result[2]["role"] == "tool" + assert result[2]["tool_call_id"] == "call_1" + assert result[3]["role"] == "tool" # Orphaned result preserved + assert result[3]["tool_call_id"] == "call_orphan" + assert result[4]["role"] == "user" + + def test_tool_calls_without_results_preserved(self): + """Test that tool calls without results are still included.""" + messages: list[ChatCompletionMessageParam] = [ + {"role": "user", "content": "Hello"}, + { + "role": "assistant", + "tool_calls": [ + { + "id": "call_1", + "type": "function", + "function": {"name": "test", "arguments": "{}"}, + } + ], + }, + {"role": "user", "content": "End"}, + ] + + model = LitellmModel("test-model") + result = model._fix_tool_message_ordering(messages) + + # Should preserve the tool call even without a result + assert len(result) == 3 + assert result[0]["role"] == "user" + assert result[1]["role"] == "assistant" + assert result[1]["tool_calls"][0]["id"] == "call_1" # type: ignore + assert result[2]["role"] == "user" + + def test_correctly_ordered_messages_unchanged(self): + """Test that correctly ordered messages remain in the same order.""" + messages: list[ChatCompletionMessageParam] = [ + {"role": "user", "content": "Hello"}, + { + "role": "assistant", + "tool_calls": [ + { + "id": "call_1", + "type": "function", + "function": {"name": "test", "arguments": "{}"}, + } + ], + }, + {"role": "tool", "tool_call_id": "call_1", "content": "Result"}, + {"role": "assistant", "content": "Done"}, + ] + + model = LitellmModel("test-model") + result = model._fix_tool_message_ordering(messages) + + # Should remain exactly the same + assert len(result) == 4 + assert result[0]["role"] == "user" + assert result[1]["role"] == "assistant" + assert result[1]["tool_calls"][0]["id"] == "call_1" # type: ignore + assert result[2]["role"] == "tool" + assert result[2]["tool_call_id"] == "call_1" + assert result[3]["role"] == "assistant" + + def test_multiple_tool_calls_single_message(self): + """Test assistant message with multiple tool calls gets split properly.""" + messages: list[ChatCompletionMessageParam] = [ + {"role": "user", "content": "Hello"}, + { + "role": "assistant", + "tool_calls": [ + { + "id": "call_1", + "type": "function", + "function": {"name": "test1", "arguments": "{}"}, + }, + { + "id": "call_2", + "type": "function", + "function": {"name": "test2", "arguments": "{}"}, + }, + ], + }, + {"role": "tool", "tool_call_id": "call_1", "content": "Result 1"}, + {"role": "tool", "tool_call_id": "call_2", "content": "Result 2"}, + ] + + model = LitellmModel("test-model") + result = model._fix_tool_message_ordering(messages) + + # Should split the multi-tool message and pair each properly + assert len(result) == 5 + assert result[0]["role"] == "user" + assert result[1]["role"] == "assistant" + assert len(result[1]["tool_calls"]) == 1 # type: ignore + assert result[1]["tool_calls"][0]["id"] == "call_1" # type: ignore + assert result[2]["role"] == "tool" + assert result[2]["tool_call_id"] == "call_1" + assert result[3]["role"] == "assistant" + assert len(result[3]["tool_calls"]) == 1 # type: ignore + assert result[3]["tool_calls"][0]["id"] == "call_2" # type: ignore + assert result[4]["role"] == "tool" + assert result[4]["tool_call_id"] == "call_2" + + def test_empty_messages_list(self): + """Test that empty message list is handled correctly.""" + messages: list[ChatCompletionMessageParam] = [] + + model = LitellmModel("test-model") + result = model._fix_tool_message_ordering(messages) + + assert result == [] + + def test_no_tool_messages(self): + """Test that messages without tool calls are left unchanged.""" + messages: list[ChatCompletionMessageParam] = [ + {"role": "user", "content": "Hello"}, + {"role": "assistant", "content": "Hi there"}, + {"role": "user", "content": "How are you?"}, + ] + + model = LitellmModel("test-model") + result = model._fix_tool_message_ordering(messages) + + assert result == messages + + def test_complex_mixed_scenario(self): + """Test a complex scenario with various message types and orderings.""" + messages: list[ChatCompletionMessageParam] = [ + {"role": "user", "content": "Start"}, + { + "role": "tool", + "tool_call_id": "call_out_of_order", + "content": "Out of order result", + }, # This comes before its call + {"role": "assistant", "content": "Regular response"}, + { + "role": "assistant", + "tool_calls": [ + { + "id": "call_out_of_order", + "type": "function", + "function": {"name": "test", "arguments": "{}"}, + } + ], + }, + { + "role": "assistant", + "tool_calls": [ + { + "id": "call_normal", + "type": "function", + "function": {"name": "test2", "arguments": "{}"}, + } + ], + }, + {"role": "tool", "tool_call_id": "call_normal", "content": "Normal result"}, + { + "role": "tool", + "tool_call_id": "call_orphan", + "content": "Orphaned result", + }, # No matching call + {"role": "user", "content": "End"}, + ] + + model = LitellmModel("test-model") + result = model._fix_tool_message_ordering(messages) + + # Should reorder properly while preserving all messages + assert len(result) == 8 + assert result[0]["role"] == "user" # Start + assert result[1]["role"] == "assistant" # Regular response + assert result[2]["role"] == "assistant" # call_out_of_order + assert result[2]["tool_calls"][0]["id"] == "call_out_of_order" # type: ignore + assert result[3]["role"] == "tool" # Out of order result (now properly paired) + assert result[3]["tool_call_id"] == "call_out_of_order" + assert result[4]["role"] == "assistant" # call_normal + assert result[4]["tool_calls"][0]["id"] == "call_normal" # type: ignore + assert result[5]["role"] == "tool" # Normal result + assert result[5]["tool_call_id"] == "call_normal" + assert result[6]["role"] == "tool" # Orphaned result (preserved) + assert result[6]["tool_call_id"] == "call_orphan" + assert result[7]["role"] == "user" # End diff --git a/tests/test_extension_filters.py b/tests/test_extension_filters.py index 4cb017aaa..11fba51ba 100644 --- a/tests/test_extension_filters.py +++ b/tests/test_extension_filters.py @@ -1,10 +1,12 @@ from openai.types.responses import ResponseOutputMessage, ResponseOutputText +from openai.types.responses.response_reasoning_item import ResponseReasoningItem -from agents import Agent, HandoffInputData +from agents import Agent, HandoffInputData, RunContextWrapper from agents.extensions.handoff_filters import remove_all_tools from agents.items import ( HandoffOutputItem, MessageOutputItem, + ReasoningItem, ToolCallOutputItem, TResponseInputItem, ) @@ -23,6 +25,10 @@ def _get_message_input_item(content: str) -> TResponseInputItem: } +def _get_reasoning_input_item() -> TResponseInputItem: + return {"id": "rid", "summary": [], "type": "reasoning"} + + def _get_function_result_input_item(content: str) -> TResponseInputItem: return { "call_id": "1", @@ -77,14 +83,30 @@ def _get_handoff_output_run_item(content: str) -> HandoffOutputItem: ) +def _get_reasoning_output_run_item() -> ReasoningItem: + return ReasoningItem( + agent=fake_agent(), raw_item=ResponseReasoningItem(id="rid", summary=[], type="reasoning") + ) + + def test_empty_data(): - handoff_input_data = HandoffInputData(input_history=(), pre_handoff_items=(), new_items=()) + handoff_input_data = HandoffInputData( + input_history=(), + pre_handoff_items=(), + new_items=(), + run_context=RunContextWrapper(context=()), + ) filtered_data = remove_all_tools(handoff_input_data) assert filtered_data == handoff_input_data def test_str_historyonly(): - handoff_input_data = HandoffInputData(input_history="Hello", pre_handoff_items=(), new_items=()) + handoff_input_data = HandoffInputData( + input_history="Hello", + pre_handoff_items=(), + new_items=(), + run_context=RunContextWrapper(context=()), + ) filtered_data = remove_all_tools(handoff_input_data) assert filtered_data == handoff_input_data @@ -94,6 +116,7 @@ def test_str_history_and_list(): input_history="Hello", pre_handoff_items=(), new_items=(_get_message_output_run_item("Hello"),), + run_context=RunContextWrapper(context=()), ) filtered_data = remove_all_tools(handoff_input_data) assert filtered_data == handoff_input_data @@ -104,6 +127,7 @@ def test_list_history_and_list(): input_history=(_get_message_input_item("Hello"),), pre_handoff_items=(_get_message_output_run_item("123"),), new_items=(_get_message_output_run_item("World"),), + run_context=RunContextWrapper(context=()), ) filtered_data = remove_all_tools(handoff_input_data) assert filtered_data == handoff_input_data @@ -121,6 +145,7 @@ def test_removes_tools_from_history(): _get_message_output_run_item("123"), ), new_items=(_get_message_output_run_item("World"),), + run_context=RunContextWrapper(context=()), ) filtered_data = remove_all_tools(handoff_input_data) assert len(filtered_data.input_history) == 2 @@ -136,6 +161,7 @@ def test_removes_tools_from_new_items(): _get_message_output_run_item("Hello"), _get_tool_output_run_item("World"), ), + run_context=RunContextWrapper(context=()), ) filtered_data = remove_all_tools(handoff_input_data) assert len(filtered_data.input_history) == 0 @@ -147,20 +173,24 @@ def test_removes_tools_from_new_items_and_history(): handoff_input_data = HandoffInputData( input_history=( _get_message_input_item("Hello1"), + _get_reasoning_input_item(), _get_function_result_input_item("World"), _get_message_input_item("Hello2"), ), pre_handoff_items=( + _get_reasoning_output_run_item(), _get_message_output_run_item("123"), _get_tool_output_run_item("456"), ), new_items=( + _get_reasoning_output_run_item(), _get_message_output_run_item("Hello"), _get_tool_output_run_item("World"), ), + run_context=RunContextWrapper(context=()), ) filtered_data = remove_all_tools(handoff_input_data) - assert len(filtered_data.input_history) == 2 + assert len(filtered_data.input_history) == 3 assert len(filtered_data.pre_handoff_items) == 1 assert len(filtered_data.new_items) == 1 @@ -172,15 +202,18 @@ def test_removes_handoffs_from_history(): _get_handoff_input_item("World"), ), pre_handoff_items=( + _get_reasoning_output_run_item(), _get_message_output_run_item("Hello"), _get_tool_output_run_item("World"), _get_handoff_output_run_item("World"), ), new_items=( + _get_reasoning_output_run_item(), _get_message_output_run_item("Hello"), _get_tool_output_run_item("World"), _get_handoff_output_run_item("World"), ), + run_context=RunContextWrapper(context=()), ) filtered_data = remove_all_tools(handoff_input_data) assert len(filtered_data.input_history) == 1 diff --git a/tests/test_extra_headers.py b/tests/test_extra_headers.py index a6af30077..c6672374b 100644 --- a/tests/test_extra_headers.py +++ b/tests/test_extra_headers.py @@ -95,6 +95,7 @@ def __init__(self): handoffs=[], tracing=ModelTracing.DISABLED, previous_response_id=None, + conversation_id=None, ) assert "extra_headers" in called_kwargs assert called_kwargs["extra_headers"]["X-Test-Header"] == "test-value" diff --git a/tests/test_function_schema.py b/tests/test_function_schema.py index f63d9b534..40607b9bd 100644 --- a/tests/test_function_schema.py +++ b/tests/test_function_schema.py @@ -1,6 +1,6 @@ from collections.abc import Mapping from enum import Enum -from typing import Any, Literal +from typing import Annotated, Any, Literal import pytest from pydantic import BaseModel, Field, ValidationError @@ -521,6 +521,44 @@ def func_with_optional_field( fs.params_pydantic_model(**{"required_param": "test", "optional_param": -1.0}) +def test_function_uses_annotated_descriptions_without_docstring() -> None: + """Test that Annotated metadata populates parameter descriptions when docstrings are ignored.""" + + def add( + a: Annotated[int, "First number to add"], + b: Annotated[int, "Second number to add"], + ) -> int: + return a + b + + fs = function_schema(add, use_docstring_info=False) + + properties = fs.params_json_schema.get("properties", {}) + assert properties["a"].get("description") == "First number to add" + assert properties["b"].get("description") == "Second number to add" + + +def test_function_prefers_docstring_descriptions_over_annotated_metadata() -> None: + """Test that docstring parameter descriptions take precedence over Annotated metadata.""" + + def add( + a: Annotated[int, "Annotated description for a"], + b: Annotated[int, "Annotated description for b"], + ) -> int: + """Adds two integers. + + Args: + a: Docstring provided description. + """ + + return a + b + + fs = function_schema(add) + + properties = fs.params_json_schema.get("properties", {}) + assert properties["a"].get("description") == "Docstring provided description." + assert properties["b"].get("description") == "Annotated description for b" + + def test_function_with_field_description_merge(): """Test that Field descriptions are merged with docstring descriptions.""" diff --git a/tests/test_function_tool.py b/tests/test_function_tool.py index 15602bbac..9f227aadb 100644 --- a/tests/test_function_tool.py +++ b/tests/test_function_tool.py @@ -27,7 +27,7 @@ async def test_argless_function(): assert tool.name == "argless_function" result = await tool.on_invoke_tool( - ToolContext(context=None, tool_name=tool.name, tool_call_id="1"), "" + ToolContext(context=None, tool_name=tool.name, tool_call_id="1", tool_arguments=""), "" ) assert result == "ok" @@ -41,12 +41,15 @@ async def test_argless_with_context(): tool = function_tool(argless_with_context) assert tool.name == "argless_with_context" - result = await tool.on_invoke_tool(ToolContext(None, tool_name=tool.name, tool_call_id="1"), "") + result = await tool.on_invoke_tool( + ToolContext(None, tool_name=tool.name, tool_call_id="1", tool_arguments=""), "" + ) assert result == "ok" # Extra JSON should not raise an error result = await tool.on_invoke_tool( - ToolContext(None, tool_name=tool.name, tool_call_id="1"), '{"a": 1}' + ToolContext(None, tool_name=tool.name, tool_call_id="1", tool_arguments='{"a": 1}'), + '{"a": 1}', ) assert result == "ok" @@ -61,18 +64,22 @@ async def test_simple_function(): assert tool.name == "simple_function" result = await tool.on_invoke_tool( - ToolContext(None, tool_name=tool.name, tool_call_id="1"), '{"a": 1}' + ToolContext(None, tool_name=tool.name, tool_call_id="1", tool_arguments='{"a": 1}'), + '{"a": 1}', ) assert result == 6 result = await tool.on_invoke_tool( - ToolContext(None, tool_name=tool.name, tool_call_id="1"), '{"a": 1, "b": 2}' + ToolContext(None, tool_name=tool.name, tool_call_id="1", tool_arguments='{"a": 1, "b": 2}'), + '{"a": 1, "b": 2}', ) assert result == 3 # Missing required argument should raise an error with pytest.raises(ModelBehaviorError): - await tool.on_invoke_tool(ToolContext(None, tool_name=tool.name, tool_call_id="1"), "") + await tool.on_invoke_tool( + ToolContext(None, tool_name=tool.name, tool_call_id="1", tool_arguments=""), "" + ) class Foo(BaseModel): @@ -101,7 +108,8 @@ async def test_complex_args_function(): } ) result = await tool.on_invoke_tool( - ToolContext(None, tool_name=tool.name, tool_call_id="1"), valid_json + ToolContext(None, tool_name=tool.name, tool_call_id="1", tool_arguments=valid_json), + valid_json, ) assert result == "6 hello10 hello" @@ -112,7 +120,8 @@ async def test_complex_args_function(): } ) result = await tool.on_invoke_tool( - ToolContext(None, tool_name=tool.name, tool_call_id="1"), valid_json + ToolContext(None, tool_name=tool.name, tool_call_id="1", tool_arguments=valid_json), + valid_json, ) assert result == "3 hello10 hello" @@ -124,14 +133,18 @@ async def test_complex_args_function(): } ) result = await tool.on_invoke_tool( - ToolContext(None, tool_name=tool.name, tool_call_id="1"), valid_json + ToolContext(None, tool_name=tool.name, tool_call_id="1", tool_arguments=valid_json), + valid_json, ) assert result == "3 hello10 world" # Missing required argument should raise an error with pytest.raises(ModelBehaviorError): await tool.on_invoke_tool( - ToolContext(None, tool_name=tool.name, tool_call_id="1"), '{"foo": {"a": 1}}' + ToolContext( + None, tool_name=tool.name, tool_call_id="1", tool_arguments='{"foo": {"a": 1}}' + ), + '{"foo": {"a": 1}}', ) @@ -193,7 +206,10 @@ async def run_function(ctx: RunContextWrapper[Any], args: str) -> str: assert tool.strict_json_schema result = await tool.on_invoke_tool( - ToolContext(None, tool_name=tool.name, tool_call_id="1"), '{"data": "hello"}' + ToolContext( + None, tool_name=tool.name, tool_call_id="1", tool_arguments='{"data": "hello"}' + ), + '{"data": "hello"}', ) assert result == "hello_done" @@ -209,7 +225,12 @@ async def run_function(ctx: RunContextWrapper[Any], args: str) -> str: assert "additionalProperties" not in tool_not_strict.params_json_schema result = await tool_not_strict.on_invoke_tool( - ToolContext(None, tool_name=tool_not_strict.name, tool_call_id="1"), + ToolContext( + None, + tool_name=tool_not_strict.name, + tool_call_id="1", + tool_arguments='{"data": "hello", "bar": "baz"}', + ), '{"data": "hello", "bar": "baz"}', ) assert result == "hello_done" @@ -221,7 +242,7 @@ def my_func(a: int, b: int = 5): raise ValueError("test") tool = function_tool(my_func) - ctx = ToolContext(None, tool_name=tool.name, tool_call_id="1") + ctx = ToolContext(None, tool_name=tool.name, tool_call_id="1", tool_arguments="") result = await tool.on_invoke_tool(ctx, "") assert "Invalid JSON" in str(result) @@ -245,7 +266,7 @@ def custom_sync_error_function(ctx: RunContextWrapper[Any], error: Exception) -> return f"error_{error.__class__.__name__}" tool = function_tool(my_func, failure_error_function=custom_sync_error_function) - ctx = ToolContext(None, tool_name=tool.name, tool_call_id="1") + ctx = ToolContext(None, tool_name=tool.name, tool_call_id="1", tool_arguments="") result = await tool.on_invoke_tool(ctx, "") assert result == "error_ModelBehaviorError" @@ -269,7 +290,7 @@ def custom_sync_error_function(ctx: RunContextWrapper[Any], error: Exception) -> return f"error_{error.__class__.__name__}" tool = function_tool(my_func, failure_error_function=custom_sync_error_function) - ctx = ToolContext(None, tool_name=tool.name, tool_call_id="1") + ctx = ToolContext(None, tool_name=tool.name, tool_call_id="1", tool_arguments="") result = await tool.on_invoke_tool(ctx, "") assert result == "error_ModelBehaviorError" diff --git a/tests/test_function_tool_decorator.py b/tests/test_function_tool_decorator.py index b81d5dbe2..2f5a38223 100644 --- a/tests/test_function_tool_decorator.py +++ b/tests/test_function_tool_decorator.py @@ -16,7 +16,9 @@ def __init__(self): def ctx_wrapper() -> ToolContext[DummyContext]: - return ToolContext(context=DummyContext(), tool_name="dummy", tool_call_id="1") + return ToolContext( + context=DummyContext(), tool_name="dummy", tool_call_id="1", tool_arguments="" + ) @function_tool diff --git a/tests/test_handoff_tool.py b/tests/test_handoff_tool.py index 0f7fc2166..70d9799fb 100644 --- a/tests/test_handoff_tool.py +++ b/tests/test_handoff_tool.py @@ -1,3 +1,4 @@ +import inspect import json from typing import Any @@ -220,6 +221,7 @@ def test_handoff_input_data(): input_history="", pre_handoff_items=(), new_items=(), + run_context=RunContextWrapper(context=()), ) assert get_len(data) == 1 @@ -227,6 +229,7 @@ def test_handoff_input_data(): input_history=({"role": "user", "content": "foo"},), pre_handoff_items=(), new_items=(), + run_context=RunContextWrapper(context=()), ) assert get_len(data) == 1 @@ -237,6 +240,7 @@ def test_handoff_input_data(): ), pre_handoff_items=(), new_items=(), + run_context=RunContextWrapper(context=()), ) assert get_len(data) == 2 @@ -250,6 +254,7 @@ def test_handoff_input_data(): message_item("bar", agent), message_item("baz", agent), ), + run_context=RunContextWrapper(context=()), ) assert get_len(data) == 5 @@ -263,6 +268,7 @@ def test_handoff_input_data(): message_item("baz", agent), message_item("qux", agent), ), + run_context=RunContextWrapper(context=()), ) assert get_len(data) == 5 @@ -318,6 +324,8 @@ def always_enabled(ctx: RunContextWrapper[Any], agent: Agent[Any]) -> bool: handoff_callable_enabled = handoff(agent, is_enabled=always_enabled) assert callable(handoff_callable_enabled.is_enabled) result = handoff_callable_enabled.is_enabled(RunContextWrapper(agent), agent) + assert inspect.isawaitable(result) + result = await result assert result is True # Test callable that returns False @@ -327,6 +335,8 @@ def always_disabled(ctx: RunContextWrapper[Any], agent: Agent[Any]) -> bool: handoff_callable_disabled = handoff(agent, is_enabled=always_disabled) assert callable(handoff_callable_disabled.is_enabled) result = handoff_callable_disabled.is_enabled(RunContextWrapper(agent), agent) + assert inspect.isawaitable(result) + result = await result assert result is False # Test async callable diff --git a/tests/test_items_helpers.py b/tests/test_items_helpers.py index f711f21e1..a94d74547 100644 --- a/tests/test_items_helpers.py +++ b/tests/test_items_helpers.py @@ -1,5 +1,7 @@ from __future__ import annotations +import json + from openai.types.responses.response_computer_tool_call import ( ActionScreenshot, ResponseComputerToolCall, @@ -20,8 +22,10 @@ from openai.types.responses.response_output_message_param import ResponseOutputMessageParam from openai.types.responses.response_output_refusal import ResponseOutputRefusal from openai.types.responses.response_output_text import ResponseOutputText +from openai.types.responses.response_output_text_param import ResponseOutputTextParam from openai.types.responses.response_reasoning_item import ResponseReasoningItem, Summary from openai.types.responses.response_reasoning_item_param import ResponseReasoningItemParam +from pydantic import TypeAdapter from agents import ( Agent, @@ -290,3 +294,34 @@ def test_to_input_items_for_reasoning() -> None: print(converted_dict) print(expected) assert converted_dict == expected + + +def test_input_to_new_input_list_copies_the_ones_produced_by_pydantic() -> None: + # Given a list of message dictionaries, ensure the returned list is a deep copy. + original = ResponseOutputMessageParam( + id="a75654dc-7492-4d1c-bce0-89e8312fbdd7", + content=[ + ResponseOutputTextParam( + type="output_text", + text="Hey, what's up?", + annotations=[], + ) + ], + role="assistant", + status="completed", + type="message", + ) + original_json = json.dumps(original) + output_item = TypeAdapter(ResponseOutputMessageParam).validate_json(original_json) + new_list = ItemHelpers.input_to_new_input_list([output_item]) + assert len(new_list) == 1 + assert new_list[0]["id"] == original["id"] # type: ignore + size = 0 + for i, item in enumerate(original["content"]): + size += 1 # pydantic_core._pydantic_core.ValidatorIterator does not support len() + assert item["type"] == original["content"][i]["type"] # type: ignore + assert item["text"] == original["content"][i]["text"] # type: ignore + assert size == 1 + assert new_list[0]["role"] == original["role"] # type: ignore + assert new_list[0]["status"] == original["status"] # type: ignore + assert new_list[0]["type"] == original["type"] diff --git a/tests/test_local_shell_tool.py b/tests/test_local_shell_tool.py new file mode 100644 index 000000000..95ef568f3 --- /dev/null +++ b/tests/test_local_shell_tool.py @@ -0,0 +1,157 @@ +"""Tests for local shell tool execution. + +These confirm that LocalShellAction.execute forwards the command to the executor +and that Runner.run executes local shell calls and records their outputs. +""" + +from typing import Any, cast + +import pytest +from openai.types.responses import ResponseOutputText +from openai.types.responses.response_output_item import LocalShellCall, LocalShellCallAction + +from agents import ( + Agent, + LocalShellCommandRequest, + LocalShellTool, + RunConfig, + RunContextWrapper, + RunHooks, + Runner, +) +from agents._run_impl import LocalShellAction, ToolRunLocalShellCall +from agents.items import ToolCallOutputItem + +from .fake_model import FakeModel +from .test_responses import get_text_message + + +class RecordingLocalShellExecutor: + """A `LocalShellTool` executor that records the requests it receives.""" + + def __init__(self, output: str = "shell output") -> None: + self.output = output + self.calls: list[LocalShellCommandRequest] = [] + + def __call__(self, request: LocalShellCommandRequest) -> str: + self.calls.append(request) + return self.output + + +@pytest.mark.asyncio +async def test_local_shell_action_execute_invokes_executor() -> None: + executor = RecordingLocalShellExecutor(output="test output") + tool = LocalShellTool(executor=executor) + + action = LocalShellCallAction( + command=["bash", "-c", "ls"], + env={"TEST": "value"}, + type="exec", + timeout_ms=5000, + working_directory="/tmp", + ) + tool_call = LocalShellCall( + id="lsh_123", + action=action, + call_id="call_456", + status="completed", + type="local_shell_call", + ) + + tool_run = ToolRunLocalShellCall(tool_call=tool_call, local_shell_tool=tool) + agent = Agent(name="test_agent", tools=[tool]) + context_wrapper: RunContextWrapper[Any] = RunContextWrapper(context=None) + + output_item = await LocalShellAction.execute( + agent=agent, + call=tool_run, + hooks=RunHooks[Any](), + context_wrapper=context_wrapper, + config=RunConfig(), + ) + + assert len(executor.calls) == 1 + request = executor.calls[0] + assert isinstance(request, LocalShellCommandRequest) + assert request.ctx_wrapper is context_wrapper + assert request.data is tool_call + assert request.data.action.command == ["bash", "-c", "ls"] + assert request.data.action.env == {"TEST": "value"} + assert request.data.action.timeout_ms == 5000 + assert request.data.action.working_directory == "/tmp" + + assert isinstance(output_item, ToolCallOutputItem) + assert output_item.agent is agent + assert output_item.output == "test output" + + raw_item = output_item.raw_item + assert isinstance(raw_item, dict) + raw = cast(dict[str, Any], raw_item) + assert raw["type"] == "local_shell_call_output" + assert raw["call_id"] == "call_456" + assert raw["output"] == "test output" + + +@pytest.mark.asyncio +async def test_runner_executes_local_shell_calls() -> None: + executor = RecordingLocalShellExecutor(output="shell result") + tool = LocalShellTool(executor=executor) + + model = FakeModel() + agent = Agent(name="shell-agent", model=model, tools=[tool]) + + action = LocalShellCallAction( + command=["bash", "-c", "echo shell"], + env={}, + type="exec", + timeout_ms=1000, + working_directory="/tmp", + ) + local_shell_call = LocalShellCall( + id="lsh_test", + action=action, + call_id="call_local_shell", + status="completed", + type="local_shell_call", + ) + + model.add_multiple_turn_outputs( + [ + [get_text_message("running shell"), local_shell_call], + [get_text_message("shell complete")], + ] + ) + + result = await Runner.run(agent, input="please run shell") + + assert len(executor.calls) == 1 + request = executor.calls[0] + assert isinstance(request, LocalShellCommandRequest) + assert request.data is local_shell_call + + items = result.new_items + assert len(items) == 4 + + message_before = items[0] + assert message_before.type == "message_output_item" + first_content = message_before.raw_item.content[0] + assert isinstance(first_content, ResponseOutputText) + assert first_content.text == "running shell" + + tool_call_item = items[1] + assert tool_call_item.type == "tool_call_item" + assert tool_call_item.raw_item is local_shell_call + + local_shell_output = items[2] + assert isinstance(local_shell_output, ToolCallOutputItem) + assert local_shell_output.raw_item.get("type") == "local_shell_call_output" + assert local_shell_output.output == "shell result" + + message_after = items[3] + assert message_after.type == "message_output_item" + last_content = message_after.raw_item.content[0] + assert isinstance(last_content, ResponseOutputText) + assert last_content.text == "shell complete" + + assert result.final_output == "shell complete" + assert len(result.raw_responses) == 2 diff --git a/tests/test_logprobs.py b/tests/test_logprobs.py new file mode 100644 index 000000000..aa5bb06f8 --- /dev/null +++ b/tests/test_logprobs.py @@ -0,0 +1,50 @@ +import pytest +from openai.types.responses.response_usage import InputTokensDetails, OutputTokensDetails + +from agents import ModelSettings, ModelTracing, OpenAIResponsesModel + + +class DummyResponses: + async def create(self, **kwargs): + self.kwargs = kwargs + + class DummyResponse: + id = "dummy" + output = [] + usage = type( + "Usage", + (), + { + "input_tokens": 0, + "output_tokens": 0, + "total_tokens": 0, + "input_tokens_details": InputTokensDetails(cached_tokens=0), + "output_tokens_details": OutputTokensDetails(reasoning_tokens=0), + }, + )() + + return DummyResponse() + + +class DummyClient: + def __init__(self): + self.responses = DummyResponses() + + +@pytest.mark.allow_call_model_methods +@pytest.mark.asyncio +async def test_top_logprobs_param_passed(): + client = DummyClient() + model = OpenAIResponsesModel(model="gpt-4", openai_client=client) # type: ignore + await model.get_response( + system_instructions=None, + input="hi", + model_settings=ModelSettings(top_logprobs=2), + tools=[], + output_schema=None, + handoffs=[], + tracing=ModelTracing.DISABLED, + previous_response_id=None, + ) + assert client.responses.kwargs["top_logprobs"] == 2 + assert "message.output_text.logprobs" in client.responses.kwargs["include"] diff --git a/tests/test_model_payload_iterators.py b/tests/test_model_payload_iterators.py new file mode 100644 index 000000000..3d7b9edc6 --- /dev/null +++ b/tests/test_model_payload_iterators.py @@ -0,0 +1,187 @@ +from __future__ import annotations + +from collections.abc import Iterable, Iterator +from typing import Any, cast + +import httpx +import pytest +from openai import omit +from openai.types.chat.chat_completion import ChatCompletion +from openai.types.responses import ToolParam + +from agents import ( + ModelSettings, + ModelTracing, + OpenAIChatCompletionsModel, + OpenAIResponsesModel, + generation_span, +) +from agents.models import ( + openai_chatcompletions as chat_module, + openai_responses as responses_module, +) + + +class _SingleUseIterable: + """Helper iterable that raises if iterated more than once.""" + + def __init__(self, values: list[object]) -> None: + self._values = list(values) + self.iterations = 0 + + def __iter__(self) -> Iterator[object]: + if self.iterations: + raise RuntimeError("Iterable should have been materialized exactly once.") + self.iterations += 1 + yield from self._values + + +def _force_materialization(value: object) -> None: + if isinstance(value, dict): + for nested in value.values(): + _force_materialization(nested) + elif isinstance(value, list): + for nested in value: + _force_materialization(nested) + elif isinstance(value, Iterable) and not isinstance(value, (str, bytes, bytearray)): + list(value) + + +@pytest.mark.allow_call_model_methods +@pytest.mark.asyncio +async def test_chat_completions_materializes_iterator_payload( + monkeypatch: pytest.MonkeyPatch, +) -> None: + message_iter = _SingleUseIterable([{"type": "text", "text": "hi"}]) + tool_iter = _SingleUseIterable([{"type": "string"}]) + + chat_converter = cast(Any, chat_module).Converter + + monkeypatch.setattr( + chat_converter, + "items_to_messages", + classmethod(lambda _cls, _input: [{"role": "user", "content": message_iter}]), + ) + monkeypatch.setattr( + chat_converter, + "tool_to_openai", + classmethod( + lambda _cls, _tool: { + "type": "function", + "function": { + "name": "dummy", + "parameters": {"properties": tool_iter}, + }, + } + ), + ) + + captured_kwargs: dict[str, Any] = {} + + class DummyCompletions: + async def create(self, **kwargs): + captured_kwargs.update(kwargs) + _force_materialization(kwargs["messages"]) + if kwargs["tools"] is not omit: + _force_materialization(kwargs["tools"]) + return ChatCompletion( + id="dummy-id", + created=0, + model="gpt-4", + object="chat.completion", + choices=[], + usage=None, + ) + + class DummyClient: + def __init__(self) -> None: + self.chat = type("_Chat", (), {"completions": DummyCompletions()})() + self.base_url = httpx.URL("http://example.test/") + + model = OpenAIChatCompletionsModel(model="gpt-4", openai_client=DummyClient()) # type: ignore[arg-type] + + with generation_span(disabled=True) as span: + await cast(Any, model)._fetch_response( + system_instructions=None, + input="ignored", + model_settings=ModelSettings(), + tools=[object()], + output_schema=None, + handoffs=[], + span=span, + tracing=ModelTracing.DISABLED, + stream=False, + ) + + assert message_iter.iterations == 1 + assert tool_iter.iterations == 1 + assert isinstance(captured_kwargs["messages"][0]["content"], list) + assert isinstance(captured_kwargs["tools"][0]["function"]["parameters"]["properties"], list) + + +@pytest.mark.allow_call_model_methods +@pytest.mark.asyncio +async def test_responses_materializes_iterator_payload(monkeypatch: pytest.MonkeyPatch) -> None: + input_iter = _SingleUseIterable([{"type": "input_text", "text": "hello"}]) + tool_iter = _SingleUseIterable([{"type": "string"}]) + + responses_item_helpers = cast(Any, responses_module).ItemHelpers + responses_converter = cast(Any, responses_module).Converter + + monkeypatch.setattr( + responses_item_helpers, + "input_to_new_input_list", + classmethod(lambda _cls, _input: [{"role": "user", "content": input_iter}]), + ) + + converted_tools = responses_module.ConvertedTools( + tools=cast( + list[ToolParam], + [ + { + "type": "function", + "name": "dummy", + "parameters": {"properties": tool_iter}, + } + ], + ), + includes=[], + ) + monkeypatch.setattr( + responses_converter, + "convert_tools", + classmethod(lambda _cls, _tools, _handoffs: converted_tools), + ) + + captured_kwargs: dict[str, Any] = {} + + class DummyResponses: + async def create(self, **kwargs): + captured_kwargs.update(kwargs) + _force_materialization(kwargs["input"]) + _force_materialization(kwargs["tools"]) + return object() + + class DummyClient: + def __init__(self) -> None: + self.responses = DummyResponses() + + model = OpenAIResponsesModel(model="gpt-4.1", openai_client=DummyClient()) # type: ignore[arg-type] + + await cast(Any, model)._fetch_response( + system_instructions=None, + input="ignored", + model_settings=ModelSettings(), + tools=[], + output_schema=None, + handoffs=[], + previous_response_id=None, + conversation_id=None, + stream=False, + prompt=None, + ) + + assert input_iter.iterations == 1 + assert tool_iter.iterations == 1 + assert isinstance(captured_kwargs["input"][0]["content"], list) + assert isinstance(captured_kwargs["tools"][0]["parameters"]["properties"], list) diff --git a/tests/test_openai_chatcompletions.py b/tests/test_openai_chatcompletions.py index a6909b195..3a0f75364 100644 --- a/tests/test_openai_chatcompletions.py +++ b/tests/test_openai_chatcompletions.py @@ -5,12 +5,12 @@ import httpx import pytest -from openai import NOT_GIVEN, AsyncOpenAI +from openai import AsyncOpenAI, omit from openai.types.chat.chat_completion import ChatCompletion, Choice from openai.types.chat.chat_completion_chunk import ChatCompletionChunk from openai.types.chat.chat_completion_message import ChatCompletionMessage -from openai.types.chat.chat_completion_message_tool_call import ( - ChatCompletionMessageToolCall, +from openai.types.chat.chat_completion_message_tool_call import ( # type: ignore[attr-defined] + ChatCompletionMessageFunctionToolCall, Function, ) from openai.types.completion_usage import ( @@ -31,9 +31,10 @@ ModelTracing, OpenAIChatCompletionsModel, OpenAIProvider, + __version__, generation_span, ) -from agents.models.chatcmpl_helpers import ChatCmplHelpers +from agents.models.chatcmpl_helpers import HEADERS_OVERRIDE, ChatCmplHelpers from agents.models.fake_id import FAKE_RESPONSES_ID @@ -77,6 +78,7 @@ async def patched_fetch_response(self, *args, **kwargs): handoffs=[], tracing=ModelTracing.DISABLED, previous_response_id=None, + conversation_id=None, prompt=None, ) # Should have produced exactly one output message with one text part @@ -129,6 +131,7 @@ async def patched_fetch_response(self, *args, **kwargs): handoffs=[], tracing=ModelTracing.DISABLED, previous_response_id=None, + conversation_id=None, prompt=None, ) assert len(resp.output) == 1 @@ -152,7 +155,7 @@ async def test_get_response_with_tool_call(monkeypatch) -> None: should append corresponding `ResponseFunctionToolCall` items after the assistant message item with matching name/arguments. """ - tool_call = ChatCompletionMessageToolCall( + tool_call = ChatCompletionMessageFunctionToolCall( id="call-id", type="function", function=Function(name="do_thing", arguments="{'x':1}"), @@ -182,6 +185,7 @@ async def patched_fetch_response(self, *args, **kwargs): handoffs=[], tracing=ModelTracing.DISABLED, previous_response_id=None, + conversation_id=None, prompt=None, ) # Expect a message item followed by a function tool call item. @@ -224,6 +228,7 @@ async def patched_fetch_response(self, *args, **kwargs): handoffs=[], tracing=ModelTracing.DISABLED, previous_response_id=None, + conversation_id=None, prompt=None, ) assert resp.output == [] @@ -280,17 +285,17 @@ def __init__(self, completions: DummyCompletions) -> None: assert result is chat # Ensure expected args were passed through to OpenAI client. kwargs = completions.kwargs - assert kwargs["stream"] is False - assert kwargs["store"] is NOT_GIVEN + assert kwargs["stream"] is omit + assert kwargs["store"] is omit assert kwargs["model"] == "gpt-4" assert kwargs["messages"][0]["role"] == "system" assert kwargs["messages"][0]["content"] == "sys" assert kwargs["messages"][1]["role"] == "user" - # Defaults for optional fields become the NOT_GIVEN sentinel - assert kwargs["tools"] is NOT_GIVEN - assert kwargs["tool_choice"] is NOT_GIVEN - assert kwargs["response_format"] is NOT_GIVEN - assert kwargs["stream_options"] is NOT_GIVEN + # Defaults for optional fields become the omit sentinel + assert kwargs["tools"] is omit + assert kwargs["tool_choice"] is omit + assert kwargs["response_format"] is omit + assert kwargs["stream_options"] is omit @pytest.mark.asyncio @@ -335,8 +340,8 @@ def __init__(self, completions: DummyCompletions) -> None: ) # Check OpenAI client was called for streaming assert completions.kwargs["stream"] is True - assert completions.kwargs["store"] is NOT_GIVEN - assert completions.kwargs["stream_options"] is NOT_GIVEN + assert completions.kwargs["store"] is omit + assert completions.kwargs["stream_options"] is omit # Response is a proper openai Response assert isinstance(response, Response) assert response.id == FAKE_RESPONSES_ID @@ -366,6 +371,60 @@ def test_store_param(): "Should respect explicitly set store=True" ) + +@pytest.mark.allow_call_model_methods +@pytest.mark.asyncio +@pytest.mark.parametrize("override_ua", [None, "test_user_agent"]) +async def test_user_agent_header_chat_completions(override_ua): + called_kwargs: dict[str, Any] = {} + expected_ua = override_ua or f"Agents/Python {__version__}" + + class DummyCompletions: + async def create(self, **kwargs): + nonlocal called_kwargs + called_kwargs = kwargs + msg = ChatCompletionMessage(role="assistant", content="Hello") + choice = Choice(index=0, finish_reason="stop", message=msg) + return ChatCompletion( + id="resp-id", + created=0, + model="fake", + object="chat.completion", + choices=[choice], + usage=None, + ) + + class DummyChatClient: + def __init__(self): + self.chat = type("_Chat", (), {"completions": DummyCompletions()})() + self.base_url = "https://api.openai.com/" + + model = OpenAIChatCompletionsModel(model="gpt-4", openai_client=DummyChatClient()) # type: ignore + + if override_ua is not None: + token = HEADERS_OVERRIDE.set({"User-Agent": override_ua}) + else: + token = None + + try: + await model.get_response( + system_instructions=None, + input="hi", + model_settings=ModelSettings(), + tools=[], + output_schema=None, + handoffs=[], + tracing=ModelTracing.DISABLED, + previous_response_id=None, + conversation_id=None, + ) + finally: + if token is not None: + HEADERS_OVERRIDE.reset(token) + + assert "extra_headers" in called_kwargs + assert called_kwargs["extra_headers"]["User-Agent"] == expected_ua + client = AsyncOpenAI(base_url="http://www.notopenai.com/") model_settings = ModelSettings() assert ChatCmplHelpers.get_store_param(client, model_settings) is None, ( diff --git a/tests/test_openai_chatcompletions_converter.py b/tests/test_openai_chatcompletions_converter.py index bcfca5495..18dfdf045 100644 --- a/tests/test_openai_chatcompletions_converter.py +++ b/tests/test_openai_chatcompletions_converter.py @@ -26,11 +26,13 @@ from typing import Literal, cast import pytest -from openai.types.chat import ChatCompletionMessage, ChatCompletionMessageToolCall +from openai import omit +from openai.types.chat import ChatCompletionMessage, ChatCompletionMessageFunctionToolCall from openai.types.chat.chat_completion_message_tool_call import Function from openai.types.responses import ( ResponseFunctionToolCall, ResponseFunctionToolCallParam, + ResponseInputAudioParam, ResponseInputTextParam, ResponseOutputMessage, ResponseOutputRefusal, @@ -87,7 +89,7 @@ def test_message_to_output_items_with_tool_call(): be reflected as separate `ResponseFunctionToolCall` items appended after the message item. """ - tool_call = ChatCompletionMessageToolCall( + tool_call = ChatCompletionMessageFunctionToolCall( id="tool1", type="function", function=Function(name="myfn", arguments='{"x":1}'), @@ -185,7 +187,7 @@ def test_items_to_messages_with_output_message_and_function_call(): # Refusal in output message should be represented in assistant message assert "refusal" in assistant assert assistant["refusal"] == refusal.refusal - # Tool calls list should contain one ChatCompletionMessageToolCall dict + # Tool calls list should contain one ChatCompletionMessageFunctionToolCall dict tool_calls = assistant.get("tool_calls") assert isinstance(tool_calls, list) assert len(tool_calls) == 1 @@ -197,12 +199,12 @@ def test_items_to_messages_with_output_message_and_function_call(): def test_convert_tool_choice_handles_standard_and_named_options() -> None: """ - The `Converter.convert_tool_choice` method should return NOT_GIVEN + The `Converter.convert_tool_choice` method should return the omit sentinel if no choice is provided, pass through values like "auto", "required", or "none" unchanged, and translate any other string into a function selection dict. """ - assert Converter.convert_tool_choice(None).__class__.__name__ == "NotGiven" + assert Converter.convert_tool_choice(None) is omit assert Converter.convert_tool_choice("auto") == "auto" assert Converter.convert_tool_choice("required") == "required" assert Converter.convert_tool_choice("none") == "none" @@ -214,17 +216,15 @@ def test_convert_tool_choice_handles_standard_and_named_options() -> None: def test_convert_response_format_returns_not_given_for_plain_text_and_dict_for_schemas() -> None: """ - The `Converter.convert_response_format` method should return NOT_GIVEN + The `Converter.convert_response_format` method should return the omit sentinel when no output schema is provided or if the output schema indicates plain text. For structured output schemas, it should return a dict with type `json_schema` and include the generated JSON schema and strict flag from the provided `AgentOutputSchema`. """ # when output is plain text (schema None or output_type str), do not include response_format - assert Converter.convert_response_format(None).__class__.__name__ == "NotGiven" - assert ( - Converter.convert_response_format(AgentOutputSchema(str)).__class__.__name__ == "NotGiven" - ) + assert Converter.convert_response_format(None) is omit + assert Converter.convert_response_format(AgentOutputSchema(str)) is omit # For e.g. integer output, we expect a response_format dict schema = AgentOutputSchema(int) resp_format = Converter.convert_response_format(schema) @@ -281,6 +281,39 @@ def test_extract_all_and_text_content_for_strings_and_lists(): assert [p["text"] for p in text_parts] == ["one", "two"] +def test_extract_all_content_handles_input_audio(): + """ + input_audio entries should translate into ChatCompletion input_audio parts. + """ + audio: ResponseInputAudioParam = { + "type": "input_audio", + "input_audio": {"data": "AAA=", "format": "wav"}, + } + parts = Converter.extract_all_content([audio]) + assert isinstance(parts, list) + assert parts == [ + { + "type": "input_audio", + "input_audio": {"data": "AAA=", "format": "wav"}, + } + ] + + +def test_extract_all_content_rejects_invalid_input_audio(): + """ + input_audio requires both data and format fields to be present. + """ + audio_missing_data = cast( + ResponseInputAudioParam, + { + "type": "input_audio", + "input_audio": {"format": "wav"}, + }, + ) + with pytest.raises(UserError): + Converter.extract_all_content([audio_missing_data]) + + def test_items_to_messages_handles_system_and_developer_roles(): """ Roles other than `user` (e.g. `system` and `developer`) need to be @@ -341,8 +374,8 @@ def test_tool_call_conversion(): tool_call = tool_calls[0] assert tool_call["id"] == function_call["call_id"] - assert tool_call["function"]["name"] == function_call["name"] - assert tool_call["function"]["arguments"] == function_call["arguments"] + assert tool_call["function"]["name"] == function_call["name"] # type: ignore + assert tool_call["function"]["arguments"] == function_call["arguments"] # type: ignore @pytest.mark.parametrize("role", ["user", "system", "developer"]) diff --git a/tests/test_openai_chatcompletions_stream.py b/tests/test_openai_chatcompletions_stream.py index 49e7bc2f4..947816f01 100644 --- a/tests/test_openai_chatcompletions_stream.py +++ b/tests/test_openai_chatcompletions_stream.py @@ -90,6 +90,7 @@ async def patched_fetch_response(self, *args, **kwargs): handoffs=[], tracing=ModelTracing.DISABLED, previous_response_id=None, + conversation_id=None, prompt=None, ): output_events.append(event) @@ -183,6 +184,7 @@ async def patched_fetch_response(self, *args, **kwargs): handoffs=[], tracing=ModelTracing.DISABLED, previous_response_id=None, + conversation_id=None, prompt=None, ): output_events.append(event) @@ -214,17 +216,18 @@ async def test_stream_response_yields_events_for_tool_call(monkeypatch) -> None: the model is streaming a function/tool call instead of plain text. The function call will be split across two chunks. """ - # Simulate a single tool call whose ID stays constant and function name/args built over chunks. + # Simulate a single tool call with complete function name in first chunk + # and arguments split across chunks (reflecting real OpenAI API behavior) tool_call_delta1 = ChoiceDeltaToolCall( index=0, id="tool-id", - function=ChoiceDeltaToolCallFunction(name="my_", arguments="arg1"), + function=ChoiceDeltaToolCallFunction(name="my_func", arguments="arg1"), type="function", ) tool_call_delta2 = ChoiceDeltaToolCall( index=0, id="tool-id", - function=ChoiceDeltaToolCallFunction(name="func", arguments="arg2"), + function=ChoiceDeltaToolCallFunction(name=None, arguments="arg2"), type="function", ) chunk1 = ChatCompletionChunk( @@ -272,6 +275,7 @@ async def patched_fetch_response(self, *args, **kwargs): handoffs=[], tracing=ModelTracing.DISABLED, previous_response_id=None, + conversation_id=None, prompt=None, ): output_events.append(event) @@ -284,18 +288,155 @@ async def patched_fetch_response(self, *args, **kwargs): # The added item should be a ResponseFunctionToolCall. added_fn = output_events[1].item assert isinstance(added_fn, ResponseFunctionToolCall) - assert added_fn.name == "my_func" # Name should be concatenation of both chunks. - assert added_fn.arguments == "arg1arg2" + assert added_fn.name == "my_func" # Name should be complete from first chunk + assert added_fn.arguments == "" # Arguments start empty assert output_events[2].type == "response.function_call_arguments.delta" - assert output_events[2].delta == "arg1arg2" - assert output_events[3].type == "response.output_item.done" - assert output_events[4].type == "response.completed" - assert output_events[2].delta == "arg1arg2" - assert output_events[3].type == "response.output_item.done" - assert output_events[4].type == "response.completed" - assert added_fn.name == "my_func" # Name should be concatenation of both chunks. - assert added_fn.arguments == "arg1arg2" - assert output_events[2].type == "response.function_call_arguments.delta" - assert output_events[2].delta == "arg1arg2" - assert output_events[3].type == "response.output_item.done" - assert output_events[4].type == "response.completed" + assert output_events[2].delta == "arg1" # First argument chunk + assert output_events[3].type == "response.function_call_arguments.delta" + assert output_events[3].delta == "arg2" # Second argument chunk + assert output_events[4].type == "response.output_item.done" + assert output_events[5].type == "response.completed" + # Final function call should have complete arguments + final_fn = output_events[4].item + assert isinstance(final_fn, ResponseFunctionToolCall) + assert final_fn.name == "my_func" + assert final_fn.arguments == "arg1arg2" + + +@pytest.mark.allow_call_model_methods +@pytest.mark.asyncio +async def test_stream_response_yields_real_time_function_call_arguments(monkeypatch) -> None: + """ + Validate that `stream_response` emits function call arguments in real-time as they + are received, not just at the end. This test simulates the real OpenAI API behavior + where function name comes first, then arguments are streamed incrementally. + """ + # Simulate realistic OpenAI API chunks: name first, then arguments incrementally + tool_call_delta1 = ChoiceDeltaToolCall( + index=0, + id="tool-call-123", + function=ChoiceDeltaToolCallFunction(name="write_file", arguments=""), + type="function", + ) + tool_call_delta2 = ChoiceDeltaToolCall( + index=0, + function=ChoiceDeltaToolCallFunction(arguments='{"filename": "'), + type="function", + ) + tool_call_delta3 = ChoiceDeltaToolCall( + index=0, + function=ChoiceDeltaToolCallFunction(arguments='test.py", "content": "'), + type="function", + ) + tool_call_delta4 = ChoiceDeltaToolCall( + index=0, + function=ChoiceDeltaToolCallFunction(arguments='print(hello)"}'), + type="function", + ) + + chunk1 = ChatCompletionChunk( + id="chunk-id", + created=1, + model="fake", + object="chat.completion.chunk", + choices=[Choice(index=0, delta=ChoiceDelta(tool_calls=[tool_call_delta1]))], + ) + chunk2 = ChatCompletionChunk( + id="chunk-id", + created=1, + model="fake", + object="chat.completion.chunk", + choices=[Choice(index=0, delta=ChoiceDelta(tool_calls=[tool_call_delta2]))], + ) + chunk3 = ChatCompletionChunk( + id="chunk-id", + created=1, + model="fake", + object="chat.completion.chunk", + choices=[Choice(index=0, delta=ChoiceDelta(tool_calls=[tool_call_delta3]))], + ) + chunk4 = ChatCompletionChunk( + id="chunk-id", + created=1, + model="fake", + object="chat.completion.chunk", + choices=[Choice(index=0, delta=ChoiceDelta(tool_calls=[tool_call_delta4]))], + usage=CompletionUsage(completion_tokens=1, prompt_tokens=1, total_tokens=2), + ) + + async def fake_stream() -> AsyncIterator[ChatCompletionChunk]: + for c in (chunk1, chunk2, chunk3, chunk4): + yield c + + async def patched_fetch_response(self, *args, **kwargs): + resp = Response( + id="resp-id", + created_at=0, + model="fake-model", + object="response", + output=[], + tool_choice="none", + tools=[], + parallel_tool_calls=False, + ) + return resp, fake_stream() + + monkeypatch.setattr(OpenAIChatCompletionsModel, "_fetch_response", patched_fetch_response) + model = OpenAIProvider(use_responses=False).get_model("gpt-4") + output_events = [] + async for event in model.stream_response( + system_instructions=None, + input="", + model_settings=ModelSettings(), + tools=[], + output_schema=None, + handoffs=[], + tracing=ModelTracing.DISABLED, + previous_response_id=None, + conversation_id=None, + prompt=None, + ): + output_events.append(event) + + # Extract events by type + created_events = [e for e in output_events if e.type == "response.created"] + output_item_added_events = [e for e in output_events if e.type == "response.output_item.added"] + function_args_delta_events = [ + e for e in output_events if e.type == "response.function_call_arguments.delta" + ] + output_item_done_events = [e for e in output_events if e.type == "response.output_item.done"] + completed_events = [e for e in output_events if e.type == "response.completed"] + + # Verify event structure + assert len(created_events) == 1 + assert len(output_item_added_events) == 1 + assert len(function_args_delta_events) == 3 # Three incremental argument chunks + assert len(output_item_done_events) == 1 + assert len(completed_events) == 1 + + # Verify the function call started as soon as we had name and ID + added_event = output_item_added_events[0] + assert isinstance(added_event.item, ResponseFunctionToolCall) + assert added_event.item.name == "write_file" + assert added_event.item.call_id == "tool-call-123" + assert added_event.item.arguments == "" # Should be empty at start + + # Verify real-time argument streaming + expected_deltas = ['{"filename": "', 'test.py", "content": "', 'print(hello)"}'] + for i, delta_event in enumerate(function_args_delta_events): + assert delta_event.delta == expected_deltas[i] + assert delta_event.item_id == "__fake_id__" # FAKE_RESPONSES_ID + assert delta_event.output_index == 0 + + # Verify completion event has full arguments + done_event = output_item_done_events[0] + assert isinstance(done_event.item, ResponseFunctionToolCall) + assert done_event.item.name == "write_file" + assert done_event.item.arguments == '{"filename": "test.py", "content": "print(hello)"}' + + # Verify final response + completed_event = completed_events[0] + function_call_output = completed_event.response.output[0] + assert isinstance(function_call_output, ResponseFunctionToolCall) + assert function_call_output.name == "write_file" + assert function_call_output.arguments == '{"filename": "test.py", "content": "print(hello)"}' diff --git a/tests/test_openai_conversations_session.py b/tests/test_openai_conversations_session.py new file mode 100644 index 000000000..732c1fa2c --- /dev/null +++ b/tests/test_openai_conversations_session.py @@ -0,0 +1,445 @@ +"""Tests for OpenAI Conversations Session functionality.""" + +from __future__ import annotations + +from unittest.mock import AsyncMock, MagicMock, patch + +import pytest + +from agents import Agent, Runner, TResponseInputItem +from agents.memory.openai_conversations_session import ( + OpenAIConversationsSession, + start_openai_conversations_session, +) +from tests.fake_model import FakeModel +from tests.test_responses import get_text_message + + +@pytest.fixture +def mock_openai_client(): + """Create a mock OpenAI client for testing.""" + client = AsyncMock() + + # Mock conversations.create + client.conversations.create.return_value = MagicMock(id="test_conversation_id") + + # Mock conversations.delete + client.conversations.delete.return_value = None + + # Mock conversations.items.create + client.conversations.items.create.return_value = None + + # Mock conversations.items.delete + client.conversations.items.delete.return_value = None + + return client + + +@pytest.fixture +def agent() -> Agent: + """Fixture for a basic agent with a fake model.""" + return Agent(name="test", model=FakeModel()) + + +class TestStartOpenAIConversationsSession: + """Test the standalone start_openai_conversations_session function.""" + + @pytest.mark.asyncio + async def test_start_with_provided_client(self, mock_openai_client): + """Test starting a conversation session with a provided client.""" + conversation_id = await start_openai_conversations_session(mock_openai_client) + + assert conversation_id == "test_conversation_id" + mock_openai_client.conversations.create.assert_called_once_with(items=[]) + + @pytest.mark.asyncio + async def test_start_with_none_client(self): + """Test starting a conversation session with None client (uses default).""" + with patch( + "agents.memory.openai_conversations_session.get_default_openai_client" + ) as mock_get_default: + with patch("agents.memory.openai_conversations_session.AsyncOpenAI"): + # Test case 1: get_default_openai_client returns a client + mock_default_client = AsyncMock() + mock_default_client.conversations.create.return_value = MagicMock( + id="default_client_id" + ) + mock_get_default.return_value = mock_default_client + + conversation_id = await start_openai_conversations_session(None) + + assert conversation_id == "default_client_id" + mock_get_default.assert_called_once() + mock_default_client.conversations.create.assert_called_once_with(items=[]) + + @pytest.mark.asyncio + async def test_start_with_none_client_fallback(self): + """Test starting a conversation session when get_default_openai_client returns None.""" + with patch( + "agents.memory.openai_conversations_session.get_default_openai_client" + ) as mock_get_default: + with patch( + "agents.memory.openai_conversations_session.AsyncOpenAI" + ) as mock_async_openai: + # Test case 2: get_default_openai_client returns None, fallback to AsyncOpenAI() + mock_get_default.return_value = None + mock_fallback_client = AsyncMock() + mock_fallback_client.conversations.create.return_value = MagicMock( + id="fallback_client_id" + ) + mock_async_openai.return_value = mock_fallback_client + + conversation_id = await start_openai_conversations_session(None) + + assert conversation_id == "fallback_client_id" + mock_get_default.assert_called_once() + mock_async_openai.assert_called_once() + mock_fallback_client.conversations.create.assert_called_once_with(items=[]) + + +class TestOpenAIConversationsSessionConstructor: + """Test OpenAIConversationsSession constructor and client handling.""" + + def test_init_with_conversation_id_and_client(self, mock_openai_client): + """Test constructor with both conversation_id and openai_client provided.""" + session = OpenAIConversationsSession( + conversation_id="test_id", openai_client=mock_openai_client + ) + + assert session._session_id == "test_id" + assert session._openai_client is mock_openai_client + + def test_init_with_conversation_id_only(self): + """Test constructor with only conversation_id, client should be created.""" + with patch( + "agents.memory.openai_conversations_session.get_default_openai_client" + ) as mock_get_default: + with patch("agents.memory.openai_conversations_session.AsyncOpenAI"): + mock_default_client = AsyncMock() + mock_get_default.return_value = mock_default_client + + session = OpenAIConversationsSession(conversation_id="test_id") + + assert session._session_id == "test_id" + assert session._openai_client is mock_default_client + mock_get_default.assert_called_once() + + def test_init_with_client_only(self, mock_openai_client): + """Test constructor with only openai_client, no conversation_id.""" + session = OpenAIConversationsSession(openai_client=mock_openai_client) + + assert session._session_id is None + assert session._openai_client is mock_openai_client + + def test_init_with_no_args_fallback(self): + """Test constructor with no args, should create default client.""" + with patch( + "agents.memory.openai_conversations_session.get_default_openai_client" + ) as mock_get_default: + with patch( + "agents.memory.openai_conversations_session.AsyncOpenAI" + ) as mock_async_openai: + # Test fallback when get_default_openai_client returns None + mock_get_default.return_value = None + mock_fallback_client = AsyncMock() + mock_async_openai.return_value = mock_fallback_client + + session = OpenAIConversationsSession() + + assert session._session_id is None + assert session._openai_client is mock_fallback_client + mock_get_default.assert_called_once() + mock_async_openai.assert_called_once() + + +class TestOpenAIConversationsSessionLifecycle: + """Test session ID lifecycle management.""" + + @pytest.mark.asyncio + async def test_get_session_id_with_existing_id(self, mock_openai_client): + """Test _get_session_id when session_id already exists.""" + session = OpenAIConversationsSession( + conversation_id="existing_id", openai_client=mock_openai_client + ) + + session_id = await session._get_session_id() + + assert session_id == "existing_id" + # Should not call conversations.create since ID already exists + mock_openai_client.conversations.create.assert_not_called() + + @pytest.mark.asyncio + async def test_get_session_id_creates_new_conversation(self, mock_openai_client): + """Test _get_session_id when session_id is None, should create new conversation.""" + session = OpenAIConversationsSession(openai_client=mock_openai_client) + + session_id = await session._get_session_id() + + assert session_id == "test_conversation_id" + assert session._session_id == "test_conversation_id" + mock_openai_client.conversations.create.assert_called_once_with(items=[]) + + @pytest.mark.asyncio + async def test_clear_session_id(self, mock_openai_client): + """Test _clear_session_id sets session_id to None.""" + session = OpenAIConversationsSession( + conversation_id="test_id", openai_client=mock_openai_client + ) + + await session._clear_session_id() + + assert session._session_id is None + + +class TestOpenAIConversationsSessionBasicOperations: + """Test basic CRUD operations with simple mocking.""" + + @pytest.mark.asyncio + async def test_add_items_simple(self, mock_openai_client): + """Test adding items to the conversation.""" + session = OpenAIConversationsSession( + conversation_id="test_id", openai_client=mock_openai_client + ) + + items: list[TResponseInputItem] = [ + {"role": "user", "content": "Hello"}, + {"role": "assistant", "content": "Hi there!"}, + ] + + await session.add_items(items) + + mock_openai_client.conversations.items.create.assert_called_once_with( + conversation_id="test_id", items=items + ) + + @pytest.mark.asyncio + async def test_add_items_creates_session_id(self, mock_openai_client): + """Test that add_items creates session_id if it doesn't exist.""" + session = OpenAIConversationsSession(openai_client=mock_openai_client) + + items: list[TResponseInputItem] = [{"role": "user", "content": "Hello"}] + + await session.add_items(items) + + # Should create conversation first + mock_openai_client.conversations.create.assert_called_once_with(items=[]) + # Then add items + mock_openai_client.conversations.items.create.assert_called_once_with( + conversation_id="test_conversation_id", items=items + ) + + @pytest.mark.asyncio + async def test_pop_item_with_items(self, mock_openai_client): + """Test popping item when items exist using method patching.""" + session = OpenAIConversationsSession( + conversation_id="test_id", openai_client=mock_openai_client + ) + + # Mock get_items to return one item + latest_item = {"id": "item_123", "role": "assistant", "content": "Latest message"} + + with patch.object(session, "get_items", return_value=[latest_item]): + popped_item = await session.pop_item() + + assert popped_item == latest_item + mock_openai_client.conversations.items.delete.assert_called_once_with( + conversation_id="test_id", item_id="item_123" + ) + + @pytest.mark.asyncio + async def test_pop_item_empty_session(self, mock_openai_client): + """Test popping item from empty session.""" + session = OpenAIConversationsSession( + conversation_id="test_id", openai_client=mock_openai_client + ) + + # Mock get_items to return empty list + with patch.object(session, "get_items", return_value=[]): + popped_item = await session.pop_item() + + assert popped_item is None + mock_openai_client.conversations.items.delete.assert_not_called() + + @pytest.mark.asyncio + async def test_clear_session(self, mock_openai_client): + """Test clearing the entire session.""" + session = OpenAIConversationsSession( + conversation_id="test_id", openai_client=mock_openai_client + ) + + await session.clear_session() + + # Should delete the conversation and clear session ID + mock_openai_client.conversations.delete.assert_called_once_with(conversation_id="test_id") + assert session._session_id is None + + @pytest.mark.asyncio + async def test_clear_session_creates_session_id_first(self, mock_openai_client): + """Test that clear_session creates session_id if it doesn't exist.""" + session = OpenAIConversationsSession(openai_client=mock_openai_client) + + await session.clear_session() + + # Should create conversation first, then delete it + mock_openai_client.conversations.create.assert_called_once_with(items=[]) + mock_openai_client.conversations.delete.assert_called_once_with( + conversation_id="test_conversation_id" + ) + assert session._session_id is None + + +class TestOpenAIConversationsSessionRunnerIntegration: + """Test integration with Agent Runner using simple mocking.""" + + @pytest.mark.asyncio + async def test_runner_integration_basic(self, agent: Agent, mock_openai_client): + """Test that OpenAIConversationsSession works with Agent Runner.""" + session = OpenAIConversationsSession(openai_client=mock_openai_client) + + # Mock the session methods to avoid complex async iterator setup + with patch.object(session, "get_items", return_value=[]): + with patch.object(session, "add_items") as mock_add_items: + # Run the agent + assert isinstance(agent.model, FakeModel) + agent.model.set_next_output([get_text_message("San Francisco")]) + + result = await Runner.run( + agent, "What city is the Golden Gate Bridge in?", session=session + ) + + assert result.final_output == "San Francisco" + + # Verify session interactions occurred + mock_add_items.assert_called() + + @pytest.mark.asyncio + async def test_runner_with_conversation_history(self, agent: Agent, mock_openai_client): + """Test that conversation history is preserved across Runner calls.""" + session = OpenAIConversationsSession(openai_client=mock_openai_client) + + # Mock conversation history + conversation_history = [ + {"role": "user", "content": "What city is the Golden Gate Bridge in?"}, + {"role": "assistant", "content": "San Francisco"}, + ] + + with patch.object(session, "get_items", return_value=conversation_history): + with patch.object(session, "add_items"): + # Second turn - should have access to previous conversation + assert isinstance(agent.model, FakeModel) + agent.model.set_next_output([get_text_message("California")]) + + result = await Runner.run(agent, "What state is it in?", session=session) + + assert result.final_output == "California" + + # Verify that the model received the conversation history + last_input = agent.model.last_turn_args["input"] + assert len(last_input) > 1 # Should include previous messages + + # Check that previous conversation is included + input_contents = [str(item.get("content", "")) for item in last_input] + assert any("Golden Gate Bridge" in content for content in input_contents) + + +class TestOpenAIConversationsSessionErrorHandling: + """Test error handling for various failure scenarios.""" + + @pytest.mark.asyncio + async def test_api_failure_during_conversation_creation(self, mock_openai_client): + """Test handling of API failures during conversation creation.""" + session = OpenAIConversationsSession(openai_client=mock_openai_client) + + # Mock API failure + mock_openai_client.conversations.create.side_effect = Exception("API Error") + + with pytest.raises(Exception, match="API Error"): + await session._get_session_id() + + @pytest.mark.asyncio + async def test_api_failure_during_add_items(self, mock_openai_client): + """Test handling of API failures during add_items.""" + session = OpenAIConversationsSession( + conversation_id="test_id", openai_client=mock_openai_client + ) + + mock_openai_client.conversations.items.create.side_effect = Exception("Add items failed") + + items: list[TResponseInputItem] = [{"role": "user", "content": "Hello"}] + + with pytest.raises(Exception, match="Add items failed"): + await session.add_items(items) + + @pytest.mark.asyncio + async def test_api_failure_during_clear_session(self, mock_openai_client): + """Test handling of API failures during clear_session.""" + session = OpenAIConversationsSession( + conversation_id="test_id", openai_client=mock_openai_client + ) + + mock_openai_client.conversations.delete.side_effect = Exception("Clear session failed") + + with pytest.raises(Exception, match="Clear session failed"): + await session.clear_session() + + @pytest.mark.asyncio + async def test_invalid_item_id_in_pop_item(self, mock_openai_client): + """Test handling of invalid item ID during pop_item.""" + session = OpenAIConversationsSession( + conversation_id="test_id", openai_client=mock_openai_client + ) + + # Mock item without ID + invalid_item = {"role": "assistant", "content": "No ID"} + + with patch.object(session, "get_items", return_value=[invalid_item]): + # This should raise a KeyError because 'id' field is missing + with pytest.raises(KeyError, match="'id'"): + await session.pop_item() + + +class TestOpenAIConversationsSessionConcurrentAccess: + """Test concurrent access patterns with simple scenarios.""" + + @pytest.mark.asyncio + async def test_multiple_sessions_different_conversation_ids(self, mock_openai_client): + """Test that multiple sessions with different conversation IDs are isolated.""" + session1 = OpenAIConversationsSession( + conversation_id="conversation_1", openai_client=mock_openai_client + ) + session2 = OpenAIConversationsSession( + conversation_id="conversation_2", openai_client=mock_openai_client + ) + + items1: list[TResponseInputItem] = [{"role": "user", "content": "Session 1 message"}] + items2: list[TResponseInputItem] = [{"role": "user", "content": "Session 2 message"}] + + # Add items to both sessions + await session1.add_items(items1) + await session2.add_items(items2) + + # Verify calls were made with correct conversation IDs + assert mock_openai_client.conversations.items.create.call_count == 2 + + # Check the calls + calls = mock_openai_client.conversations.items.create.call_args_list + assert calls[0][1]["conversation_id"] == "conversation_1" + assert calls[0][1]["items"] == items1 + assert calls[1][1]["conversation_id"] == "conversation_2" + assert calls[1][1]["items"] == items2 + + @pytest.mark.asyncio + async def test_session_id_lazy_creation_consistency(self, mock_openai_client): + """Test that session ID creation is consistent across multiple calls.""" + session = OpenAIConversationsSession(openai_client=mock_openai_client) + + # Call _get_session_id multiple times + id1 = await session._get_session_id() + id2 = await session._get_session_id() + id3 = await session._get_session_id() + + # All should return the same session ID + assert id1 == id2 == id3 == "test_conversation_id" + + # Conversation should only be created once + mock_openai_client.conversations.create.assert_called_once() diff --git a/tests/test_openai_responses.py b/tests/test_openai_responses.py new file mode 100644 index 000000000..0823d3cac --- /dev/null +++ b/tests/test_openai_responses.py @@ -0,0 +1,65 @@ +from __future__ import annotations + +from typing import Any + +import pytest +from openai.types.responses import ResponseCompletedEvent + +from agents import ModelSettings, ModelTracing, __version__ +from agents.models.openai_responses import _HEADERS_OVERRIDE as RESP_HEADERS, OpenAIResponsesModel +from tests.fake_model import get_response_obj + + +@pytest.mark.allow_call_model_methods +@pytest.mark.asyncio +@pytest.mark.parametrize("override_ua", [None, "test_user_agent"]) +async def test_user_agent_header_responses(override_ua: str | None): + called_kwargs: dict[str, Any] = {} + expected_ua = override_ua or f"Agents/Python {__version__}" + + class DummyStream: + def __aiter__(self): + async def gen(): + yield ResponseCompletedEvent( + type="response.completed", + response=get_response_obj([]), + sequence_number=0, + ) + + return gen() + + class DummyResponses: + async def create(self, **kwargs): + nonlocal called_kwargs + called_kwargs = kwargs + return DummyStream() + + class DummyResponsesClient: + def __init__(self): + self.responses = DummyResponses() + + model = OpenAIResponsesModel(model="gpt-4", openai_client=DummyResponsesClient()) # type: ignore + + if override_ua is not None: + token = RESP_HEADERS.set({"User-Agent": override_ua}) + else: + token = None + + try: + stream = model.stream_response( + system_instructions=None, + input="hi", + model_settings=ModelSettings(), + tools=[], + output_schema=None, + handoffs=[], + tracing=ModelTracing.DISABLED, + ) + async for _ in stream: + pass + finally: + if token is not None: + RESP_HEADERS.reset(token) + + assert "extra_headers" in called_kwargs + assert called_kwargs["extra_headers"]["User-Agent"] == expected_ua diff --git a/tests/test_openai_responses_converter.py b/tests/test_openai_responses_converter.py index 8e4866656..f0ae2e816 100644 --- a/tests/test_openai_responses_converter.py +++ b/tests/test_openai_responses_converter.py @@ -15,7 +15,7 @@ the tool choice values accepted by the Responses API, including special types like `file_search` and `web_search`, and falling back to function names for arbitrary string values. -- `get_response_format` returns `openai.NOT_GIVEN` for plain-text response +- `get_response_format` returns `openai.omit` for plain-text response formats and an appropriate format dict when a JSON-structured output schema is provided. - `convert_tools` maps our internal `Tool` dataclasses into the appropriate @@ -24,7 +24,7 @@ """ import pytest -from openai import NOT_GIVEN +from openai import omit from pydantic import BaseModel from agents import ( @@ -49,7 +49,7 @@ def test_convert_tool_choice_standard_values(): to "auto"/"required"/"none" as appropriate, and that special string values map to the appropriate dicts. """ - assert Converter.convert_tool_choice(None) is NOT_GIVEN + assert Converter.convert_tool_choice(None) is omit assert Converter.convert_tool_choice("auto") == "auto" assert Converter.convert_tool_choice("required") == "required" assert Converter.convert_tool_choice("none") == "none" @@ -67,16 +67,16 @@ def test_convert_tool_choice_standard_values(): def test_get_response_format_plain_text_and_json_schema(): """ For plain text output (default, or output type of `str`), the converter - should return NOT_GIVEN, indicating no special response format constraint. + should return omit, indicating no special response format constraint. If an output schema is provided for a structured type, the converter should return a `format` dict with the schema and strictness. The exact JSON schema depends on the output type; we just assert that required keys are present and that we get back the original schema. """ # Default output (None) should be considered plain text. - assert Converter.get_response_format(None) is NOT_GIVEN - # An explicit plain-text schema (str) should also yield NOT_GIVEN. - assert Converter.get_response_format(AgentOutputSchema(str)) is NOT_GIVEN + assert Converter.get_response_format(None) is omit + # An explicit plain-text schema (str) should also yield omit. + assert Converter.get_response_format(AgentOutputSchema(str)) is omit # A model-based schema should produce a format dict. class OutModel(BaseModel): @@ -162,14 +162,14 @@ def drag(self, path: list[tuple[int, int]]) -> None: types = [ct["type"] for ct in converted.tools] assert "function" in types assert "file_search" in types - assert "web_search_preview" in types + assert "web_search" in types assert "computer_use_preview" in types # Verify file search tool contains max_num_results and vector_store_ids file_params = next(ct for ct in converted.tools if ct["type"] == "file_search") assert file_params.get("max_num_results") == file_tool.max_num_results assert file_params.get("vector_store_ids") == file_tool.vector_store_ids # Verify web search tool contains user_location and search_context_size - web_params = next(ct for ct in converted.tools if ct["type"] == "web_search_preview") + web_params = next(ct for ct in converted.tools if ct["type"] == "web_search") assert web_params.get("user_location") == web_tool.user_location assert web_params.get("search_context_size") == web_tool.search_context_size # Verify computer tool contains environment and computed dimensions diff --git a/tests/test_reasoning_content.py b/tests/test_reasoning_content.py index 69e9a7d0c..a64fdaf15 100644 --- a/tests/test_reasoning_content.py +++ b/tests/test_reasoning_content.py @@ -129,6 +129,7 @@ async def patched_fetch_response(self, *args, **kwargs): handoffs=[], tracing=ModelTracing.DISABLED, previous_response_id=None, + conversation_id=None, prompt=None, ): output_events.append(event) @@ -216,6 +217,7 @@ async def patched_fetch_response(self, *args, **kwargs): handoffs=[], tracing=ModelTracing.DISABLED, previous_response_id=None, + conversation_id=None, prompt=None, ) @@ -270,6 +272,7 @@ async def patched_fetch_response(self, *args, **kwargs): handoffs=[], tracing=ModelTracing.DISABLED, previous_response_id=None, + conversation_id=None, prompt=None, ): output_events.append(event) diff --git a/tests/test_responses_tracing.py b/tests/test_responses_tracing.py index fe63e8ecb..a2d9b3c3d 100644 --- a/tests/test_responses_tracing.py +++ b/tests/test_responses_tracing.py @@ -69,7 +69,8 @@ async def dummy_fetch_response( tools, output_schema, handoffs, - prev_response_id, + previous_response_id, + conversation_id, stream, prompt, ): @@ -114,7 +115,8 @@ async def dummy_fetch_response( tools, output_schema, handoffs, - prev_response_id, + previous_response_id, + conversation_id, stream, prompt, ): @@ -157,7 +159,8 @@ async def dummy_fetch_response( tools, output_schema, handoffs, - prev_response_id, + previous_response_id, + conversation_id, stream, prompt, ): @@ -197,7 +200,8 @@ async def dummy_fetch_response( tools, output_schema, handoffs, - prev_response_id, + previous_response_id, + conversation_id, stream, prompt, ): @@ -251,7 +255,8 @@ async def dummy_fetch_response( tools, output_schema, handoffs, - prev_response_id, + previous_response_id, + conversation_id, stream, prompt, ): @@ -304,7 +309,8 @@ async def dummy_fetch_response( tools, output_schema, handoffs, - prev_response_id, + previous_response_id, + conversation_id, stream, prompt, ): diff --git a/tests/test_result_cast.py b/tests/test_result_cast.py index c621e7352..4ef1a293d 100644 --- a/tests/test_result_cast.py +++ b/tests/test_result_cast.py @@ -14,6 +14,8 @@ def create_run_result(final_output: Any) -> RunResult: final_output=final_output, input_guardrail_results=[], output_guardrail_results=[], + tool_input_guardrail_results=[], + tool_output_guardrail_results=[], _last_agent=Agent(name="test"), context_wrapper=RunContextWrapper(context=None), ) diff --git a/tests/test_run_config.py b/tests/test_run_config.py index e19899006..31d6d0a46 100644 --- a/tests/test_run_config.py +++ b/tests/test_run_config.py @@ -86,3 +86,55 @@ async def test_agent_model_object_is_used_when_present() -> None: # the FakeModel on the agent. assert provider.last_requested is None assert result.final_output == "from-agent-object" + + +def test_trace_include_sensitive_data_defaults_to_true_when_env_not_set(monkeypatch): + """By default, trace_include_sensitive_data should be True when the env is not set.""" + monkeypatch.delenv("OPENAI_AGENTS_TRACE_INCLUDE_SENSITIVE_DATA", raising=False) + config = RunConfig() + assert config.trace_include_sensitive_data is True + + +@pytest.mark.parametrize( + "env_value,expected", + [ + ("true", True), + ("True", True), + ("1", True), + ("yes", True), + ("on", True), + ("false", False), + ("False", False), + ("0", False), + ("no", False), + ("off", False), + ], + ids=[ + "lowercase-true", + "capital-True", + "numeric-1", + "text-yes", + "text-on", + "lowercase-false", + "capital-False", + "numeric-0", + "text-no", + "text-off", + ], +) +def test_trace_include_sensitive_data_follows_env_value(env_value, expected, monkeypatch): + """trace_include_sensitive_data should follow the environment variable if not explicitly set.""" + monkeypatch.setenv("OPENAI_AGENTS_TRACE_INCLUDE_SENSITIVE_DATA", env_value) + config = RunConfig() + assert config.trace_include_sensitive_data is expected + + +def test_trace_include_sensitive_data_explicit_override_takes_precedence(monkeypatch): + """Explicit value passed to RunConfig should take precedence over the environment variable.""" + monkeypatch.setenv("OPENAI_AGENTS_TRACE_INCLUDE_SENSITIVE_DATA", "false") + config = RunConfig(trace_include_sensitive_data=True) + assert config.trace_include_sensitive_data is True + + monkeypatch.setenv("OPENAI_AGENTS_TRACE_INCLUDE_SENSITIVE_DATA", "true") + config = RunConfig(trace_include_sensitive_data=False) + assert config.trace_include_sensitive_data is False diff --git a/tests/test_run_hooks.py b/tests/test_run_hooks.py new file mode 100644 index 000000000..f5a2ed478 --- /dev/null +++ b/tests/test_run_hooks.py @@ -0,0 +1,246 @@ +from collections import defaultdict +from typing import Any, Optional, cast + +import pytest + +from agents.agent import Agent +from agents.items import ItemHelpers, ModelResponse, TResponseInputItem +from agents.lifecycle import AgentHooks, RunHooks +from agents.models.interface import Model +from agents.run import Runner +from agents.run_context import RunContextWrapper, TContext +from agents.tool import Tool +from tests.test_agent_llm_hooks import AgentHooksForTests + +from .fake_model import FakeModel +from .test_responses import ( + get_function_tool, + get_text_message, +) + + +class RunHooksForTests(RunHooks): + def __init__(self): + self.events: dict[str, int] = defaultdict(int) + + def reset(self): + self.events.clear() + + async def on_agent_start( + self, context: RunContextWrapper[TContext], agent: Agent[TContext] + ) -> None: + self.events["on_agent_start"] += 1 + + async def on_agent_end( + self, context: RunContextWrapper[TContext], agent: Agent[TContext], output: Any + ) -> None: + self.events["on_agent_end"] += 1 + + async def on_handoff( + self, + context: RunContextWrapper[TContext], + from_agent: Agent[TContext], + to_agent: Agent[TContext], + ) -> None: + self.events["on_handoff"] += 1 + + async def on_tool_start( + self, context: RunContextWrapper[TContext], agent: Agent[TContext], tool: Tool + ) -> None: + self.events["on_tool_start"] += 1 + + async def on_tool_end( + self, + context: RunContextWrapper[TContext], + agent: Agent[TContext], + tool: Tool, + result: str, + ) -> None: + self.events["on_tool_end"] += 1 + + async def on_llm_start( + self, + context: RunContextWrapper[TContext], + agent: Agent[TContext], + system_prompt: Optional[str], + input_items: list[TResponseInputItem], + ) -> None: + self.events["on_llm_start"] += 1 + + async def on_llm_end( + self, + context: RunContextWrapper[TContext], + agent: Agent[TContext], + response: ModelResponse, + ) -> None: + self.events["on_llm_end"] += 1 + + +# Example test using the above hooks +@pytest.mark.asyncio +async def test_async_run_hooks_with_llm(): + hooks = RunHooksForTests() + model = FakeModel() + + agent = Agent(name="A", model=model, tools=[get_function_tool("f", "res")], handoffs=[]) + # Simulate a single LLM call producing an output: + model.set_next_output([get_text_message("hello")]) + await Runner.run(agent, input="hello", hooks=hooks) + # Expect one on_agent_start, one on_llm_start, one on_llm_end, and one on_agent_end + assert hooks.events == { + "on_agent_start": 1, + "on_llm_start": 1, + "on_llm_end": 1, + "on_agent_end": 1, + } + + +# test_sync_run_hook_with_llm() +def test_sync_run_hook_with_llm(): + hooks = RunHooksForTests() + model = FakeModel() + agent = Agent(name="A", model=model, tools=[get_function_tool("f", "res")], handoffs=[]) + # Simulate a single LLM call producing an output: + model.set_next_output([get_text_message("hello")]) + Runner.run_sync(agent, input="hello", hooks=hooks) + # Expect one on_agent_start, one on_llm_start, one on_llm_end, and one on_agent_end + assert hooks.events == { + "on_agent_start": 1, + "on_llm_start": 1, + "on_llm_end": 1, + "on_agent_end": 1, + } + + +# test_streamed_run_hooks_with_llm(): +@pytest.mark.asyncio +async def test_streamed_run_hooks_with_llm(): + hooks = RunHooksForTests() + model = FakeModel() + agent = Agent(name="A", model=model, tools=[get_function_tool("f", "res")], handoffs=[]) + # Simulate a single LLM call producing an output: + model.set_next_output([get_text_message("hello")]) + stream = Runner.run_streamed(agent, input="hello", hooks=hooks) + + async for event in stream.stream_events(): + if event.type == "raw_response_event": + continue + if event.type == "agent_updated_stream_event": + print(f"[EVENT] agent_updated → {event.new_agent.name}") + elif event.type == "run_item_stream_event": + item = event.item + if item.type == "tool_call_item": + print("[EVENT] tool_call_item") + elif item.type == "tool_call_output_item": + print(f"[EVENT] tool_call_output_item → {item.output}") + elif item.type == "message_output_item": + text = ItemHelpers.text_message_output(item) + print(f"[EVENT] message_output_item → {text}") + + # Expect one on_agent_start, one on_llm_start, one on_llm_end, and one on_agent_end + assert hooks.events == { + "on_agent_start": 1, + "on_llm_start": 1, + "on_llm_end": 1, + "on_agent_end": 1, + } + + +# test_async_run_hooks_with_agent_hooks_with_llm +@pytest.mark.asyncio +async def test_async_run_hooks_with_agent_hooks_with_llm(): + hooks = RunHooksForTests() + agent_hooks = AgentHooksForTests() + model = FakeModel() + + agent = Agent( + name="A", model=model, tools=[get_function_tool("f", "res")], handoffs=[], hooks=agent_hooks + ) + # Simulate a single LLM call producing an output: + model.set_next_output([get_text_message("hello")]) + await Runner.run(agent, input="hello", hooks=hooks) + # Expect one on_agent_start, one on_llm_start, one on_llm_end, and one on_agent_end + assert hooks.events == { + "on_agent_start": 1, + "on_llm_start": 1, + "on_llm_end": 1, + "on_agent_end": 1, + } + # Expect one on_start, one on_llm_start, one on_llm_end, and one on_end + assert agent_hooks.events == {"on_start": 1, "on_llm_start": 1, "on_llm_end": 1, "on_end": 1} + + +@pytest.mark.asyncio +async def test_run_hooks_llm_error_non_streaming(monkeypatch): + hooks = RunHooksForTests() + model = FakeModel() + agent = Agent(name="A", model=model, tools=[get_function_tool("f", "res")], handoffs=[]) + + async def boom(*args, **kwargs): + raise RuntimeError("boom") + + monkeypatch.setattr(FakeModel, "get_response", boom, raising=True) + + with pytest.raises(RuntimeError, match="boom"): + await Runner.run(agent, input="hello", hooks=hooks) + + # Current behavior is that hooks will not fire on LLM failure + assert hooks.events["on_agent_start"] == 1 + assert hooks.events["on_llm_start"] == 1 + assert hooks.events["on_llm_end"] == 0 + assert hooks.events["on_agent_end"] == 0 + + +class DummyAgentHooks(AgentHooks): + """Agent-scoped hooks used to verify runtime validation.""" + + +@pytest.mark.asyncio +async def test_runner_run_rejects_agent_hooks(): + model = FakeModel() + agent = Agent(name="A", model=model) + hooks = cast(RunHooks, DummyAgentHooks()) + + with pytest.raises(TypeError, match="Run hooks must be instances of RunHooks"): + await Runner.run(agent, input="hello", hooks=hooks) + + +def test_runner_run_streamed_rejects_agent_hooks(): + model = FakeModel() + agent = Agent(name="A", model=model) + hooks = cast(RunHooks, DummyAgentHooks()) + + with pytest.raises(TypeError, match="Run hooks must be instances of RunHooks"): + Runner.run_streamed(agent, input="hello", hooks=hooks) + + +class BoomModel(Model): + async def get_response(self, *a, **k): + raise AssertionError("get_response should not be called in streaming test") + + async def stream_response(self, *a, **k): + yield {"foo": "bar"} + raise RuntimeError("stream blew up") + + +@pytest.mark.asyncio +async def test_streamed_run_hooks_llm_error(monkeypatch): + """ + Verify that when the streaming path raises, we still emit on_llm_start + but do NOT emit on_llm_end (current behavior), and the exception propagates. + """ + hooks = RunHooksForTests() + agent = Agent(name="A", model=BoomModel(), tools=[get_function_tool("f", "res")], handoffs=[]) + + stream = Runner.run_streamed(agent, input="hello", hooks=hooks) + + # Consuming the stream should surface the exception + with pytest.raises(RuntimeError, match="stream blew up"): + async for _ in stream.stream_events(): + pass + + # Current behavior: success-only on_llm_end; ensure starts fired but ends did not. + assert hooks.events["on_agent_start"] == 1 + assert hooks.events["on_llm_start"] == 1 + assert hooks.events["on_llm_end"] == 0 + assert hooks.events["on_agent_end"] == 0 diff --git a/tests/test_session.py b/tests/test_session.py index 032f2bb38..40c0dc779 100644 --- a/tests/test_session.py +++ b/tests/test_session.py @@ -6,7 +6,7 @@ import pytest -from agents import Agent, Runner, SQLiteSession, TResponseInputItem +from agents import Agent, RunConfig, Runner, SQLiteSession, TResponseInputItem from agents.exceptions import UserError from .fake_model import FakeModel @@ -394,7 +394,143 @@ async def test_session_memory_rejects_both_session_and_list_input(runner_method) await run_agent_async(runner_method, agent, list_input, session=session) # Verify the error message explains the issue - assert "Cannot provide both a session and a list of input items" in str(exc_info.value) - assert "manually manage conversation history" in str(exc_info.value) + assert "list inputs require a `RunConfig.session_input_callback" in str(exc_info.value) + assert "to manage the history manually" in str(exc_info.value) session.close() + + +@pytest.mark.parametrize("runner_method", ["run", "run_sync", "run_streamed"]) +@pytest.mark.asyncio +async def test_session_callback_prepared_input(runner_method): + """Test if the user passes a list of items and want to append them.""" + with tempfile.TemporaryDirectory() as temp_dir: + db_path = Path(temp_dir) / "test_memory.db" + + model = FakeModel() + agent = Agent(name="test", model=model) + + # Session + session_id = "session_1" + session = SQLiteSession(session_id, db_path) + + # Add first messages manually + initial_history: list[TResponseInputItem] = [ + {"role": "user", "content": "Hello there."}, + {"role": "assistant", "content": "Hi, I'm here to assist you."}, + ] + await session.add_items(initial_history) + + def filter_assistant_messages(history, new_input): + # Only include user messages from history + return [item for item in history if item["role"] == "user"] + new_input + + new_turn_input = [{"role": "user", "content": "What your name?"}] + model.set_next_output([get_text_message("I'm gpt-4o")]) + + # Run the agent with the callable + await run_agent_async( + runner_method, + agent, + new_turn_input, + session=session, + run_config=RunConfig(session_input_callback=filter_assistant_messages), + ) + + expected_model_input = [ + initial_history[0], # From history + new_turn_input[0], # New input + ] + + assert len(model.last_turn_args["input"]) == 2 + assert model.last_turn_args["input"] == expected_model_input + + +@pytest.mark.asyncio +async def test_sqlite_session_unicode_content(): + """Test that session correctly stores and retrieves unicode/non-ASCII content.""" + with tempfile.TemporaryDirectory() as temp_dir: + db_path = Path(temp_dir) / "test_unicode.db" + session_id = "unicode_test" + session = SQLiteSession(session_id, db_path) + + # Add unicode content to the session + items: list[TResponseInputItem] = [ + {"role": "user", "content": "こんにちは"}, + {"role": "assistant", "content": "😊👍"}, + {"role": "user", "content": "Привет"}, + ] + await session.add_items(items) + + # Retrieve items and verify unicode content + retrieved = await session.get_items() + assert retrieved[0].get("content") == "こんにちは" + assert retrieved[1].get("content") == "😊👍" + assert retrieved[2].get("content") == "Привет" + session.close() + + +@pytest.mark.asyncio +async def test_sqlite_session_special_characters_and_sql_injection(): + """ + Test that session safely stores and retrieves items with special characters and SQL keywords. + """ + with tempfile.TemporaryDirectory() as temp_dir: + db_path = Path(temp_dir) / "test_special_chars.db" + session_id = "special_chars_test" + session = SQLiteSession(session_id, db_path) + + # Add items with special characters and SQL keywords + items: list[TResponseInputItem] = [ + {"role": "user", "content": "O'Reilly"}, + {"role": "assistant", "content": "DROP TABLE sessions;"}, + {"role": "user", "content": ('"SELECT * FROM users WHERE name = "admin";"')}, + {"role": "assistant", "content": "Robert'); DROP TABLE students;--"}, + {"role": "user", "content": "Normal message"}, + ] + await session.add_items(items) + + # Retrieve all items and verify they are stored correctly + retrieved = await session.get_items() + assert len(retrieved) == len(items) + assert retrieved[0].get("content") == "O'Reilly" + assert retrieved[1].get("content") == "DROP TABLE sessions;" + assert retrieved[2].get("content") == '"SELECT * FROM users WHERE name = "admin";"' + assert retrieved[3].get("content") == "Robert'); DROP TABLE students;--" + assert retrieved[4].get("content") == "Normal message" + session.close() + + +@pytest.mark.asyncio +async def test_sqlite_session_concurrent_access(): + """ + Test concurrent access to the same session to verify data integrity. + """ + import concurrent.futures + + with tempfile.TemporaryDirectory() as temp_dir: + db_path = Path(temp_dir) / "test_concurrent.db" + session_id = "concurrent_test" + session = SQLiteSession(session_id, db_path) + + # Add initial item + items: list[TResponseInputItem] = [ + {"role": "user", "content": f"Message {i}"} for i in range(10) + ] + + # Use ThreadPoolExecutor to simulate concurrent writes + def add_item(item): + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) + loop.run_until_complete(session.add_items([item])) + loop.close() + + with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor: + executor.map(add_item, items) + + # Retrieve all items and verify all are present + retrieved = await session.get_items() + contents = {item.get("content") for item in retrieved} + expected = {f"Message {i}" for i in range(10)} + assert contents == expected + session.close() diff --git a/tests/test_session_exceptions.py b/tests/test_session_exceptions.py index a454cca92..da9390236 100644 --- a/tests/test_session_exceptions.py +++ b/tests/test_session_exceptions.py @@ -90,6 +90,8 @@ def fake_agent(): """Create a fake agent for testing.""" agent = Mock() agent.get_all_tools = AsyncMock(return_value=[]) + agent.get_system_prompt = AsyncMock(return_value="test instructions") + agent.handoffs = [] return agent diff --git a/tests/test_soft_cancel.py b/tests/test_soft_cancel.py new file mode 100644 index 000000000..395f2fb6f --- /dev/null +++ b/tests/test_soft_cancel.py @@ -0,0 +1,478 @@ +"""Tests for soft cancel (after_turn mode) functionality.""" + +import json + +import pytest + +from agents import Agent, Runner, SQLiteSession + +from .fake_model import FakeModel +from .test_responses import get_function_tool, get_function_tool_call, get_text_message + + +@pytest.mark.asyncio +async def test_soft_cancel_completes_turn(): + """Verify soft cancel waits for turn to complete.""" + model = FakeModel() + agent = Agent(name="Assistant", model=model) + + result = Runner.run_streamed(agent, input="Hello") + + # Cancel immediately after first event + event_count = 0 + async for _ in result.stream_events(): + event_count += 1 + if event_count == 1: + result.cancel(mode="after_turn") + + # Should get more than 1 event (turn completes) + assert event_count > 1, "Soft cancel should allow turn to complete" + assert result.is_complete + + +@pytest.mark.asyncio +async def test_soft_cancel_vs_immediate(): + """Compare soft cancel vs immediate cancel behavior.""" + # Immediate cancel + model1 = FakeModel() + agent1 = Agent(name="A1", model=model1) + result1 = Runner.run_streamed(agent1, input="Hello") + immediate_events = [] + async for event in result1.stream_events(): + immediate_events.append(event) + if len(immediate_events) == 1: + result1.cancel(mode="immediate") + + # Soft cancel + model2 = FakeModel() + agent2 = Agent(name="A2", model=model2) + result2 = Runner.run_streamed(agent2, input="Hello") + soft_events = [] + async for event in result2.stream_events(): + soft_events.append(event) + if len(soft_events) == 1: + result2.cancel(mode="after_turn") + + # Soft cancel should get more events + assert len(soft_events) > len(immediate_events), ( + f"Soft cancel should get more events: soft={len(soft_events)}, immediate={len(immediate_events)}" # noqa: E501 + ) + + +@pytest.mark.asyncio +async def test_soft_cancel_with_tool_calls(): + """Verify tool calls execute before soft cancel stops.""" + model = FakeModel() + agent = Agent( + name="Assistant", + model=model, + tools=[get_function_tool("calc", "42")], + ) + + model.add_multiple_turn_outputs( + [ + [ + get_text_message("Let me calculate"), + get_function_tool_call("calc", json.dumps({})), + ], + [get_text_message("Result is 42")], + ] + ) + + result = Runner.run_streamed(agent, input="Calculate") + + tool_call_seen = False + tool_output_seen = False + async for event in result.stream_events(): + if event.type == "run_item_stream_event": + if event.name == "tool_called": + tool_call_seen = True + # Cancel right after seeing tool call + result.cancel(mode="after_turn") + elif event.name == "tool_output": + tool_output_seen = True + + assert tool_call_seen, "Tool call should be seen" + assert tool_output_seen, "Tool output should be seen (tool should execute before soft cancel)" + + +@pytest.mark.asyncio +async def test_soft_cancel_saves_session(): + """Verify session is saved properly with soft cancel.""" + model = FakeModel() + agent = Agent(name="Assistant", model=model) + + session = SQLiteSession("test_soft_cancel_session") + await session.clear_session() # Start fresh + + result = Runner.run_streamed(agent, input="Hello", session=session) + + async for event in result.stream_events(): + if event.type == "run_item_stream_event": + result.cancel(mode="after_turn") + + # Check session has the turn + items = await session.get_items() + assert len(items) > 0, "Session should have saved items from completed turn" + + # Verify we can resume + result2 = await Runner.run(agent, "Continue", session=session) + assert result2.final_output is not None + + # Cleanup + await session.clear_session() + + +@pytest.mark.asyncio +async def test_soft_cancel_tracks_usage(): + """Verify usage is tracked for completed turn.""" + model = FakeModel() + agent = Agent(name="Assistant", model=model) + + result = Runner.run_streamed(agent, input="Hello") + + async for event in result.stream_events(): + if event.type == "raw_response_event": + result.cancel(mode="after_turn") + + # Usage should be tracked (FakeModel tracks requests even if tokens are 0) + assert result.context_wrapper.usage.requests > 0 + + +@pytest.mark.asyncio +async def test_soft_cancel_stops_next_turn(): + """Verify soft cancel prevents next turn from starting.""" + model = FakeModel() + agent = Agent( + name="Assistant", + model=model, + tools=[get_function_tool("tool1", "result1")], + ) + + # Set up multi-turn scenario + model.add_multiple_turn_outputs( + [ + [get_function_tool_call("tool1", "{}")], + [get_text_message("Turn 2")], + [get_text_message("Turn 3")], + ] + ) + + result = Runner.run_streamed(agent, input="Hello") + + turns_completed = 0 + async for event in result.stream_events(): + if event.type == "run_item_stream_event" and event.name == "tool_output": + turns_completed += 1 + if turns_completed == 1: + result.cancel(mode="after_turn") + + assert turns_completed == 1, "Should complete exactly 1 turn" + + +@pytest.mark.asyncio +async def test_cancel_mode_backward_compatibility(): + """Verify default behavior unchanged.""" + model = FakeModel() + agent = Agent(name="Assistant", model=model) + + result = Runner.run_streamed(agent, input="Hello") + + events = [] + async for event in result.stream_events(): + events.append(event) + if len(events) == 1: + result.cancel() # No mode argument + + # Should behave like immediate cancel + assert len(events) == 1 + assert result.is_complete + assert result._event_queue.empty() + assert result._cancel_mode == "immediate", "Should default to immediate mode" + + +@pytest.mark.asyncio +async def test_soft_cancel_idempotent(): + """Verify calling cancel multiple times is safe.""" + model = FakeModel() + agent = Agent(name="Assistant", model=model) + + result = Runner.run_streamed(agent, input="Hello") + + called_twice = False + async for _ in result.stream_events(): + if not called_twice: + result.cancel(mode="after_turn") + result.cancel(mode="after_turn") # Second call + called_twice = True + + # Should not raise or cause issues + assert result.is_complete + + +@pytest.mark.asyncio +async def test_soft_cancel_before_streaming(): + """Verify soft cancel before streaming starts.""" + model = FakeModel() + agent = Agent(name="Assistant", model=model) + + result = Runner.run_streamed(agent, input="Hello") + result.cancel(mode="after_turn") + + events = [e async for e in result.stream_events()] + + # Should stop quickly (may get agent_updated event before stopping) + assert len(events) <= 1, "Should get at most 1 event (agent_updated)" + assert result.is_complete + + +@pytest.mark.asyncio +async def test_soft_cancel_mixed_modes(): + """Verify changing cancel mode behaves correctly.""" + model = FakeModel() + agent = Agent(name="Assistant", model=model) + + result = Runner.run_streamed(agent, input="Hello") + + # First call soft, then immediate + result.cancel(mode="after_turn") + result.cancel(mode="immediate") # Override to immediate + + _ = [e async for e in result.stream_events()] + + # Immediate should take precedence + assert result._cancel_mode == "immediate" + # Queues should be empty (immediate cancel behavior) + assert result._event_queue.empty() + + +@pytest.mark.asyncio +async def test_soft_cancel_explicit_immediate_mode(): + """Test explicit immediate mode behaves same as default.""" + model = FakeModel() + agent = Agent(name="Assistant", model=model) + + result = Runner.run_streamed(agent, input="Hello") + + events = [] + async for event in result.stream_events(): + events.append(event) + if len(events) == 1: + result.cancel(mode="immediate") + break + + assert result.is_complete + assert result._event_queue.empty() + assert result._cancel_mode == "immediate" + assert len(events) == 1 + + +@pytest.mark.asyncio +async def test_soft_cancel_with_multiple_tool_calls(): + """Verify soft cancel works with multiple tool calls in one turn.""" + model = FakeModel() + agent = Agent( + name="Assistant", + model=model, + tools=[ + get_function_tool("tool1", "result1"), + get_function_tool("tool2", "result2"), + ], + ) + + # Turn with multiple tool calls + model.add_multiple_turn_outputs( + [ + [ + get_function_tool_call("tool1", "{}"), + get_function_tool_call("tool2", "{}"), + ], + [get_text_message("Both tools executed")], + ] + ) + + result = Runner.run_streamed(agent, input="Execute tools") + + tool_outputs_seen = 0 + async for event in result.stream_events(): + if event.type == "run_item_stream_event": + if event.name == "tool_called": + # Cancel after seeing first tool call + if tool_outputs_seen == 0: + result.cancel(mode="after_turn") + elif event.name == "tool_output": + tool_outputs_seen += 1 + + # Both tools should execute + assert tool_outputs_seen == 2, "Both tools should execute before soft cancel" + + +@pytest.mark.asyncio +async def test_soft_cancel_preserves_state(): + """Verify soft cancel preserves all result state correctly.""" + model = FakeModel() + agent = Agent( + name="Assistant", + model=model, + tools=[get_function_tool("tool1", "result")], + ) + + model.add_multiple_turn_outputs( + [ + [get_function_tool_call("tool1", "{}")], + [get_text_message("Done")], + ] + ) + + result = Runner.run_streamed(agent, input="Hello") + + async for event in result.stream_events(): + if event.type == "run_item_stream_event" and event.name == "tool_output": + result.cancel(mode="after_turn") + + # Verify state is preserved + assert result.is_complete + assert len(result.new_items) > 0, "Should have items from completed turn" + assert len(result.raw_responses) > 0, "Should have raw responses" + assert result.context_wrapper.usage.requests > 0, "Should have usage data (requests tracked)" + + +@pytest.mark.asyncio +async def test_immediate_cancel_clears_queues(): + """Verify immediate cancel clears queues as expected.""" + model = FakeModel() + agent = Agent(name="Assistant", model=model) + + result = Runner.run_streamed(agent, input="Hello") + + async for _ in result.stream_events(): + result.cancel(mode="immediate") + break + + # Verify queues are cleared + assert result._event_queue.empty(), "Event queue should be empty after immediate cancel" + assert result._input_guardrail_queue.empty(), ( + "Input guardrail queue should be empty after immediate cancel" + ) + + +@pytest.mark.asyncio +async def test_soft_cancel_does_not_clear_queues_immediately(): + """Verify soft cancel does NOT clear queues immediately.""" + model = FakeModel() + agent = Agent(name="Assistant", model=model) + + result = Runner.run_streamed(agent, input="Hello") + + # Just call cancel, don't consume events yet + result.cancel(mode="after_turn") + + # The cancel mode should be set + assert result._cancel_mode == "after_turn" + + # Now consume events + events = [e async for e in result.stream_events()] + + # Should have received events (queue was not cleared immediately) + assert len(events) >= 0 # Events may or may not be present depending on timing + + +@pytest.mark.asyncio +async def test_soft_cancel_with_handoff(): + """Verify soft cancel after handoff saves the handoff turn.""" + from agents import Handoff + + model = FakeModel() + + # Create two agents with handoff + agent2 = Agent(name="Agent2", model=model) + + async def on_invoke_handoff(context, data): + return agent2 + + agent1 = Agent( + name="Agent1", + model=model, + handoffs=[ + Handoff( + tool_name=Handoff.default_tool_name(agent2), + tool_description=Handoff.default_tool_description(agent2), + input_json_schema={}, + on_invoke_handoff=on_invoke_handoff, + agent_name=agent2.name, + ) + ], + ) + + # Setup: Agent1 does handoff, Agent2 responds + model.add_multiple_turn_outputs( + [ + # Agent1's turn - triggers handoff + [get_function_tool_call(Handoff.default_tool_name(agent2), "{}")], + # Agent2's turn after handoff + [get_text_message("Agent2 response")], + ] + ) + + session = SQLiteSession("test_soft_cancel_handoff") + await session.clear_session() + + result = Runner.run_streamed(agent1, input="Hello", session=session) + + handoff_seen = False + async for event in result.stream_events(): + if event.type == "run_item_stream_event" and event.name == "handoff_occured": + handoff_seen = True + # Cancel right after handoff + result.cancel(mode="after_turn") + + assert handoff_seen, "Handoff should have occurred" + + # Verify session has items from the handoff turn + items = await session.get_items() + assert len(items) > 0, "Session should have saved the handoff turn" + + # Cleanup + await session.clear_session() + + +@pytest.mark.asyncio +async def test_soft_cancel_with_session_and_multiple_turns(): + """Verify soft cancel with session across multiple turns.""" + model = FakeModel() + agent = Agent( + name="Assistant", + model=model, + tools=[get_function_tool("tool1", "result1")], + ) + + session = SQLiteSession("test_soft_cancel_multi") + await session.clear_session() + + # Setup 3 turns + model.add_multiple_turn_outputs( + [ + [get_function_tool_call("tool1", "{}")], + [get_function_tool_call("tool1", "{}")], + [get_text_message("Final")], + ] + ) + + result = Runner.run_streamed(agent, input="Hello", session=session) + + turns_seen = 0 + async for event in result.stream_events(): + if event.type == "run_item_stream_event" and event.name == "tool_output": + turns_seen += 1 + if turns_seen == 2: + result.cancel(mode="after_turn") + + # Should have completed 2 turns + assert turns_seen == 2 + + # Check session has both turns + items = await session.get_items() + assert len(items) > 0 + + # Cleanup + await session.clear_session() diff --git a/tests/test_stream_events.py b/tests/test_stream_events.py new file mode 100644 index 000000000..a2de208b5 --- /dev/null +++ b/tests/test_stream_events.py @@ -0,0 +1,282 @@ +import asyncio +import time + +import pytest +from openai.types.responses import ( + ResponseCompletedEvent, + ResponseContentPartAddedEvent, + ResponseContentPartDoneEvent, + ResponseCreatedEvent, + ResponseFunctionCallArgumentsDeltaEvent, + ResponseFunctionCallArgumentsDoneEvent, + ResponseInProgressEvent, + ResponseOutputItemAddedEvent, + ResponseOutputItemDoneEvent, + ResponseReasoningSummaryPartAddedEvent, + ResponseReasoningSummaryPartDoneEvent, + ResponseReasoningSummaryTextDeltaEvent, + ResponseReasoningSummaryTextDoneEvent, + ResponseTextDeltaEvent, + ResponseTextDoneEvent, +) +from openai.types.responses.response_reasoning_item import ResponseReasoningItem, Summary + +from agents import Agent, HandoffCallItem, Runner, function_tool +from agents.extensions.handoff_filters import remove_all_tools +from agents.handoffs import handoff +from agents.items import MessageOutputItem, ReasoningItem, ToolCallItem, ToolCallOutputItem + +from .fake_model import FakeModel +from .test_responses import get_function_tool_call, get_handoff_tool_call, get_text_message + + +def get_reasoning_item() -> ResponseReasoningItem: + return ResponseReasoningItem( + id="rid", type="reasoning", summary=[Summary(text="thinking", type="summary_text")] + ) + + +@function_tool +async def foo() -> str: + await asyncio.sleep(3) + return "success!" + + +@pytest.mark.asyncio +async def test_stream_events_main(): + model = FakeModel() + agent = Agent( + name="Joker", + model=model, + tools=[foo], + ) + + model.add_multiple_turn_outputs( + [ + # First turn: a message and tool call + [ + get_text_message("a_message"), + get_function_tool_call("foo", ""), + ], + # Second turn: text message + [get_text_message("done")], + ] + ) + + result = Runner.run_streamed( + agent, + input="Hello", + ) + tool_call_start_time = -1 + tool_call_end_time = -1 + async for event in result.stream_events(): + if event.type == "run_item_stream_event": + if event.item.type == "tool_call_item": + tool_call_start_time = time.time_ns() + elif event.item.type == "tool_call_output_item": + tool_call_end_time = time.time_ns() + + assert tool_call_start_time > 0, "tool_call_item was not observed" + assert tool_call_end_time > 0, "tool_call_output_item was not observed" + assert tool_call_start_time < tool_call_end_time, "Tool call ended before or equals it started?" + + +@pytest.mark.asyncio +async def test_stream_events_main_with_handoff(): + @function_tool + async def foo(args: str) -> str: + return f"foo_result_{args}" + + english_agent = Agent( + name="EnglishAgent", + instructions="You only speak English.", + model=FakeModel(), + ) + + model = FakeModel() + model.add_multiple_turn_outputs( + [ + [ + get_text_message("Hello"), + get_function_tool_call("foo", '{"args": "arg1"}'), + get_handoff_tool_call(english_agent), + ], + [get_text_message("Done")], + ] + ) + + triage_agent = Agent( + name="TriageAgent", + instructions="Handoff to the appropriate agent based on the language of the request.", + handoffs=[ + handoff(english_agent, input_filter=remove_all_tools), + ], + tools=[foo], + model=model, + ) + + result = Runner.run_streamed( + triage_agent, + input="Start", + ) + + handoff_requested_seen = False + agent_switched_to_english = False + + async for event in result.stream_events(): + if event.type == "run_item_stream_event": + if isinstance(event.item, HandoffCallItem): + handoff_requested_seen = True + elif event.type == "agent_updated_stream_event": + if hasattr(event, "new_agent") and event.new_agent.name == "EnglishAgent": + agent_switched_to_english = True + + assert handoff_requested_seen, "handoff_requested event not observed" + assert agent_switched_to_english, "Agent did not switch to EnglishAgent" + + +@pytest.mark.asyncio +async def test_complete_streaming_events(): + """Verify all streaming event types are emitted in correct order. + + Tests the complete event sequence including: + - Reasoning items with summary events + - Function call with arguments delta/done events + - Message output with content_part and text delta/done events + """ + model = FakeModel() + agent = Agent( + name="TestAgent", + model=model, + tools=[foo], + ) + + model.add_multiple_turn_outputs( + [ + [ + get_reasoning_item(), + get_function_tool_call("foo", '{"arg": "value"}'), + ], + [get_text_message("Final response")], + ] + ) + + result = Runner.run_streamed(agent, input="Hello") + + events = [] + async for event in result.stream_events(): + events.append(event) + + assert len(events) == 27, f"Expected 27 events but got {len(events)}" + + # Event 0: agent_updated_stream_event + assert events[0].type == "agent_updated_stream_event" + assert events[0].new_agent.name == "TestAgent" + + # Event 1: ResponseCreatedEvent (first turn started) + assert events[1].type == "raw_response_event" + assert isinstance(events[1].data, ResponseCreatedEvent) + + # Event 2: ResponseInProgressEvent + assert events[2].type == "raw_response_event" + assert isinstance(events[2].data, ResponseInProgressEvent) + + # Event 3: ResponseOutputItemAddedEvent (reasoning item) + assert events[3].type == "raw_response_event" + assert isinstance(events[3].data, ResponseOutputItemAddedEvent) + + # Event 4: ResponseReasoningSummaryPartAddedEvent + assert events[4].type == "raw_response_event" + assert isinstance(events[4].data, ResponseReasoningSummaryPartAddedEvent) + + # Event 5: ResponseReasoningSummaryTextDeltaEvent + assert events[5].type == "raw_response_event" + assert isinstance(events[5].data, ResponseReasoningSummaryTextDeltaEvent) + + # Event 6: ResponseReasoningSummaryTextDoneEvent + assert events[6].type == "raw_response_event" + assert isinstance(events[6].data, ResponseReasoningSummaryTextDoneEvent) + + # Event 7: ResponseReasoningSummaryPartDoneEvent + assert events[7].type == "raw_response_event" + assert isinstance(events[7].data, ResponseReasoningSummaryPartDoneEvent) + + # Event 8: ResponseOutputItemDoneEvent (reasoning item) + assert events[8].type == "raw_response_event" + assert isinstance(events[8].data, ResponseOutputItemDoneEvent) + + # Event 9: ReasoningItem run_item_stream_event + assert events[9].type == "run_item_stream_event" + assert events[9].name == "reasoning_item_created" + assert isinstance(events[9].item, ReasoningItem) + + # Event 10: ResponseOutputItemAddedEvent (function call) + assert events[10].type == "raw_response_event" + assert isinstance(events[10].data, ResponseOutputItemAddedEvent) + + # Event 11: ResponseFunctionCallArgumentsDeltaEvent + assert events[11].type == "raw_response_event" + assert isinstance(events[11].data, ResponseFunctionCallArgumentsDeltaEvent) + + # Event 12: ResponseFunctionCallArgumentsDoneEvent + assert events[12].type == "raw_response_event" + assert isinstance(events[12].data, ResponseFunctionCallArgumentsDoneEvent) + + # Event 13: ResponseOutputItemDoneEvent (function call) + assert events[13].type == "raw_response_event" + assert isinstance(events[13].data, ResponseOutputItemDoneEvent) + + # Event 14: ToolCallItem run_item_stream_event + assert events[14].type == "run_item_stream_event" + assert events[14].name == "tool_called" + assert isinstance(events[14].item, ToolCallItem) + + # Event 15: ResponseCompletedEvent (first turn ended) + assert events[15].type == "raw_response_event" + assert isinstance(events[15].data, ResponseCompletedEvent) + + # Event 16: ToolCallOutputItem run_item_stream_event + assert events[16].type == "run_item_stream_event" + assert events[16].name == "tool_output" + assert isinstance(events[16].item, ToolCallOutputItem) + + # Event 17: ResponseCreatedEvent (second turn started) + assert events[17].type == "raw_response_event" + assert isinstance(events[17].data, ResponseCreatedEvent) + + # Event 18: ResponseInProgressEvent + assert events[18].type == "raw_response_event" + assert isinstance(events[18].data, ResponseInProgressEvent) + + # Event 19: ResponseOutputItemAddedEvent + assert events[19].type == "raw_response_event" + assert isinstance(events[19].data, ResponseOutputItemAddedEvent) + + # Event 20: ResponseContentPartAddedEvent + assert events[20].type == "raw_response_event" + assert isinstance(events[20].data, ResponseContentPartAddedEvent) + + # Event 21: ResponseTextDeltaEvent + assert events[21].type == "raw_response_event" + assert isinstance(events[21].data, ResponseTextDeltaEvent) + + # Event 22: ResponseTextDoneEvent + assert events[22].type == "raw_response_event" + assert isinstance(events[22].data, ResponseTextDoneEvent) + + # Event 23: ResponseContentPartDoneEvent + assert events[23].type == "raw_response_event" + assert isinstance(events[23].data, ResponseContentPartDoneEvent) + + # Event 24: ResponseOutputItemDoneEvent + assert events[24].type == "raw_response_event" + assert isinstance(events[24].data, ResponseOutputItemDoneEvent) + + # Event 25: ResponseCompletedEvent (second turn ended) + assert events[25].type == "raw_response_event" + assert isinstance(events[25].data, ResponseCompletedEvent) + + # Event 26: MessageOutputItem run_item_stream_event + assert events[26].type == "run_item_stream_event" + assert events[26].name == "message_output_created" + assert isinstance(events[26].item, MessageOutputItem) diff --git a/tests/test_stream_input_guardrail_timing.py b/tests/test_stream_input_guardrail_timing.py new file mode 100644 index 000000000..3de8897aa --- /dev/null +++ b/tests/test_stream_input_guardrail_timing.py @@ -0,0 +1,230 @@ +from __future__ import annotations + +import asyncio +from datetime import datetime +from typing import Any + +import pytest +from openai.types.responses import ResponseCompletedEvent + +from agents import Agent, GuardrailFunctionOutput, InputGuardrail, RunContextWrapper, Runner +from agents.exceptions import InputGuardrailTripwireTriggered +from agents.items import TResponseInputItem +from tests.fake_model import FakeModel +from tests.test_responses import get_text_message +from tests.testing_processor import fetch_events, fetch_ordered_spans + + +def make_input_guardrail(delay_seconds: float, *, trip: bool) -> InputGuardrail[Any]: + async def guardrail( + ctx: RunContextWrapper[Any], agent: Agent[Any], input: str | list[TResponseInputItem] + ) -> GuardrailFunctionOutput: + # Simulate variable guardrail completion timing. + if delay_seconds > 0: + await asyncio.sleep(delay_seconds) + return GuardrailFunctionOutput( + output_info={"delay": delay_seconds}, tripwire_triggered=trip + ) + + name = "tripping_input_guardrail" if trip else "delayed_input_guardrail" + return InputGuardrail(guardrail_function=guardrail, name=name) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("guardrail_delay", [0.0, 0.2]) +async def test_run_streamed_input_guardrail_timing_is_consistent(guardrail_delay: float): + """Ensure streaming behavior matches when input guardrail finishes before and after LLM stream. + + We verify that: + - The sequence of streamed event types is identical. + - Final output matches. + - Exactly one input guardrail result is recorded and does not trigger. + """ + + # Arrange: Agent with a single text output and a delayed input guardrail + model = FakeModel() + model.set_next_output([get_text_message("Final response")]) + + agent = Agent( + name="TimingAgent", + model=model, + input_guardrails=[make_input_guardrail(guardrail_delay, trip=False)], + ) + + # Act: Run streamed and collect event types + result = Runner.run_streamed(agent, input="Hello") + event_types: list[str] = [] + + async for event in result.stream_events(): + event_types.append(event.type) + + # Assert: Guardrail results populated and identical behavioral outcome + assert len(result.input_guardrail_results) == 1, "Expected exactly one input guardrail result" + assert result.input_guardrail_results[0].guardrail.get_name() == "delayed_input_guardrail", ( + "Guardrail name mismatch" + ) + assert result.input_guardrail_results[0].output.tripwire_triggered is False, ( + "Guardrail should not trigger in this test" + ) + + # Final output should be the text from the model's single message + assert result.final_output == "Final response" + + # Minimal invariants on event sequence to ensure stability across timing + # Must start with agent update and include raw response events + assert len(event_types) >= 3, f"Unexpectedly few events: {event_types}" + assert event_types[0] == "agent_updated_stream_event" + # Ensure we observed raw response events in the stream irrespective of guardrail timing + assert any(t == "raw_response_event" for t in event_types) + + +@pytest.mark.asyncio +async def test_run_streamed_input_guardrail_sequences_match_between_fast_and_slow(): + """Run twice with fast vs slow input guardrail and compare event sequences exactly.""" + + async def run_once(delay: float) -> list[str]: + model = FakeModel() + model.set_next_output([get_text_message("Final response")]) + agent = Agent( + name="TimingAgent", + model=model, + input_guardrails=[make_input_guardrail(delay, trip=False)], + ) + result = Runner.run_streamed(agent, input="Hello") + events: list[str] = [] + async for ev in result.stream_events(): + events.append(ev.type) + return events + + events_fast = await run_once(0.0) + events_slow = await run_once(0.2) + + assert events_fast == events_slow, ( + f"Event sequences differ between guardrail timings:\nfast={events_fast}\nslow={events_slow}" + ) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("guardrail_delay", [0.0, 0.2]) +async def test_run_streamed_input_guardrail_tripwire_raises(guardrail_delay: float): + """Guardrail tripwire must raise from stream_events regardless of timing.""" + + model = FakeModel() + model.set_next_output([get_text_message("Final response")]) + + agent = Agent( + name="TimingAgentTrip", + model=model, + input_guardrails=[make_input_guardrail(guardrail_delay, trip=True)], + ) + + result = Runner.run_streamed(agent, input="Hello") + + with pytest.raises(InputGuardrailTripwireTriggered) as excinfo: + async for _ in result.stream_events(): + pass + + # Exception contains the guardrail result and run data + exc = excinfo.value + assert exc.guardrail_result.output.tripwire_triggered is True + assert exc.run_data is not None + assert len(exc.run_data.input_guardrail_results) == 1 + assert ( + exc.run_data.input_guardrail_results[0].guardrail.get_name() == "tripping_input_guardrail" + ) + + +class SlowCompleteFakeModel(FakeModel): + """A FakeModel that delays just before emitting ResponseCompletedEvent in streaming.""" + + def __init__(self, delay_seconds: float, tracing_enabled: bool = True): + super().__init__(tracing_enabled=tracing_enabled) + self._delay_seconds = delay_seconds + + async def stream_response(self, *args, **kwargs): + async for ev in super().stream_response(*args, **kwargs): + if isinstance(ev, ResponseCompletedEvent) and self._delay_seconds > 0: + await asyncio.sleep(self._delay_seconds) + yield ev + + +def _get_span_by_type(spans, span_type: str): + for s in spans: + exported = s.export() + if not exported: + continue + if exported.get("span_data", {}).get("type") == span_type: + return s + return None + + +def _iso(s: str | None) -> datetime: + assert s is not None + return datetime.fromisoformat(s) + + +@pytest.mark.asyncio +async def test_parent_span_and_trace_finish_after_slow_input_guardrail(): + """Agent span and trace finish after guardrail when guardrail completes last.""" + + model = FakeModel(tracing_enabled=True) + model.set_next_output([get_text_message("Final response")]) + agent = Agent( + name="TimingAgentTrace", + model=model, + input_guardrails=[make_input_guardrail(0.2, trip=False)], # guardrail slower than model + ) + + result = Runner.run_streamed(agent, input="Hello") + async for _ in result.stream_events(): + pass + + spans = fetch_ordered_spans() + agent_span = _get_span_by_type(spans, "agent") + guardrail_span = _get_span_by_type(spans, "guardrail") + generation_span = _get_span_by_type(spans, "generation") + + assert agent_span and guardrail_span and generation_span, ( + "Expected agent, guardrail, generation spans" + ) + + # Agent span must finish last + assert _iso(agent_span.ended_at) >= _iso(guardrail_span.ended_at) + assert _iso(agent_span.ended_at) >= _iso(generation_span.ended_at) + + # Trace should end after all spans end + events = fetch_events() + assert events[-1] == "trace_end" + + +@pytest.mark.asyncio +async def test_parent_span_and_trace_finish_after_slow_model(): + """Agent span and trace finish after model when model completes last.""" + + model = SlowCompleteFakeModel(delay_seconds=0.2, tracing_enabled=True) + model.set_next_output([get_text_message("Final response")]) + agent = Agent( + name="TimingAgentTrace", + model=model, + input_guardrails=[make_input_guardrail(0.0, trip=False)], # guardrail faster than model + ) + + result = Runner.run_streamed(agent, input="Hello") + async for _ in result.stream_events(): + pass + + spans = fetch_ordered_spans() + agent_span = _get_span_by_type(spans, "agent") + guardrail_span = _get_span_by_type(spans, "guardrail") + generation_span = _get_span_by_type(spans, "generation") + + assert agent_span and guardrail_span and generation_span, ( + "Expected agent, guardrail, generation spans" + ) + + # Agent span must finish last + assert _iso(agent_span.ended_at) >= _iso(guardrail_span.ended_at) + assert _iso(agent_span.ended_at) >= _iso(generation_span.ended_at) + + events = fetch_events() + assert events[-1] == "trace_end" diff --git a/tests/test_streaming_tool_call_arguments.py b/tests/test_streaming_tool_call_arguments.py new file mode 100644 index 000000000..ce476e59b --- /dev/null +++ b/tests/test_streaming_tool_call_arguments.py @@ -0,0 +1,373 @@ +""" +Tests to ensure that tool call arguments are properly populated in streaming events. + +This test specifically guards against the regression where tool_called events +were emitted with empty arguments during streaming (Issue #1629). +""" + +import json +from collections.abc import AsyncIterator +from typing import Any, Optional, Union, cast + +import pytest +from openai.types.responses import ( + ResponseCompletedEvent, + ResponseFunctionToolCall, + ResponseOutputItemAddedEvent, + ResponseOutputItemDoneEvent, +) + +from agents import Agent, Runner, function_tool +from agents.agent_output import AgentOutputSchemaBase +from agents.handoffs import Handoff +from agents.items import TResponseInputItem, TResponseOutputItem, TResponseStreamEvent +from agents.model_settings import ModelSettings +from agents.models.interface import Model, ModelTracing +from agents.stream_events import RunItemStreamEvent +from agents.tool import Tool +from agents.tracing import generation_span + +from .fake_model import get_response_obj +from .test_responses import get_function_tool_call + + +class StreamingFakeModel(Model): + """A fake model that actually emits streaming events to test our streaming fix.""" + + def __init__(self): + self.turn_outputs: list[list[TResponseOutputItem]] = [] + self.last_turn_args: dict[str, Any] = {} + + def set_next_output(self, output: list[TResponseOutputItem]): + self.turn_outputs.append(output) + + def get_next_output(self) -> list[TResponseOutputItem]: + if not self.turn_outputs: + return [] + return self.turn_outputs.pop(0) + + async def get_response( + self, + system_instructions: Optional[str], + input: Union[str, list[TResponseInputItem]], + model_settings: ModelSettings, + tools: list[Tool], + output_schema: Optional[AgentOutputSchemaBase], + handoffs: list[Handoff], + tracing: ModelTracing, + *, + previous_response_id: Optional[str], + conversation_id: Optional[str], + prompt: Optional[Any], + ): + raise NotImplementedError("Use stream_response instead") + + async def stream_response( + self, + system_instructions: Optional[str], + input: Union[str, list[TResponseInputItem]], + model_settings: ModelSettings, + tools: list[Tool], + output_schema: Optional[AgentOutputSchemaBase], + handoffs: list[Handoff], + tracing: ModelTracing, + *, + previous_response_id: Optional[str] = None, + conversation_id: Optional[str] = None, + prompt: Optional[Any] = None, + ) -> AsyncIterator[TResponseStreamEvent]: + """Stream events that simulate real OpenAI streaming behavior for tool calls.""" + self.last_turn_args = { + "system_instructions": system_instructions, + "input": input, + "model_settings": model_settings, + "tools": tools, + "output_schema": output_schema, + "previous_response_id": previous_response_id, + "conversation_id": conversation_id, + } + + with generation_span(disabled=True) as _: + output = self.get_next_output() + + sequence_number = 0 + + # Emit each output item with proper streaming events + for item in output: + if isinstance(item, ResponseFunctionToolCall): + # First: emit ResponseOutputItemAddedEvent with EMPTY arguments + # (this simulates the real streaming behavior that was causing the bug) + empty_args_item = ResponseFunctionToolCall( + id=item.id, + call_id=item.call_id, + type=item.type, + name=item.name, + arguments="", # EMPTY - this is the bug condition! + ) + + yield ResponseOutputItemAddedEvent( + item=empty_args_item, + output_index=0, + type="response.output_item.added", + sequence_number=sequence_number, + ) + sequence_number += 1 + + # Then: emit ResponseOutputItemDoneEvent with COMPLETE arguments + yield ResponseOutputItemDoneEvent( + item=item, # This has the complete arguments + output_index=0, + type="response.output_item.done", + sequence_number=sequence_number, + ) + sequence_number += 1 + + # Finally: emit completion + yield ResponseCompletedEvent( + type="response.completed", + response=get_response_obj(output), + sequence_number=sequence_number, + ) + + +@function_tool +def calculate_sum(a: int, b: int) -> str: + """Add two numbers together.""" + return str(a + b) + + +@function_tool +def format_message(name: str, message: str, urgent: bool = False) -> str: + """Format a message with name and urgency.""" + prefix = "URGENT: " if urgent else "" + return f"{prefix}Hello {name}, {message}" + + +@pytest.mark.asyncio +async def test_streaming_tool_call_arguments_not_empty(): + """Test that tool_called events contain non-empty arguments during streaming.""" + model = StreamingFakeModel() + agent = Agent( + name="TestAgent", + model=model, + tools=[calculate_sum], + ) + + # Set up a tool call with arguments + expected_arguments = '{"a": 5, "b": 3}' + model.set_next_output( + [ + get_function_tool_call("calculate_sum", expected_arguments, "call_123"), + ] + ) + + result = Runner.run_streamed(agent, input="Add 5 and 3") + + tool_called_events = [] + async for event in result.stream_events(): + if ( + event.type == "run_item_stream_event" + and isinstance(event, RunItemStreamEvent) + and event.name == "tool_called" + ): + tool_called_events.append(event) + + # Verify we got exactly one tool_called event + assert len(tool_called_events) == 1, ( + f"Expected 1 tool_called event, got {len(tool_called_events)}" + ) + + tool_event = tool_called_events[0] + + # Verify the event has the expected structure + assert hasattr(tool_event.item, "raw_item"), "tool_called event should have raw_item" + assert hasattr(tool_event.item.raw_item, "arguments"), "raw_item should have arguments field" + + # The critical test: arguments should NOT be empty + # Cast to ResponseFunctionToolCall since we know that's what it is in our test + raw_item = cast(ResponseFunctionToolCall, tool_event.item.raw_item) + actual_arguments = raw_item.arguments + assert actual_arguments != "", ( + f"Tool call arguments should not be empty, got: '{actual_arguments}'" + ) + assert actual_arguments is not None, "Tool call arguments should not be None" + + # Verify arguments contain the expected data + assert actual_arguments == expected_arguments, ( + f"Expected arguments '{expected_arguments}', got '{actual_arguments}'" + ) + + # Verify arguments are valid JSON that can be parsed + try: + parsed_args = json.loads(actual_arguments) + assert parsed_args == {"a": 5, "b": 3}, ( + f"Parsed arguments should match expected values, got {parsed_args}" + ) + except json.JSONDecodeError as e: + pytest.fail( + f"Tool call arguments should be valid JSON, but got: '{actual_arguments}' with error: {e}" # noqa: E501 + ) + + +@pytest.mark.asyncio +async def test_streaming_tool_call_arguments_complex(): + """Test streaming tool calls with complex arguments including strings and booleans.""" + model = StreamingFakeModel() + agent = Agent( + name="TestAgent", + model=model, + tools=[format_message], + ) + + # Set up a tool call with complex arguments + expected_arguments = ( + '{"name": "Alice", "message": "Your meeting is starting soon", "urgent": true}' + ) + model.set_next_output( + [ + get_function_tool_call("format_message", expected_arguments, "call_456"), + ] + ) + + result = Runner.run_streamed(agent, input="Format a message for Alice") + + tool_called_events = [] + async for event in result.stream_events(): + if ( + event.type == "run_item_stream_event" + and isinstance(event, RunItemStreamEvent) + and event.name == "tool_called" + ): + tool_called_events.append(event) + + assert len(tool_called_events) == 1, ( + f"Expected 1 tool_called event, got {len(tool_called_events)}" + ) + + tool_event = tool_called_events[0] + # Cast to ResponseFunctionToolCall since we know that's what it is in our test + raw_item = cast(ResponseFunctionToolCall, tool_event.item.raw_item) + actual_arguments = raw_item.arguments + + # Critical checks for the regression + assert actual_arguments != "", "Tool call arguments should not be empty" + assert actual_arguments is not None, "Tool call arguments should not be None" + assert actual_arguments == expected_arguments, ( + f"Expected '{expected_arguments}', got '{actual_arguments}'" + ) + + # Verify the complex arguments parse correctly + parsed_args = json.loads(actual_arguments) + expected_parsed = {"name": "Alice", "message": "Your meeting is starting soon", "urgent": True} + assert parsed_args == expected_parsed, f"Parsed arguments should match, got {parsed_args}" + + +@pytest.mark.asyncio +async def test_streaming_multiple_tool_calls_arguments(): + """Test that multiple tool calls in streaming all have proper arguments.""" + model = StreamingFakeModel() + agent = Agent( + name="TestAgent", + model=model, + tools=[calculate_sum, format_message], + ) + + # Set up multiple tool calls + model.set_next_output( + [ + get_function_tool_call("calculate_sum", '{"a": 10, "b": 20}', "call_1"), + get_function_tool_call( + "format_message", '{"name": "Bob", "message": "Test"}', "call_2" + ), + ] + ) + + result = Runner.run_streamed(agent, input="Do some calculations") + + tool_called_events = [] + async for event in result.stream_events(): + if ( + event.type == "run_item_stream_event" + and isinstance(event, RunItemStreamEvent) + and event.name == "tool_called" + ): + tool_called_events.append(event) + + # Should have exactly 2 tool_called events + assert len(tool_called_events) == 2, ( + f"Expected 2 tool_called events, got {len(tool_called_events)}" + ) + + # Check first tool call + event1 = tool_called_events[0] + # Cast to ResponseFunctionToolCall since we know that's what it is in our test + raw_item1 = cast(ResponseFunctionToolCall, event1.item.raw_item) + args1 = raw_item1.arguments + assert args1 != "", "First tool call arguments should not be empty" + expected_args1 = '{"a": 10, "b": 20}' + assert args1 == expected_args1, ( + f"First tool call args: expected '{expected_args1}', got '{args1}'" + ) + + # Check second tool call + event2 = tool_called_events[1] + # Cast to ResponseFunctionToolCall since we know that's what it is in our test + raw_item2 = cast(ResponseFunctionToolCall, event2.item.raw_item) + args2 = raw_item2.arguments + assert args2 != "", "Second tool call arguments should not be empty" + expected_args2 = '{"name": "Bob", "message": "Test"}' + assert args2 == expected_args2, ( + f"Second tool call args: expected '{expected_args2}', got '{args2}'" + ) + + +@pytest.mark.asyncio +async def test_streaming_tool_call_with_empty_arguments(): + """Test that tool calls with legitimately empty arguments still work correctly.""" + model = StreamingFakeModel() + + @function_tool + def get_current_time() -> str: + """Get the current time (no arguments needed).""" + return "2024-01-15 10:30:00" + + agent = Agent( + name="TestAgent", + model=model, + tools=[get_current_time], + ) + + # Tool call with empty arguments (legitimate case) + model.set_next_output( + [ + get_function_tool_call("get_current_time", "{}", "call_time"), + ] + ) + + result = Runner.run_streamed(agent, input="What time is it?") + + tool_called_events = [] + async for event in result.stream_events(): + if ( + event.type == "run_item_stream_event" + and isinstance(event, RunItemStreamEvent) + and event.name == "tool_called" + ): + tool_called_events.append(event) + + assert len(tool_called_events) == 1, ( + f"Expected 1 tool_called event, got {len(tool_called_events)}" + ) + + tool_event = tool_called_events[0] + # Cast to ResponseFunctionToolCall since we know that's what it is in our test + raw_item = cast(ResponseFunctionToolCall, tool_event.item.raw_item) + actual_arguments = raw_item.arguments + + # Even "empty" arguments should be "{}", not literally empty string + assert actual_arguments is not None, "Arguments should not be None" + assert actual_arguments == "{}", f"Expected empty JSON object '{{}}', got '{actual_arguments}'" + + # Should parse as valid empty JSON + parsed_args = json.loads(actual_arguments) + assert parsed_args == {}, f"Should parse to empty dict, got {parsed_args}" diff --git a/tests/test_strict_schema_oneof.py b/tests/test_strict_schema_oneof.py new file mode 100644 index 000000000..7e289e70f --- /dev/null +++ b/tests/test_strict_schema_oneof.py @@ -0,0 +1,264 @@ +from typing import Annotated, Literal, Union + +from pydantic import BaseModel, Field + +from agents.agent_output import AgentOutputSchema +from agents.strict_schema import ensure_strict_json_schema + + +def test_oneof_converted_to_anyof(): + schema = { + "type": "object", + "properties": {"value": {"oneOf": [{"type": "string"}, {"type": "integer"}]}}, + } + + result = ensure_strict_json_schema(schema) + + expected = { + "type": "object", + "properties": {"value": {"anyOf": [{"type": "string"}, {"type": "integer"}]}}, + "additionalProperties": False, + "required": ["value"], + } + assert result == expected + + +def test_nested_oneof_in_array_items(): + schema = { + "type": "object", + "properties": { + "steps": { + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "action": {"type": "string", "const": "buy_fruit"}, + "color": {"type": "string"}, + }, + "required": ["action", "color"], + }, + { + "type": "object", + "properties": { + "action": {"type": "string", "const": "buy_food"}, + "price": {"type": "integer"}, + }, + "required": ["action", "price"], + }, + ], + "discriminator": { + "propertyName": "action", + "mapping": { + "buy_fruit": "#/components/schemas/BuyFruitStep", + "buy_food": "#/components/schemas/BuyFoodStep", + }, + }, + }, + } + }, + } + + result = ensure_strict_json_schema(schema) + + expected = { + "type": "object", + "properties": { + "steps": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "properties": { + "action": {"type": "string", "const": "buy_fruit"}, + "color": {"type": "string"}, + }, + "required": ["action", "color"], + "additionalProperties": False, + }, + { + "type": "object", + "properties": { + "action": {"type": "string", "const": "buy_food"}, + "price": {"type": "integer"}, + }, + "required": ["action", "price"], + "additionalProperties": False, + }, + ], + "discriminator": { + "propertyName": "action", + "mapping": { + "buy_fruit": "#/components/schemas/BuyFruitStep", + "buy_food": "#/components/schemas/BuyFoodStep", + }, + }, + }, + } + }, + "additionalProperties": False, + "required": ["steps"], + } + assert result == expected + + +def test_discriminated_union_with_pydantic(): + class FruitArgs(BaseModel): + color: str + + class FoodArgs(BaseModel): + price: int + + class BuyFruitStep(BaseModel): + action: Literal["buy_fruit"] + args: FruitArgs + + class BuyFoodStep(BaseModel): + action: Literal["buy_food"] + args: FoodArgs + + Step = Annotated[Union[BuyFruitStep, BuyFoodStep], Field(discriminator="action")] + + class Actions(BaseModel): + steps: list[Step] + + output_schema = AgentOutputSchema(Actions) + schema = output_schema.json_schema() + + items_schema = schema["properties"]["steps"]["items"] + assert "oneOf" not in items_schema + assert "anyOf" in items_schema + assert len(items_schema["anyOf"]) == 2 + assert "discriminator" in items_schema + + +def test_oneof_merged_with_existing_anyof(): + schema = { + "type": "object", + "anyOf": [{"type": "string"}], + "oneOf": [{"type": "integer"}, {"type": "boolean"}], + } + + result = ensure_strict_json_schema(schema) + + expected = { + "type": "object", + "anyOf": [{"type": "string"}, {"type": "integer"}, {"type": "boolean"}], + "additionalProperties": False, + } + assert result == expected + + +def test_discriminator_preserved(): + schema = { + "oneOf": [{"$ref": "#/$defs/TypeA"}, {"$ref": "#/$defs/TypeB"}], + "discriminator": { + "propertyName": "type", + "mapping": {"a": "#/$defs/TypeA", "b": "#/$defs/TypeB"}, + }, + "$defs": { + "TypeA": { + "type": "object", + "properties": {"type": {"const": "a"}, "value_a": {"type": "string"}}, + }, + "TypeB": { + "type": "object", + "properties": {"type": {"const": "b"}, "value_b": {"type": "integer"}}, + }, + }, + } + + result = ensure_strict_json_schema(schema) + + expected = { + "anyOf": [{"$ref": "#/$defs/TypeA"}, {"$ref": "#/$defs/TypeB"}], + "discriminator": { + "propertyName": "type", + "mapping": {"a": "#/$defs/TypeA", "b": "#/$defs/TypeB"}, + }, + "$defs": { + "TypeA": { + "type": "object", + "properties": {"type": {"const": "a"}, "value_a": {"type": "string"}}, + "additionalProperties": False, + "required": ["type", "value_a"], + }, + "TypeB": { + "type": "object", + "properties": {"type": {"const": "b"}, "value_b": {"type": "integer"}}, + "additionalProperties": False, + "required": ["type", "value_b"], + }, + }, + } + assert result == expected + + +def test_deeply_nested_oneof(): + schema = { + "type": "object", + "properties": { + "level1": { + "type": "object", + "properties": { + "level2": { + "type": "array", + "items": {"oneOf": [{"type": "string"}, {"type": "number"}]}, + } + }, + } + }, + } + + result = ensure_strict_json_schema(schema) + + expected = { + "type": "object", + "properties": { + "level1": { + "type": "object", + "properties": { + "level2": { + "type": "array", + "items": {"anyOf": [{"type": "string"}, {"type": "number"}]}, + } + }, + "additionalProperties": False, + "required": ["level2"], + } + }, + "additionalProperties": False, + "required": ["level1"], + } + assert result == expected + + +def test_oneof_with_refs(): + schema = { + "type": "object", + "properties": { + "value": {"oneOf": [{"$ref": "#/$defs/StringType"}, {"$ref": "#/$defs/IntType"}]} + }, + "$defs": { + "StringType": {"type": "string"}, + "IntType": {"type": "integer"}, + }, + } + + result = ensure_strict_json_schema(schema) + + expected = { + "type": "object", + "properties": { + "value": {"anyOf": [{"$ref": "#/$defs/StringType"}, {"$ref": "#/$defs/IntType"}]} + }, + "$defs": { + "StringType": {"type": "string"}, + "IntType": {"type": "integer"}, + }, + "additionalProperties": False, + "required": ["value"], + } + assert result == expected diff --git a/tests/test_tool_guardrails.py b/tests/test_tool_guardrails.py new file mode 100644 index 000000000..8ccaec0ad --- /dev/null +++ b/tests/test_tool_guardrails.py @@ -0,0 +1,533 @@ +from __future__ import annotations + +import asyncio +from typing import Any + +import pytest + +from agents import ( + Agent, + ToolGuardrailFunctionOutput, + ToolInputGuardrail, + ToolInputGuardrailData, + ToolInputGuardrailTripwireTriggered, + ToolOutputGuardrail, + ToolOutputGuardrailData, + ToolOutputGuardrailTripwireTriggered, + UserError, +) +from agents.tool_context import ToolContext +from agents.tool_guardrails import tool_input_guardrail, tool_output_guardrail + + +def get_mock_tool_context(tool_arguments: str = '{"param": "value"}') -> ToolContext: + """Helper to create a mock tool context for testing.""" + return ToolContext( + context=None, + tool_name="test_tool", + tool_call_id="call_123", + tool_arguments=tool_arguments, + ) + + +def get_sync_input_guardrail(triggers: bool, output_info: Any | None = None): + """Helper to create a sync input guardrail function.""" + + def sync_guardrail(data: ToolInputGuardrailData) -> ToolGuardrailFunctionOutput: + if triggers: + return ToolGuardrailFunctionOutput.raise_exception(output_info=output_info) + else: + return ToolGuardrailFunctionOutput.allow(output_info=output_info) + + return sync_guardrail + + +def get_async_input_guardrail(triggers: bool, output_info: Any | None = None): + """Helper to create an async input guardrail function.""" + + async def async_guardrail(data: ToolInputGuardrailData) -> ToolGuardrailFunctionOutput: + if triggers: + return ToolGuardrailFunctionOutput.raise_exception(output_info=output_info) + else: + return ToolGuardrailFunctionOutput.allow(output_info=output_info) + + return async_guardrail + + +def get_sync_output_guardrail(triggers: bool, output_info: Any | None = None): + """Helper to create a sync output guardrail function.""" + + def sync_guardrail(data: ToolOutputGuardrailData) -> ToolGuardrailFunctionOutput: + if triggers: + return ToolGuardrailFunctionOutput.raise_exception(output_info=output_info) + else: + return ToolGuardrailFunctionOutput.allow(output_info=output_info) + + return sync_guardrail + + +def get_async_output_guardrail(triggers: bool, output_info: Any | None = None): + """Helper to create an async output guardrail function.""" + + async def async_guardrail(data: ToolOutputGuardrailData) -> ToolGuardrailFunctionOutput: + if triggers: + return ToolGuardrailFunctionOutput.raise_exception(output_info=output_info) + else: + return ToolGuardrailFunctionOutput.allow(output_info=output_info) + + return async_guardrail + + +@pytest.mark.asyncio +async def test_sync_tool_input_guardrail(): + """Test sync tool input guardrail execution.""" + # Test non-triggering guardrail + guardrail: ToolInputGuardrail[Any] = ToolInputGuardrail( + guardrail_function=get_sync_input_guardrail(triggers=False) + ) + data = ToolInputGuardrailData( + context=get_mock_tool_context(), + agent=Agent(name="test"), + ) + result = await guardrail.run(data) + assert result.behavior["type"] == "allow" + assert result.output_info is None + + # Test triggering guardrail + guardrail_2: ToolInputGuardrail[Any] = ToolInputGuardrail( + guardrail_function=get_sync_input_guardrail(triggers=True) + ) + result = await guardrail_2.run(data) + assert result.behavior["type"] == "raise_exception" + assert result.output_info is None + + # Test triggering guardrail with output info + guardrail_3: ToolInputGuardrail[Any] = ToolInputGuardrail( + guardrail_function=get_sync_input_guardrail(triggers=True, output_info="test_info") + ) + result = await guardrail_3.run(data) + assert result.behavior["type"] == "raise_exception" + assert result.output_info == "test_info" + + +@pytest.mark.asyncio +async def test_async_tool_input_guardrail(): + """Test async tool input guardrail execution.""" + # Test non-triggering guardrail + guardrail: ToolInputGuardrail[Any] = ToolInputGuardrail( + guardrail_function=get_async_input_guardrail(triggers=False) + ) + data = ToolInputGuardrailData( + context=get_mock_tool_context(), + agent=Agent(name="test"), + ) + result = await guardrail.run(data) + assert result.behavior["type"] == "allow" + assert result.output_info is None + + # Test triggering guardrail + guardrail_2: ToolInputGuardrail[Any] = ToolInputGuardrail( + guardrail_function=get_async_input_guardrail(triggers=True) + ) + result = await guardrail_2.run(data) + assert result.behavior["type"] == "raise_exception" + assert result.output_info is None + + # Test triggering guardrail with output info + guardrail_3: ToolInputGuardrail[Any] = ToolInputGuardrail( + guardrail_function=get_async_input_guardrail(triggers=True, output_info="test_info") + ) + result = await guardrail_3.run(data) + assert result.behavior["type"] == "raise_exception" + assert result.output_info == "test_info" + + +@pytest.mark.asyncio +async def test_sync_tool_output_guardrail(): + """Test sync tool output guardrail execution.""" + # Test non-triggering guardrail + guardrail: ToolOutputGuardrail[Any] = ToolOutputGuardrail( + guardrail_function=get_sync_output_guardrail(triggers=False) + ) + data = ToolOutputGuardrailData( + context=get_mock_tool_context(), + agent=Agent(name="test"), + output="test output", + ) + result = await guardrail.run(data) + assert result.behavior["type"] == "allow" + assert result.output_info is None + + # Test triggering guardrail + guardrail_2: ToolOutputGuardrail[Any] = ToolOutputGuardrail( + guardrail_function=get_sync_output_guardrail(triggers=True) + ) + result = await guardrail_2.run(data) + assert result.behavior["type"] == "raise_exception" + assert result.output_info is None + + # Test triggering guardrail with output info + guardrail_3: ToolOutputGuardrail[Any] = ToolOutputGuardrail( + guardrail_function=get_sync_output_guardrail(triggers=True, output_info="test_info") + ) + result = await guardrail_3.run(data) + assert result.behavior["type"] == "raise_exception" + assert result.output_info == "test_info" + + +@pytest.mark.asyncio +async def test_async_tool_output_guardrail(): + """Test async tool output guardrail execution.""" + # Test non-triggering guardrail + guardrail: ToolOutputGuardrail[Any] = ToolOutputGuardrail( + guardrail_function=get_async_output_guardrail(triggers=False) + ) + data = ToolOutputGuardrailData( + context=get_mock_tool_context(), + agent=Agent(name="test"), + output="test output", + ) + result = await guardrail.run(data) + assert result.behavior["type"] == "allow" + assert result.output_info is None + + # Test triggering guardrail + guardrail_2: ToolOutputGuardrail[Any] = ToolOutputGuardrail( + guardrail_function=get_async_output_guardrail(triggers=True) + ) + result = await guardrail_2.run(data) + assert result.behavior["type"] == "raise_exception" + assert result.output_info is None + + # Test triggering guardrail with output info + guardrail_3: ToolOutputGuardrail[Any] = ToolOutputGuardrail( + guardrail_function=get_async_output_guardrail(triggers=True, output_info="test_info") + ) + result = await guardrail_3.run(data) + assert result.behavior["type"] == "raise_exception" + assert result.output_info == "test_info" + + +@pytest.mark.asyncio +async def test_invalid_tool_input_guardrail_raises_user_error(): + """Test that invalid guardrail functions raise UserError.""" + with pytest.raises(UserError): + # Purposely ignoring type error + guardrail: ToolInputGuardrail[Any] = ToolInputGuardrail(guardrail_function="foo") # type: ignore + data = ToolInputGuardrailData( + context=get_mock_tool_context(), + agent=Agent(name="test"), + ) + await guardrail.run(data) + + +@pytest.mark.asyncio +async def test_invalid_tool_output_guardrail_raises_user_error(): + """Test that invalid guardrail functions raise UserError.""" + with pytest.raises(UserError): + # Purposely ignoring type error + guardrail: ToolOutputGuardrail[Any] = ToolOutputGuardrail(guardrail_function="foo") # type: ignore + data = ToolOutputGuardrailData( + context=get_mock_tool_context(), + agent=Agent(name="test"), + output="test output", + ) + await guardrail.run(data) + + +# Test decorators + + +@tool_input_guardrail +def decorated_input_guardrail(data: ToolInputGuardrailData) -> ToolGuardrailFunctionOutput: + return ToolGuardrailFunctionOutput.allow(output_info="test_1") + + +@tool_input_guardrail(name="Custom input name") +def decorated_named_input_guardrail(data: ToolInputGuardrailData) -> ToolGuardrailFunctionOutput: + return ToolGuardrailFunctionOutput.allow(output_info="test_2") + + +@pytest.mark.asyncio +async def test_tool_input_guardrail_decorators(): + """Test input guardrail decorators.""" + data = ToolInputGuardrailData( + context=get_mock_tool_context(), + agent=Agent(name="test"), + ) + + # Test basic decorator + guardrail = decorated_input_guardrail + result = await guardrail.run(data) + assert result.behavior["type"] == "allow" + assert result.output_info == "test_1" + + # Test named decorator + guardrail = decorated_named_input_guardrail + result = await guardrail.run(data) + assert result.behavior["type"] == "allow" + assert result.output_info == "test_2" + assert guardrail.get_name() == "Custom input name" + + +@tool_output_guardrail +def decorated_output_guardrail(data: ToolOutputGuardrailData) -> ToolGuardrailFunctionOutput: + return ToolGuardrailFunctionOutput.allow(output_info="test_3") + + +@tool_output_guardrail(name="Custom output name") +def decorated_named_output_guardrail(data: ToolOutputGuardrailData) -> ToolGuardrailFunctionOutput: + return ToolGuardrailFunctionOutput.allow(output_info="test_4") + + +@pytest.mark.asyncio +async def test_tool_output_guardrail_decorators(): + """Test output guardrail decorators.""" + data = ToolOutputGuardrailData( + context=get_mock_tool_context(), + agent=Agent(name="test"), + output="test output", + ) + + # Test basic decorator + guardrail = decorated_output_guardrail + result = await guardrail.run(data) + assert result.behavior["type"] == "allow" + assert result.output_info == "test_3" + + # Test named decorator + guardrail = decorated_named_output_guardrail + result = await guardrail.run(data) + assert result.behavior["type"] == "allow" + assert result.output_info == "test_4" + assert guardrail.get_name() == "Custom output name" + + +# Test practical examples + + +@pytest.mark.asyncio +async def test_password_blocking_input_guardrail(): + """Test a realistic input guardrail that blocks passwords.""" + + @tool_input_guardrail + def check_for_password(data: ToolInputGuardrailData) -> ToolGuardrailFunctionOutput: + if "password" in data.context.tool_arguments.lower(): + return ToolGuardrailFunctionOutput.reject_content( + message="Tool call blocked: contains password", + output_info={"blocked_word": "password"}, + ) + return ToolGuardrailFunctionOutput(output_info="safe_input") + + # Test with password - should trigger + data = ToolInputGuardrailData( + context=get_mock_tool_context('{"message": "Hello password world"}'), + agent=Agent(name="test"), + ) + result = await check_for_password.run(data) + assert result.behavior["type"] == "reject_content" + assert result.behavior["message"] == "Tool call blocked: contains password" + assert result.output_info["blocked_word"] == "password" + + # Test without password - should pass + data = ToolInputGuardrailData( + context=get_mock_tool_context('{"message": "Hello safe world"}'), + agent=Agent(name="test"), + ) + result = await check_for_password.run(data) + assert result.behavior["type"] == "allow" + assert result.output_info == "safe_input" + + +@pytest.mark.asyncio +async def test_ssn_blocking_output_guardrail(): + """Test a realistic output guardrail that blocks SSNs.""" + + @tool_output_guardrail + def check_for_ssn(data: ToolOutputGuardrailData) -> ToolGuardrailFunctionOutput: + output_str = str(data.output).lower() + if "ssn" in output_str or "123-45-6789" in output_str: + return ToolGuardrailFunctionOutput.raise_exception( + output_info={"blocked_pattern": "SSN"} + ) + return ToolGuardrailFunctionOutput(output_info="safe_output") + + # Test with SSN in output - should trigger + data = ToolOutputGuardrailData( + context=get_mock_tool_context(), + agent=Agent(name="test"), + output="User SSN is 123-45-6789", + ) + result = await check_for_ssn.run(data) + assert result.behavior["type"] == "raise_exception" + assert result.output_info["blocked_pattern"] == "SSN" + + # Test with safe output - should pass + data = ToolOutputGuardrailData( + context=get_mock_tool_context(), + agent=Agent(name="test"), + output="User name is John Doe", + ) + result = await check_for_ssn.run(data) + assert result.behavior["type"] == "allow" + assert result.output_info == "safe_output" + + +def test_tool_input_guardrail_exception(): + """Test the tool input guardrail tripwire exception.""" + + @tool_input_guardrail + def test_guardrail(data: ToolInputGuardrailData) -> ToolGuardrailFunctionOutput: + return ToolGuardrailFunctionOutput.raise_exception(output_info="test") + + output = ToolGuardrailFunctionOutput.raise_exception(output_info="test") + + exception = ToolInputGuardrailTripwireTriggered( + guardrail=test_guardrail, + output=output, + ) + + assert exception.guardrail == test_guardrail + assert exception.output == output + assert "ToolInputGuardrail" in str(exception) + + +def test_tool_output_guardrail_exception(): + """Test the tool output guardrail tripwire exception.""" + + @tool_output_guardrail + def test_guardrail(data: ToolOutputGuardrailData) -> ToolGuardrailFunctionOutput: + return ToolGuardrailFunctionOutput.raise_exception(output_info="test") + + output = ToolGuardrailFunctionOutput.raise_exception(output_info="test") + + exception = ToolOutputGuardrailTripwireTriggered( + guardrail=test_guardrail, + output=output, + ) + + assert exception.guardrail == test_guardrail + assert exception.output == output + assert "ToolOutputGuardrail" in str(exception) + + +# Test new behavior system + + +@pytest.mark.asyncio +async def test_allow_behavior(): + """Test the allow behavior type.""" + + @tool_input_guardrail + def allow_guardrail(data: ToolInputGuardrailData) -> ToolGuardrailFunctionOutput: + return ToolGuardrailFunctionOutput.allow(output_info="allowed") + + data = ToolInputGuardrailData( + context=get_mock_tool_context(), + agent=Agent(name="test"), + ) + result = await allow_guardrail.run(data) + assert result.behavior["type"] == "allow" + assert result.output_info == "allowed" + + +@pytest.mark.asyncio +async def test_reject_content_behavior(): + """Test the reject_content behavior type.""" + + @tool_input_guardrail + def reject_content_guardrail(data: ToolInputGuardrailData) -> ToolGuardrailFunctionOutput: + return ToolGuardrailFunctionOutput.reject_content( + message="Tool blocked by guardrail", output_info="rejected" + ) + + data = ToolInputGuardrailData( + context=get_mock_tool_context(), + agent=Agent(name="test"), + ) + result = await reject_content_guardrail.run(data) + assert result.behavior["type"] == "reject_content" + assert result.behavior["message"] == "Tool blocked by guardrail" + assert result.output_info == "rejected" + + +@pytest.mark.asyncio +async def test_raise_exception_behavior(): + """Test the raise_exception behavior type.""" + + @tool_input_guardrail + def raise_exception_guardrail(data: ToolInputGuardrailData) -> ToolGuardrailFunctionOutput: + return ToolGuardrailFunctionOutput.raise_exception(output_info="exception") + + data = ToolInputGuardrailData( + context=get_mock_tool_context(), + agent=Agent(name="test"), + ) + result = await raise_exception_guardrail.run(data) + assert result.behavior["type"] == "raise_exception" + assert result.output_info == "exception" + + +@pytest.mark.asyncio +async def test_mixed_behavior_output_guardrail(): + """Test mixing different behavior types in output guardrails.""" + + @tool_output_guardrail + def mixed_guardrail(data: ToolOutputGuardrailData) -> ToolGuardrailFunctionOutput: + output_str = str(data.output).lower() + if "dangerous" in output_str: + return ToolGuardrailFunctionOutput.raise_exception( + output_info={"reason": "dangerous_content"} + ) + elif "sensitive" in output_str: + return ToolGuardrailFunctionOutput.reject_content( + message="Content was filtered", output_info={"reason": "sensitive_content"} + ) + else: + return ToolGuardrailFunctionOutput(output_info={"status": "clean"}) + + # Test dangerous content (should raise exception) + data_dangerous = ToolOutputGuardrailData( + context=get_mock_tool_context(), + agent=Agent(name="test"), + output="This is dangerous content", + ) + result = await mixed_guardrail.run(data_dangerous) + assert result.behavior["type"] == "raise_exception" + assert result.output_info["reason"] == "dangerous_content" + + # Test sensitive content (should reject content) + data_sensitive = ToolOutputGuardrailData( + context=get_mock_tool_context(), + agent=Agent(name="test"), + output="This is sensitive data", + ) + result = await mixed_guardrail.run(data_sensitive) + assert result.behavior["type"] == "reject_content" + assert result.behavior["message"] == "Content was filtered" + assert result.output_info["reason"] == "sensitive_content" + + # Test clean content (should allow) + data_clean = ToolOutputGuardrailData( + context=get_mock_tool_context(), + agent=Agent(name="test"), + output="This is clean content", + ) + result = await mixed_guardrail.run(data_clean) + assert result.behavior["type"] == "allow" + assert result.output_info["status"] == "clean" + + +if __name__ == "__main__": + # Run a simple test to verify functionality + async def main(): + print("Testing tool guardrails...") + + @tool_input_guardrail + def test_guard(data: ToolInputGuardrailData) -> ToolGuardrailFunctionOutput: + return ToolGuardrailFunctionOutput.allow(output_info="test_passed") + + print(f"✅ Created guardrail: {test_guard.get_name()}") + print("✅ All basic tests passed!") + + asyncio.run(main()) diff --git a/tests/test_tool_output_conversion.py b/tests/test_tool_output_conversion.py new file mode 100644 index 000000000..cd3a2a11a --- /dev/null +++ b/tests/test_tool_output_conversion.py @@ -0,0 +1,372 @@ +from __future__ import annotations + +from openai.types.responses.response_function_tool_call import ResponseFunctionToolCall + +from agents import ItemHelpers, ToolOutputFileContent, ToolOutputImage, ToolOutputText + + +def _make_tool_call() -> ResponseFunctionToolCall: + return ResponseFunctionToolCall( + id="call-1", + arguments="{}", + call_id="call-1", + name="dummy", + type="function_call", + ) + + +def test_tool_call_output_item_text_model() -> None: + call = _make_tool_call() + out = ToolOutputText(text="hello") + payload = ItemHelpers.tool_call_output_item(call, out) + + assert payload["type"] == "function_call_output" + assert payload["call_id"] == call.call_id + assert isinstance(payload["output"], list) and len(payload["output"]) == 1 + item = payload["output"][0] + assert item["type"] == "input_text" + assert item["text"] == "hello" + + +def test_tool_call_output_item_image_model() -> None: + call = _make_tool_call() + out = ToolOutputImage(image_url="data:image/png;base64,AAAA") + payload = ItemHelpers.tool_call_output_item(call, out) + + assert payload["type"] == "function_call_output" + assert payload["call_id"] == call.call_id + assert isinstance(payload["output"], list) and len(payload["output"]) == 1 + item = payload["output"][0] + assert isinstance(item, dict) + assert item["type"] == "input_image" + assert item["image_url"] == "data:image/png;base64,AAAA" + + +def test_tool_call_output_item_file_model() -> None: + call = _make_tool_call() + out = ToolOutputFileContent(file_data="ZmFrZS1kYXRh", filename="foo.txt") + payload = ItemHelpers.tool_call_output_item(call, out) + + assert payload["type"] == "function_call_output" + assert payload["call_id"] == call.call_id + assert isinstance(payload["output"], list) and len(payload["output"]) == 1 + item = payload["output"][0] + assert isinstance(item, dict) + assert item["type"] == "input_file" + assert item["file_data"] == "ZmFrZS1kYXRh" + + +def test_tool_call_output_item_mixed_list() -> None: + call = _make_tool_call() + outputs = [ + ToolOutputText(text="a"), + ToolOutputImage(image_url="http://example/img.png"), + ToolOutputFileContent(file_data="ZmlsZS1kYXRh"), + ] + + payload = ItemHelpers.tool_call_output_item(call, outputs) + + assert payload["type"] == "function_call_output" + assert payload["call_id"] == call.call_id + items = payload["output"] + assert isinstance(items, list) and len(items) == 3 + + assert items[0]["type"] == "input_text" and items[0]["text"] == "a" + assert items[1]["type"] == "input_image" and items[1]["image_url"] == "http://example/img.png" + assert items[2]["type"] == "input_file" and items[2]["file_data"] == "ZmlsZS1kYXRh" + + +def test_tool_call_output_item_image_forwards_file_id_and_detail() -> None: + """Ensure image outputs forward provided file_id and detail fields.""" + call = _make_tool_call() + out = ToolOutputImage(file_id="file_123", detail="high") + payload = ItemHelpers.tool_call_output_item(call, out) + + assert payload["type"] == "function_call_output" + assert payload["call_id"] == call.call_id + item = payload["output"][0] + assert isinstance(item, dict) + assert item["type"] == "input_image" + assert item["file_id"] == "file_123" + assert item["detail"] == "high" + + +def test_tool_call_output_item_file_forwards_file_id_and_filename() -> None: + """Ensure file outputs forward provided file_id and filename fields.""" + call = _make_tool_call() + out = ToolOutputFileContent(file_id="file_456", filename="report.pdf") + payload = ItemHelpers.tool_call_output_item(call, out) + + assert payload["type"] == "function_call_output" + assert payload["call_id"] == call.call_id + item = payload["output"][0] + assert isinstance(item, dict) + assert item["type"] == "input_file" + assert item["file_id"] == "file_456" + assert item["filename"] == "report.pdf" + + +def test_tool_call_output_item_file_forwards_file_url() -> None: + """Ensure file outputs forward provided file_url when present.""" + call = _make_tool_call() + out = ToolOutputFileContent(file_url="https://example.com/report.pdf") + payload = ItemHelpers.tool_call_output_item(call, out) + + assert payload["type"] == "function_call_output" + assert payload["call_id"] == call.call_id + item = payload["output"][0] + assert isinstance(item, dict) + assert item["type"] == "input_file" + assert item["file_url"] == "https://example.com/report.pdf" + + +def test_tool_call_output_item_text_dict_variant() -> None: + """Dict with type='text' and text field should be treated as structured output.""" + call = _make_tool_call() + # Dict variant using the pydantic model schema (type="text"). + out = {"type": "text", "text": "hey"} + payload = ItemHelpers.tool_call_output_item(call, out) + + assert payload["type"] == "function_call_output" + assert payload["call_id"] == call.call_id + assert isinstance(payload["output"], list) and len(payload["output"]) == 1 + item = payload["output"][0] + assert isinstance(item, dict) + assert item["type"] == "input_text" + assert item["text"] == "hey" + + +def test_tool_call_output_item_image_dict_variant() -> None: + """Dict with type='image' and image_url field should be treated as structured output.""" + call = _make_tool_call() + out = {"type": "image", "image_url": "http://example.com/img.png", "detail": "auto"} + payload = ItemHelpers.tool_call_output_item(call, out) + + assert payload["type"] == "function_call_output" + assert payload["call_id"] == call.call_id + assert isinstance(payload["output"], list) and len(payload["output"]) == 1 + item = payload["output"][0] + assert isinstance(item, dict) + assert item["type"] == "input_image" + assert item["image_url"] == "http://example.com/img.png" + assert item["detail"] == "auto" + + +def test_tool_call_output_item_image_dict_variant_with_file_id() -> None: + """Dict with type='image' and image_url field should be treated as structured output.""" + call = _make_tool_call() + out = {"type": "image", "file_id": "file_123"} + payload = ItemHelpers.tool_call_output_item(call, out) + + assert payload["type"] == "function_call_output" + assert payload["call_id"] == call.call_id + assert isinstance(payload["output"], list) and len(payload["output"]) == 1 + item = payload["output"][0] + assert isinstance(item, dict) + assert item["type"] == "input_image" + assert item["file_id"] == "file_123" + + +def test_tool_call_output_item_file_dict_variant_with_file_data() -> None: + """Dict with type='file' and file_data field should be treated as structured output.""" + call = _make_tool_call() + out = {"type": "file", "file_data": "foobar", "filename": "report.pdf"} + payload = ItemHelpers.tool_call_output_item(call, out) + + assert payload["type"] == "function_call_output" + assert payload["call_id"] == call.call_id + assert isinstance(payload["output"], list) and len(payload["output"]) == 1 + item = payload["output"][0] + assert isinstance(item, dict) + assert item["type"] == "input_file" + assert item["file_data"] == "foobar" + assert item["filename"] == "report.pdf" + + +def test_tool_call_output_item_file_dict_variant_with_file_url() -> None: + """Dict with type='file' and file_url field should be treated as structured output.""" + call = _make_tool_call() + out = {"type": "file", "file_url": "https://example.com/report.pdf", "filename": "report.pdf"} + payload = ItemHelpers.tool_call_output_item(call, out) + + assert payload["type"] == "function_call_output" + assert payload["call_id"] == call.call_id + assert isinstance(payload["output"], list) and len(payload["output"]) == 1 + item = payload["output"][0] + assert isinstance(item, dict) + assert item["type"] == "input_file" + assert item["file_url"] == "https://example.com/report.pdf" + assert item["filename"] == "report.pdf" + + +def test_tool_call_output_item_file_dict_variant_with_file_id() -> None: + """Dict with type='file' and file_id field should be treated as structured output.""" + call = _make_tool_call() + out = {"type": "file", "file_id": "file_123", "filename": "report.pdf"} + payload = ItemHelpers.tool_call_output_item(call, out) + + assert payload["type"] == "function_call_output" + assert payload["call_id"] == call.call_id + assert isinstance(payload["output"], list) and len(payload["output"]) == 1 + item = payload["output"][0] + assert isinstance(item, dict) + assert item["type"] == "input_file" + assert item["file_id"] == "file_123" + assert item["filename"] == "report.pdf" + + +def test_tool_call_output_item_image_with_extra_fields() -> None: + """Dict with type='image', image_url, and extra fields should still be converted.""" + call = _make_tool_call() + out = {"type": "image", "image_url": "http://example.com/img.png", "foobar": 213} + payload = ItemHelpers.tool_call_output_item(call, out) + + assert payload["type"] == "function_call_output" + assert payload["call_id"] == call.call_id + assert isinstance(payload["output"], list) and len(payload["output"]) == 1 + item = payload["output"][0] + assert isinstance(item, dict) + assert item["type"] == "input_image" + assert item["image_url"] == "http://example.com/img.png" + # Extra field should be ignored by Pydantic + assert "foobar" not in item + + +def test_tool_call_output_item_mixed_list_with_valid_dicts() -> None: + """List with valid dict variants (with type field) should be converted.""" + call = _make_tool_call() + out = [ + {"type": "text", "text": "hello"}, + {"type": "image", "image_url": "http://example.com/img.png"}, + {"type": "file", "file_id": "file_123"}, + ] + payload = ItemHelpers.tool_call_output_item(call, out) + + assert payload["type"] == "function_call_output" + assert payload["call_id"] == call.call_id + assert isinstance(payload["output"], list) and len(payload["output"]) == 3 + + assert payload["output"][0]["type"] == "input_text" + assert payload["output"][0]["text"] == "hello" + assert payload["output"][1]["type"] == "input_image" + assert payload["output"][1]["image_url"] == "http://example.com/img.png" + assert payload["output"][2]["type"] == "input_file" + assert payload["output"][2]["file_id"] == "file_123" + + +def test_tool_call_output_item_text_type_only_not_converted() -> None: + """Dict with only type='text' should NOT be treated as structured output.""" + call = _make_tool_call() + out = {"type": "text"} + payload = ItemHelpers.tool_call_output_item(call, out) + + assert payload["type"] == "function_call_output" + assert payload["call_id"] == call.call_id + # Should be converted to string since it doesn't have required fields + assert isinstance(payload["output"], str) + assert payload["output"] == "{'type': 'text'}" + + +def test_tool_call_output_item_image_type_only_not_converted() -> None: + """Dict with only type='image' should NOT be treated as structured output.""" + call = _make_tool_call() + out = {"type": "image"} + payload = ItemHelpers.tool_call_output_item(call, out) + + assert payload["type"] == "function_call_output" + assert payload["call_id"] == call.call_id + # Should be converted to string since it doesn't have required fields + assert isinstance(payload["output"], str) + assert payload["output"] == "{'type': 'image'}" + + +def test_tool_call_output_item_file_type_only_not_converted() -> None: + """Dict with only type='file' should NOT be treated as structured output.""" + call = _make_tool_call() + out = {"type": "file"} + payload = ItemHelpers.tool_call_output_item(call, out) + + assert payload["type"] == "function_call_output" + assert payload["call_id"] == call.call_id + assert isinstance(payload["output"], str) + assert payload["output"] == "{'type': 'file'}" + + +def test_tool_call_output_item_empty_dict_not_converted() -> None: + """Empty dict should NOT be treated as structured output.""" + call = _make_tool_call() + out: dict[str, str] = {} + payload = ItemHelpers.tool_call_output_item(call, out) + + assert payload["type"] == "function_call_output" + assert payload["call_id"] == call.call_id + assert isinstance(payload["output"], str) + assert payload["output"] == "{}" + + +def test_tool_call_output_item_dict_without_type_not_converted() -> None: + """Dict without 'type' field should NOT be treated as structured output.""" + call = _make_tool_call() + out = {"msg": "1234"} + payload = ItemHelpers.tool_call_output_item(call, out) + + assert payload["type"] == "function_call_output" + assert payload["call_id"] == call.call_id + # Should be converted to string since it lacks 'type' field + assert isinstance(payload["output"], str) + assert payload["output"] == "{'msg': '1234'}" + + +def test_tool_call_output_item_image_dict_variant_with_location_not_converted() -> None: + """Dict with type='image' and location field should NOT be treated as structured output.""" + call = _make_tool_call() + out = {"type": "image", "location": "/path/to/img.png"} + payload = ItemHelpers.tool_call_output_item(call, out) + + assert payload["type"] == "function_call_output" + assert payload["call_id"] == call.call_id + # Should be converted to string since it lacks required fields (image_url or file_id) + assert isinstance(payload["output"], str) + assert payload["output"] == "{'type': 'image', 'location': '/path/to/img.png'}" + + +def test_tool_call_output_item_file_dict_variant_with_path_not_converted() -> None: + """Dict with type='file' and path field should NOT be treated as structured output.""" + call = _make_tool_call() + out = {"type": "file", "path": "/path/to/file.txt"} + payload = ItemHelpers.tool_call_output_item(call, out) + + assert payload["type"] == "function_call_output" + assert payload["call_id"] == call.call_id + # Should be converted to string since it lacks required fields (file_data, file_url, or file_id) + assert isinstance(payload["output"], str) + assert payload["output"] == "{'type': 'file', 'path': '/path/to/file.txt'}" + + +def test_tool_call_output_item_list_without_type_not_converted() -> None: + """List with dicts lacking 'type' field should NOT be treated as structured output.""" + call = _make_tool_call() + out = [{"msg": "foobar"}] + payload = ItemHelpers.tool_call_output_item(call, out) + + assert payload["type"] == "function_call_output" + assert payload["call_id"] == call.call_id + # Should be converted to string since list items lack 'type' field + assert isinstance(payload["output"], str) + assert payload["output"] == "[{'msg': 'foobar'}]" + + +def test_tool_call_output_item_mixed_list_partial_invalid_not_converted() -> None: + """List with mix of valid and invalid dicts should NOT be treated as structured output.""" + call = _make_tool_call() + out = [ + {"type": "text", "text": "hello"}, # Valid + {"msg": "foobar"}, # Invalid + ] + payload = ItemHelpers.tool_call_output_item(call, out) + + assert payload["type"] == "function_call_output" + assert payload["call_id"] == call.call_id + # All-or-nothing: if any item is invalid, convert entire list to string + assert isinstance(payload["output"], str) + assert payload["output"] == "[{'type': 'text', 'text': 'hello'}, {'msg': 'foobar'}]" diff --git a/tests/test_visualization.py b/tests/test_visualization.py index 8bce897e9..89211cc9c 100644 --- a/tests/test_visualization.py +++ b/tests/test_visualization.py @@ -1,3 +1,4 @@ +import sys from unittest.mock import Mock import graphviz # type: ignore @@ -12,6 +13,9 @@ ) from agents.handoffs import Handoff +if sys.version_info >= (3, 10): + from .mcp.helpers import FakeMCPServer + @pytest.fixture def mock_agent(): @@ -27,6 +31,10 @@ def mock_agent(): agent.name = "Agent1" agent.tools = [tool1, tool2] agent.handoffs = [handoff1] + agent.mcp_servers = [] + + if sys.version_info >= (3, 10): + agent.mcp_servers = [FakeMCPServer(server_name="MCPServer1")] return agent @@ -62,6 +70,7 @@ def test_get_main_graph(mock_agent): '"Handoff1" [label="Handoff1", shape=box, style=filled, style=rounded, ' "fillcolor=lightyellow, width=1.5, height=0.8];" in result ) + _assert_mcp_nodes(result) def test_get_all_nodes(mock_agent): @@ -90,6 +99,7 @@ def test_get_all_nodes(mock_agent): '"Handoff1" [label="Handoff1", shape=box, style=filled, style=rounded, ' "fillcolor=lightyellow, width=1.5, height=0.8];" in result ) + _assert_mcp_nodes(result) def test_get_all_edges(mock_agent): @@ -101,6 +111,7 @@ def test_get_all_edges(mock_agent): assert '"Agent1" -> "Tool2" [style=dotted, penwidth=1.5];' in result assert '"Tool2" -> "Agent1" [style=dotted, penwidth=1.5];' in result assert '"Agent1" -> "Handoff1";' in result + _assert_mcp_edges(result) def test_draw_graph(mock_agent): @@ -134,6 +145,25 @@ def test_draw_graph(mock_agent): '"Handoff1" [label="Handoff1", shape=box, style=filled, style=rounded, ' "fillcolor=lightyellow, width=1.5, height=0.8];" in graph.source ) + _assert_mcp_nodes(graph.source) + + +def _assert_mcp_nodes(source: str): + if sys.version_info < (3, 10): + assert "MCPServer1" not in source + return + assert ( + '"MCPServer1" [label="MCPServer1", shape=box, style=filled, ' + "fillcolor=lightgrey, width=1, height=0.5];" in source + ) + + +def _assert_mcp_edges(source: str): + if sys.version_info < (3, 10): + assert "MCPServer1" not in source + return + assert '"Agent1" -> "MCPServer1" [style=dashed, penwidth=1.5];' in source + assert '"MCPServer1" -> "Agent1" [style=dashed, penwidth=1.5];' in source def test_cycle_detection(): diff --git a/tests/tracing/test_set_api_key_fix.py b/tests/tracing/test_set_api_key_fix.py new file mode 100644 index 000000000..8022d9fe3 --- /dev/null +++ b/tests/tracing/test_set_api_key_fix.py @@ -0,0 +1,32 @@ +import os + +from agents.tracing.processors import BackendSpanExporter + + +def test_set_api_key_preserves_env_fallback(): + """Test that set_api_key doesn't break environment variable fallback.""" + # Set up environment + original_key = os.environ.get("OPENAI_API_KEY") + os.environ["OPENAI_API_KEY"] = "env-key" + + try: + exporter = BackendSpanExporter() + + # Initially should use env var + assert exporter.api_key == "env-key" + + # Set explicit key + exporter.set_api_key("explicit-key") + assert exporter.api_key == "explicit-key" + + # Clear explicit key and verify env fallback works + exporter._api_key = None + if "api_key" in exporter.__dict__: + del exporter.__dict__["api_key"] + assert exporter.api_key == "env-key" + + finally: + if original_key is None: + os.environ.pop("OPENAI_API_KEY", None) + else: + os.environ["OPENAI_API_KEY"] = original_key diff --git a/tests/utils/simple_session.py b/tests/utils/simple_session.py new file mode 100644 index 000000000..b18d6fb92 --- /dev/null +++ b/tests/utils/simple_session.py @@ -0,0 +1,30 @@ +from __future__ import annotations + +from agents.items import TResponseInputItem +from agents.memory.session import Session + + +class SimpleListSession(Session): + """A minimal in-memory session implementation for tests.""" + + def __init__(self, session_id: str = "test") -> None: + self.session_id = session_id + self._items: list[TResponseInputItem] = [] + + async def get_items(self, limit: int | None = None) -> list[TResponseInputItem]: + if limit is None: + return list(self._items) + if limit <= 0: + return [] + return self._items[-limit:] + + async def add_items(self, items: list[TResponseInputItem]) -> None: + self._items.extend(items) + + async def pop_item(self) -> TResponseInputItem | None: + if not self._items: + return None + return self._items.pop() + + async def clear_session(self) -> None: + self._items.clear() diff --git a/tests/utils/test_json.py b/tests/utils/test_json.py new file mode 100644 index 000000000..ff52364f0 --- /dev/null +++ b/tests/utils/test_json.py @@ -0,0 +1,32 @@ +import json + +from openai.types.responses.response_output_message_param import ResponseOutputMessageParam +from openai.types.responses.response_output_text_param import ResponseOutputTextParam + +from agents.util._json import _to_dump_compatible + + +def test_to_dump_compatible(): + # Given a list of message dictionaries, ensure the returned list is a deep copy. + input_iter = [ + ResponseOutputMessageParam( + id="a75654dc-7492-4d1c-bce0-89e8312fbdd7", + content=[ + ResponseOutputTextParam( + type="output_text", + text="Hey, what's up?", + annotations=[], + ) + ].__iter__(), + role="assistant", + status="completed", + type="message", + ) + ].__iter__() + # this fails if any of the properties are Iterable objects. + # result = json.dumps(input_iter) + result = json.dumps(_to_dump_compatible(input_iter)) + assert ( + result + == """[{"id": "a75654dc-7492-4d1c-bce0-89e8312fbdd7", "content": [{"type": "output_text", "text": "Hey, what's up?", "annotations": []}], "role": "assistant", "status": "completed", "type": "message"}]""" # noqa: E501 + ) diff --git a/tests/voice/test_input.py b/tests/voice/test_input.py index d41d870d7..fa3951eab 100644 --- a/tests/voice/test_input.py +++ b/tests/voice/test_input.py @@ -55,8 +55,7 @@ def test_buffer_to_audio_file_invalid_dtype(): buffer = np.array([1.0, 2.0, 3.0], dtype=np.float64) with pytest.raises(UserError, match="Buffer must be a numpy array of int16 or float32"): - # Purposely ignore the type error - _buffer_to_audio_file(buffer) # type: ignore + _buffer_to_audio_file(buffer=buffer) class TestAudioInput: @@ -121,7 +120,14 @@ async def test_streamed_audio_input(self): # Verify the queue contents assert streamed_input.queue.qsize() == 2 # Test non-blocking get - assert np.array_equal(streamed_input.queue.get_nowait(), audio1) + retrieved_audio1 = streamed_input.queue.get_nowait() + # Satisfy type checker + assert retrieved_audio1 is not None + assert np.array_equal(retrieved_audio1, audio1) + # Test blocking get - assert np.array_equal(await streamed_input.queue.get(), audio2) + retrieved_audio2 = await streamed_input.queue.get() + # Satisfy type checker + assert retrieved_audio2 is not None + assert np.array_equal(retrieved_audio2, audio2) assert streamed_input.queue.empty() diff --git a/tests/voice/test_openai_stt.py b/tests/voice/test_openai_stt.py index ecc41f2e2..8eefc995f 100644 --- a/tests/voice/test_openai_stt.py +++ b/tests/voice/test_openai_stt.py @@ -112,13 +112,13 @@ async def test_session_connects_and_configures_successfully(): assert "wss://api.openai.com/v1/realtime?intent=transcription" in args[0] headers = kwargs.get("additional_headers", {}) assert headers.get("Authorization") == "Bearer FAKE_KEY" - assert headers.get("OpenAI-Beta") == "realtime=v1" + assert headers.get("OpenAI-Beta") is None assert headers.get("OpenAI-Log-Session") == "1" - # Check that we sent a 'transcription_session.update' message + # Check that we sent a 'session.update' message sent_messages = [call.args[0] for call in mock_ws.send.call_args_list] - assert any('"type": "transcription_session.update"' in msg for msg in sent_messages), ( - f"Expected 'transcription_session.update' in {sent_messages}" + assert any('"type": "session.update"' in msg for msg in sent_messages), ( + f"Expected 'session.update' in {sent_messages}" ) await session.close() @@ -184,22 +184,35 @@ async def test_stream_audio_sends_correct_json(): @pytest.mark.asyncio -async def test_transcription_event_puts_output_in_queue(): +@pytest.mark.parametrize( + "created,updated,completed", + [ + ( + {"type": "transcription_session.created"}, + {"type": "transcription_session.updated"}, + {"type": "input_audio_transcription_completed", "transcript": "Hello world!"}, + ), + ( + {"type": "session.created"}, + {"type": "session.updated"}, + { + "type": "conversation.item.input_audio_transcription.completed", + "transcript": "Hello world!", + }, + ), + ], +) +async def test_transcription_event_puts_output_in_queue(created, updated, completed): """ - Test that a 'input_audio_transcription_completed' event + Test that a 'input_audio_transcription_completed' event and + 'conversation.item.input_audio_transcription.completed' yields a transcript from transcribe_turns(). """ mock_ws = create_mock_websocket( [ - json.dumps({"type": "transcription_session.created"}), - json.dumps({"type": "transcription_session.updated"}), - # Once configured, we mock a completed transcription event: - json.dumps( - { - "type": "input_audio_transcription_completed", - "transcript": "Hello world!", - } - ), + json.dumps(created), + json.dumps(updated), + json.dumps(completed), ] ) diff --git a/tests/voice/test_workflow.py b/tests/voice/test_workflow.py index e99810be1..2b8548442 100644 --- a/tests/voice/test_workflow.py +++ b/tests/voice/test_workflow.py @@ -55,6 +55,7 @@ async def get_response( tracing: ModelTracing, *, previous_response_id: str | None, + conversation_id: str | None, prompt: Any | None, ) -> ModelResponse: raise NotImplementedError("Not implemented") @@ -70,6 +71,7 @@ async def stream_response( tracing: ModelTracing, *, previous_response_id: str | None, + conversation_id: str | None, prompt: Any | None, ) -> AsyncIterator[TResponseStreamEvent]: output = self.get_next_output() @@ -86,6 +88,7 @@ async def stream_response( output_index=0, item_id=item.id, sequence_number=0, + logprobs=[], ) yield ResponseCompletedEvent( @@ -141,7 +144,11 @@ async def test_single_agent_workflow(monkeypatch) -> None: "status": "completed", "type": "message", }, - {"call_id": "2", "output": "tool_result", "type": "function_call_output"}, + { + "call_id": "2", + "output": "tool_result", + "type": "function_call_output", + }, { "id": "1", "content": [{"annotations": [], "text": "done", "type": "output_text"}], @@ -177,7 +184,11 @@ async def test_single_agent_workflow(monkeypatch) -> None: "status": "completed", "type": "message", }, - {"call_id": "2", "output": "tool_result", "type": "function_call_output"}, + { + "call_id": "2", + "output": "tool_result", + "type": "function_call_output", + }, { "id": "1", "content": [{"annotations": [], "text": "done", "type": "output_text"}], diff --git a/uv.lock b/uv.lock index 7d0621d88..31bfddb9f 100644 --- a/uv.lock +++ b/uv.lock @@ -1,8 +1,9 @@ version = 1 -revision = 2 +revision = 3 requires-python = ">=3.9" resolution-markers = [ - "python_full_version >= '3.10'", + "python_full_version >= '3.11'", + "python_full_version == '3.10.*'", "python_full_version < '3.10'", ] @@ -17,7 +18,7 @@ wheels = [ [[package]] name = "aiohttp" -version = "3.11.16" +version = "3.12.15" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "aiohappyeyeballs" }, @@ -29,100 +30,118 @@ dependencies = [ { name = "propcache" }, { name = "yarl" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/f1/d9/1c4721d143e14af753f2bf5e3b681883e1f24b592c0482df6fa6e33597fa/aiohttp-3.11.16.tar.gz", hash = "sha256:16f8a2c9538c14a557b4d309ed4d0a7c60f0253e8ed7b6c9a2859a7582f8b1b8", size = 7676826, upload-time = "2025-04-02T02:17:44.74Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/b8/21/6bd4cb580a323b64cda3b11fcb3f68deba77568e97806727a858de57349d/aiohttp-3.11.16-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:fb46bb0f24813e6cede6cc07b1961d4b04f331f7112a23b5e21f567da4ee50aa", size = 708259, upload-time = "2025-04-02T02:15:15.439Z" }, - { url = "https://files.pythonhosted.org/packages/96/8c/7b4b9debe90ffc31931b85ee8612a5c83f34d8fdc6d90ee3eb27b43639e4/aiohttp-3.11.16-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:54eb3aead72a5c19fad07219acd882c1643a1027fbcdefac9b502c267242f955", size = 468886, upload-time = "2025-04-02T02:15:17.025Z" }, - { url = "https://files.pythonhosted.org/packages/13/da/a7fcd68e62acacf0a1930060afd2c970826f989265893082b6fb9eb25cb5/aiohttp-3.11.16-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:38bea84ee4fe24ebcc8edeb7b54bf20f06fd53ce4d2cc8b74344c5b9620597fd", size = 455846, upload-time = "2025-04-02T02:15:18.662Z" }, - { url = "https://files.pythonhosted.org/packages/5d/12/b73d9423253f4c872d276a3771decb0722cb5f962352593bd617445977ba/aiohttp-3.11.16-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d0666afbe984f6933fe72cd1f1c3560d8c55880a0bdd728ad774006eb4241ecd", size = 1587183, upload-time = "2025-04-02T02:15:20.048Z" }, - { url = "https://files.pythonhosted.org/packages/75/d3/291b57d54719d996e6cb8c1db8b13d01bdb24dca90434815ac7e6a70393f/aiohttp-3.11.16-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7ba92a2d9ace559a0a14b03d87f47e021e4fa7681dc6970ebbc7b447c7d4b7cd", size = 1634937, upload-time = "2025-04-02T02:15:22.156Z" }, - { url = "https://files.pythonhosted.org/packages/be/85/4229eba92b433173065b0b459ab677ca11ead4a179f76ccfe55d8738b188/aiohttp-3.11.16-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3ad1d59fd7114e6a08c4814983bb498f391c699f3c78712770077518cae63ff7", size = 1667980, upload-time = "2025-04-02T02:15:23.843Z" }, - { url = "https://files.pythonhosted.org/packages/2b/0d/d2423936962e3c711fafd5bb9172a99e6b07dd63e086515aa957d8a991fd/aiohttp-3.11.16-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:98b88a2bf26965f2015a771381624dd4b0839034b70d406dc74fd8be4cc053e3", size = 1590365, upload-time = "2025-04-02T02:15:25.809Z" }, - { url = "https://files.pythonhosted.org/packages/ea/93/04209affc20834982c1ef4214b1afc07743667998a9975d69413e9c1e1c1/aiohttp-3.11.16-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:576f5ca28d1b3276026f7df3ec841ae460e0fc3aac2a47cbf72eabcfc0f102e1", size = 1547614, upload-time = "2025-04-02T02:15:27.544Z" }, - { url = "https://files.pythonhosted.org/packages/f6/fb/194ad4e4cae98023ae19556e576347f402ce159e80d74cc0713d460c4a39/aiohttp-3.11.16-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:a2a450bcce4931b295fc0848f384834c3f9b00edfc2150baafb4488c27953de6", size = 1532815, upload-time = "2025-04-02T02:15:28.985Z" }, - { url = "https://files.pythonhosted.org/packages/33/6d/a4da7adbac90188bf1228c73b6768a607dd279c146721a9ff7dcb75c5ac6/aiohttp-3.11.16-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:37dcee4906454ae377be5937ab2a66a9a88377b11dd7c072df7a7c142b63c37c", size = 1559005, upload-time = "2025-04-02T02:15:30.406Z" }, - { url = "https://files.pythonhosted.org/packages/7e/88/2fa9fbfd23fc16cb2cfdd1f290343e085e7e327438041e9c6aa0208a854d/aiohttp-3.11.16-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:4d0c970c0d602b1017e2067ff3b7dac41c98fef4f7472ec2ea26fd8a4e8c2149", size = 1535231, upload-time = "2025-04-02T02:15:32.468Z" }, - { url = "https://files.pythonhosted.org/packages/f5/8f/9623cd2558e3e182d02dcda8b480643e1c48a0550a86e3050210e98dba27/aiohttp-3.11.16-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:004511d3413737700835e949433536a2fe95a7d0297edd911a1e9705c5b5ea43", size = 1609985, upload-time = "2025-04-02T02:15:33.899Z" }, - { url = "https://files.pythonhosted.org/packages/f8/a2/53a8d1bfc67130710f1c8091f623cdefe7f85cd5d09e14637ed2ed6e1a6d/aiohttp-3.11.16-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:c15b2271c44da77ee9d822552201180779e5e942f3a71fb74e026bf6172ff287", size = 1628842, upload-time = "2025-04-02T02:15:35.396Z" }, - { url = "https://files.pythonhosted.org/packages/49/3a/35fb43d07489573c6c1f8c6a3e6c657196124a63223705b7feeddaea06f1/aiohttp-3.11.16-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:ad9509ffb2396483ceacb1eee9134724443ee45b92141105a4645857244aecc8", size = 1566929, upload-time = "2025-04-02T02:15:36.863Z" }, - { url = "https://files.pythonhosted.org/packages/d5/82/bb3f4f2cc7677e790ba4c040db7dd8445c234a810ef893a858e217647d38/aiohttp-3.11.16-cp310-cp310-win32.whl", hash = "sha256:634d96869be6c4dc232fc503e03e40c42d32cfaa51712aee181e922e61d74814", size = 416935, upload-time = "2025-04-02T02:15:38.337Z" }, - { url = "https://files.pythonhosted.org/packages/df/ad/a64db1c18063569d6dff474c46a7d4de7ab85ff55e2a35839b149b1850ea/aiohttp-3.11.16-cp310-cp310-win_amd64.whl", hash = "sha256:938f756c2b9374bbcc262a37eea521d8a0e6458162f2a9c26329cc87fdf06534", size = 442168, upload-time = "2025-04-02T02:15:39.757Z" }, - { url = "https://files.pythonhosted.org/packages/b1/98/be30539cd84260d9f3ea1936d50445e25aa6029a4cb9707f3b64cfd710f7/aiohttp-3.11.16-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:8cb0688a8d81c63d716e867d59a9ccc389e97ac7037ebef904c2b89334407180", size = 708664, upload-time = "2025-04-02T02:15:41.433Z" }, - { url = "https://files.pythonhosted.org/packages/e6/27/d51116ce18bdfdea7a2244b55ad38d7b01a4298af55765eed7e8431f013d/aiohttp-3.11.16-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:0ad1fb47da60ae1ddfb316f0ff16d1f3b8e844d1a1e154641928ea0583d486ed", size = 468953, upload-time = "2025-04-02T02:15:43.118Z" }, - { url = "https://files.pythonhosted.org/packages/34/23/eedf80ec42865ea5355b46265a2433134138eff9a4fea17e1348530fa4ae/aiohttp-3.11.16-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:df7db76400bf46ec6a0a73192b14c8295bdb9812053f4fe53f4e789f3ea66bbb", size = 456065, upload-time = "2025-04-02T02:15:44.994Z" }, - { url = "https://files.pythonhosted.org/packages/36/23/4a5b1ef6cff994936bf96d981dd817b487d9db755457a0d1c2939920d620/aiohttp-3.11.16-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cc3a145479a76ad0ed646434d09216d33d08eef0d8c9a11f5ae5cdc37caa3540", size = 1687976, upload-time = "2025-04-02T02:15:46.632Z" }, - { url = "https://files.pythonhosted.org/packages/d0/5d/c7474b4c3069bb35276d54c82997dff4f7575e4b73f0a7b1b08a39ece1eb/aiohttp-3.11.16-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d007aa39a52d62373bd23428ba4a2546eed0e7643d7bf2e41ddcefd54519842c", size = 1752711, upload-time = "2025-04-02T02:15:48.276Z" }, - { url = "https://files.pythonhosted.org/packages/64/4c/ee416987b6729558f2eb1b727c60196580aafdb141e83bd78bb031d1c000/aiohttp-3.11.16-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f6ddd90d9fb4b501c97a4458f1c1720e42432c26cb76d28177c5b5ad4e332601", size = 1791305, upload-time = "2025-04-02T02:15:49.965Z" }, - { url = "https://files.pythonhosted.org/packages/58/28/3e1e1884070b95f1f69c473a1995852a6f8516670bb1c29d6cb2dbb73e1c/aiohttp-3.11.16-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0a2f451849e6b39e5c226803dcacfa9c7133e9825dcefd2f4e837a2ec5a3bb98", size = 1674499, upload-time = "2025-04-02T02:15:51.718Z" }, - { url = "https://files.pythonhosted.org/packages/ad/55/a032b32fa80a662d25d9eb170ed1e2c2be239304ca114ec66c89dc40f37f/aiohttp-3.11.16-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8df6612df74409080575dca38a5237282865408016e65636a76a2eb9348c2567", size = 1622313, upload-time = "2025-04-02T02:15:53.377Z" }, - { url = "https://files.pythonhosted.org/packages/b1/df/ca775605f72abbda4e4746e793c408c84373ca2c6ce7a106a09f853f1e89/aiohttp-3.11.16-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:78e6e23b954644737e385befa0deb20233e2dfddf95dd11e9db752bdd2a294d3", size = 1658274, upload-time = "2025-04-02T02:15:55.035Z" }, - { url = "https://files.pythonhosted.org/packages/cc/6c/21c45b66124df5b4b0ab638271ecd8c6402b702977120cb4d5be6408e15d/aiohttp-3.11.16-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:696ef00e8a1f0cec5e30640e64eca75d8e777933d1438f4facc9c0cdf288a810", size = 1666704, upload-time = "2025-04-02T02:15:56.581Z" }, - { url = "https://files.pythonhosted.org/packages/1d/e2/7d92adc03e3458edd18a21da2575ab84e58f16b1672ae98529e4eeee45ab/aiohttp-3.11.16-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e3538bc9fe1b902bef51372462e3d7c96fce2b566642512138a480b7adc9d508", size = 1652815, upload-time = "2025-04-02T02:15:58.126Z" }, - { url = "https://files.pythonhosted.org/packages/3a/52/7549573cd654ad651e3c5786ec3946d8f0ee379023e22deb503ff856b16c/aiohttp-3.11.16-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:3ab3367bb7f61ad18793fea2ef71f2d181c528c87948638366bf1de26e239183", size = 1735669, upload-time = "2025-04-02T02:16:00.313Z" }, - { url = "https://files.pythonhosted.org/packages/d5/54/dcd24a23c7a5a2922123e07a296a5f79ea87ce605f531be068415c326de6/aiohttp-3.11.16-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:56a3443aca82abda0e07be2e1ecb76a050714faf2be84256dae291182ba59049", size = 1760422, upload-time = "2025-04-02T02:16:02.233Z" }, - { url = "https://files.pythonhosted.org/packages/a7/53/87327fe982fa310944e1450e97bf7b2a28015263771931372a1dfe682c58/aiohttp-3.11.16-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:61c721764e41af907c9d16b6daa05a458f066015abd35923051be8705108ed17", size = 1694457, upload-time = "2025-04-02T02:16:04.233Z" }, - { url = "https://files.pythonhosted.org/packages/ce/6d/c5ccf41059267bcf89853d3db9d8d217dacf0a04f4086cb6bf278323011f/aiohttp-3.11.16-cp311-cp311-win32.whl", hash = "sha256:3e061b09f6fa42997cf627307f220315e313ece74907d35776ec4373ed718b86", size = 416817, upload-time = "2025-04-02T02:16:06.268Z" }, - { url = "https://files.pythonhosted.org/packages/e7/dd/01f6fe028e054ef4f909c9d63e3a2399e77021bb2e1bb51d56ca8b543989/aiohttp-3.11.16-cp311-cp311-win_amd64.whl", hash = "sha256:745f1ed5e2c687baefc3c5e7b4304e91bf3e2f32834d07baaee243e349624b24", size = 442986, upload-time = "2025-04-02T02:16:07.712Z" }, - { url = "https://files.pythonhosted.org/packages/db/38/100d01cbc60553743baf0fba658cb125f8ad674a8a771f765cdc155a890d/aiohttp-3.11.16-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:911a6e91d08bb2c72938bc17f0a2d97864c531536b7832abee6429d5296e5b27", size = 704881, upload-time = "2025-04-02T02:16:09.26Z" }, - { url = "https://files.pythonhosted.org/packages/21/ed/b4102bb6245e36591209e29f03fe87e7956e54cb604ee12e20f7eb47f994/aiohttp-3.11.16-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:6ac13b71761e49d5f9e4d05d33683bbafef753e876e8e5a7ef26e937dd766713", size = 464564, upload-time = "2025-04-02T02:16:10.781Z" }, - { url = "https://files.pythonhosted.org/packages/3b/e1/a9ab6c47b62ecee080eeb33acd5352b40ecad08fb2d0779bcc6739271745/aiohttp-3.11.16-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:fd36c119c5d6551bce374fcb5c19269638f8d09862445f85a5a48596fd59f4bb", size = 456548, upload-time = "2025-04-02T02:16:12.764Z" }, - { url = "https://files.pythonhosted.org/packages/80/ad/216c6f71bdff2becce6c8776f0aa32cb0fa5d83008d13b49c3208d2e4016/aiohttp-3.11.16-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d489d9778522fbd0f8d6a5c6e48e3514f11be81cb0a5954bdda06f7e1594b321", size = 1691749, upload-time = "2025-04-02T02:16:14.304Z" }, - { url = "https://files.pythonhosted.org/packages/bd/ea/7df7bcd3f4e734301605f686ffc87993f2d51b7acb6bcc9b980af223f297/aiohttp-3.11.16-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:69a2cbd61788d26f8f1e626e188044834f37f6ae3f937bd9f08b65fc9d7e514e", size = 1736874, upload-time = "2025-04-02T02:16:16.538Z" }, - { url = "https://files.pythonhosted.org/packages/51/41/c7724b9c87a29b7cfd1202ec6446bae8524a751473d25e2ff438bc9a02bf/aiohttp-3.11.16-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cd464ba806e27ee24a91362ba3621bfc39dbbb8b79f2e1340201615197370f7c", size = 1786885, upload-time = "2025-04-02T02:16:18.268Z" }, - { url = "https://files.pythonhosted.org/packages/86/b3/f61f8492fa6569fa87927ad35a40c159408862f7e8e70deaaead349e2fba/aiohttp-3.11.16-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1ce63ae04719513dd2651202352a2beb9f67f55cb8490c40f056cea3c5c355ce", size = 1698059, upload-time = "2025-04-02T02:16:20.234Z" }, - { url = "https://files.pythonhosted.org/packages/ce/be/7097cf860a9ce8bbb0e8960704e12869e111abcd3fbd245153373079ccec/aiohttp-3.11.16-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:09b00dd520d88eac9d1768439a59ab3d145065c91a8fab97f900d1b5f802895e", size = 1626527, upload-time = "2025-04-02T02:16:22.092Z" }, - { url = "https://files.pythonhosted.org/packages/1d/1d/aaa841c340e8c143a8d53a1f644c2a2961c58cfa26e7b398d6bf75cf5d23/aiohttp-3.11.16-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:7f6428fee52d2bcf96a8aa7b62095b190ee341ab0e6b1bcf50c615d7966fd45b", size = 1644036, upload-time = "2025-04-02T02:16:23.707Z" }, - { url = "https://files.pythonhosted.org/packages/2c/88/59d870f76e9345e2b149f158074e78db457985c2b4da713038d9da3020a8/aiohttp-3.11.16-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:13ceac2c5cdcc3f64b9015710221ddf81c900c5febc505dbd8f810e770011540", size = 1685270, upload-time = "2025-04-02T02:16:25.874Z" }, - { url = "https://files.pythonhosted.org/packages/2b/b1/c6686948d4c79c3745595efc469a9f8a43cab3c7efc0b5991be65d9e8cb8/aiohttp-3.11.16-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:fadbb8f1d4140825069db3fedbbb843290fd5f5bc0a5dbd7eaf81d91bf1b003b", size = 1650852, upload-time = "2025-04-02T02:16:27.556Z" }, - { url = "https://files.pythonhosted.org/packages/fe/94/3e42a6916fd3441721941e0f1b8438e1ce2a4c49af0e28e0d3c950c9b3c9/aiohttp-3.11.16-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:6a792ce34b999fbe04a7a71a90c74f10c57ae4c51f65461a411faa70e154154e", size = 1704481, upload-time = "2025-04-02T02:16:29.573Z" }, - { url = "https://files.pythonhosted.org/packages/b1/6d/6ab5854ff59b27075c7a8c610597d2b6c38945f9a1284ee8758bc3720ff6/aiohttp-3.11.16-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:f4065145bf69de124accdd17ea5f4dc770da0a6a6e440c53f6e0a8c27b3e635c", size = 1735370, upload-time = "2025-04-02T02:16:31.191Z" }, - { url = "https://files.pythonhosted.org/packages/73/2a/08a68eec3c99a6659067d271d7553e4d490a0828d588e1daa3970dc2b771/aiohttp-3.11.16-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fa73e8c2656a3653ae6c307b3f4e878a21f87859a9afab228280ddccd7369d71", size = 1697619, upload-time = "2025-04-02T02:16:32.873Z" }, - { url = "https://files.pythonhosted.org/packages/61/d5/fea8dbbfb0cd68fbb56f0ae913270a79422d9a41da442a624febf72d2aaf/aiohttp-3.11.16-cp312-cp312-win32.whl", hash = "sha256:f244b8e541f414664889e2c87cac11a07b918cb4b540c36f7ada7bfa76571ea2", size = 411710, upload-time = "2025-04-02T02:16:34.525Z" }, - { url = "https://files.pythonhosted.org/packages/33/fb/41cde15fbe51365024550bf77b95a4fc84ef41365705c946da0421f0e1e0/aiohttp-3.11.16-cp312-cp312-win_amd64.whl", hash = "sha256:23a15727fbfccab973343b6d1b7181bfb0b4aa7ae280f36fd2f90f5476805682", size = 438012, upload-time = "2025-04-02T02:16:36.103Z" }, - { url = "https://files.pythonhosted.org/packages/52/52/7c712b2d9fb4d5e5fd6d12f9ab76e52baddfee71e3c8203ca7a7559d7f51/aiohttp-3.11.16-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:a3814760a1a700f3cfd2f977249f1032301d0a12c92aba74605cfa6ce9f78489", size = 698005, upload-time = "2025-04-02T02:16:37.923Z" }, - { url = "https://files.pythonhosted.org/packages/51/3e/61057814f7247666d43ac538abcd6335b022869ade2602dab9bf33f607d2/aiohttp-3.11.16-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:9b751a6306f330801665ae69270a8a3993654a85569b3469662efaad6cf5cc50", size = 461106, upload-time = "2025-04-02T02:16:39.961Z" }, - { url = "https://files.pythonhosted.org/packages/4f/85/6b79fb0ea6e913d596d5b949edc2402b20803f51b1a59e1bbc5bb7ba7569/aiohttp-3.11.16-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:ad497f38a0d6c329cb621774788583ee12321863cd4bd9feee1effd60f2ad133", size = 453394, upload-time = "2025-04-02T02:16:41.562Z" }, - { url = "https://files.pythonhosted.org/packages/4b/04/e1bb3fcfbd2c26753932c759593a32299aff8625eaa0bf8ff7d9c0c34a36/aiohttp-3.11.16-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ca37057625693d097543bd88076ceebeb248291df9d6ca8481349efc0b05dcd0", size = 1666643, upload-time = "2025-04-02T02:16:43.62Z" }, - { url = "https://files.pythonhosted.org/packages/0e/27/97bc0fdd1f439b8f060beb3ba8fb47b908dc170280090801158381ad7942/aiohttp-3.11.16-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a5abcbba9f4b463a45c8ca8b7720891200658f6f46894f79517e6cd11f3405ca", size = 1721948, upload-time = "2025-04-02T02:16:45.617Z" }, - { url = "https://files.pythonhosted.org/packages/2c/4f/bc4c5119e75c05ef15c5670ef1563bbe25d4ed4893b76c57b0184d815e8b/aiohttp-3.11.16-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f420bfe862fb357a6d76f2065447ef6f484bc489292ac91e29bc65d2d7a2c84d", size = 1774454, upload-time = "2025-04-02T02:16:48.562Z" }, - { url = "https://files.pythonhosted.org/packages/73/5b/54b42b2150bb26fdf795464aa55ceb1a49c85f84e98e6896d211eabc6670/aiohttp-3.11.16-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:58ede86453a6cf2d6ce40ef0ca15481677a66950e73b0a788917916f7e35a0bb", size = 1677785, upload-time = "2025-04-02T02:16:50.367Z" }, - { url = "https://files.pythonhosted.org/packages/10/ee/a0fe68916d3f82eae199b8535624cf07a9c0a0958c7a76e56dd21140487a/aiohttp-3.11.16-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6fdec0213244c39973674ca2a7f5435bf74369e7d4e104d6c7473c81c9bcc8c4", size = 1608456, upload-time = "2025-04-02T02:16:52.158Z" }, - { url = "https://files.pythonhosted.org/packages/8b/48/83afd779242b7cf7e1ceed2ff624a86d3221e17798061cf9a79e0b246077/aiohttp-3.11.16-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:72b1b03fb4655c1960403c131740755ec19c5898c82abd3961c364c2afd59fe7", size = 1622424, upload-time = "2025-04-02T02:16:54.386Z" }, - { url = "https://files.pythonhosted.org/packages/6f/27/452f1d5fca1f516f9f731539b7f5faa9e9d3bf8a3a6c3cd7c4b031f20cbd/aiohttp-3.11.16-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:780df0d837276276226a1ff803f8d0fa5f8996c479aeef52eb040179f3156cbd", size = 1660943, upload-time = "2025-04-02T02:16:56.887Z" }, - { url = "https://files.pythonhosted.org/packages/d6/e1/5c7d63143b8d00c83b958b9e78e7048c4a69903c760c1e329bf02bac57a1/aiohttp-3.11.16-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:ecdb8173e6c7aa09eee342ac62e193e6904923bd232e76b4157ac0bfa670609f", size = 1622797, upload-time = "2025-04-02T02:16:58.676Z" }, - { url = "https://files.pythonhosted.org/packages/46/9e/2ac29cca2746ee8e449e73cd2fcb3d454467393ec03a269d50e49af743f1/aiohttp-3.11.16-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:a6db7458ab89c7d80bc1f4e930cc9df6edee2200127cfa6f6e080cf619eddfbd", size = 1687162, upload-time = "2025-04-02T02:17:01.076Z" }, - { url = "https://files.pythonhosted.org/packages/ad/6b/eaa6768e02edebaf37d77f4ffb74dd55f5cbcbb6a0dbf798ccec7b0ac23b/aiohttp-3.11.16-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:2540ddc83cc724b13d1838026f6a5ad178510953302a49e6d647f6e1de82bc34", size = 1718518, upload-time = "2025-04-02T02:17:03.388Z" }, - { url = "https://files.pythonhosted.org/packages/e5/18/dda87cbad29472a51fa058d6d8257dfce168289adaeb358b86bd93af3b20/aiohttp-3.11.16-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:3b4e6db8dc4879015b9955778cfb9881897339c8fab7b3676f8433f849425913", size = 1675254, upload-time = "2025-04-02T02:17:05.579Z" }, - { url = "https://files.pythonhosted.org/packages/32/d9/d2fb08c614df401d92c12fcbc60e6e879608d5e8909ef75c5ad8d4ad8aa7/aiohttp-3.11.16-cp313-cp313-win32.whl", hash = "sha256:493910ceb2764f792db4dc6e8e4b375dae1b08f72e18e8f10f18b34ca17d0979", size = 410698, upload-time = "2025-04-02T02:17:07.499Z" }, - { url = "https://files.pythonhosted.org/packages/ce/ed/853e36d5a33c24544cfa46585895547de152dfef0b5c79fa675f6e4b7b87/aiohttp-3.11.16-cp313-cp313-win_amd64.whl", hash = "sha256:42864e70a248f5f6a49fdaf417d9bc62d6e4d8ee9695b24c5916cb4bb666c802", size = 436395, upload-time = "2025-04-02T02:17:09.566Z" }, - { url = "https://files.pythonhosted.org/packages/4b/6e/a423a6fd07e651f6078da862128031cff2f333e995f5efe30bb110c97041/aiohttp-3.11.16-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:bbcba75fe879ad6fd2e0d6a8d937f34a571f116a0e4db37df8079e738ea95c71", size = 709172, upload-time = "2025-04-02T02:17:11.327Z" }, - { url = "https://files.pythonhosted.org/packages/bf/8d/925f3c893523118e5dc729d340df2283d68e7adfa77192908ae63f1ec904/aiohttp-3.11.16-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:87a6e922b2b2401e0b0cf6b976b97f11ec7f136bfed445e16384fbf6fd5e8602", size = 469390, upload-time = "2025-04-02T02:17:13.495Z" }, - { url = "https://files.pythonhosted.org/packages/49/57/8a27b793480887bd23288364138c9db2f58cd3cff28945809aa062d019dc/aiohttp-3.11.16-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ccf10f16ab498d20e28bc2b5c1306e9c1512f2840f7b6a67000a517a4b37d5ee", size = 456246, upload-time = "2025-04-02T02:17:15.311Z" }, - { url = "https://files.pythonhosted.org/packages/e8/e5/e8114c5b1336357089cacf5a4ff298335429f0a0e75dea3ffefd3d4d82e5/aiohttp-3.11.16-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fb3d0cc5cdb926090748ea60172fa8a213cec728bd6c54eae18b96040fcd6227", size = 1590764, upload-time = "2025-04-02T02:17:17.559Z" }, - { url = "https://files.pythonhosted.org/packages/db/49/ec13c0ad70c4843169111265c47dd568437be354aea4ac732dc6f2e79842/aiohttp-3.11.16-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d07502cc14ecd64f52b2a74ebbc106893d9a9717120057ea9ea1fd6568a747e7", size = 1638375, upload-time = "2025-04-02T02:17:19.571Z" }, - { url = "https://files.pythonhosted.org/packages/0f/0d/78a64579b054fa3c0e72083912d4410f5514dc0cd03bef5644d4f1e4e6ed/aiohttp-3.11.16-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:776c8e959a01e5e8321f1dec77964cb6101020a69d5a94cd3d34db6d555e01f7", size = 1672027, upload-time = "2025-04-02T02:17:21.51Z" }, - { url = "https://files.pythonhosted.org/packages/54/11/06602ab3446fe96519998b79c762cf0921b620e702bd7659a5e8b998d0e0/aiohttp-3.11.16-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0902e887b0e1d50424112f200eb9ae3dfed6c0d0a19fc60f633ae5a57c809656", size = 1589609, upload-time = "2025-04-02T02:17:23.446Z" }, - { url = "https://files.pythonhosted.org/packages/34/1b/6bdebdf702d7f339579e9d3c2e784ca6e5867e247dd7b8690c004431ab57/aiohttp-3.11.16-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e87fd812899aa78252866ae03a048e77bd11b80fb4878ce27c23cade239b42b2", size = 1547540, upload-time = "2025-04-02T02:17:25.665Z" }, - { url = "https://files.pythonhosted.org/packages/88/dd/5d0c0a936baaabbf7467851c0cc9f1aedab67428479a528ea14ab852c730/aiohttp-3.11.16-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:0a950c2eb8ff17361abd8c85987fd6076d9f47d040ebffce67dce4993285e973", size = 1534880, upload-time = "2025-04-02T02:17:27.782Z" }, - { url = "https://files.pythonhosted.org/packages/a8/ff/2245148b047833eb7b37f5754ece17ade561a46c40d6fecc3ed3f5eae1c1/aiohttp-3.11.16-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:c10d85e81d0b9ef87970ecbdbfaeec14a361a7fa947118817fcea8e45335fa46", size = 1557692, upload-time = "2025-04-02T02:17:29.833Z" }, - { url = "https://files.pythonhosted.org/packages/c4/1c/fe0dd097427c295ae49b6c10e37eda546036fd8de75bc43d69df392b9377/aiohttp-3.11.16-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:7951decace76a9271a1ef181b04aa77d3cc309a02a51d73826039003210bdc86", size = 1538918, upload-time = "2025-04-02T02:17:31.779Z" }, - { url = "https://files.pythonhosted.org/packages/94/58/10af247fb0084327579ebaccfd1f9c2f759ec972b204b31598debfa0829a/aiohttp-3.11.16-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:14461157d8426bcb40bd94deb0450a6fa16f05129f7da546090cebf8f3123b0f", size = 1609351, upload-time = "2025-04-02T02:17:34.026Z" }, - { url = "https://files.pythonhosted.org/packages/d3/91/b1f0928b6d2eb0c47ecee7122067a8ad330f812795d8f16343d206394040/aiohttp-3.11.16-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:9756d9b9d4547e091f99d554fbba0d2a920aab98caa82a8fb3d3d9bee3c9ae85", size = 1630514, upload-time = "2025-04-02T02:17:36.334Z" }, - { url = "https://files.pythonhosted.org/packages/88/51/3319add72ea4053bee66825aef3e691ee4b26d0a22b7f817d73b0af02d38/aiohttp-3.11.16-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:87944bd16b7fe6160607f6a17808abd25f17f61ae1e26c47a491b970fb66d8cb", size = 1567084, upload-time = "2025-04-02T02:17:38.877Z" }, - { url = "https://files.pythonhosted.org/packages/e5/93/e90a84c263f02f01efd6f32042c08d7f7d88338cb18d91c5b1752accffeb/aiohttp-3.11.16-cp39-cp39-win32.whl", hash = "sha256:92b7ee222e2b903e0a4b329a9943d432b3767f2d5029dbe4ca59fb75223bbe2e", size = 417187, upload-time = "2025-04-02T02:17:40.873Z" }, - { url = "https://files.pythonhosted.org/packages/11/b8/7200f637f223199d8f3e7add720ab19843b9969ffa89b758b5649cab8099/aiohttp-3.11.16-cp39-cp39-win_amd64.whl", hash = "sha256:17ae4664031aadfbcb34fd40ffd90976671fa0c0286e6c4113989f78bebab37a", size = 442378, upload-time = "2025-04-02T02:17:42.709Z" }, +sdist = { url = "https://files.pythonhosted.org/packages/9b/e7/d92a237d8802ca88483906c388f7c201bbe96cd80a165ffd0ac2f6a8d59f/aiohttp-3.12.15.tar.gz", hash = "sha256:4fc61385e9c98d72fcdf47e6dd81833f47b2f77c114c29cd64a361be57a763a2", size = 7823716, upload-time = "2025-07-29T05:52:32.215Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/47/dc/ef9394bde9080128ad401ac7ede185267ed637df03b51f05d14d1c99ad67/aiohttp-3.12.15-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:b6fc902bff74d9b1879ad55f5404153e2b33a82e72a95c89cec5eb6cc9e92fbc", size = 703921, upload-time = "2025-07-29T05:49:43.584Z" }, + { url = "https://files.pythonhosted.org/packages/8f/42/63fccfc3a7ed97eb6e1a71722396f409c46b60a0552d8a56d7aad74e0df5/aiohttp-3.12.15-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:098e92835b8119b54c693f2f88a1dec690e20798ca5f5fe5f0520245253ee0af", size = 480288, upload-time = "2025-07-29T05:49:47.851Z" }, + { url = "https://files.pythonhosted.org/packages/9c/a2/7b8a020549f66ea2a68129db6960a762d2393248f1994499f8ba9728bbed/aiohttp-3.12.15-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:40b3fee496a47c3b4a39a731954c06f0bd9bd3e8258c059a4beb76ac23f8e421", size = 468063, upload-time = "2025-07-29T05:49:49.789Z" }, + { url = "https://files.pythonhosted.org/packages/8f/f5/d11e088da9176e2ad8220338ae0000ed5429a15f3c9dfd983f39105399cd/aiohttp-3.12.15-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2ce13fcfb0bb2f259fb42106cdc63fa5515fb85b7e87177267d89a771a660b79", size = 1650122, upload-time = "2025-07-29T05:49:51.874Z" }, + { url = "https://files.pythonhosted.org/packages/b0/6b/b60ce2757e2faed3d70ed45dafee48cee7bfb878785a9423f7e883f0639c/aiohttp-3.12.15-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:3beb14f053222b391bf9cf92ae82e0171067cc9c8f52453a0f1ec7c37df12a77", size = 1624176, upload-time = "2025-07-29T05:49:53.805Z" }, + { url = "https://files.pythonhosted.org/packages/dd/de/8c9fde2072a1b72c4fadecf4f7d4be7a85b1d9a4ab333d8245694057b4c6/aiohttp-3.12.15-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4c39e87afe48aa3e814cac5f535bc6199180a53e38d3f51c5e2530f5aa4ec58c", size = 1696583, upload-time = "2025-07-29T05:49:55.338Z" }, + { url = "https://files.pythonhosted.org/packages/0c/ad/07f863ca3d895a1ad958a54006c6dafb4f9310f8c2fdb5f961b8529029d3/aiohttp-3.12.15-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d5f1b4ce5bc528a6ee38dbf5f39bbf11dd127048726323b72b8e85769319ffc4", size = 1738896, upload-time = "2025-07-29T05:49:57.045Z" }, + { url = "https://files.pythonhosted.org/packages/20/43/2bd482ebe2b126533e8755a49b128ec4e58f1a3af56879a3abdb7b42c54f/aiohttp-3.12.15-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1004e67962efabbaf3f03b11b4c43b834081c9e3f9b32b16a7d97d4708a9abe6", size = 1643561, upload-time = "2025-07-29T05:49:58.762Z" }, + { url = "https://files.pythonhosted.org/packages/23/40/2fa9f514c4cf4cbae8d7911927f81a1901838baf5e09a8b2c299de1acfe5/aiohttp-3.12.15-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8faa08fcc2e411f7ab91d1541d9d597d3a90e9004180edb2072238c085eac8c2", size = 1583685, upload-time = "2025-07-29T05:50:00.375Z" }, + { url = "https://files.pythonhosted.org/packages/b8/c3/94dc7357bc421f4fb978ca72a201a6c604ee90148f1181790c129396ceeb/aiohttp-3.12.15-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:fe086edf38b2222328cdf89af0dde2439ee173b8ad7cb659b4e4c6f385b2be3d", size = 1627533, upload-time = "2025-07-29T05:50:02.306Z" }, + { url = "https://files.pythonhosted.org/packages/bf/3f/1f8911fe1844a07001e26593b5c255a685318943864b27b4e0267e840f95/aiohttp-3.12.15-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:79b26fe467219add81d5e47b4a4ba0f2394e8b7c7c3198ed36609f9ba161aecb", size = 1638319, upload-time = "2025-07-29T05:50:04.282Z" }, + { url = "https://files.pythonhosted.org/packages/4e/46/27bf57a99168c4e145ffee6b63d0458b9c66e58bb70687c23ad3d2f0bd17/aiohttp-3.12.15-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:b761bac1192ef24e16706d761aefcb581438b34b13a2f069a6d343ec8fb693a5", size = 1613776, upload-time = "2025-07-29T05:50:05.863Z" }, + { url = "https://files.pythonhosted.org/packages/0f/7e/1d2d9061a574584bb4ad3dbdba0da90a27fdc795bc227def3a46186a8bc1/aiohttp-3.12.15-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:e153e8adacfe2af562861b72f8bc47f8a5c08e010ac94eebbe33dc21d677cd5b", size = 1693359, upload-time = "2025-07-29T05:50:07.563Z" }, + { url = "https://files.pythonhosted.org/packages/08/98/bee429b52233c4a391980a5b3b196b060872a13eadd41c3a34be9b1469ed/aiohttp-3.12.15-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:fc49c4de44977aa8601a00edbf157e9a421f227aa7eb477d9e3df48343311065", size = 1716598, upload-time = "2025-07-29T05:50:09.33Z" }, + { url = "https://files.pythonhosted.org/packages/57/39/b0314c1ea774df3392751b686104a3938c63ece2b7ce0ba1ed7c0b4a934f/aiohttp-3.12.15-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:2776c7ec89c54a47029940177e75c8c07c29c66f73464784971d6a81904ce9d1", size = 1644940, upload-time = "2025-07-29T05:50:11.334Z" }, + { url = "https://files.pythonhosted.org/packages/1b/83/3dacb8d3f8f512c8ca43e3fa8a68b20583bd25636ffa4e56ee841ffd79ae/aiohttp-3.12.15-cp310-cp310-win32.whl", hash = "sha256:2c7d81a277fa78b2203ab626ced1487420e8c11a8e373707ab72d189fcdad20a", size = 429239, upload-time = "2025-07-29T05:50:12.803Z" }, + { url = "https://files.pythonhosted.org/packages/eb/f9/470b5daba04d558c9673ca2034f28d067f3202a40e17804425f0c331c89f/aiohttp-3.12.15-cp310-cp310-win_amd64.whl", hash = "sha256:83603f881e11f0f710f8e2327817c82e79431ec976448839f3cd05d7afe8f830", size = 452297, upload-time = "2025-07-29T05:50:14.266Z" }, + { url = "https://files.pythonhosted.org/packages/20/19/9e86722ec8e835959bd97ce8c1efa78cf361fa4531fca372551abcc9cdd6/aiohttp-3.12.15-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:d3ce17ce0220383a0f9ea07175eeaa6aa13ae5a41f30bc61d84df17f0e9b1117", size = 711246, upload-time = "2025-07-29T05:50:15.937Z" }, + { url = "https://files.pythonhosted.org/packages/71/f9/0a31fcb1a7d4629ac9d8f01f1cb9242e2f9943f47f5d03215af91c3c1a26/aiohttp-3.12.15-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:010cc9bbd06db80fe234d9003f67e97a10fe003bfbedb40da7d71c1008eda0fe", size = 483515, upload-time = "2025-07-29T05:50:17.442Z" }, + { url = "https://files.pythonhosted.org/packages/62/6c/94846f576f1d11df0c2e41d3001000527c0fdf63fce7e69b3927a731325d/aiohttp-3.12.15-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3f9d7c55b41ed687b9d7165b17672340187f87a773c98236c987f08c858145a9", size = 471776, upload-time = "2025-07-29T05:50:19.568Z" }, + { url = "https://files.pythonhosted.org/packages/f8/6c/f766d0aaafcee0447fad0328da780d344489c042e25cd58fde566bf40aed/aiohttp-3.12.15-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bc4fbc61bb3548d3b482f9ac7ddd0f18c67e4225aaa4e8552b9f1ac7e6bda9e5", size = 1741977, upload-time = "2025-07-29T05:50:21.665Z" }, + { url = "https://files.pythonhosted.org/packages/17/e5/fb779a05ba6ff44d7bc1e9d24c644e876bfff5abe5454f7b854cace1b9cc/aiohttp-3.12.15-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:7fbc8a7c410bb3ad5d595bb7118147dfbb6449d862cc1125cf8867cb337e8728", size = 1690645, upload-time = "2025-07-29T05:50:23.333Z" }, + { url = "https://files.pythonhosted.org/packages/37/4e/a22e799c2035f5d6a4ad2cf8e7c1d1bd0923192871dd6e367dafb158b14c/aiohttp-3.12.15-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:74dad41b3458dbb0511e760fb355bb0b6689e0630de8a22b1b62a98777136e16", size = 1789437, upload-time = "2025-07-29T05:50:25.007Z" }, + { url = "https://files.pythonhosted.org/packages/28/e5/55a33b991f6433569babb56018b2fb8fb9146424f8b3a0c8ecca80556762/aiohttp-3.12.15-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3b6f0af863cf17e6222b1735a756d664159e58855da99cfe965134a3ff63b0b0", size = 1828482, upload-time = "2025-07-29T05:50:26.693Z" }, + { url = "https://files.pythonhosted.org/packages/c6/82/1ddf0ea4f2f3afe79dffed5e8a246737cff6cbe781887a6a170299e33204/aiohttp-3.12.15-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b5b7fe4972d48a4da367043b8e023fb70a04d1490aa7d68800e465d1b97e493b", size = 1730944, upload-time = "2025-07-29T05:50:28.382Z" }, + { url = "https://files.pythonhosted.org/packages/1b/96/784c785674117b4cb3877522a177ba1b5e4db9ce0fd519430b5de76eec90/aiohttp-3.12.15-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6443cca89553b7a5485331bc9bedb2342b08d073fa10b8c7d1c60579c4a7b9bd", size = 1668020, upload-time = "2025-07-29T05:50:30.032Z" }, + { url = "https://files.pythonhosted.org/packages/12/8a/8b75f203ea7e5c21c0920d84dd24a5c0e971fe1e9b9ebbf29ae7e8e39790/aiohttp-3.12.15-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:6c5f40ec615e5264f44b4282ee27628cea221fcad52f27405b80abb346d9f3f8", size = 1716292, upload-time = "2025-07-29T05:50:31.983Z" }, + { url = "https://files.pythonhosted.org/packages/47/0b/a1451543475bb6b86a5cfc27861e52b14085ae232896a2654ff1231c0992/aiohttp-3.12.15-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:2abbb216a1d3a2fe86dbd2edce20cdc5e9ad0be6378455b05ec7f77361b3ab50", size = 1711451, upload-time = "2025-07-29T05:50:33.989Z" }, + { url = "https://files.pythonhosted.org/packages/55/fd/793a23a197cc2f0d29188805cfc93aa613407f07e5f9da5cd1366afd9d7c/aiohttp-3.12.15-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:db71ce547012a5420a39c1b744d485cfb823564d01d5d20805977f5ea1345676", size = 1691634, upload-time = "2025-07-29T05:50:35.846Z" }, + { url = "https://files.pythonhosted.org/packages/ca/bf/23a335a6670b5f5dfc6d268328e55a22651b440fca341a64fccf1eada0c6/aiohttp-3.12.15-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:ced339d7c9b5030abad5854aa5413a77565e5b6e6248ff927d3e174baf3badf7", size = 1785238, upload-time = "2025-07-29T05:50:37.597Z" }, + { url = "https://files.pythonhosted.org/packages/57/4f/ed60a591839a9d85d40694aba5cef86dde9ee51ce6cca0bb30d6eb1581e7/aiohttp-3.12.15-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:7c7dd29c7b5bda137464dc9bfc738d7ceea46ff70309859ffde8c022e9b08ba7", size = 1805701, upload-time = "2025-07-29T05:50:39.591Z" }, + { url = "https://files.pythonhosted.org/packages/85/e0/444747a9455c5de188c0f4a0173ee701e2e325d4b2550e9af84abb20cdba/aiohttp-3.12.15-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:421da6fd326460517873274875c6c5a18ff225b40da2616083c5a34a7570b685", size = 1718758, upload-time = "2025-07-29T05:50:41.292Z" }, + { url = "https://files.pythonhosted.org/packages/36/ab/1006278d1ffd13a698e5dd4bfa01e5878f6bddefc296c8b62649753ff249/aiohttp-3.12.15-cp311-cp311-win32.whl", hash = "sha256:4420cf9d179ec8dfe4be10e7d0fe47d6d606485512ea2265b0d8c5113372771b", size = 428868, upload-time = "2025-07-29T05:50:43.063Z" }, + { url = "https://files.pythonhosted.org/packages/10/97/ad2b18700708452400278039272032170246a1bf8ec5d832772372c71f1a/aiohttp-3.12.15-cp311-cp311-win_amd64.whl", hash = "sha256:edd533a07da85baa4b423ee8839e3e91681c7bfa19b04260a469ee94b778bf6d", size = 453273, upload-time = "2025-07-29T05:50:44.613Z" }, + { url = "https://files.pythonhosted.org/packages/63/97/77cb2450d9b35f517d6cf506256bf4f5bda3f93a66b4ad64ba7fc917899c/aiohttp-3.12.15-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:802d3868f5776e28f7bf69d349c26fc0efadb81676d0afa88ed00d98a26340b7", size = 702333, upload-time = "2025-07-29T05:50:46.507Z" }, + { url = "https://files.pythonhosted.org/packages/83/6d/0544e6b08b748682c30b9f65640d006e51f90763b41d7c546693bc22900d/aiohttp-3.12.15-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:f2800614cd560287be05e33a679638e586a2d7401f4ddf99e304d98878c29444", size = 476948, upload-time = "2025-07-29T05:50:48.067Z" }, + { url = "https://files.pythonhosted.org/packages/3a/1d/c8c40e611e5094330284b1aea8a4b02ca0858f8458614fa35754cab42b9c/aiohttp-3.12.15-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8466151554b593909d30a0a125d638b4e5f3836e5aecde85b66b80ded1cb5b0d", size = 469787, upload-time = "2025-07-29T05:50:49.669Z" }, + { url = "https://files.pythonhosted.org/packages/38/7d/b76438e70319796bfff717f325d97ce2e9310f752a267bfdf5192ac6082b/aiohttp-3.12.15-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2e5a495cb1be69dae4b08f35a6c4579c539e9b5706f606632102c0f855bcba7c", size = 1716590, upload-time = "2025-07-29T05:50:51.368Z" }, + { url = "https://files.pythonhosted.org/packages/79/b1/60370d70cdf8b269ee1444b390cbd72ce514f0d1cd1a715821c784d272c9/aiohttp-3.12.15-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:6404dfc8cdde35c69aaa489bb3542fb86ef215fc70277c892be8af540e5e21c0", size = 1699241, upload-time = "2025-07-29T05:50:53.628Z" }, + { url = "https://files.pythonhosted.org/packages/a3/2b/4968a7b8792437ebc12186db31523f541943e99bda8f30335c482bea6879/aiohttp-3.12.15-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3ead1c00f8521a5c9070fcb88f02967b1d8a0544e6d85c253f6968b785e1a2ab", size = 1754335, upload-time = "2025-07-29T05:50:55.394Z" }, + { url = "https://files.pythonhosted.org/packages/fb/c1/49524ed553f9a0bec1a11fac09e790f49ff669bcd14164f9fab608831c4d/aiohttp-3.12.15-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6990ef617f14450bc6b34941dba4f12d5613cbf4e33805932f853fbd1cf18bfb", size = 1800491, upload-time = "2025-07-29T05:50:57.202Z" }, + { url = "https://files.pythonhosted.org/packages/de/5e/3bf5acea47a96a28c121b167f5ef659cf71208b19e52a88cdfa5c37f1fcc/aiohttp-3.12.15-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fd736ed420f4db2b8148b52b46b88ed038d0354255f9a73196b7bbce3ea97545", size = 1719929, upload-time = "2025-07-29T05:50:59.192Z" }, + { url = "https://files.pythonhosted.org/packages/39/94/8ae30b806835bcd1cba799ba35347dee6961a11bd507db634516210e91d8/aiohttp-3.12.15-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3c5092ce14361a73086b90c6efb3948ffa5be2f5b6fbcf52e8d8c8b8848bb97c", size = 1635733, upload-time = "2025-07-29T05:51:01.394Z" }, + { url = "https://files.pythonhosted.org/packages/7a/46/06cdef71dd03acd9da7f51ab3a9107318aee12ad38d273f654e4f981583a/aiohttp-3.12.15-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:aaa2234bb60c4dbf82893e934d8ee8dea30446f0647e024074237a56a08c01bd", size = 1696790, upload-time = "2025-07-29T05:51:03.657Z" }, + { url = "https://files.pythonhosted.org/packages/02/90/6b4cfaaf92ed98d0ec4d173e78b99b4b1a7551250be8937d9d67ecb356b4/aiohttp-3.12.15-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:6d86a2fbdd14192e2f234a92d3b494dd4457e683ba07e5905a0b3ee25389ac9f", size = 1718245, upload-time = "2025-07-29T05:51:05.911Z" }, + { url = "https://files.pythonhosted.org/packages/2e/e6/2593751670fa06f080a846f37f112cbe6f873ba510d070136a6ed46117c6/aiohttp-3.12.15-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:a041e7e2612041a6ddf1c6a33b883be6a421247c7afd47e885969ee4cc58bd8d", size = 1658899, upload-time = "2025-07-29T05:51:07.753Z" }, + { url = "https://files.pythonhosted.org/packages/8f/28/c15bacbdb8b8eb5bf39b10680d129ea7410b859e379b03190f02fa104ffd/aiohttp-3.12.15-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:5015082477abeafad7203757ae44299a610e89ee82a1503e3d4184e6bafdd519", size = 1738459, upload-time = "2025-07-29T05:51:09.56Z" }, + { url = "https://files.pythonhosted.org/packages/00/de/c269cbc4faa01fb10f143b1670633a8ddd5b2e1ffd0548f7aa49cb5c70e2/aiohttp-3.12.15-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:56822ff5ddfd1b745534e658faba944012346184fbfe732e0d6134b744516eea", size = 1766434, upload-time = "2025-07-29T05:51:11.423Z" }, + { url = "https://files.pythonhosted.org/packages/52/b0/4ff3abd81aa7d929b27d2e1403722a65fc87b763e3a97b3a2a494bfc63bc/aiohttp-3.12.15-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b2acbbfff69019d9014508c4ba0401822e8bae5a5fdc3b6814285b71231b60f3", size = 1726045, upload-time = "2025-07-29T05:51:13.689Z" }, + { url = "https://files.pythonhosted.org/packages/71/16/949225a6a2dd6efcbd855fbd90cf476052e648fb011aa538e3b15b89a57a/aiohttp-3.12.15-cp312-cp312-win32.whl", hash = "sha256:d849b0901b50f2185874b9a232f38e26b9b3d4810095a7572eacea939132d4e1", size = 423591, upload-time = "2025-07-29T05:51:15.452Z" }, + { url = "https://files.pythonhosted.org/packages/2b/d8/fa65d2a349fe938b76d309db1a56a75c4fb8cc7b17a398b698488a939903/aiohttp-3.12.15-cp312-cp312-win_amd64.whl", hash = "sha256:b390ef5f62bb508a9d67cb3bba9b8356e23b3996da7062f1a57ce1a79d2b3d34", size = 450266, upload-time = "2025-07-29T05:51:17.239Z" }, + { url = "https://files.pythonhosted.org/packages/f2/33/918091abcf102e39d15aba2476ad9e7bd35ddb190dcdd43a854000d3da0d/aiohttp-3.12.15-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:9f922ffd05034d439dde1c77a20461cf4a1b0831e6caa26151fe7aa8aaebc315", size = 696741, upload-time = "2025-07-29T05:51:19.021Z" }, + { url = "https://files.pythonhosted.org/packages/b5/2a/7495a81e39a998e400f3ecdd44a62107254803d1681d9189be5c2e4530cd/aiohttp-3.12.15-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:2ee8a8ac39ce45f3e55663891d4b1d15598c157b4d494a4613e704c8b43112cd", size = 474407, upload-time = "2025-07-29T05:51:21.165Z" }, + { url = "https://files.pythonhosted.org/packages/49/fc/a9576ab4be2dcbd0f73ee8675d16c707cfc12d5ee80ccf4015ba543480c9/aiohttp-3.12.15-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:3eae49032c29d356b94eee45a3f39fdf4b0814b397638c2f718e96cfadf4c4e4", size = 466703, upload-time = "2025-07-29T05:51:22.948Z" }, + { url = "https://files.pythonhosted.org/packages/09/2f/d4bcc8448cf536b2b54eed48f19682031ad182faa3a3fee54ebe5b156387/aiohttp-3.12.15-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b97752ff12cc12f46a9b20327104448042fce5c33a624f88c18f66f9368091c7", size = 1705532, upload-time = "2025-07-29T05:51:25.211Z" }, + { url = "https://files.pythonhosted.org/packages/f1/f3/59406396083f8b489261e3c011aa8aee9df360a96ac8fa5c2e7e1b8f0466/aiohttp-3.12.15-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:894261472691d6fe76ebb7fcf2e5870a2ac284c7406ddc95823c8598a1390f0d", size = 1686794, upload-time = "2025-07-29T05:51:27.145Z" }, + { url = "https://files.pythonhosted.org/packages/dc/71/164d194993a8d114ee5656c3b7ae9c12ceee7040d076bf7b32fb98a8c5c6/aiohttp-3.12.15-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5fa5d9eb82ce98959fc1031c28198b431b4d9396894f385cb63f1e2f3f20ca6b", size = 1738865, upload-time = "2025-07-29T05:51:29.366Z" }, + { url = "https://files.pythonhosted.org/packages/1c/00/d198461b699188a93ead39cb458554d9f0f69879b95078dce416d3209b54/aiohttp-3.12.15-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f0fa751efb11a541f57db59c1dd821bec09031e01452b2b6217319b3a1f34f3d", size = 1788238, upload-time = "2025-07-29T05:51:31.285Z" }, + { url = "https://files.pythonhosted.org/packages/85/b8/9e7175e1fa0ac8e56baa83bf3c214823ce250d0028955dfb23f43d5e61fd/aiohttp-3.12.15-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5346b93e62ab51ee2a9d68e8f73c7cf96ffb73568a23e683f931e52450e4148d", size = 1710566, upload-time = "2025-07-29T05:51:33.219Z" }, + { url = "https://files.pythonhosted.org/packages/59/e4/16a8eac9df39b48ae102ec030fa9f726d3570732e46ba0c592aeeb507b93/aiohttp-3.12.15-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:049ec0360f939cd164ecbfd2873eaa432613d5e77d6b04535e3d1fbae5a9e645", size = 1624270, upload-time = "2025-07-29T05:51:35.195Z" }, + { url = "https://files.pythonhosted.org/packages/1f/f8/cd84dee7b6ace0740908fd0af170f9fab50c2a41ccbc3806aabcb1050141/aiohttp-3.12.15-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:b52dcf013b57464b6d1e51b627adfd69a8053e84b7103a7cd49c030f9ca44461", size = 1677294, upload-time = "2025-07-29T05:51:37.215Z" }, + { url = "https://files.pythonhosted.org/packages/ce/42/d0f1f85e50d401eccd12bf85c46ba84f947a84839c8a1c2c5f6e8ab1eb50/aiohttp-3.12.15-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:9b2af240143dd2765e0fb661fd0361a1b469cab235039ea57663cda087250ea9", size = 1708958, upload-time = "2025-07-29T05:51:39.328Z" }, + { url = "https://files.pythonhosted.org/packages/d5/6b/f6fa6c5790fb602538483aa5a1b86fcbad66244997e5230d88f9412ef24c/aiohttp-3.12.15-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:ac77f709a2cde2cc71257ab2d8c74dd157c67a0558a0d2799d5d571b4c63d44d", size = 1651553, upload-time = "2025-07-29T05:51:41.356Z" }, + { url = "https://files.pythonhosted.org/packages/04/36/a6d36ad545fa12e61d11d1932eef273928b0495e6a576eb2af04297fdd3c/aiohttp-3.12.15-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:47f6b962246f0a774fbd3b6b7be25d59b06fdb2f164cf2513097998fc6a29693", size = 1727688, upload-time = "2025-07-29T05:51:43.452Z" }, + { url = "https://files.pythonhosted.org/packages/aa/c8/f195e5e06608a97a4e52c5d41c7927301bf757a8e8bb5bbf8cef6c314961/aiohttp-3.12.15-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:760fb7db442f284996e39cf9915a94492e1896baac44f06ae551974907922b64", size = 1761157, upload-time = "2025-07-29T05:51:45.643Z" }, + { url = "https://files.pythonhosted.org/packages/05/6a/ea199e61b67f25ba688d3ce93f63b49b0a4e3b3d380f03971b4646412fc6/aiohttp-3.12.15-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ad702e57dc385cae679c39d318def49aef754455f237499d5b99bea4ef582e51", size = 1710050, upload-time = "2025-07-29T05:51:48.203Z" }, + { url = "https://files.pythonhosted.org/packages/b4/2e/ffeb7f6256b33635c29dbed29a22a723ff2dd7401fff42ea60cf2060abfb/aiohttp-3.12.15-cp313-cp313-win32.whl", hash = "sha256:f813c3e9032331024de2eb2e32a88d86afb69291fbc37a3a3ae81cc9917fb3d0", size = 422647, upload-time = "2025-07-29T05:51:50.718Z" }, + { url = "https://files.pythonhosted.org/packages/1b/8e/78ee35774201f38d5e1ba079c9958f7629b1fd079459aea9467441dbfbf5/aiohttp-3.12.15-cp313-cp313-win_amd64.whl", hash = "sha256:1a649001580bdb37c6fdb1bebbd7e3bc688e8ec2b5c6f52edbb664662b17dc84", size = 449067, upload-time = "2025-07-29T05:51:52.549Z" }, + { url = "https://files.pythonhosted.org/packages/18/8d/da08099af8db234d1cd43163e6ffc8e9313d0e988cee1901610f2fa5c764/aiohttp-3.12.15-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:691d203c2bdf4f4637792efbbcdcd157ae11e55eaeb5e9c360c1206fb03d4d98", size = 706829, upload-time = "2025-07-29T05:51:54.434Z" }, + { url = "https://files.pythonhosted.org/packages/4e/94/8eed385cfb60cf4fdb5b8a165f6148f3bebeb365f08663d83c35a5f273ef/aiohttp-3.12.15-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:8e995e1abc4ed2a454c731385bf4082be06f875822adc4c6d9eaadf96e20d406", size = 481806, upload-time = "2025-07-29T05:51:56.355Z" }, + { url = "https://files.pythonhosted.org/packages/38/68/b13e1a34584fbf263151b3a72a084e89f2102afe38df1dce5a05a15b83e9/aiohttp-3.12.15-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:bd44d5936ab3193c617bfd6c9a7d8d1085a8dc8c3f44d5f1dcf554d17d04cf7d", size = 469205, upload-time = "2025-07-29T05:51:58.277Z" }, + { url = "https://files.pythonhosted.org/packages/38/14/3d7348bf53aa4af54416bc64cbef3a2ac5e8b9bfa97cc45f1cf9a94d9c8d/aiohttp-3.12.15-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:46749be6e89cd78d6068cdf7da51dbcfa4321147ab8e4116ee6678d9a056a0cf", size = 1644174, upload-time = "2025-07-29T05:52:00.23Z" }, + { url = "https://files.pythonhosted.org/packages/ba/ed/fd9b5b22b0f6ca1a85c33bb4868cbcc6ae5eae070a0f4c9c5cad003c89d7/aiohttp-3.12.15-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:0c643f4d75adea39e92c0f01b3fb83d57abdec8c9279b3078b68a3a52b3933b6", size = 1618672, upload-time = "2025-07-29T05:52:02.272Z" }, + { url = "https://files.pythonhosted.org/packages/39/f7/f6530ab5f8c8c409e44a63fcad35e839c87aabecdfe5b8e96d671ed12f64/aiohttp-3.12.15-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0a23918fedc05806966a2438489dcffccbdf83e921a1170773b6178d04ade142", size = 1692295, upload-time = "2025-07-29T05:52:04.546Z" }, + { url = "https://files.pythonhosted.org/packages/cb/dc/3cf483bb0106566dc97ebaa2bb097f5e44d4bc4ab650a6f107151cd7b193/aiohttp-3.12.15-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:74bdd8c864b36c3673741023343565d95bfbd778ffe1eb4d412c135a28a8dc89", size = 1731609, upload-time = "2025-07-29T05:52:06.552Z" }, + { url = "https://files.pythonhosted.org/packages/de/a4/fd04bf807851197077d9cac9381d58f86d91c95c06cbaf9d3a776ac4467a/aiohttp-3.12.15-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0a146708808c9b7a988a4af3821379e379e0f0e5e466ca31a73dbdd0325b0263", size = 1637852, upload-time = "2025-07-29T05:52:08.975Z" }, + { url = "https://files.pythonhosted.org/packages/98/03/29d626ca3bcdcafbd74b45d77ca42645a5c94d396f2ee3446880ad2405fb/aiohttp-3.12.15-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b7011a70b56facde58d6d26da4fec3280cc8e2a78c714c96b7a01a87930a9530", size = 1572852, upload-time = "2025-07-29T05:52:11.508Z" }, + { url = "https://files.pythonhosted.org/packages/5f/cd/b4777a9e204f4e01091091027e5d1e2fa86decd0fee5067bc168e4fa1e76/aiohttp-3.12.15-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:3bdd6e17e16e1dbd3db74d7f989e8af29c4d2e025f9828e6ef45fbdee158ec75", size = 1620813, upload-time = "2025-07-29T05:52:13.891Z" }, + { url = "https://files.pythonhosted.org/packages/ae/26/1a44a6e8417e84057beaf8c462529b9e05d4b53b8605784f1eb571f0ff68/aiohttp-3.12.15-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:57d16590a351dfc914670bd72530fd78344b885a00b250e992faea565b7fdc05", size = 1630951, upload-time = "2025-07-29T05:52:15.955Z" }, + { url = "https://files.pythonhosted.org/packages/dd/7f/10c605dbd01c40e2b27df7ef9004bec75d156f0705141e11047ecdfe264d/aiohttp-3.12.15-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:bc9a0f6569ff990e0bbd75506c8d8fe7214c8f6579cca32f0546e54372a3bb54", size = 1607595, upload-time = "2025-07-29T05:52:18.089Z" }, + { url = "https://files.pythonhosted.org/packages/66/f6/2560dcb01731c1d7df1d34b64de95bc4b3ed02bb78830fd82299c1eb314e/aiohttp-3.12.15-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:536ad7234747a37e50e7b6794ea868833d5220b49c92806ae2d7e8a9d6b5de02", size = 1695194, upload-time = "2025-07-29T05:52:20.255Z" }, + { url = "https://files.pythonhosted.org/packages/e7/02/ee105ae82dc2b981039fd25b0cf6eaa52b493731960f9bc861375a72b463/aiohttp-3.12.15-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:f0adb4177fa748072546fb650d9bd7398caaf0e15b370ed3317280b13f4083b0", size = 1710872, upload-time = "2025-07-29T05:52:22.769Z" }, + { url = "https://files.pythonhosted.org/packages/88/16/70c4e42ed6a04f78fb58d1a46500a6ce560741d13afde2a5f33840746a5f/aiohttp-3.12.15-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:14954a2988feae3987f1eb49c706bff39947605f4b6fa4027c1d75743723eb09", size = 1640539, upload-time = "2025-07-29T05:52:25.733Z" }, + { url = "https://files.pythonhosted.org/packages/fe/1d/a7eb5fa8a6967117c5c0ad5ab4b1dec0d21e178c89aa08bc442a0b836392/aiohttp-3.12.15-cp39-cp39-win32.whl", hash = "sha256:b784d6ed757f27574dca1c336f968f4e81130b27595e458e69457e6878251f5d", size = 430164, upload-time = "2025-07-29T05:52:27.905Z" }, + { url = "https://files.pythonhosted.org/packages/14/25/e0cf8793aedc41c6d7f2aad646a27e27bdacafe3b402bb373d7651c94d73/aiohttp-3.12.15-cp39-cp39-win_amd64.whl", hash = "sha256:86ceded4e78a992f835209e236617bffae649371c4a50d5e5a3987f237db84b8", size = 453370, upload-time = "2025-07-29T05:52:29.936Z" }, ] [[package]] name = "aiosignal" -version = "1.3.2" +version = "1.4.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "frozenlist" }, + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/61/62/06741b579156360248d1ec624842ad0edf697050bbaf7c3e46394e106ad1/aiosignal-1.4.0.tar.gz", hash = "sha256:f47eecd9468083c2029cc99945502cb7708b082c232f9aca65da147157b251c7", size = 25007, upload-time = "2025-07-03T22:54:43.528Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fb/76/641ae371508676492379f16e2fa48f4e2c11741bd63c48be4b12a6b09cba/aiosignal-1.4.0-py3-none-any.whl", hash = "sha256:053243f8b92b990551949e63930a839ff0cf0b0ebbe0597b0f3fb19e1a0fe82e", size = 7490, upload-time = "2025-07-03T22:54:42.156Z" }, +] + +[[package]] +name = "aiosqlite" +version = "0.21.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/ba/b5/6d55e80f6d8a08ce22b982eafa278d823b541c925f11ee774b0b9c43473d/aiosignal-1.3.2.tar.gz", hash = "sha256:a8c255c66fafb1e499c9351d0bf32ff2d8a0321595ebac3b93713656d2436f54", size = 19424, upload-time = "2024-12-13T17:10:40.86Z" } +sdist = { url = "https://files.pythonhosted.org/packages/13/7d/8bca2bf9a247c2c5dfeec1d7a5f40db6518f88d314b8bca9da29670d2671/aiosqlite-0.21.0.tar.gz", hash = "sha256:131bb8056daa3bc875608c631c678cda73922a2d4ba8aec373b19f18c17e7aa3", size = 13454, upload-time = "2025-02-03T07:30:16.235Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/ec/6a/bc7e17a3e87a2985d3e8f4da4cd0f481060eb78fb08596c42be62c90a4d9/aiosignal-1.3.2-py2.py3-none-any.whl", hash = "sha256:45cde58e409a301715980c2b01d0c28bdde3770d8290b5eb2173759d9acb31a5", size = 7597, upload-time = "2024-12-13T17:10:38.469Z" }, + { url = "https://files.pythonhosted.org/packages/f5/10/6c25ed6de94c49f88a91fa5018cb4c0f3625f31d5be9f771ebe5cc7cd506/aiosqlite-0.21.0-py3-none-any.whl", hash = "sha256:2549cf4057f95f53dcba16f2b64e8e2791d7e1adedb13197dd8ed77bb226d7d0", size = 15792, upload-time = "2025-02-03T07:30:13.6Z" }, ] [[package]] @@ -136,7 +155,7 @@ wheels = [ [[package]] name = "anyio" -version = "4.9.0" +version = "4.10.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "exceptiongroup", marker = "python_full_version < '3.11'" }, @@ -144,9 +163,9 @@ dependencies = [ { name = "sniffio" }, { name = "typing-extensions", marker = "python_full_version < '3.13'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/95/7d/4c1bd541d4dffa1b52bd83fb8527089e097a106fc90b467a7313b105f840/anyio-4.9.0.tar.gz", hash = "sha256:673c0c244e15788651a4ff38710fea9675823028a6f08a5eda409e0c9840a028", size = 190949, upload-time = "2025-03-17T00:02:54.77Z" } +sdist = { url = "https://files.pythonhosted.org/packages/f1/b4/636b3b65173d3ce9a38ef5f0522789614e590dab6a8d505340a4efe4c567/anyio-4.10.0.tar.gz", hash = "sha256:3f3fae35c96039744587aa5b8371e7e8e603c0702999535961dd336026973ba6", size = 213252, upload-time = "2025-08-04T08:54:26.451Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/a1/ee/48ca1a7c89ffec8b6a0c5d02b89c305671d5ffd8d3c94acf8b8c408575bb/anyio-4.9.0-py3-none-any.whl", hash = "sha256:9f76d541cad6e36af7beb62e978876f3b41e3e04f2c1fbf0884604c0a9c4d93c", size = 100916, upload-time = "2025-03-17T00:02:52.713Z" }, + { url = "https://files.pythonhosted.org/packages/6f/12/e5e0282d673bb9746bacfb6e2dba8719989d3660cdb2ea79aee9a9651afb/anyio-4.10.0-py3-none-any.whl", hash = "sha256:60e474ac86736bbfd6f210f7a61218939c318f43f9972497381f1c5e930ed3d1", size = 107213, upload-time = "2025-08-04T08:54:24.882Z" }, ] [[package]] @@ -167,6 +186,57 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/fe/ba/e2081de779ca30d473f21f5b30e0e737c438205440784c7dfc81efc2b029/async_timeout-5.0.1-py3-none-any.whl", hash = "sha256:39e3809566ff85354557ec2398b55e096c8364bacac9405a7a1fa429e77fe76c", size = 6233, upload-time = "2024-11-06T16:41:37.9Z" }, ] +[[package]] +name = "asyncpg" +version = "0.30.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "async-timeout", marker = "python_full_version < '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/2f/4c/7c991e080e106d854809030d8584e15b2e996e26f16aee6d757e387bc17d/asyncpg-0.30.0.tar.gz", hash = "sha256:c551e9928ab6707602f44811817f82ba3c446e018bfe1d3abecc8ba5f3eac851", size = 957746, upload-time = "2024-10-20T00:30:41.127Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/bb/07/1650a8c30e3a5c625478fa8aafd89a8dd7d85999bf7169b16f54973ebf2c/asyncpg-0.30.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:bfb4dd5ae0699bad2b233672c8fc5ccbd9ad24b89afded02341786887e37927e", size = 673143, upload-time = "2024-10-20T00:29:08.846Z" }, + { url = "https://files.pythonhosted.org/packages/a0/9a/568ff9b590d0954553c56806766914c149609b828c426c5118d4869111d3/asyncpg-0.30.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:dc1f62c792752a49f88b7e6f774c26077091b44caceb1983509edc18a2222ec0", size = 645035, upload-time = "2024-10-20T00:29:12.02Z" }, + { url = "https://files.pythonhosted.org/packages/de/11/6f2fa6c902f341ca10403743701ea952bca896fc5b07cc1f4705d2bb0593/asyncpg-0.30.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3152fef2e265c9c24eec4ee3d22b4f4d2703d30614b0b6753e9ed4115c8a146f", size = 2912384, upload-time = "2024-10-20T00:29:13.644Z" }, + { url = "https://files.pythonhosted.org/packages/83/83/44bd393919c504ffe4a82d0aed8ea0e55eb1571a1dea6a4922b723f0a03b/asyncpg-0.30.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c7255812ac85099a0e1ffb81b10dc477b9973345793776b128a23e60148dd1af", size = 2947526, upload-time = "2024-10-20T00:29:15.871Z" }, + { url = "https://files.pythonhosted.org/packages/08/85/e23dd3a2b55536eb0ded80c457b0693352262dc70426ef4d4a6fc994fa51/asyncpg-0.30.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:578445f09f45d1ad7abddbff2a3c7f7c291738fdae0abffbeb737d3fc3ab8b75", size = 2895390, upload-time = "2024-10-20T00:29:19.346Z" }, + { url = "https://files.pythonhosted.org/packages/9b/26/fa96c8f4877d47dc6c1864fef5500b446522365da3d3d0ee89a5cce71a3f/asyncpg-0.30.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:c42f6bb65a277ce4d93f3fba46b91a265631c8df7250592dd4f11f8b0152150f", size = 3015630, upload-time = "2024-10-20T00:29:21.186Z" }, + { url = "https://files.pythonhosted.org/packages/34/00/814514eb9287614188a5179a8b6e588a3611ca47d41937af0f3a844b1b4b/asyncpg-0.30.0-cp310-cp310-win32.whl", hash = "sha256:aa403147d3e07a267ada2ae34dfc9324e67ccc4cdca35261c8c22792ba2b10cf", size = 568760, upload-time = "2024-10-20T00:29:22.769Z" }, + { url = "https://files.pythonhosted.org/packages/f0/28/869a7a279400f8b06dd237266fdd7220bc5f7c975348fea5d1e6909588e9/asyncpg-0.30.0-cp310-cp310-win_amd64.whl", hash = "sha256:fb622c94db4e13137c4c7f98834185049cc50ee01d8f657ef898b6407c7b9c50", size = 625764, upload-time = "2024-10-20T00:29:25.882Z" }, + { url = "https://files.pythonhosted.org/packages/4c/0e/f5d708add0d0b97446c402db7e8dd4c4183c13edaabe8a8500b411e7b495/asyncpg-0.30.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:5e0511ad3dec5f6b4f7a9e063591d407eee66b88c14e2ea636f187da1dcfff6a", size = 674506, upload-time = "2024-10-20T00:29:27.988Z" }, + { url = "https://files.pythonhosted.org/packages/6a/a0/67ec9a75cb24a1d99f97b8437c8d56da40e6f6bd23b04e2f4ea5d5ad82ac/asyncpg-0.30.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:915aeb9f79316b43c3207363af12d0e6fd10776641a7de8a01212afd95bdf0ed", size = 645922, upload-time = "2024-10-20T00:29:29.391Z" }, + { url = "https://files.pythonhosted.org/packages/5c/d9/a7584f24174bd86ff1053b14bb841f9e714380c672f61c906eb01d8ec433/asyncpg-0.30.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1c198a00cce9506fcd0bf219a799f38ac7a237745e1d27f0e1f66d3707c84a5a", size = 3079565, upload-time = "2024-10-20T00:29:30.832Z" }, + { url = "https://files.pythonhosted.org/packages/a0/d7/a4c0f9660e333114bdb04d1a9ac70db690dd4ae003f34f691139a5cbdae3/asyncpg-0.30.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3326e6d7381799e9735ca2ec9fd7be4d5fef5dcbc3cb555d8a463d8460607956", size = 3109962, upload-time = "2024-10-20T00:29:33.114Z" }, + { url = "https://files.pythonhosted.org/packages/3c/21/199fd16b5a981b1575923cbb5d9cf916fdc936b377e0423099f209e7e73d/asyncpg-0.30.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:51da377487e249e35bd0859661f6ee2b81db11ad1f4fc036194bc9cb2ead5056", size = 3064791, upload-time = "2024-10-20T00:29:34.677Z" }, + { url = "https://files.pythonhosted.org/packages/77/52/0004809b3427534a0c9139c08c87b515f1c77a8376a50ae29f001e53962f/asyncpg-0.30.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:bc6d84136f9c4d24d358f3b02be4b6ba358abd09f80737d1ac7c444f36108454", size = 3188696, upload-time = "2024-10-20T00:29:36.389Z" }, + { url = "https://files.pythonhosted.org/packages/52/cb/fbad941cd466117be58b774a3f1cc9ecc659af625f028b163b1e646a55fe/asyncpg-0.30.0-cp311-cp311-win32.whl", hash = "sha256:574156480df14f64c2d76450a3f3aaaf26105869cad3865041156b38459e935d", size = 567358, upload-time = "2024-10-20T00:29:37.915Z" }, + { url = "https://files.pythonhosted.org/packages/3c/0a/0a32307cf166d50e1ad120d9b81a33a948a1a5463ebfa5a96cc5606c0863/asyncpg-0.30.0-cp311-cp311-win_amd64.whl", hash = "sha256:3356637f0bd830407b5597317b3cb3571387ae52ddc3bca6233682be88bbbc1f", size = 629375, upload-time = "2024-10-20T00:29:39.987Z" }, + { url = "https://files.pythonhosted.org/packages/4b/64/9d3e887bb7b01535fdbc45fbd5f0a8447539833b97ee69ecdbb7a79d0cb4/asyncpg-0.30.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:c902a60b52e506d38d7e80e0dd5399f657220f24635fee368117b8b5fce1142e", size = 673162, upload-time = "2024-10-20T00:29:41.88Z" }, + { url = "https://files.pythonhosted.org/packages/6e/eb/8b236663f06984f212a087b3e849731f917ab80f84450e943900e8ca4052/asyncpg-0.30.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:aca1548e43bbb9f0f627a04666fedaca23db0a31a84136ad1f868cb15deb6e3a", size = 637025, upload-time = "2024-10-20T00:29:43.352Z" }, + { url = "https://files.pythonhosted.org/packages/cc/57/2dc240bb263d58786cfaa60920779af6e8d32da63ab9ffc09f8312bd7a14/asyncpg-0.30.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6c2a2ef565400234a633da0eafdce27e843836256d40705d83ab7ec42074efb3", size = 3496243, upload-time = "2024-10-20T00:29:44.922Z" }, + { url = "https://files.pythonhosted.org/packages/f4/40/0ae9d061d278b10713ea9021ef6b703ec44698fe32178715a501ac696c6b/asyncpg-0.30.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1292b84ee06ac8a2ad8e51c7475aa309245874b61333d97411aab835c4a2f737", size = 3575059, upload-time = "2024-10-20T00:29:46.891Z" }, + { url = "https://files.pythonhosted.org/packages/c3/75/d6b895a35a2c6506952247640178e5f768eeb28b2e20299b6a6f1d743ba0/asyncpg-0.30.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:0f5712350388d0cd0615caec629ad53c81e506b1abaaf8d14c93f54b35e3595a", size = 3473596, upload-time = "2024-10-20T00:29:49.201Z" }, + { url = "https://files.pythonhosted.org/packages/c8/e7/3693392d3e168ab0aebb2d361431375bd22ffc7b4a586a0fc060d519fae7/asyncpg-0.30.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:db9891e2d76e6f425746c5d2da01921e9a16b5a71a1c905b13f30e12a257c4af", size = 3641632, upload-time = "2024-10-20T00:29:50.768Z" }, + { url = "https://files.pythonhosted.org/packages/32/ea/15670cea95745bba3f0352341db55f506a820b21c619ee66b7d12ea7867d/asyncpg-0.30.0-cp312-cp312-win32.whl", hash = "sha256:68d71a1be3d83d0570049cd1654a9bdfe506e794ecc98ad0873304a9f35e411e", size = 560186, upload-time = "2024-10-20T00:29:52.394Z" }, + { url = "https://files.pythonhosted.org/packages/7e/6b/fe1fad5cee79ca5f5c27aed7bd95baee529c1bf8a387435c8ba4fe53d5c1/asyncpg-0.30.0-cp312-cp312-win_amd64.whl", hash = "sha256:9a0292c6af5c500523949155ec17b7fe01a00ace33b68a476d6b5059f9630305", size = 621064, upload-time = "2024-10-20T00:29:53.757Z" }, + { url = "https://files.pythonhosted.org/packages/3a/22/e20602e1218dc07692acf70d5b902be820168d6282e69ef0d3cb920dc36f/asyncpg-0.30.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:05b185ebb8083c8568ea8a40e896d5f7af4b8554b64d7719c0eaa1eb5a5c3a70", size = 670373, upload-time = "2024-10-20T00:29:55.165Z" }, + { url = "https://files.pythonhosted.org/packages/3d/b3/0cf269a9d647852a95c06eb00b815d0b95a4eb4b55aa2d6ba680971733b9/asyncpg-0.30.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:c47806b1a8cbb0a0db896f4cd34d89942effe353a5035c62734ab13b9f938da3", size = 634745, upload-time = "2024-10-20T00:29:57.14Z" }, + { url = "https://files.pythonhosted.org/packages/8e/6d/a4f31bf358ce8491d2a31bfe0d7bcf25269e80481e49de4d8616c4295a34/asyncpg-0.30.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9b6fde867a74e8c76c71e2f64f80c64c0f3163e687f1763cfaf21633ec24ec33", size = 3512103, upload-time = "2024-10-20T00:29:58.499Z" }, + { url = "https://files.pythonhosted.org/packages/96/19/139227a6e67f407b9c386cb594d9628c6c78c9024f26df87c912fabd4368/asyncpg-0.30.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:46973045b567972128a27d40001124fbc821c87a6cade040cfcd4fa8a30bcdc4", size = 3592471, upload-time = "2024-10-20T00:30:00.354Z" }, + { url = "https://files.pythonhosted.org/packages/67/e4/ab3ca38f628f53f0fd28d3ff20edff1c975dd1cb22482e0061916b4b9a74/asyncpg-0.30.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:9110df111cabc2ed81aad2f35394a00cadf4f2e0635603db6ebbd0fc896f46a4", size = 3496253, upload-time = "2024-10-20T00:30:02.794Z" }, + { url = "https://files.pythonhosted.org/packages/ef/5f/0bf65511d4eeac3a1f41c54034a492515a707c6edbc642174ae79034d3ba/asyncpg-0.30.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:04ff0785ae7eed6cc138e73fc67b8e51d54ee7a3ce9b63666ce55a0bf095f7ba", size = 3662720, upload-time = "2024-10-20T00:30:04.501Z" }, + { url = "https://files.pythonhosted.org/packages/e7/31/1513d5a6412b98052c3ed9158d783b1e09d0910f51fbe0e05f56cc370bc4/asyncpg-0.30.0-cp313-cp313-win32.whl", hash = "sha256:ae374585f51c2b444510cdf3595b97ece4f233fde739aa14b50e0d64e8a7a590", size = 560404, upload-time = "2024-10-20T00:30:06.537Z" }, + { url = "https://files.pythonhosted.org/packages/c8/a4/cec76b3389c4c5ff66301cd100fe88c318563ec8a520e0b2e792b5b84972/asyncpg-0.30.0-cp313-cp313-win_amd64.whl", hash = "sha256:f59b430b8e27557c3fb9869222559f7417ced18688375825f8f12302c34e915e", size = 621623, upload-time = "2024-10-20T00:30:09.024Z" }, + { url = "https://files.pythonhosted.org/packages/b4/82/d94f3ed6921136a0ef40a825740eda19437ccdad7d92d924302dca1d5c9e/asyncpg-0.30.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6f4e83f067b35ab5e6371f8a4c93296e0439857b4569850b178a01385e82e9ad", size = 673026, upload-time = "2024-10-20T00:30:26.928Z" }, + { url = "https://files.pythonhosted.org/packages/4e/db/7db8b73c5d86ec9a21807f405e0698f8f637a8a3ca14b7b6fd4259b66bcf/asyncpg-0.30.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:5df69d55add4efcd25ea2a3b02025b669a285b767bfbf06e356d68dbce4234ff", size = 644732, upload-time = "2024-10-20T00:30:28.393Z" }, + { url = "https://files.pythonhosted.org/packages/eb/a0/1f1910659d08050cb3e8f7d82b32983974798d7fd4ddf7620b8e2023d4ac/asyncpg-0.30.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a3479a0d9a852c7c84e822c073622baca862d1217b10a02dd57ee4a7a081f708", size = 2911761, upload-time = "2024-10-20T00:30:30.569Z" }, + { url = "https://files.pythonhosted.org/packages/4d/53/5aa0d92488ded50bab2b6626430ed9743b0b7e2d864a2b435af1ccbf219a/asyncpg-0.30.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:26683d3b9a62836fad771a18ecf4659a30f348a561279d6227dab96182f46144", size = 2946595, upload-time = "2024-10-20T00:30:32.244Z" }, + { url = "https://files.pythonhosted.org/packages/c5/cd/d6d548d8ee721f4e0f7fbbe509bbac140d556c2e45814d945540c96cf7d4/asyncpg-0.30.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:1b982daf2441a0ed314bd10817f1606f1c28b1136abd9e4f11335358c2c631cb", size = 2890135, upload-time = "2024-10-20T00:30:33.817Z" }, + { url = "https://files.pythonhosted.org/packages/46/f0/28df398b685dabee20235e24880e1f6486d84ae7e6b0d11bdebc17740e7a/asyncpg-0.30.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:1c06a3a50d014b303e5f6fc1e5f95eb28d2cee89cf58384b700da621e5d5e547", size = 3011889, upload-time = "2024-10-20T00:30:35.378Z" }, + { url = "https://files.pythonhosted.org/packages/c8/07/8c7ffe6fe8bccff9b12fcb6410b1b2fa74b917fd8b837806a40217d5228b/asyncpg-0.30.0-cp39-cp39-win32.whl", hash = "sha256:1b11a555a198b08f5c4baa8f8231c74a366d190755aa4f99aacec5970afe929a", size = 569406, upload-time = "2024-10-20T00:30:37.644Z" }, + { url = "https://files.pythonhosted.org/packages/05/51/f59e4df6d9b8937530d4b9fdee1598b93db40c631fe94ff3ce64207b7a95/asyncpg-0.30.0-cp39-cp39-win_amd64.whl", hash = "sha256:8b684a3c858a83cd876f05958823b68e8d14ec01bb0c0d14a6704c5bf9711773", size = 626581, upload-time = "2024-10-20T00:30:39.69Z" }, +] + [[package]] name = "attrs" version = "25.3.0" @@ -185,26 +255,36 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/b7/b8/3fe70c75fe32afc4bb507f75563d39bc5642255d1d94f1f23604725780bf/babel-2.17.0-py3-none-any.whl", hash = "sha256:4d0b53093fdfb4b21c92b5213dba5a1b23885afa8383709427046b21c366e5f2", size = 10182537, upload-time = "2025-02-01T15:17:37.39Z" }, ] +[[package]] +name = "backports-asyncio-runner" +version = "1.2.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/8e/ff/70dca7d7cb1cbc0edb2c6cc0c38b65cba36cccc491eca64cabd5fe7f8670/backports_asyncio_runner-1.2.0.tar.gz", hash = "sha256:a5aa7b2b7d8f8bfcaa2b57313f70792df84e32a2a746f585213373f900b42162", size = 69893, upload-time = "2025-07-02T02:27:15.685Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a0/59/76ab57e3fe74484f48a53f8e337171b4a2349e506eabe136d7e01d059086/backports_asyncio_runner-1.2.0-py3-none-any.whl", hash = "sha256:0da0a936a8aeb554eccb426dc55af3ba63bcdc69fa1a600b5bb305413a4477b5", size = 12313, upload-time = "2025-07-02T02:27:14.263Z" }, +] + [[package]] name = "backrefs" -version = "5.8" +version = "5.9" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/6c/46/caba1eb32fa5784428ab401a5487f73db4104590ecd939ed9daaf18b47e0/backrefs-5.8.tar.gz", hash = "sha256:2cab642a205ce966af3dd4b38ee36009b31fa9502a35fd61d59ccc116e40a6bd", size = 6773994, upload-time = "2025-02-25T18:15:32.003Z" } +sdist = { url = "https://files.pythonhosted.org/packages/eb/a7/312f673df6a79003279e1f55619abbe7daebbb87c17c976ddc0345c04c7b/backrefs-5.9.tar.gz", hash = "sha256:808548cb708d66b82ee231f962cb36faaf4f2baab032f2fbb783e9c2fdddaa59", size = 5765857, upload-time = "2025-06-22T19:34:13.97Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/bf/cb/d019ab87fe70e0fe3946196d50d6a4428623dc0c38a6669c8cae0320fbf3/backrefs-5.8-py310-none-any.whl", hash = "sha256:c67f6638a34a5b8730812f5101376f9d41dc38c43f1fdc35cb54700f6ed4465d", size = 380337, upload-time = "2025-02-25T16:53:14.607Z" }, - { url = "https://files.pythonhosted.org/packages/a9/86/abd17f50ee21b2248075cb6924c6e7f9d23b4925ca64ec660e869c2633f1/backrefs-5.8-py311-none-any.whl", hash = "sha256:2e1c15e4af0e12e45c8701bd5da0902d326b2e200cafcd25e49d9f06d44bb61b", size = 392142, upload-time = "2025-02-25T16:53:17.266Z" }, - { url = "https://files.pythonhosted.org/packages/b3/04/7b415bd75c8ab3268cc138c76fa648c19495fcc7d155508a0e62f3f82308/backrefs-5.8-py312-none-any.whl", hash = "sha256:bbef7169a33811080d67cdf1538c8289f76f0942ff971222a16034da88a73486", size = 398021, upload-time = "2025-02-25T16:53:26.378Z" }, - { url = "https://files.pythonhosted.org/packages/04/b8/60dcfb90eb03a06e883a92abbc2ab95c71f0d8c9dd0af76ab1d5ce0b1402/backrefs-5.8-py313-none-any.whl", hash = "sha256:e3a63b073867dbefd0536425f43db618578528e3896fb77be7141328642a1585", size = 399915, upload-time = "2025-02-25T16:53:28.167Z" }, - { url = "https://files.pythonhosted.org/packages/0c/37/fb6973edeb700f6e3d6ff222400602ab1830446c25c7b4676d8de93e65b8/backrefs-5.8-py39-none-any.whl", hash = "sha256:a66851e4533fb5b371aa0628e1fee1af05135616b86140c9d787a2ffdf4b8fdc", size = 380336, upload-time = "2025-02-25T16:53:29.858Z" }, + { url = "https://files.pythonhosted.org/packages/19/4d/798dc1f30468134906575156c089c492cf79b5a5fd373f07fe26c4d046bf/backrefs-5.9-py310-none-any.whl", hash = "sha256:db8e8ba0e9de81fcd635f440deab5ae5f2591b54ac1ebe0550a2ca063488cd9f", size = 380267, upload-time = "2025-06-22T19:34:05.252Z" }, + { url = "https://files.pythonhosted.org/packages/55/07/f0b3375bf0d06014e9787797e6b7cc02b38ac9ff9726ccfe834d94e9991e/backrefs-5.9-py311-none-any.whl", hash = "sha256:6907635edebbe9b2dc3de3a2befff44d74f30a4562adbb8b36f21252ea19c5cf", size = 392072, upload-time = "2025-06-22T19:34:06.743Z" }, + { url = "https://files.pythonhosted.org/packages/9d/12/4f345407259dd60a0997107758ba3f221cf89a9b5a0f8ed5b961aef97253/backrefs-5.9-py312-none-any.whl", hash = "sha256:7fdf9771f63e6028d7fee7e0c497c81abda597ea45d6b8f89e8ad76994f5befa", size = 397947, upload-time = "2025-06-22T19:34:08.172Z" }, + { url = "https://files.pythonhosted.org/packages/10/bf/fa31834dc27a7f05e5290eae47c82690edc3a7b37d58f7fb35a1bdbf355b/backrefs-5.9-py313-none-any.whl", hash = "sha256:cc37b19fa219e93ff825ed1fed8879e47b4d89aa7a1884860e2db64ccd7c676b", size = 399843, upload-time = "2025-06-22T19:34:09.68Z" }, + { url = "https://files.pythonhosted.org/packages/fc/24/b29af34b2c9c41645a9f4ff117bae860291780d73880f449e0b5d948c070/backrefs-5.9-py314-none-any.whl", hash = "sha256:df5e169836cc8acb5e440ebae9aad4bf9d15e226d3bad049cf3f6a5c20cc8dc9", size = 411762, upload-time = "2025-06-22T19:34:11.037Z" }, + { url = "https://files.pythonhosted.org/packages/41/ff/392bff89415399a979be4a65357a41d92729ae8580a66073d8ec8d810f98/backrefs-5.9-py39-none-any.whl", hash = "sha256:f48ee18f6252b8f5777a22a00a09a85de0ca931658f1dd96d4406a34f3748c60", size = 380265, upload-time = "2025-06-22T19:34:12.405Z" }, ] [[package]] name = "certifi" -version = "2025.1.31" +version = "2025.8.3" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/1c/ab/c9f1e32b7b1bf505bf26f0ef697775960db7932abeb7b516de930ba2705f/certifi-2025.1.31.tar.gz", hash = "sha256:3d5da6925056f6f18f119200434a4780a94263f10d1c21d032a6f6b2baa20651", size = 167577, upload-time = "2025-01-31T02:16:47.166Z" } +sdist = { url = "https://files.pythonhosted.org/packages/dc/67/960ebe6bf230a96cda2e0abcf73af550ec4f090005363542f0765df162e0/certifi-2025.8.3.tar.gz", hash = "sha256:e564105f78ded564e3ae7c923924435e1daa7463faeab5bb932bc53ffae63407", size = 162386, upload-time = "2025-08-03T03:07:47.08Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/38/fc/bce832fd4fd99766c04d1ee0eead6b0ec6486fb100ae5e74c1d91292b982/certifi-2025.1.31-py3-none-any.whl", hash = "sha256:ca78db4565a652026a4db2bcdf68f2fb589ea80d0be70e03929ed730746b84fe", size = 166393, upload-time = "2025-01-31T02:16:45.015Z" }, + { url = "https://files.pythonhosted.org/packages/e5/48/1549795ba7742c948d2ad169c1c8cdbae65bc450d6cd753d124b17c8cd32/certifi-2025.8.3-py3-none-any.whl", hash = "sha256:f6c12493cfb1b06ba2ff328595af9350c65d6644968e5d3a2ffd78699af217a5", size = 161216, upload-time = "2025-08-03T03:07:45.777Z" }, ] [[package]] @@ -278,90 +358,110 @@ wheels = [ [[package]] name = "charset-normalizer" -version = "3.4.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/16/b0/572805e227f01586461c80e0fd25d65a2115599cc9dad142fee4b747c357/charset_normalizer-3.4.1.tar.gz", hash = "sha256:44251f18cd68a75b56585dd00dae26183e102cd5e0f9f1466e6df5da2ed64ea3", size = 123188, upload-time = "2024-12-24T18:12:35.43Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/0d/58/5580c1716040bc89206c77d8f74418caf82ce519aae06450393ca73475d1/charset_normalizer-3.4.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:91b36a978b5ae0ee86c394f5a54d6ef44db1de0815eb43de826d41d21e4af3de", size = 198013, upload-time = "2024-12-24T18:09:43.671Z" }, - { url = "https://files.pythonhosted.org/packages/d0/11/00341177ae71c6f5159a08168bcb98c6e6d196d372c94511f9f6c9afe0c6/charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7461baadb4dc00fd9e0acbe254e3d7d2112e7f92ced2adc96e54ef6501c5f176", size = 141285, upload-time = "2024-12-24T18:09:48.113Z" }, - { url = "https://files.pythonhosted.org/packages/01/09/11d684ea5819e5a8f5100fb0b38cf8d02b514746607934134d31233e02c8/charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e218488cd232553829be0664c2292d3af2eeeb94b32bea483cf79ac6a694e037", size = 151449, upload-time = "2024-12-24T18:09:50.845Z" }, - { url = "https://files.pythonhosted.org/packages/08/06/9f5a12939db324d905dc1f70591ae7d7898d030d7662f0d426e2286f68c9/charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:80ed5e856eb7f30115aaf94e4a08114ccc8813e6ed1b5efa74f9f82e8509858f", size = 143892, upload-time = "2024-12-24T18:09:52.078Z" }, - { url = "https://files.pythonhosted.org/packages/93/62/5e89cdfe04584cb7f4d36003ffa2936681b03ecc0754f8e969c2becb7e24/charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b010a7a4fd316c3c484d482922d13044979e78d1861f0e0650423144c616a46a", size = 146123, upload-time = "2024-12-24T18:09:54.575Z" }, - { url = "https://files.pythonhosted.org/packages/a9/ac/ab729a15c516da2ab70a05f8722ecfccc3f04ed7a18e45c75bbbaa347d61/charset_normalizer-3.4.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4532bff1b8421fd0a320463030c7520f56a79c9024a4e88f01c537316019005a", size = 147943, upload-time = "2024-12-24T18:09:57.324Z" }, - { url = "https://files.pythonhosted.org/packages/03/d2/3f392f23f042615689456e9a274640c1d2e5dd1d52de36ab8f7955f8f050/charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:d973f03c0cb71c5ed99037b870f2be986c3c05e63622c017ea9816881d2dd247", size = 142063, upload-time = "2024-12-24T18:09:59.794Z" }, - { url = "https://files.pythonhosted.org/packages/f2/e3/e20aae5e1039a2cd9b08d9205f52142329f887f8cf70da3650326670bddf/charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:3a3bd0dcd373514dcec91c411ddb9632c0d7d92aed7093b8c3bbb6d69ca74408", size = 150578, upload-time = "2024-12-24T18:10:02.357Z" }, - { url = "https://files.pythonhosted.org/packages/8d/af/779ad72a4da0aed925e1139d458adc486e61076d7ecdcc09e610ea8678db/charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:d9c3cdf5390dcd29aa8056d13e8e99526cda0305acc038b96b30352aff5ff2bb", size = 153629, upload-time = "2024-12-24T18:10:03.678Z" }, - { url = "https://files.pythonhosted.org/packages/c2/b6/7aa450b278e7aa92cf7732140bfd8be21f5f29d5bf334ae987c945276639/charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:2bdfe3ac2e1bbe5b59a1a63721eb3b95fc9b6817ae4a46debbb4e11f6232428d", size = 150778, upload-time = "2024-12-24T18:10:06.197Z" }, - { url = "https://files.pythonhosted.org/packages/39/f4/d9f4f712d0951dcbfd42920d3db81b00dd23b6ab520419626f4023334056/charset_normalizer-3.4.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:eab677309cdb30d047996b36d34caeda1dc91149e4fdca0b1a039b3f79d9a807", size = 146453, upload-time = "2024-12-24T18:10:08.848Z" }, - { url = "https://files.pythonhosted.org/packages/49/2b/999d0314e4ee0cff3cb83e6bc9aeddd397eeed693edb4facb901eb8fbb69/charset_normalizer-3.4.1-cp310-cp310-win32.whl", hash = "sha256:c0429126cf75e16c4f0ad00ee0eae4242dc652290f940152ca8c75c3a4b6ee8f", size = 95479, upload-time = "2024-12-24T18:10:10.044Z" }, - { url = "https://files.pythonhosted.org/packages/2d/ce/3cbed41cff67e455a386fb5e5dd8906cdda2ed92fbc6297921f2e4419309/charset_normalizer-3.4.1-cp310-cp310-win_amd64.whl", hash = "sha256:9f0b8b1c6d84c8034a44893aba5e767bf9c7a211e313a9605d9c617d7083829f", size = 102790, upload-time = "2024-12-24T18:10:11.323Z" }, - { url = "https://files.pythonhosted.org/packages/72/80/41ef5d5a7935d2d3a773e3eaebf0a9350542f2cab4eac59a7a4741fbbbbe/charset_normalizer-3.4.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:8bfa33f4f2672964266e940dd22a195989ba31669bd84629f05fab3ef4e2d125", size = 194995, upload-time = "2024-12-24T18:10:12.838Z" }, - { url = "https://files.pythonhosted.org/packages/7a/28/0b9fefa7b8b080ec492110af6d88aa3dea91c464b17d53474b6e9ba5d2c5/charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:28bf57629c75e810b6ae989f03c0828d64d6b26a5e205535585f96093e405ed1", size = 139471, upload-time = "2024-12-24T18:10:14.101Z" }, - { url = "https://files.pythonhosted.org/packages/71/64/d24ab1a997efb06402e3fc07317e94da358e2585165930d9d59ad45fcae2/charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f08ff5e948271dc7e18a35641d2f11a4cd8dfd5634f55228b691e62b37125eb3", size = 149831, upload-time = "2024-12-24T18:10:15.512Z" }, - { url = "https://files.pythonhosted.org/packages/37/ed/be39e5258e198655240db5e19e0b11379163ad7070962d6b0c87ed2c4d39/charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:234ac59ea147c59ee4da87a0c0f098e9c8d169f4dc2a159ef720f1a61bbe27cd", size = 142335, upload-time = "2024-12-24T18:10:18.369Z" }, - { url = "https://files.pythonhosted.org/packages/88/83/489e9504711fa05d8dde1574996408026bdbdbd938f23be67deebb5eca92/charset_normalizer-3.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fd4ec41f914fa74ad1b8304bbc634b3de73d2a0889bd32076342a573e0779e00", size = 143862, upload-time = "2024-12-24T18:10:19.743Z" }, - { url = "https://files.pythonhosted.org/packages/c6/c7/32da20821cf387b759ad24627a9aca289d2822de929b8a41b6241767b461/charset_normalizer-3.4.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eea6ee1db730b3483adf394ea72f808b6e18cf3cb6454b4d86e04fa8c4327a12", size = 145673, upload-time = "2024-12-24T18:10:21.139Z" }, - { url = "https://files.pythonhosted.org/packages/68/85/f4288e96039abdd5aeb5c546fa20a37b50da71b5cf01e75e87f16cd43304/charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:c96836c97b1238e9c9e3fe90844c947d5afbf4f4c92762679acfe19927d81d77", size = 140211, upload-time = "2024-12-24T18:10:22.382Z" }, - { url = "https://files.pythonhosted.org/packages/28/a3/a42e70d03cbdabc18997baf4f0227c73591a08041c149e710045c281f97b/charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:4d86f7aff21ee58f26dcf5ae81a9addbd914115cdebcbb2217e4f0ed8982e146", size = 148039, upload-time = "2024-12-24T18:10:24.802Z" }, - { url = "https://files.pythonhosted.org/packages/85/e4/65699e8ab3014ecbe6f5c71d1a55d810fb716bbfd74f6283d5c2aa87febf/charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:09b5e6733cbd160dcc09589227187e242a30a49ca5cefa5a7edd3f9d19ed53fd", size = 151939, upload-time = "2024-12-24T18:10:26.124Z" }, - { url = "https://files.pythonhosted.org/packages/b1/82/8e9fe624cc5374193de6860aba3ea8070f584c8565ee77c168ec13274bd2/charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:5777ee0881f9499ed0f71cc82cf873d9a0ca8af166dfa0af8ec4e675b7df48e6", size = 149075, upload-time = "2024-12-24T18:10:30.027Z" }, - { url = "https://files.pythonhosted.org/packages/3d/7b/82865ba54c765560c8433f65e8acb9217cb839a9e32b42af4aa8e945870f/charset_normalizer-3.4.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:237bdbe6159cff53b4f24f397d43c6336c6b0b42affbe857970cefbb620911c8", size = 144340, upload-time = "2024-12-24T18:10:32.679Z" }, - { url = "https://files.pythonhosted.org/packages/b5/b6/9674a4b7d4d99a0d2df9b215da766ee682718f88055751e1e5e753c82db0/charset_normalizer-3.4.1-cp311-cp311-win32.whl", hash = "sha256:8417cb1f36cc0bc7eaba8ccb0e04d55f0ee52df06df3ad55259b9a323555fc8b", size = 95205, upload-time = "2024-12-24T18:10:34.724Z" }, - { url = "https://files.pythonhosted.org/packages/1e/ab/45b180e175de4402dcf7547e4fb617283bae54ce35c27930a6f35b6bef15/charset_normalizer-3.4.1-cp311-cp311-win_amd64.whl", hash = "sha256:d7f50a1f8c450f3925cb367d011448c39239bb3eb4117c36a6d354794de4ce76", size = 102441, upload-time = "2024-12-24T18:10:37.574Z" }, - { url = "https://files.pythonhosted.org/packages/0a/9a/dd1e1cdceb841925b7798369a09279bd1cf183cef0f9ddf15a3a6502ee45/charset_normalizer-3.4.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:73d94b58ec7fecbc7366247d3b0b10a21681004153238750bb67bd9012414545", size = 196105, upload-time = "2024-12-24T18:10:38.83Z" }, - { url = "https://files.pythonhosted.org/packages/d3/8c/90bfabf8c4809ecb648f39794cf2a84ff2e7d2a6cf159fe68d9a26160467/charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dad3e487649f498dd991eeb901125411559b22e8d7ab25d3aeb1af367df5efd7", size = 140404, upload-time = "2024-12-24T18:10:44.272Z" }, - { url = "https://files.pythonhosted.org/packages/ad/8f/e410d57c721945ea3b4f1a04b74f70ce8fa800d393d72899f0a40526401f/charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c30197aa96e8eed02200a83fba2657b4c3acd0f0aa4bdc9f6c1af8e8962e0757", size = 150423, upload-time = "2024-12-24T18:10:45.492Z" }, - { url = "https://files.pythonhosted.org/packages/f0/b8/e6825e25deb691ff98cf5c9072ee0605dc2acfca98af70c2d1b1bc75190d/charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2369eea1ee4a7610a860d88f268eb39b95cb588acd7235e02fd5a5601773d4fa", size = 143184, upload-time = "2024-12-24T18:10:47.898Z" }, - { url = "https://files.pythonhosted.org/packages/3e/a2/513f6cbe752421f16d969e32f3583762bfd583848b763913ddab8d9bfd4f/charset_normalizer-3.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc2722592d8998c870fa4e290c2eec2c1569b87fe58618e67d38b4665dfa680d", size = 145268, upload-time = "2024-12-24T18:10:50.589Z" }, - { url = "https://files.pythonhosted.org/packages/74/94/8a5277664f27c3c438546f3eb53b33f5b19568eb7424736bdc440a88a31f/charset_normalizer-3.4.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ffc9202a29ab3920fa812879e95a9e78b2465fd10be7fcbd042899695d75e616", size = 147601, upload-time = "2024-12-24T18:10:52.541Z" }, - { url = "https://files.pythonhosted.org/packages/7c/5f/6d352c51ee763623a98e31194823518e09bfa48be2a7e8383cf691bbb3d0/charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:804a4d582ba6e5b747c625bf1255e6b1507465494a40a2130978bda7b932c90b", size = 141098, upload-time = "2024-12-24T18:10:53.789Z" }, - { url = "https://files.pythonhosted.org/packages/78/d4/f5704cb629ba5ab16d1d3d741396aec6dc3ca2b67757c45b0599bb010478/charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:0f55e69f030f7163dffe9fd0752b32f070566451afe180f99dbeeb81f511ad8d", size = 149520, upload-time = "2024-12-24T18:10:55.048Z" }, - { url = "https://files.pythonhosted.org/packages/c5/96/64120b1d02b81785f222b976c0fb79a35875457fa9bb40827678e54d1bc8/charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:c4c3e6da02df6fa1410a7680bd3f63d4f710232d3139089536310d027950696a", size = 152852, upload-time = "2024-12-24T18:10:57.647Z" }, - { url = "https://files.pythonhosted.org/packages/84/c9/98e3732278a99f47d487fd3468bc60b882920cef29d1fa6ca460a1fdf4e6/charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:5df196eb874dae23dcfb968c83d4f8fdccb333330fe1fc278ac5ceeb101003a9", size = 150488, upload-time = "2024-12-24T18:10:59.43Z" }, - { url = "https://files.pythonhosted.org/packages/13/0e/9c8d4cb99c98c1007cc11eda969ebfe837bbbd0acdb4736d228ccaabcd22/charset_normalizer-3.4.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e358e64305fe12299a08e08978f51fc21fac060dcfcddd95453eabe5b93ed0e1", size = 146192, upload-time = "2024-12-24T18:11:00.676Z" }, - { url = "https://files.pythonhosted.org/packages/b2/21/2b6b5b860781a0b49427309cb8670785aa543fb2178de875b87b9cc97746/charset_normalizer-3.4.1-cp312-cp312-win32.whl", hash = "sha256:9b23ca7ef998bc739bf6ffc077c2116917eabcc901f88da1b9856b210ef63f35", size = 95550, upload-time = "2024-12-24T18:11:01.952Z" }, - { url = "https://files.pythonhosted.org/packages/21/5b/1b390b03b1d16c7e382b561c5329f83cc06623916aab983e8ab9239c7d5c/charset_normalizer-3.4.1-cp312-cp312-win_amd64.whl", hash = "sha256:6ff8a4a60c227ad87030d76e99cd1698345d4491638dfa6673027c48b3cd395f", size = 102785, upload-time = "2024-12-24T18:11:03.142Z" }, - { url = "https://files.pythonhosted.org/packages/38/94/ce8e6f63d18049672c76d07d119304e1e2d7c6098f0841b51c666e9f44a0/charset_normalizer-3.4.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:aabfa34badd18f1da5ec1bc2715cadc8dca465868a4e73a0173466b688f29dda", size = 195698, upload-time = "2024-12-24T18:11:05.834Z" }, - { url = "https://files.pythonhosted.org/packages/24/2e/dfdd9770664aae179a96561cc6952ff08f9a8cd09a908f259a9dfa063568/charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22e14b5d70560b8dd51ec22863f370d1e595ac3d024cb8ad7d308b4cd95f8313", size = 140162, upload-time = "2024-12-24T18:11:07.064Z" }, - { url = "https://files.pythonhosted.org/packages/24/4e/f646b9093cff8fc86f2d60af2de4dc17c759de9d554f130b140ea4738ca6/charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8436c508b408b82d87dc5f62496973a1805cd46727c34440b0d29d8a2f50a6c9", size = 150263, upload-time = "2024-12-24T18:11:08.374Z" }, - { url = "https://files.pythonhosted.org/packages/5e/67/2937f8d548c3ef6e2f9aab0f6e21001056f692d43282b165e7c56023e6dd/charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2d074908e1aecee37a7635990b2c6d504cd4766c7bc9fc86d63f9c09af3fa11b", size = 142966, upload-time = "2024-12-24T18:11:09.831Z" }, - { url = "https://files.pythonhosted.org/packages/52/ed/b7f4f07de100bdb95c1756d3a4d17b90c1a3c53715c1a476f8738058e0fa/charset_normalizer-3.4.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:955f8851919303c92343d2f66165294848d57e9bba6cf6e3625485a70a038d11", size = 144992, upload-time = "2024-12-24T18:11:12.03Z" }, - { url = "https://files.pythonhosted.org/packages/96/2c/d49710a6dbcd3776265f4c923bb73ebe83933dfbaa841c5da850fe0fd20b/charset_normalizer-3.4.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:44ecbf16649486d4aebafeaa7ec4c9fed8b88101f4dd612dcaf65d5e815f837f", size = 147162, upload-time = "2024-12-24T18:11:13.372Z" }, - { url = "https://files.pythonhosted.org/packages/b4/41/35ff1f9a6bd380303dea55e44c4933b4cc3c4850988927d4082ada230273/charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:0924e81d3d5e70f8126529951dac65c1010cdf117bb75eb02dd12339b57749dd", size = 140972, upload-time = "2024-12-24T18:11:14.628Z" }, - { url = "https://files.pythonhosted.org/packages/fb/43/c6a0b685fe6910d08ba971f62cd9c3e862a85770395ba5d9cad4fede33ab/charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:2967f74ad52c3b98de4c3b32e1a44e32975e008a9cd2a8cc8966d6a5218c5cb2", size = 149095, upload-time = "2024-12-24T18:11:17.672Z" }, - { url = "https://files.pythonhosted.org/packages/4c/ff/a9a504662452e2d2878512115638966e75633519ec11f25fca3d2049a94a/charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:c75cb2a3e389853835e84a2d8fb2b81a10645b503eca9bcb98df6b5a43eb8886", size = 152668, upload-time = "2024-12-24T18:11:18.989Z" }, - { url = "https://files.pythonhosted.org/packages/6c/71/189996b6d9a4b932564701628af5cee6716733e9165af1d5e1b285c530ed/charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:09b26ae6b1abf0d27570633b2b078a2a20419c99d66fb2823173d73f188ce601", size = 150073, upload-time = "2024-12-24T18:11:21.507Z" }, - { url = "https://files.pythonhosted.org/packages/e4/93/946a86ce20790e11312c87c75ba68d5f6ad2208cfb52b2d6a2c32840d922/charset_normalizer-3.4.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:fa88b843d6e211393a37219e6a1c1df99d35e8fd90446f1118f4216e307e48cd", size = 145732, upload-time = "2024-12-24T18:11:22.774Z" }, - { url = "https://files.pythonhosted.org/packages/cd/e5/131d2fb1b0dddafc37be4f3a2fa79aa4c037368be9423061dccadfd90091/charset_normalizer-3.4.1-cp313-cp313-win32.whl", hash = "sha256:eb8178fe3dba6450a3e024e95ac49ed3400e506fd4e9e5c32d30adda88cbd407", size = 95391, upload-time = "2024-12-24T18:11:24.139Z" }, - { url = "https://files.pythonhosted.org/packages/27/f2/4f9a69cc7712b9b5ad8fdb87039fd89abba997ad5cbe690d1835d40405b0/charset_normalizer-3.4.1-cp313-cp313-win_amd64.whl", hash = "sha256:b1ac5992a838106edb89654e0aebfc24f5848ae2547d22c2c3f66454daa11971", size = 102702, upload-time = "2024-12-24T18:11:26.535Z" }, - { url = "https://files.pythonhosted.org/packages/7f/c0/b913f8f02836ed9ab32ea643c6fe4d3325c3d8627cf6e78098671cafff86/charset_normalizer-3.4.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:b97e690a2118911e39b4042088092771b4ae3fc3aa86518f84b8cf6888dbdb41", size = 197867, upload-time = "2024-12-24T18:12:10.438Z" }, - { url = "https://files.pythonhosted.org/packages/0f/6c/2bee440303d705b6fb1e2ec789543edec83d32d258299b16eed28aad48e0/charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:78baa6d91634dfb69ec52a463534bc0df05dbd546209b79a3880a34487f4b84f", size = 141385, upload-time = "2024-12-24T18:12:11.847Z" }, - { url = "https://files.pythonhosted.org/packages/3d/04/cb42585f07f6f9fd3219ffb6f37d5a39b4fd2db2355b23683060029c35f7/charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1a2bc9f351a75ef49d664206d51f8e5ede9da246602dc2d2726837620ea034b2", size = 151367, upload-time = "2024-12-24T18:12:13.177Z" }, - { url = "https://files.pythonhosted.org/packages/54/54/2412a5b093acb17f0222de007cc129ec0e0df198b5ad2ce5699355269dfe/charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:75832c08354f595c760a804588b9357d34ec00ba1c940c15e31e96d902093770", size = 143928, upload-time = "2024-12-24T18:12:14.497Z" }, - { url = "https://files.pythonhosted.org/packages/5a/6d/e2773862b043dcf8a221342954f375392bb2ce6487bcd9f2c1b34e1d6781/charset_normalizer-3.4.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0af291f4fe114be0280cdd29d533696a77b5b49cfde5467176ecab32353395c4", size = 146203, upload-time = "2024-12-24T18:12:15.731Z" }, - { url = "https://files.pythonhosted.org/packages/b9/f8/ca440ef60d8f8916022859885f231abb07ada3c347c03d63f283bec32ef5/charset_normalizer-3.4.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0167ddc8ab6508fe81860a57dd472b2ef4060e8d378f0cc555707126830f2537", size = 148082, upload-time = "2024-12-24T18:12:18.641Z" }, - { url = "https://files.pythonhosted.org/packages/04/d2/42fd330901aaa4b805a1097856c2edf5095e260a597f65def493f4b8c833/charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:2a75d49014d118e4198bcee5ee0a6f25856b29b12dbf7cd012791f8a6cc5c496", size = 142053, upload-time = "2024-12-24T18:12:20.036Z" }, - { url = "https://files.pythonhosted.org/packages/9e/af/3a97a4fa3c53586f1910dadfc916e9c4f35eeada36de4108f5096cb7215f/charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:363e2f92b0f0174b2f8238240a1a30142e3db7b957a5dd5689b0e75fb717cc78", size = 150625, upload-time = "2024-12-24T18:12:22.804Z" }, - { url = "https://files.pythonhosted.org/packages/26/ae/23d6041322a3556e4da139663d02fb1b3c59a23ab2e2b56432bd2ad63ded/charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:ab36c8eb7e454e34e60eb55ca5d241a5d18b2c6244f6827a30e451c42410b5f7", size = 153549, upload-time = "2024-12-24T18:12:24.163Z" }, - { url = "https://files.pythonhosted.org/packages/94/22/b8f2081c6a77cb20d97e57e0b385b481887aa08019d2459dc2858ed64871/charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:4c0907b1928a36d5a998d72d64d8eaa7244989f7aaaf947500d3a800c83a3fd6", size = 150945, upload-time = "2024-12-24T18:12:25.415Z" }, - { url = "https://files.pythonhosted.org/packages/c7/0b/c5ec5092747f801b8b093cdf5610e732b809d6cb11f4c51e35fc28d1d389/charset_normalizer-3.4.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:04432ad9479fa40ec0f387795ddad4437a2b50417c69fa275e212933519ff294", size = 146595, upload-time = "2024-12-24T18:12:28.03Z" }, - { url = "https://files.pythonhosted.org/packages/0c/5a/0b59704c38470df6768aa154cc87b1ac7c9bb687990a1559dc8765e8627e/charset_normalizer-3.4.1-cp39-cp39-win32.whl", hash = "sha256:3bed14e9c89dcb10e8f3a29f9ccac4955aebe93c71ae803af79265c9ca5644c5", size = 95453, upload-time = "2024-12-24T18:12:29.569Z" }, - { url = "https://files.pythonhosted.org/packages/85/2d/a9790237cb4d01a6d57afadc8573c8b73c609ade20b80f4cda30802009ee/charset_normalizer-3.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:49402233c892a461407c512a19435d1ce275543138294f7ef013f0b63d5d3765", size = 102811, upload-time = "2024-12-24T18:12:30.83Z" }, - { url = "https://files.pythonhosted.org/packages/0e/f6/65ecc6878a89bb1c23a086ea335ad4bf21a588990c3f535a227b9eea9108/charset_normalizer-3.4.1-py3-none-any.whl", hash = "sha256:d98b1668f06378c6dbefec3b92299716b931cd4e6061f3c875a71ced1780ab85", size = 49767, upload-time = "2024-12-24T18:12:32.852Z" }, +version = "3.4.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/83/2d/5fd176ceb9b2fc619e63405525573493ca23441330fcdaee6bef9460e924/charset_normalizer-3.4.3.tar.gz", hash = "sha256:6fce4b8500244f6fcb71465d4a4930d132ba9ab8e71a7859e6a5d59851068d14", size = 122371, upload-time = "2025-08-09T07:57:28.46Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d6/98/f3b8013223728a99b908c9344da3aa04ee6e3fa235f19409033eda92fb78/charset_normalizer-3.4.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:fb7f67a1bfa6e40b438170ebdc8158b78dc465a5a67b6dde178a46987b244a72", size = 207695, upload-time = "2025-08-09T07:55:36.452Z" }, + { url = "https://files.pythonhosted.org/packages/21/40/5188be1e3118c82dcb7c2a5ba101b783822cfb413a0268ed3be0468532de/charset_normalizer-3.4.3-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:cc9370a2da1ac13f0153780040f465839e6cccb4a1e44810124b4e22483c93fe", size = 147153, upload-time = "2025-08-09T07:55:38.467Z" }, + { url = "https://files.pythonhosted.org/packages/37/60/5d0d74bc1e1380f0b72c327948d9c2aca14b46a9efd87604e724260f384c/charset_normalizer-3.4.3-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:07a0eae9e2787b586e129fdcbe1af6997f8d0e5abaa0bc98c0e20e124d67e601", size = 160428, upload-time = "2025-08-09T07:55:40.072Z" }, + { url = "https://files.pythonhosted.org/packages/85/9a/d891f63722d9158688de58d050c59dc3da560ea7f04f4c53e769de5140f5/charset_normalizer-3.4.3-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:74d77e25adda8581ffc1c720f1c81ca082921329452eba58b16233ab1842141c", size = 157627, upload-time = "2025-08-09T07:55:41.706Z" }, + { url = "https://files.pythonhosted.org/packages/65/1a/7425c952944a6521a9cfa7e675343f83fd82085b8af2b1373a2409c683dc/charset_normalizer-3.4.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d0e909868420b7049dafd3a31d45125b31143eec59235311fc4c57ea26a4acd2", size = 152388, upload-time = "2025-08-09T07:55:43.262Z" }, + { url = "https://files.pythonhosted.org/packages/f0/c9/a2c9c2a355a8594ce2446085e2ec97fd44d323c684ff32042e2a6b718e1d/charset_normalizer-3.4.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:c6f162aabe9a91a309510d74eeb6507fab5fff92337a15acbe77753d88d9dcf0", size = 150077, upload-time = "2025-08-09T07:55:44.903Z" }, + { url = "https://files.pythonhosted.org/packages/3b/38/20a1f44e4851aa1c9105d6e7110c9d020e093dfa5836d712a5f074a12bf7/charset_normalizer-3.4.3-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:4ca4c094de7771a98d7fbd67d9e5dbf1eb73efa4f744a730437d8a3a5cf994f0", size = 161631, upload-time = "2025-08-09T07:55:46.346Z" }, + { url = "https://files.pythonhosted.org/packages/a4/fa/384d2c0f57edad03d7bec3ebefb462090d8905b4ff5a2d2525f3bb711fac/charset_normalizer-3.4.3-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:02425242e96bcf29a49711b0ca9f37e451da7c70562bc10e8ed992a5a7a25cc0", size = 159210, upload-time = "2025-08-09T07:55:47.539Z" }, + { url = "https://files.pythonhosted.org/packages/33/9e/eca49d35867ca2db336b6ca27617deed4653b97ebf45dfc21311ce473c37/charset_normalizer-3.4.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:78deba4d8f9590fe4dae384aeff04082510a709957e968753ff3c48399f6f92a", size = 153739, upload-time = "2025-08-09T07:55:48.744Z" }, + { url = "https://files.pythonhosted.org/packages/2a/91/26c3036e62dfe8de8061182d33be5025e2424002125c9500faff74a6735e/charset_normalizer-3.4.3-cp310-cp310-win32.whl", hash = "sha256:d79c198e27580c8e958906f803e63cddb77653731be08851c7df0b1a14a8fc0f", size = 99825, upload-time = "2025-08-09T07:55:50.305Z" }, + { url = "https://files.pythonhosted.org/packages/e2/c6/f05db471f81af1fa01839d44ae2a8bfeec8d2a8b4590f16c4e7393afd323/charset_normalizer-3.4.3-cp310-cp310-win_amd64.whl", hash = "sha256:c6e490913a46fa054e03699c70019ab869e990270597018cef1d8562132c2669", size = 107452, upload-time = "2025-08-09T07:55:51.461Z" }, + { url = "https://files.pythonhosted.org/packages/7f/b5/991245018615474a60965a7c9cd2b4efbaabd16d582a5547c47ee1c7730b/charset_normalizer-3.4.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:b256ee2e749283ef3ddcff51a675ff43798d92d746d1a6e4631bf8c707d22d0b", size = 204483, upload-time = "2025-08-09T07:55:53.12Z" }, + { url = "https://files.pythonhosted.org/packages/c7/2a/ae245c41c06299ec18262825c1569c5d3298fc920e4ddf56ab011b417efd/charset_normalizer-3.4.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:13faeacfe61784e2559e690fc53fa4c5ae97c6fcedb8eb6fb8d0a15b475d2c64", size = 145520, upload-time = "2025-08-09T07:55:54.712Z" }, + { url = "https://files.pythonhosted.org/packages/3a/a4/b3b6c76e7a635748c4421d2b92c7b8f90a432f98bda5082049af37ffc8e3/charset_normalizer-3.4.3-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:00237675befef519d9af72169d8604a067d92755e84fe76492fef5441db05b91", size = 158876, upload-time = "2025-08-09T07:55:56.024Z" }, + { url = "https://files.pythonhosted.org/packages/e2/e6/63bb0e10f90a8243c5def74b5b105b3bbbfb3e7bb753915fe333fb0c11ea/charset_normalizer-3.4.3-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:585f3b2a80fbd26b048a0be90c5aae8f06605d3c92615911c3a2b03a8a3b796f", size = 156083, upload-time = "2025-08-09T07:55:57.582Z" }, + { url = "https://files.pythonhosted.org/packages/87/df/b7737ff046c974b183ea9aa111b74185ac8c3a326c6262d413bd5a1b8c69/charset_normalizer-3.4.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0e78314bdc32fa80696f72fa16dc61168fda4d6a0c014e0380f9d02f0e5d8a07", size = 150295, upload-time = "2025-08-09T07:55:59.147Z" }, + { url = "https://files.pythonhosted.org/packages/61/f1/190d9977e0084d3f1dc169acd060d479bbbc71b90bf3e7bf7b9927dec3eb/charset_normalizer-3.4.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:96b2b3d1a83ad55310de8c7b4a2d04d9277d5591f40761274856635acc5fcb30", size = 148379, upload-time = "2025-08-09T07:56:00.364Z" }, + { url = "https://files.pythonhosted.org/packages/4c/92/27dbe365d34c68cfe0ca76f1edd70e8705d82b378cb54ebbaeabc2e3029d/charset_normalizer-3.4.3-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:939578d9d8fd4299220161fdd76e86c6a251987476f5243e8864a7844476ba14", size = 160018, upload-time = "2025-08-09T07:56:01.678Z" }, + { url = "https://files.pythonhosted.org/packages/99/04/baae2a1ea1893a01635d475b9261c889a18fd48393634b6270827869fa34/charset_normalizer-3.4.3-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:fd10de089bcdcd1be95a2f73dbe6254798ec1bda9f450d5828c96f93e2536b9c", size = 157430, upload-time = "2025-08-09T07:56:02.87Z" }, + { url = "https://files.pythonhosted.org/packages/2f/36/77da9c6a328c54d17b960c89eccacfab8271fdaaa228305330915b88afa9/charset_normalizer-3.4.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:1e8ac75d72fa3775e0b7cb7e4629cec13b7514d928d15ef8ea06bca03ef01cae", size = 151600, upload-time = "2025-08-09T07:56:04.089Z" }, + { url = "https://files.pythonhosted.org/packages/64/d4/9eb4ff2c167edbbf08cdd28e19078bf195762e9bd63371689cab5ecd3d0d/charset_normalizer-3.4.3-cp311-cp311-win32.whl", hash = "sha256:6cf8fd4c04756b6b60146d98cd8a77d0cdae0e1ca20329da2ac85eed779b6849", size = 99616, upload-time = "2025-08-09T07:56:05.658Z" }, + { url = "https://files.pythonhosted.org/packages/f4/9c/996a4a028222e7761a96634d1820de8a744ff4327a00ada9c8942033089b/charset_normalizer-3.4.3-cp311-cp311-win_amd64.whl", hash = "sha256:31a9a6f775f9bcd865d88ee350f0ffb0e25936a7f930ca98995c05abf1faf21c", size = 107108, upload-time = "2025-08-09T07:56:07.176Z" }, + { url = "https://files.pythonhosted.org/packages/e9/5e/14c94999e418d9b87682734589404a25854d5f5d0408df68bc15b6ff54bb/charset_normalizer-3.4.3-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:e28e334d3ff134e88989d90ba04b47d84382a828c061d0d1027b1b12a62b39b1", size = 205655, upload-time = "2025-08-09T07:56:08.475Z" }, + { url = "https://files.pythonhosted.org/packages/7d/a8/c6ec5d389672521f644505a257f50544c074cf5fc292d5390331cd6fc9c3/charset_normalizer-3.4.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0cacf8f7297b0c4fcb74227692ca46b4a5852f8f4f24b3c766dd94a1075c4884", size = 146223, upload-time = "2025-08-09T07:56:09.708Z" }, + { url = "https://files.pythonhosted.org/packages/fc/eb/a2ffb08547f4e1e5415fb69eb7db25932c52a52bed371429648db4d84fb1/charset_normalizer-3.4.3-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c6fd51128a41297f5409deab284fecbe5305ebd7e5a1f959bee1c054622b7018", size = 159366, upload-time = "2025-08-09T07:56:11.326Z" }, + { url = "https://files.pythonhosted.org/packages/82/10/0fd19f20c624b278dddaf83b8464dcddc2456cb4b02bb902a6da126b87a1/charset_normalizer-3.4.3-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:3cfb2aad70f2c6debfbcb717f23b7eb55febc0bb23dcffc0f076009da10c6392", size = 157104, upload-time = "2025-08-09T07:56:13.014Z" }, + { url = "https://files.pythonhosted.org/packages/16/ab/0233c3231af734f5dfcf0844aa9582d5a1466c985bbed6cedab85af9bfe3/charset_normalizer-3.4.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1606f4a55c0fd363d754049cdf400175ee96c992b1f8018b993941f221221c5f", size = 151830, upload-time = "2025-08-09T07:56:14.428Z" }, + { url = "https://files.pythonhosted.org/packages/ae/02/e29e22b4e02839a0e4a06557b1999d0a47db3567e82989b5bb21f3fbbd9f/charset_normalizer-3.4.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:027b776c26d38b7f15b26a5da1044f376455fb3766df8fc38563b4efbc515154", size = 148854, upload-time = "2025-08-09T07:56:16.051Z" }, + { url = "https://files.pythonhosted.org/packages/05/6b/e2539a0a4be302b481e8cafb5af8792da8093b486885a1ae4d15d452bcec/charset_normalizer-3.4.3-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:42e5088973e56e31e4fa58eb6bd709e42fc03799c11c42929592889a2e54c491", size = 160670, upload-time = "2025-08-09T07:56:17.314Z" }, + { url = "https://files.pythonhosted.org/packages/31/e7/883ee5676a2ef217a40ce0bffcc3d0dfbf9e64cbcfbdf822c52981c3304b/charset_normalizer-3.4.3-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:cc34f233c9e71701040d772aa7490318673aa7164a0efe3172b2981218c26d93", size = 158501, upload-time = "2025-08-09T07:56:18.641Z" }, + { url = "https://files.pythonhosted.org/packages/c1/35/6525b21aa0db614cf8b5792d232021dca3df7f90a1944db934efa5d20bb1/charset_normalizer-3.4.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:320e8e66157cc4e247d9ddca8e21f427efc7a04bbd0ac8a9faf56583fa543f9f", size = 153173, upload-time = "2025-08-09T07:56:20.289Z" }, + { url = "https://files.pythonhosted.org/packages/50/ee/f4704bad8201de513fdc8aac1cabc87e38c5818c93857140e06e772b5892/charset_normalizer-3.4.3-cp312-cp312-win32.whl", hash = "sha256:fb6fecfd65564f208cbf0fba07f107fb661bcd1a7c389edbced3f7a493f70e37", size = 99822, upload-time = "2025-08-09T07:56:21.551Z" }, + { url = "https://files.pythonhosted.org/packages/39/f5/3b3836ca6064d0992c58c7561c6b6eee1b3892e9665d650c803bd5614522/charset_normalizer-3.4.3-cp312-cp312-win_amd64.whl", hash = "sha256:86df271bf921c2ee3818f0522e9a5b8092ca2ad8b065ece5d7d9d0e9f4849bcc", size = 107543, upload-time = "2025-08-09T07:56:23.115Z" }, + { url = "https://files.pythonhosted.org/packages/65/ca/2135ac97709b400c7654b4b764daf5c5567c2da45a30cdd20f9eefe2d658/charset_normalizer-3.4.3-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:14c2a87c65b351109f6abfc424cab3927b3bdece6f706e4d12faaf3d52ee5efe", size = 205326, upload-time = "2025-08-09T07:56:24.721Z" }, + { url = "https://files.pythonhosted.org/packages/71/11/98a04c3c97dd34e49c7d247083af03645ca3730809a5509443f3c37f7c99/charset_normalizer-3.4.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:41d1fc408ff5fdfb910200ec0e74abc40387bccb3252f3f27c0676731df2b2c8", size = 146008, upload-time = "2025-08-09T07:56:26.004Z" }, + { url = "https://files.pythonhosted.org/packages/60/f5/4659a4cb3c4ec146bec80c32d8bb16033752574c20b1252ee842a95d1a1e/charset_normalizer-3.4.3-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:1bb60174149316da1c35fa5233681f7c0f9f514509b8e399ab70fea5f17e45c9", size = 159196, upload-time = "2025-08-09T07:56:27.25Z" }, + { url = "https://files.pythonhosted.org/packages/86/9e/f552f7a00611f168b9a5865a1414179b2c6de8235a4fa40189f6f79a1753/charset_normalizer-3.4.3-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:30d006f98569de3459c2fc1f2acde170b7b2bd265dc1943e87e1a4efe1b67c31", size = 156819, upload-time = "2025-08-09T07:56:28.515Z" }, + { url = "https://files.pythonhosted.org/packages/7e/95/42aa2156235cbc8fa61208aded06ef46111c4d3f0de233107b3f38631803/charset_normalizer-3.4.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:416175faf02e4b0810f1f38bcb54682878a4af94059a1cd63b8747244420801f", size = 151350, upload-time = "2025-08-09T07:56:29.716Z" }, + { url = "https://files.pythonhosted.org/packages/c2/a9/3865b02c56f300a6f94fc631ef54f0a8a29da74fb45a773dfd3dcd380af7/charset_normalizer-3.4.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:6aab0f181c486f973bc7262a97f5aca3ee7e1437011ef0c2ec04b5a11d16c927", size = 148644, upload-time = "2025-08-09T07:56:30.984Z" }, + { url = "https://files.pythonhosted.org/packages/77/d9/cbcf1a2a5c7d7856f11e7ac2d782aec12bdfea60d104e60e0aa1c97849dc/charset_normalizer-3.4.3-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:fdabf8315679312cfa71302f9bd509ded4f2f263fb5b765cf1433b39106c3cc9", size = 160468, upload-time = "2025-08-09T07:56:32.252Z" }, + { url = "https://files.pythonhosted.org/packages/f6/42/6f45efee8697b89fda4d50580f292b8f7f9306cb2971d4b53f8914e4d890/charset_normalizer-3.4.3-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:bd28b817ea8c70215401f657edef3a8aa83c29d447fb0b622c35403780ba11d5", size = 158187, upload-time = "2025-08-09T07:56:33.481Z" }, + { url = "https://files.pythonhosted.org/packages/70/99/f1c3bdcfaa9c45b3ce96f70b14f070411366fa19549c1d4832c935d8e2c3/charset_normalizer-3.4.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:18343b2d246dc6761a249ba1fb13f9ee9a2bcd95decc767319506056ea4ad4dc", size = 152699, upload-time = "2025-08-09T07:56:34.739Z" }, + { url = "https://files.pythonhosted.org/packages/a3/ad/b0081f2f99a4b194bcbb1934ef3b12aa4d9702ced80a37026b7607c72e58/charset_normalizer-3.4.3-cp313-cp313-win32.whl", hash = "sha256:6fb70de56f1859a3f71261cbe41005f56a7842cc348d3aeb26237560bfa5e0ce", size = 99580, upload-time = "2025-08-09T07:56:35.981Z" }, + { url = "https://files.pythonhosted.org/packages/9a/8f/ae790790c7b64f925e5c953b924aaa42a243fb778fed9e41f147b2a5715a/charset_normalizer-3.4.3-cp313-cp313-win_amd64.whl", hash = "sha256:cf1ebb7d78e1ad8ec2a8c4732c7be2e736f6e5123a4146c5b89c9d1f585f8cef", size = 107366, upload-time = "2025-08-09T07:56:37.339Z" }, + { url = "https://files.pythonhosted.org/packages/8e/91/b5a06ad970ddc7a0e513112d40113e834638f4ca1120eb727a249fb2715e/charset_normalizer-3.4.3-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:3cd35b7e8aedeb9e34c41385fda4f73ba609e561faedfae0a9e75e44ac558a15", size = 204342, upload-time = "2025-08-09T07:56:38.687Z" }, + { url = "https://files.pythonhosted.org/packages/ce/ec/1edc30a377f0a02689342f214455c3f6c2fbedd896a1d2f856c002fc3062/charset_normalizer-3.4.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b89bc04de1d83006373429975f8ef9e7932534b8cc9ca582e4db7d20d91816db", size = 145995, upload-time = "2025-08-09T07:56:40.048Z" }, + { url = "https://files.pythonhosted.org/packages/17/e5/5e67ab85e6d22b04641acb5399c8684f4d37caf7558a53859f0283a650e9/charset_normalizer-3.4.3-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:2001a39612b241dae17b4687898843f254f8748b796a2e16f1051a17078d991d", size = 158640, upload-time = "2025-08-09T07:56:41.311Z" }, + { url = "https://files.pythonhosted.org/packages/f1/e5/38421987f6c697ee3722981289d554957c4be652f963d71c5e46a262e135/charset_normalizer-3.4.3-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:8dcfc373f888e4fb39a7bc57e93e3b845e7f462dacc008d9749568b1c4ece096", size = 156636, upload-time = "2025-08-09T07:56:43.195Z" }, + { url = "https://files.pythonhosted.org/packages/a0/e4/5a075de8daa3ec0745a9a3b54467e0c2967daaaf2cec04c845f73493e9a1/charset_normalizer-3.4.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:18b97b8404387b96cdbd30ad660f6407799126d26a39ca65729162fd810a99aa", size = 150939, upload-time = "2025-08-09T07:56:44.819Z" }, + { url = "https://files.pythonhosted.org/packages/02/f7/3611b32318b30974131db62b4043f335861d4d9b49adc6d57c1149cc49d4/charset_normalizer-3.4.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:ccf600859c183d70eb47e05a44cd80a4ce77394d1ac0f79dbd2dd90a69a3a049", size = 148580, upload-time = "2025-08-09T07:56:46.684Z" }, + { url = "https://files.pythonhosted.org/packages/7e/61/19b36f4bd67f2793ab6a99b979b4e4f3d8fc754cbdffb805335df4337126/charset_normalizer-3.4.3-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:53cd68b185d98dde4ad8990e56a58dea83a4162161b1ea9272e5c9182ce415e0", size = 159870, upload-time = "2025-08-09T07:56:47.941Z" }, + { url = "https://files.pythonhosted.org/packages/06/57/84722eefdd338c04cf3030ada66889298eaedf3e7a30a624201e0cbe424a/charset_normalizer-3.4.3-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:30a96e1e1f865f78b030d65241c1ee850cdf422d869e9028e2fc1d5e4db73b92", size = 157797, upload-time = "2025-08-09T07:56:49.756Z" }, + { url = "https://files.pythonhosted.org/packages/72/2a/aff5dd112b2f14bcc3462c312dce5445806bfc8ab3a7328555da95330e4b/charset_normalizer-3.4.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:d716a916938e03231e86e43782ca7878fb602a125a91e7acb8b5112e2e96ac16", size = 152224, upload-time = "2025-08-09T07:56:51.369Z" }, + { url = "https://files.pythonhosted.org/packages/b7/8c/9839225320046ed279c6e839d51f028342eb77c91c89b8ef2549f951f3ec/charset_normalizer-3.4.3-cp314-cp314-win32.whl", hash = "sha256:c6dbd0ccdda3a2ba7c2ecd9d77b37f3b5831687d8dc1b6ca5f56a4880cc7b7ce", size = 100086, upload-time = "2025-08-09T07:56:52.722Z" }, + { url = "https://files.pythonhosted.org/packages/ee/7a/36fbcf646e41f710ce0a563c1c9a343c6edf9be80786edeb15b6f62e17db/charset_normalizer-3.4.3-cp314-cp314-win_amd64.whl", hash = "sha256:73dc19b562516fc9bcf6e5d6e596df0b4eb98d87e4f79f3ae71840e6ed21361c", size = 107400, upload-time = "2025-08-09T07:56:55.172Z" }, + { url = "https://files.pythonhosted.org/packages/c2/ca/9a0983dd5c8e9733565cf3db4df2b0a2e9a82659fd8aa2a868ac6e4a991f/charset_normalizer-3.4.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:70bfc5f2c318afece2f5838ea5e4c3febada0be750fcf4775641052bbba14d05", size = 207520, upload-time = "2025-08-09T07:57:11.026Z" }, + { url = "https://files.pythonhosted.org/packages/39/c6/99271dc37243a4f925b09090493fb96c9333d7992c6187f5cfe5312008d2/charset_normalizer-3.4.3-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:23b6b24d74478dc833444cbd927c338349d6ae852ba53a0d02a2de1fce45b96e", size = 147307, upload-time = "2025-08-09T07:57:12.4Z" }, + { url = "https://files.pythonhosted.org/packages/e4/69/132eab043356bba06eb333cc2cc60c6340857d0a2e4ca6dc2b51312886b3/charset_normalizer-3.4.3-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:34a7f768e3f985abdb42841e20e17b330ad3aaf4bb7e7aeeb73db2e70f077b99", size = 160448, upload-time = "2025-08-09T07:57:13.712Z" }, + { url = "https://files.pythonhosted.org/packages/04/9a/914d294daa4809c57667b77470533e65def9c0be1ef8b4c1183a99170e9d/charset_normalizer-3.4.3-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:fb731e5deb0c7ef82d698b0f4c5bb724633ee2a489401594c5c88b02e6cb15f7", size = 157758, upload-time = "2025-08-09T07:57:14.979Z" }, + { url = "https://files.pythonhosted.org/packages/b0/a8/6f5bcf1bcf63cb45625f7c5cadca026121ff8a6c8a3256d8d8cd59302663/charset_normalizer-3.4.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:257f26fed7d7ff59921b78244f3cd93ed2af1800ff048c33f624c87475819dd7", size = 152487, upload-time = "2025-08-09T07:57:16.332Z" }, + { url = "https://files.pythonhosted.org/packages/c4/72/d3d0e9592f4e504f9dea08b8db270821c909558c353dc3b457ed2509f2fb/charset_normalizer-3.4.3-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:1ef99f0456d3d46a50945c98de1774da86f8e992ab5c77865ea8b8195341fc19", size = 150054, upload-time = "2025-08-09T07:57:17.576Z" }, + { url = "https://files.pythonhosted.org/packages/20/30/5f64fe3981677fe63fa987b80e6c01042eb5ff653ff7cec1b7bd9268e54e/charset_normalizer-3.4.3-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:2c322db9c8c89009a990ef07c3bcc9f011a3269bc06782f916cd3d9eed7c9312", size = 161703, upload-time = "2025-08-09T07:57:20.012Z" }, + { url = "https://files.pythonhosted.org/packages/e1/ef/dd08b2cac9284fd59e70f7d97382c33a3d0a926e45b15fc21b3308324ffd/charset_normalizer-3.4.3-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:511729f456829ef86ac41ca78c63a5cb55240ed23b4b737faca0eb1abb1c41bc", size = 159096, upload-time = "2025-08-09T07:57:21.329Z" }, + { url = "https://files.pythonhosted.org/packages/45/8c/dcef87cfc2b3f002a6478f38906f9040302c68aebe21468090e39cde1445/charset_normalizer-3.4.3-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:88ab34806dea0671532d3f82d82b85e8fc23d7b2dd12fa837978dad9bb392a34", size = 153852, upload-time = "2025-08-09T07:57:22.608Z" }, + { url = "https://files.pythonhosted.org/packages/63/86/9cbd533bd37883d467fcd1bd491b3547a3532d0fbb46de2b99feeebf185e/charset_normalizer-3.4.3-cp39-cp39-win32.whl", hash = "sha256:16a8770207946ac75703458e2c743631c79c59c5890c80011d536248f8eaa432", size = 99840, upload-time = "2025-08-09T07:57:23.883Z" }, + { url = "https://files.pythonhosted.org/packages/ce/d6/7e805c8e5c46ff9729c49950acc4ee0aeb55efb8b3a56687658ad10c3216/charset_normalizer-3.4.3-cp39-cp39-win_amd64.whl", hash = "sha256:d22dbedd33326a4a5190dd4fe9e9e693ef12160c77382d9e87919bce54f3d4ca", size = 107438, upload-time = "2025-08-09T07:57:25.287Z" }, + { url = "https://files.pythonhosted.org/packages/8a/1f/f041989e93b001bc4e44bb1669ccdcf54d3f00e628229a85b08d330615c5/charset_normalizer-3.4.3-py3-none-any.whl", hash = "sha256:ce571ab16d890d23b5c278547ba694193a45011ff86a9162a71307ed9f86759a", size = 53175, upload-time = "2025-08-09T07:57:26.864Z" }, ] [[package]] name = "click" version = "8.1.8" source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.10'", +] dependencies = [ - { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "colorama", marker = "python_full_version < '3.10' and sys_platform == 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/b9/2e/0090cbf739cee7d23781ad4b89a9894a41538e4fcf4c31dcdd705b78eb8b/click-8.1.8.tar.gz", hash = "sha256:ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a", size = 226593, upload-time = "2024-12-21T18:38:44.339Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/7e/d4/7ebdbd03970677812aac39c869717059dbb71a4cfc033ca6e5221787892c/click-8.1.8-py3-none-any.whl", hash = "sha256:63c132bbbed01578a06712a2d1f497bb62d9c1c0d329b7903a866228027263b2", size = 98188, upload-time = "2024-12-21T18:38:41.666Z" }, ] +[[package]] +name = "click" +version = "8.2.1" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.11'", + "python_full_version == '3.10.*'", +] +dependencies = [ + { name = "colorama", marker = "python_full_version >= '3.10' and sys_platform == 'win32'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/60/6c/8ca2efa64cf75a977a0d7fac081354553ebe483345c734fb6b6515d96bbc/click-8.2.1.tar.gz", hash = "sha256:27c491cc05d968d271d5a1db13e3b5a184636d9d930f148c50b038f0d0646202", size = 286342, upload-time = "2025-05-20T23:19:49.832Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/85/32/10bb5764d90a8eee674e9dc6f4db6a0ab47c8c4d0d83c27f7c39ac415a4d/click-8.2.1-py3-none-any.whl", hash = "sha256:61a3265b914e850b85317d0b3109c7f8cd35a670f963866005d6ef1d5175a12b", size = 102215, upload-time = "2025-05-20T23:19:47.796Z" }, +] + [[package]] name = "colorama" version = "0.4.6" @@ -373,72 +473,144 @@ wheels = [ [[package]] name = "coverage" -version = "7.8.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/19/4f/2251e65033ed2ce1e68f00f91a0294e0f80c80ae8c3ebbe2f12828c4cd53/coverage-7.8.0.tar.gz", hash = "sha256:7a3d62b3b03b4b6fd41a085f3574874cf946cb4604d2b4d3e8dca8cd570ca501", size = 811872, upload-time = "2025-03-30T20:36:45.376Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/78/01/1c5e6ee4ebaaa5e079db933a9a45f61172048c7efa06648445821a201084/coverage-7.8.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:2931f66991175369859b5fd58529cd4b73582461877ecfd859b6549869287ffe", size = 211379, upload-time = "2025-03-30T20:34:53.904Z" }, - { url = "https://files.pythonhosted.org/packages/e9/16/a463389f5ff916963471f7c13585e5f38c6814607306b3cb4d6b4cf13384/coverage-7.8.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:52a523153c568d2c0ef8826f6cc23031dc86cffb8c6aeab92c4ff776e7951b28", size = 211814, upload-time = "2025-03-30T20:34:56.959Z" }, - { url = "https://files.pythonhosted.org/packages/b8/b1/77062b0393f54d79064dfb72d2da402657d7c569cfbc724d56ac0f9c67ed/coverage-7.8.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5c8a5c139aae4c35cbd7cadca1df02ea8cf28a911534fc1b0456acb0b14234f3", size = 240937, upload-time = "2025-03-30T20:34:58.751Z" }, - { url = "https://files.pythonhosted.org/packages/d7/54/c7b00a23150083c124e908c352db03bcd33375494a4beb0c6d79b35448b9/coverage-7.8.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5a26c0c795c3e0b63ec7da6efded5f0bc856d7c0b24b2ac84b4d1d7bc578d676", size = 238849, upload-time = "2025-03-30T20:35:00.521Z" }, - { url = "https://files.pythonhosted.org/packages/f7/ec/a6b7cfebd34e7b49f844788fda94713035372b5200c23088e3bbafb30970/coverage-7.8.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:821f7bcbaa84318287115d54becb1915eece6918136c6f91045bb84e2f88739d", size = 239986, upload-time = "2025-03-30T20:35:02.307Z" }, - { url = "https://files.pythonhosted.org/packages/21/8c/c965ecef8af54e6d9b11bfbba85d4f6a319399f5f724798498387f3209eb/coverage-7.8.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:a321c61477ff8ee705b8a5fed370b5710c56b3a52d17b983d9215861e37b642a", size = 239896, upload-time = "2025-03-30T20:35:04.141Z" }, - { url = "https://files.pythonhosted.org/packages/40/83/070550273fb4c480efa8381735969cb403fa8fd1626d74865bfaf9e4d903/coverage-7.8.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:ed2144b8a78f9d94d9515963ed273d620e07846acd5d4b0a642d4849e8d91a0c", size = 238613, upload-time = "2025-03-30T20:35:05.889Z" }, - { url = "https://files.pythonhosted.org/packages/07/76/fbb2540495b01d996d38e9f8897b861afed356be01160ab4e25471f4fed1/coverage-7.8.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:042e7841a26498fff7a37d6fda770d17519982f5b7d8bf5278d140b67b61095f", size = 238909, upload-time = "2025-03-30T20:35:07.76Z" }, - { url = "https://files.pythonhosted.org/packages/a3/7e/76d604db640b7d4a86e5dd730b73e96e12a8185f22b5d0799025121f4dcb/coverage-7.8.0-cp310-cp310-win32.whl", hash = "sha256:f9983d01d7705b2d1f7a95e10bbe4091fabc03a46881a256c2787637b087003f", size = 213948, upload-time = "2025-03-30T20:35:09.144Z" }, - { url = "https://files.pythonhosted.org/packages/5c/a7/f8ce4aafb4a12ab475b56c76a71a40f427740cf496c14e943ade72e25023/coverage-7.8.0-cp310-cp310-win_amd64.whl", hash = "sha256:5a570cd9bd20b85d1a0d7b009aaf6c110b52b5755c17be6962f8ccd65d1dbd23", size = 214844, upload-time = "2025-03-30T20:35:10.734Z" }, - { url = "https://files.pythonhosted.org/packages/2b/77/074d201adb8383addae5784cb8e2dac60bb62bfdf28b2b10f3a3af2fda47/coverage-7.8.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:e7ac22a0bb2c7c49f441f7a6d46c9c80d96e56f5a8bc6972529ed43c8b694e27", size = 211493, upload-time = "2025-03-30T20:35:12.286Z" }, - { url = "https://files.pythonhosted.org/packages/a9/89/7a8efe585750fe59b48d09f871f0e0c028a7b10722b2172dfe021fa2fdd4/coverage-7.8.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:bf13d564d310c156d1c8e53877baf2993fb3073b2fc9f69790ca6a732eb4bfea", size = 211921, upload-time = "2025-03-30T20:35:14.18Z" }, - { url = "https://files.pythonhosted.org/packages/e9/ef/96a90c31d08a3f40c49dbe897df4f1fd51fb6583821a1a1c5ee30cc8f680/coverage-7.8.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a5761c70c017c1b0d21b0815a920ffb94a670c8d5d409d9b38857874c21f70d7", size = 244556, upload-time = "2025-03-30T20:35:15.616Z" }, - { url = "https://files.pythonhosted.org/packages/89/97/dcd5c2ce72cee9d7b0ee8c89162c24972fb987a111b92d1a3d1d19100c61/coverage-7.8.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e5ff52d790c7e1628241ffbcaeb33e07d14b007b6eb00a19320c7b8a7024c040", size = 242245, upload-time = "2025-03-30T20:35:18.648Z" }, - { url = "https://files.pythonhosted.org/packages/b2/7b/b63cbb44096141ed435843bbb251558c8e05cc835c8da31ca6ffb26d44c0/coverage-7.8.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d39fc4817fd67b3915256af5dda75fd4ee10621a3d484524487e33416c6f3543", size = 244032, upload-time = "2025-03-30T20:35:20.131Z" }, - { url = "https://files.pythonhosted.org/packages/97/e3/7fa8c2c00a1ef530c2a42fa5df25a6971391f92739d83d67a4ee6dcf7a02/coverage-7.8.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:b44674870709017e4b4036e3d0d6c17f06a0e6d4436422e0ad29b882c40697d2", size = 243679, upload-time = "2025-03-30T20:35:21.636Z" }, - { url = "https://files.pythonhosted.org/packages/4f/b3/e0a59d8df9150c8a0c0841d55d6568f0a9195692136c44f3d21f1842c8f6/coverage-7.8.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:8f99eb72bf27cbb167b636eb1726f590c00e1ad375002230607a844d9e9a2318", size = 241852, upload-time = "2025-03-30T20:35:23.525Z" }, - { url = "https://files.pythonhosted.org/packages/9b/82/db347ccd57bcef150c173df2ade97976a8367a3be7160e303e43dd0c795f/coverage-7.8.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:b571bf5341ba8c6bc02e0baeaf3b061ab993bf372d982ae509807e7f112554e9", size = 242389, upload-time = "2025-03-30T20:35:25.09Z" }, - { url = "https://files.pythonhosted.org/packages/21/f6/3f7d7879ceb03923195d9ff294456241ed05815281f5254bc16ef71d6a20/coverage-7.8.0-cp311-cp311-win32.whl", hash = "sha256:e75a2ad7b647fd8046d58c3132d7eaf31b12d8a53c0e4b21fa9c4d23d6ee6d3c", size = 213997, upload-time = "2025-03-30T20:35:26.914Z" }, - { url = "https://files.pythonhosted.org/packages/28/87/021189643e18ecf045dbe1e2071b2747901f229df302de01c998eeadf146/coverage-7.8.0-cp311-cp311-win_amd64.whl", hash = "sha256:3043ba1c88b2139126fc72cb48574b90e2e0546d4c78b5299317f61b7f718b78", size = 214911, upload-time = "2025-03-30T20:35:28.498Z" }, - { url = "https://files.pythonhosted.org/packages/aa/12/4792669473297f7973518bec373a955e267deb4339286f882439b8535b39/coverage-7.8.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:bbb5cc845a0292e0c520656d19d7ce40e18d0e19b22cb3e0409135a575bf79fc", size = 211684, upload-time = "2025-03-30T20:35:29.959Z" }, - { url = "https://files.pythonhosted.org/packages/be/e1/2a4ec273894000ebedd789e8f2fc3813fcaf486074f87fd1c5b2cb1c0a2b/coverage-7.8.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4dfd9a93db9e78666d178d4f08a5408aa3f2474ad4d0e0378ed5f2ef71640cb6", size = 211935, upload-time = "2025-03-30T20:35:31.912Z" }, - { url = "https://files.pythonhosted.org/packages/f8/3a/7b14f6e4372786709a361729164125f6b7caf4024ce02e596c4a69bccb89/coverage-7.8.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f017a61399f13aa6d1039f75cd467be388d157cd81f1a119b9d9a68ba6f2830d", size = 245994, upload-time = "2025-03-30T20:35:33.455Z" }, - { url = "https://files.pythonhosted.org/packages/54/80/039cc7f1f81dcbd01ea796d36d3797e60c106077e31fd1f526b85337d6a1/coverage-7.8.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0915742f4c82208ebf47a2b154a5334155ed9ef9fe6190674b8a46c2fb89cb05", size = 242885, upload-time = "2025-03-30T20:35:35.354Z" }, - { url = "https://files.pythonhosted.org/packages/10/e0/dc8355f992b6cc2f9dcd5ef6242b62a3f73264893bc09fbb08bfcab18eb4/coverage-7.8.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8a40fcf208e021eb14b0fac6bdb045c0e0cab53105f93ba0d03fd934c956143a", size = 245142, upload-time = "2025-03-30T20:35:37.121Z" }, - { url = "https://files.pythonhosted.org/packages/43/1b/33e313b22cf50f652becb94c6e7dae25d8f02e52e44db37a82de9ac357e8/coverage-7.8.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a1f406a8e0995d654b2ad87c62caf6befa767885301f3b8f6f73e6f3c31ec3a6", size = 244906, upload-time = "2025-03-30T20:35:39.07Z" }, - { url = "https://files.pythonhosted.org/packages/05/08/c0a8048e942e7f918764ccc99503e2bccffba1c42568693ce6955860365e/coverage-7.8.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:77af0f6447a582fdc7de5e06fa3757a3ef87769fbb0fdbdeba78c23049140a47", size = 243124, upload-time = "2025-03-30T20:35:40.598Z" }, - { url = "https://files.pythonhosted.org/packages/5b/62/ea625b30623083c2aad645c9a6288ad9fc83d570f9adb913a2abdba562dd/coverage-7.8.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:f2d32f95922927186c6dbc8bc60df0d186b6edb828d299ab10898ef3f40052fe", size = 244317, upload-time = "2025-03-30T20:35:42.204Z" }, - { url = "https://files.pythonhosted.org/packages/62/cb/3871f13ee1130a6c8f020e2f71d9ed269e1e2124aa3374d2180ee451cee9/coverage-7.8.0-cp312-cp312-win32.whl", hash = "sha256:769773614e676f9d8e8a0980dd7740f09a6ea386d0f383db6821df07d0f08545", size = 214170, upload-time = "2025-03-30T20:35:44.216Z" }, - { url = "https://files.pythonhosted.org/packages/88/26/69fe1193ab0bfa1eb7a7c0149a066123611baba029ebb448500abd8143f9/coverage-7.8.0-cp312-cp312-win_amd64.whl", hash = "sha256:e5d2b9be5b0693cf21eb4ce0ec8d211efb43966f6657807f6859aab3814f946b", size = 214969, upload-time = "2025-03-30T20:35:45.797Z" }, - { url = "https://files.pythonhosted.org/packages/f3/21/87e9b97b568e223f3438d93072479c2f36cc9b3f6b9f7094b9d50232acc0/coverage-7.8.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5ac46d0c2dd5820ce93943a501ac5f6548ea81594777ca585bf002aa8854cacd", size = 211708, upload-time = "2025-03-30T20:35:47.417Z" }, - { url = "https://files.pythonhosted.org/packages/75/be/882d08b28a0d19c9c4c2e8a1c6ebe1f79c9c839eb46d4fca3bd3b34562b9/coverage-7.8.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:771eb7587a0563ca5bb6f622b9ed7f9d07bd08900f7589b4febff05f469bea00", size = 211981, upload-time = "2025-03-30T20:35:49.002Z" }, - { url = "https://files.pythonhosted.org/packages/7a/1d/ce99612ebd58082fbe3f8c66f6d8d5694976c76a0d474503fa70633ec77f/coverage-7.8.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42421e04069fb2cbcbca5a696c4050b84a43b05392679d4068acbe65449b5c64", size = 245495, upload-time = "2025-03-30T20:35:51.073Z" }, - { url = "https://files.pythonhosted.org/packages/dc/8d/6115abe97df98db6b2bd76aae395fcc941d039a7acd25f741312ced9a78f/coverage-7.8.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:554fec1199d93ab30adaa751db68acec2b41c5602ac944bb19187cb9a41a8067", size = 242538, upload-time = "2025-03-30T20:35:52.941Z" }, - { url = "https://files.pythonhosted.org/packages/cb/74/2f8cc196643b15bc096d60e073691dadb3dca48418f08bc78dd6e899383e/coverage-7.8.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5aaeb00761f985007b38cf463b1d160a14a22c34eb3f6a39d9ad6fc27cb73008", size = 244561, upload-time = "2025-03-30T20:35:54.658Z" }, - { url = "https://files.pythonhosted.org/packages/22/70/c10c77cd77970ac965734fe3419f2c98665f6e982744a9bfb0e749d298f4/coverage-7.8.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:581a40c7b94921fffd6457ffe532259813fc68eb2bdda60fa8cc343414ce3733", size = 244633, upload-time = "2025-03-30T20:35:56.221Z" }, - { url = "https://files.pythonhosted.org/packages/38/5a/4f7569d946a07c952688debee18c2bb9ab24f88027e3d71fd25dbc2f9dca/coverage-7.8.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:f319bae0321bc838e205bf9e5bc28f0a3165f30c203b610f17ab5552cff90323", size = 242712, upload-time = "2025-03-30T20:35:57.801Z" }, - { url = "https://files.pythonhosted.org/packages/bb/a1/03a43b33f50475a632a91ea8c127f7e35e53786dbe6781c25f19fd5a65f8/coverage-7.8.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:04bfec25a8ef1c5f41f5e7e5c842f6b615599ca8ba8391ec33a9290d9d2db3a3", size = 244000, upload-time = "2025-03-30T20:35:59.378Z" }, - { url = "https://files.pythonhosted.org/packages/6a/89/ab6c43b1788a3128e4d1b7b54214548dcad75a621f9d277b14d16a80d8a1/coverage-7.8.0-cp313-cp313-win32.whl", hash = "sha256:dd19608788b50eed889e13a5d71d832edc34fc9dfce606f66e8f9f917eef910d", size = 214195, upload-time = "2025-03-30T20:36:01.005Z" }, - { url = "https://files.pythonhosted.org/packages/12/12/6bf5f9a8b063d116bac536a7fb594fc35cb04981654cccb4bbfea5dcdfa0/coverage-7.8.0-cp313-cp313-win_amd64.whl", hash = "sha256:a9abbccd778d98e9c7e85038e35e91e67f5b520776781d9a1e2ee9d400869487", size = 214998, upload-time = "2025-03-30T20:36:03.006Z" }, - { url = "https://files.pythonhosted.org/packages/2a/e6/1e9df74ef7a1c983a9c7443dac8aac37a46f1939ae3499424622e72a6f78/coverage-7.8.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:18c5ae6d061ad5b3e7eef4363fb27a0576012a7447af48be6c75b88494c6cf25", size = 212541, upload-time = "2025-03-30T20:36:04.638Z" }, - { url = "https://files.pythonhosted.org/packages/04/51/c32174edb7ee49744e2e81c4b1414ac9df3dacfcb5b5f273b7f285ad43f6/coverage-7.8.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:95aa6ae391a22bbbce1b77ddac846c98c5473de0372ba5c463480043a07bff42", size = 212767, upload-time = "2025-03-30T20:36:06.503Z" }, - { url = "https://files.pythonhosted.org/packages/e9/8f/f454cbdb5212f13f29d4a7983db69169f1937e869a5142bce983ded52162/coverage-7.8.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e013b07ba1c748dacc2a80e69a46286ff145935f260eb8c72df7185bf048f502", size = 256997, upload-time = "2025-03-30T20:36:08.137Z" }, - { url = "https://files.pythonhosted.org/packages/e6/74/2bf9e78b321216d6ee90a81e5c22f912fc428442c830c4077b4a071db66f/coverage-7.8.0-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d766a4f0e5aa1ba056ec3496243150698dc0481902e2b8559314368717be82b1", size = 252708, upload-time = "2025-03-30T20:36:09.781Z" }, - { url = "https://files.pythonhosted.org/packages/92/4d/50d7eb1e9a6062bee6e2f92e78b0998848a972e9afad349b6cdde6fa9e32/coverage-7.8.0-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ad80e6b4a0c3cb6f10f29ae4c60e991f424e6b14219d46f1e7d442b938ee68a4", size = 255046, upload-time = "2025-03-30T20:36:11.409Z" }, - { url = "https://files.pythonhosted.org/packages/40/9e/71fb4e7402a07c4198ab44fc564d09d7d0ffca46a9fb7b0a7b929e7641bd/coverage-7.8.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:b87eb6fc9e1bb8f98892a2458781348fa37e6925f35bb6ceb9d4afd54ba36c73", size = 256139, upload-time = "2025-03-30T20:36:13.86Z" }, - { url = "https://files.pythonhosted.org/packages/49/1a/78d37f7a42b5beff027e807c2843185961fdae7fe23aad5a4837c93f9d25/coverage-7.8.0-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:d1ba00ae33be84066cfbe7361d4e04dec78445b2b88bdb734d0d1cbab916025a", size = 254307, upload-time = "2025-03-30T20:36:16.074Z" }, - { url = "https://files.pythonhosted.org/packages/58/e9/8fb8e0ff6bef5e170ee19d59ca694f9001b2ec085dc99b4f65c128bb3f9a/coverage-7.8.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:f3c38e4e5ccbdc9198aecc766cedbb134b2d89bf64533973678dfcf07effd883", size = 255116, upload-time = "2025-03-30T20:36:18.033Z" }, - { url = "https://files.pythonhosted.org/packages/56/b0/d968ecdbe6fe0a863de7169bbe9e8a476868959f3af24981f6a10d2b6924/coverage-7.8.0-cp313-cp313t-win32.whl", hash = "sha256:379fe315e206b14e21db5240f89dc0774bdd3e25c3c58c2c733c99eca96f1ada", size = 214909, upload-time = "2025-03-30T20:36:19.644Z" }, - { url = "https://files.pythonhosted.org/packages/87/e9/d6b7ef9fecf42dfb418d93544af47c940aa83056c49e6021a564aafbc91f/coverage-7.8.0-cp313-cp313t-win_amd64.whl", hash = "sha256:2e4b6b87bb0c846a9315e3ab4be2d52fac905100565f4b92f02c445c8799e257", size = 216068, upload-time = "2025-03-30T20:36:21.282Z" }, - { url = "https://files.pythonhosted.org/packages/60/0c/5da94be095239814bf2730a28cffbc48d6df4304e044f80d39e1ae581997/coverage-7.8.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:fa260de59dfb143af06dcf30c2be0b200bed2a73737a8a59248fcb9fa601ef0f", size = 211377, upload-time = "2025-03-30T20:36:23.298Z" }, - { url = "https://files.pythonhosted.org/packages/d5/cb/b9e93ebf193a0bb89dbcd4f73d7b0e6ecb7c1b6c016671950e25f041835e/coverage-7.8.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:96121edfa4c2dfdda409877ea8608dd01de816a4dc4a0523356067b305e4e17a", size = 211803, upload-time = "2025-03-30T20:36:25.74Z" }, - { url = "https://files.pythonhosted.org/packages/78/1a/cdbfe9e1bb14d3afcaf6bb6e1b9ba76c72666e329cd06865bbd241efd652/coverage-7.8.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6b8af63b9afa1031c0ef05b217faa598f3069148eeee6bb24b79da9012423b82", size = 240561, upload-time = "2025-03-30T20:36:27.548Z" }, - { url = "https://files.pythonhosted.org/packages/59/04/57f1223f26ac018d7ce791bfa65b0c29282de3e041c1cd3ed430cfeac5a5/coverage-7.8.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:89b1f4af0d4afe495cd4787a68e00f30f1d15939f550e869de90a86efa7e0814", size = 238488, upload-time = "2025-03-30T20:36:29.175Z" }, - { url = "https://files.pythonhosted.org/packages/b7/b1/0f25516ae2a35e265868670384feebe64e7857d9cffeeb3887b0197e2ba2/coverage-7.8.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:94ec0be97723ae72d63d3aa41961a0b9a6f5a53ff599813c324548d18e3b9e8c", size = 239589, upload-time = "2025-03-30T20:36:30.876Z" }, - { url = "https://files.pythonhosted.org/packages/e0/a4/99d88baac0d1d5a46ceef2dd687aac08fffa8795e4c3e71b6f6c78e14482/coverage-7.8.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:8a1d96e780bdb2d0cbb297325711701f7c0b6f89199a57f2049e90064c29f6bd", size = 239366, upload-time = "2025-03-30T20:36:32.563Z" }, - { url = "https://files.pythonhosted.org/packages/ea/9e/1db89e135feb827a868ed15f8fc857160757f9cab140ffee21342c783ceb/coverage-7.8.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:f1d8a2a57b47142b10374902777e798784abf400a004b14f1b0b9eaf1e528ba4", size = 237591, upload-time = "2025-03-30T20:36:34.721Z" }, - { url = "https://files.pythonhosted.org/packages/1b/6d/ac4d6fdfd0e201bc82d1b08adfacb1e34b40d21a22cdd62cfaf3c1828566/coverage-7.8.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:cf60dd2696b457b710dd40bf17ad269d5f5457b96442f7f85722bdb16fa6c899", size = 238572, upload-time = "2025-03-30T20:36:36.805Z" }, - { url = "https://files.pythonhosted.org/packages/25/5e/917cbe617c230f7f1745b6a13e780a3a1cd1cf328dbcd0fd8d7ec52858cd/coverage-7.8.0-cp39-cp39-win32.whl", hash = "sha256:be945402e03de47ba1872cd5236395e0f4ad635526185a930735f66710e1bd3f", size = 213966, upload-time = "2025-03-30T20:36:38.551Z" }, - { url = "https://files.pythonhosted.org/packages/bd/93/72b434fe550135869f9ea88dd36068af19afce666db576e059e75177e813/coverage-7.8.0-cp39-cp39-win_amd64.whl", hash = "sha256:90e7fbc6216ecaffa5a880cdc9c77b7418c1dcb166166b78dbc630d07f278cc3", size = 214852, upload-time = "2025-03-30T20:36:40.209Z" }, - { url = "https://files.pythonhosted.org/packages/c4/f1/1da77bb4c920aa30e82fa9b6ea065da3467977c2e5e032e38e66f1c57ffd/coverage-7.8.0-pp39.pp310.pp311-none-any.whl", hash = "sha256:b8194fb8e50d556d5849753de991d390c5a1edeeba50f68e3a9253fbd8bf8ccd", size = 203443, upload-time = "2025-03-30T20:36:41.959Z" }, - { url = "https://files.pythonhosted.org/packages/59/f1/4da7717f0063a222db253e7121bd6a56f6fb1ba439dcc36659088793347c/coverage-7.8.0-py3-none-any.whl", hash = "sha256:dbf364b4c5e7bae9250528167dfe40219b62e2d573c854d74be213e1e52069f7", size = 203435, upload-time = "2025-03-30T20:36:43.61Z" }, +version = "7.10.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f4/2c/253cc41cd0f40b84c1c34c5363e0407d73d4a1cae005fed6db3b823175bd/coverage-7.10.3.tar.gz", hash = "sha256:812ba9250532e4a823b070b0420a36499859542335af3dca8f47fc6aa1a05619", size = 822936, upload-time = "2025-08-10T21:27:39.968Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2f/44/e14576c34b37764c821866909788ff7463228907ab82bae188dab2b421f1/coverage-7.10.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:53808194afdf948c462215e9403cca27a81cf150d2f9b386aee4dab614ae2ffe", size = 215964, upload-time = "2025-08-10T21:25:22.828Z" }, + { url = "https://files.pythonhosted.org/packages/e6/15/f4f92d9b83100903efe06c9396ee8d8bdba133399d37c186fc5b16d03a87/coverage-7.10.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f4d1b837d1abf72187a61645dbf799e0d7705aa9232924946e1f57eb09a3bf00", size = 216361, upload-time = "2025-08-10T21:25:25.603Z" }, + { url = "https://files.pythonhosted.org/packages/e9/3a/c92e8cd5e89acc41cfc026dfb7acedf89661ce2ea1ee0ee13aacb6b2c20c/coverage-7.10.3-cp310-cp310-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:2a90dd4505d3cc68b847ab10c5ee81822a968b5191664e8a0801778fa60459fa", size = 243115, upload-time = "2025-08-10T21:25:27.09Z" }, + { url = "https://files.pythonhosted.org/packages/23/53/c1d8c2778823b1d95ca81701bb8f42c87dc341a2f170acdf716567523490/coverage-7.10.3-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:d52989685ff5bf909c430e6d7f6550937bc6d6f3e6ecb303c97a86100efd4596", size = 244927, upload-time = "2025-08-10T21:25:28.77Z" }, + { url = "https://files.pythonhosted.org/packages/79/41/1e115fd809031f432b4ff8e2ca19999fb6196ab95c35ae7ad5e07c001130/coverage-7.10.3-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:bdb558a1d97345bde3a9f4d3e8d11c9e5611f748646e9bb61d7d612a796671b5", size = 246784, upload-time = "2025-08-10T21:25:30.195Z" }, + { url = "https://files.pythonhosted.org/packages/c7/b2/0eba9bdf8f1b327ae2713c74d4b7aa85451bb70622ab4e7b8c000936677c/coverage-7.10.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:c9e6331a8f09cb1fc8bda032752af03c366870b48cce908875ba2620d20d0ad4", size = 244828, upload-time = "2025-08-10T21:25:31.785Z" }, + { url = "https://files.pythonhosted.org/packages/1f/cc/74c56b6bf71f2a53b9aa3df8bc27163994e0861c065b4fe3a8ac290bed35/coverage-7.10.3-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:992f48bf35b720e174e7fae916d943599f1a66501a2710d06c5f8104e0756ee1", size = 242844, upload-time = "2025-08-10T21:25:33.37Z" }, + { url = "https://files.pythonhosted.org/packages/b6/7b/ac183fbe19ac5596c223cb47af5737f4437e7566100b7e46cc29b66695a5/coverage-7.10.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:c5595fc4ad6a39312c786ec3326d7322d0cf10e3ac6a6df70809910026d67cfb", size = 243721, upload-time = "2025-08-10T21:25:34.939Z" }, + { url = "https://files.pythonhosted.org/packages/57/96/cb90da3b5a885af48f531905234a1e7376acfc1334242183d23154a1c285/coverage-7.10.3-cp310-cp310-win32.whl", hash = "sha256:9e92fa1f2bd5a57df9d00cf9ce1eb4ef6fccca4ceabec1c984837de55329db34", size = 218481, upload-time = "2025-08-10T21:25:36.935Z" }, + { url = "https://files.pythonhosted.org/packages/15/67/1ba4c7d75745c4819c54a85766e0a88cc2bff79e1760c8a2debc34106dc2/coverage-7.10.3-cp310-cp310-win_amd64.whl", hash = "sha256:b96524d6e4a3ce6a75c56bb15dbd08023b0ae2289c254e15b9fbdddf0c577416", size = 219382, upload-time = "2025-08-10T21:25:38.267Z" }, + { url = "https://files.pythonhosted.org/packages/87/04/810e506d7a19889c244d35199cbf3239a2f952b55580aa42ca4287409424/coverage-7.10.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f2ff2e2afdf0d51b9b8301e542d9c21a8d084fd23d4c8ea2b3a1b3c96f5f7397", size = 216075, upload-time = "2025-08-10T21:25:39.891Z" }, + { url = "https://files.pythonhosted.org/packages/2e/50/6b3fbab034717b4af3060bdaea6b13dfdc6b1fad44b5082e2a95cd378a9a/coverage-7.10.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:18ecc5d1b9a8c570f6c9b808fa9a2b16836b3dd5414a6d467ae942208b095f85", size = 216476, upload-time = "2025-08-10T21:25:41.137Z" }, + { url = "https://files.pythonhosted.org/packages/c7/96/4368c624c1ed92659812b63afc76c492be7867ac8e64b7190b88bb26d43c/coverage-7.10.3-cp311-cp311-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:1af4461b25fe92889590d438905e1fc79a95680ec2a1ff69a591bb3fdb6c7157", size = 246865, upload-time = "2025-08-10T21:25:42.408Z" }, + { url = "https://files.pythonhosted.org/packages/34/12/5608f76070939395c17053bf16e81fd6c06cf362a537ea9d07e281013a27/coverage-7.10.3-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:3966bc9a76b09a40dc6063c8b10375e827ea5dfcaffae402dd65953bef4cba54", size = 248800, upload-time = "2025-08-10T21:25:44.098Z" }, + { url = "https://files.pythonhosted.org/packages/ce/52/7cc90c448a0ad724283cbcdfd66b8d23a598861a6a22ac2b7b8696491798/coverage-7.10.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:205a95b87ef4eb303b7bc5118b47b6b6604a644bcbdb33c336a41cfc0a08c06a", size = 250904, upload-time = "2025-08-10T21:25:45.384Z" }, + { url = "https://files.pythonhosted.org/packages/e6/70/9967b847063c1c393b4f4d6daab1131558ebb6b51f01e7df7150aa99f11d/coverage-7.10.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:5b3801b79fb2ad61e3c7e2554bab754fc5f105626056980a2b9cf3aef4f13f84", size = 248597, upload-time = "2025-08-10T21:25:47.059Z" }, + { url = "https://files.pythonhosted.org/packages/2d/fe/263307ce6878b9ed4865af42e784b42bb82d066bcf10f68defa42931c2c7/coverage-7.10.3-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:b0dc69c60224cda33d384572da945759756e3f06b9cdac27f302f53961e63160", size = 246647, upload-time = "2025-08-10T21:25:48.334Z" }, + { url = "https://files.pythonhosted.org/packages/8e/27/d27af83ad162eba62c4eb7844a1de6cf7d9f6b185df50b0a3514a6f80ddd/coverage-7.10.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:a83d4f134bab2c7ff758e6bb1541dd72b54ba295ced6a63d93efc2e20cb9b124", size = 247290, upload-time = "2025-08-10T21:25:49.945Z" }, + { url = "https://files.pythonhosted.org/packages/28/83/904ff27e15467a5622dbe9ad2ed5831b4a616a62570ec5924d06477dff5a/coverage-7.10.3-cp311-cp311-win32.whl", hash = "sha256:54e409dd64e5302b2a8fdf44ec1c26f47abd1f45a2dcf67bd161873ee05a59b8", size = 218521, upload-time = "2025-08-10T21:25:51.208Z" }, + { url = "https://files.pythonhosted.org/packages/b8/29/bc717b8902faaccf0ca486185f0dcab4778561a529dde51cb157acaafa16/coverage-7.10.3-cp311-cp311-win_amd64.whl", hash = "sha256:30c601610a9b23807c5e9e2e442054b795953ab85d525c3de1b1b27cebeb2117", size = 219412, upload-time = "2025-08-10T21:25:52.494Z" }, + { url = "https://files.pythonhosted.org/packages/7b/7a/5a1a7028c11bb589268c656c6b3f2bbf06e0aced31bbdf7a4e94e8442cc0/coverage-7.10.3-cp311-cp311-win_arm64.whl", hash = "sha256:dabe662312a97958e932dee056f2659051d822552c0b866823e8ba1c2fe64770", size = 218091, upload-time = "2025-08-10T21:25:54.102Z" }, + { url = "https://files.pythonhosted.org/packages/b8/62/13c0b66e966c43d7aa64dadc8cd2afa1f5a2bf9bb863bdabc21fb94e8b63/coverage-7.10.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:449c1e2d3a84d18bd204258a897a87bc57380072eb2aded6a5b5226046207b42", size = 216262, upload-time = "2025-08-10T21:25:55.367Z" }, + { url = "https://files.pythonhosted.org/packages/b5/f0/59fdf79be7ac2f0206fc739032f482cfd3f66b18f5248108ff192741beae/coverage-7.10.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1d4f9ce50b9261ad196dc2b2e9f1fbbee21651b54c3097a25ad783679fd18294", size = 216496, upload-time = "2025-08-10T21:25:56.759Z" }, + { url = "https://files.pythonhosted.org/packages/34/b1/bc83788ba31bde6a0c02eb96bbc14b2d1eb083ee073beda18753fa2c4c66/coverage-7.10.3-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:4dd4564207b160d0d45c36a10bc0a3d12563028e8b48cd6459ea322302a156d7", size = 247989, upload-time = "2025-08-10T21:25:58.067Z" }, + { url = "https://files.pythonhosted.org/packages/0c/29/f8bdf88357956c844bd872e87cb16748a37234f7f48c721dc7e981145eb7/coverage-7.10.3-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:5ca3c9530ee072b7cb6a6ea7b640bcdff0ad3b334ae9687e521e59f79b1d0437", size = 250738, upload-time = "2025-08-10T21:25:59.406Z" }, + { url = "https://files.pythonhosted.org/packages/ae/df/6396301d332b71e42bbe624670af9376f63f73a455cc24723656afa95796/coverage-7.10.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b6df359e59fa243c9925ae6507e27f29c46698359f45e568fd51b9315dbbe587", size = 251868, upload-time = "2025-08-10T21:26:00.65Z" }, + { url = "https://files.pythonhosted.org/packages/91/21/d760b2df6139b6ef62c9cc03afb9bcdf7d6e36ed4d078baacffa618b4c1c/coverage-7.10.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a181e4c2c896c2ff64c6312db3bda38e9ade2e1aa67f86a5628ae85873786cea", size = 249790, upload-time = "2025-08-10T21:26:02.009Z" }, + { url = "https://files.pythonhosted.org/packages/69/91/5dcaa134568202397fa4023d7066d4318dc852b53b428052cd914faa05e1/coverage-7.10.3-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:a374d4e923814e8b72b205ef6b3d3a647bb50e66f3558582eda074c976923613", size = 247907, upload-time = "2025-08-10T21:26:03.757Z" }, + { url = "https://files.pythonhosted.org/packages/38/ed/70c0e871cdfef75f27faceada461206c1cc2510c151e1ef8d60a6fedda39/coverage-7.10.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:daeefff05993e5e8c6e7499a8508e7bd94502b6b9a9159c84fd1fe6bce3151cb", size = 249344, upload-time = "2025-08-10T21:26:05.11Z" }, + { url = "https://files.pythonhosted.org/packages/5f/55/c8a273ed503cedc07f8a00dcd843daf28e849f0972e4c6be4c027f418ad6/coverage-7.10.3-cp312-cp312-win32.whl", hash = "sha256:187ecdcac21f9636d570e419773df7bd2fda2e7fa040f812e7f95d0bddf5f79a", size = 218693, upload-time = "2025-08-10T21:26:06.534Z" }, + { url = "https://files.pythonhosted.org/packages/94/58/dd3cfb2473b85be0b6eb8c5b6d80b6fc3f8f23611e69ef745cef8cf8bad5/coverage-7.10.3-cp312-cp312-win_amd64.whl", hash = "sha256:4a50ad2524ee7e4c2a95e60d2b0b83283bdfc745fe82359d567e4f15d3823eb5", size = 219501, upload-time = "2025-08-10T21:26:08.195Z" }, + { url = "https://files.pythonhosted.org/packages/56/af/7cbcbf23d46de6f24246e3f76b30df099d05636b30c53c158a196f7da3ad/coverage-7.10.3-cp312-cp312-win_arm64.whl", hash = "sha256:c112f04e075d3495fa3ed2200f71317da99608cbb2e9345bdb6de8819fc30571", size = 218135, upload-time = "2025-08-10T21:26:09.584Z" }, + { url = "https://files.pythonhosted.org/packages/0a/ff/239e4de9cc149c80e9cc359fab60592365b8c4cbfcad58b8a939d18c6898/coverage-7.10.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:b99e87304ffe0eb97c5308447328a584258951853807afdc58b16143a530518a", size = 216298, upload-time = "2025-08-10T21:26:10.973Z" }, + { url = "https://files.pythonhosted.org/packages/56/da/28717da68f8ba68f14b9f558aaa8f3e39ada8b9a1ae4f4977c8f98b286d5/coverage-7.10.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:4af09c7574d09afbc1ea7da9dcea23665c01f3bc1b1feb061dac135f98ffc53a", size = 216546, upload-time = "2025-08-10T21:26:12.616Z" }, + { url = "https://files.pythonhosted.org/packages/de/bb/e1ade16b9e3f2d6c323faeb6bee8e6c23f3a72760a5d9af102ef56a656cb/coverage-7.10.3-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:488e9b50dc5d2aa9521053cfa706209e5acf5289e81edc28291a24f4e4488f46", size = 247538, upload-time = "2025-08-10T21:26:14.455Z" }, + { url = "https://files.pythonhosted.org/packages/ea/2f/6ae1db51dc34db499bfe340e89f79a63bd115fc32513a7bacdf17d33cd86/coverage-7.10.3-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:913ceddb4289cbba3a310704a424e3fb7aac2bc0c3a23ea473193cb290cf17d4", size = 250141, upload-time = "2025-08-10T21:26:15.787Z" }, + { url = "https://files.pythonhosted.org/packages/4f/ed/33efd8819895b10c66348bf26f011dd621e804866c996ea6893d682218df/coverage-7.10.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6b1f91cbc78c7112ab84ed2a8defbccd90f888fcae40a97ddd6466b0bec6ae8a", size = 251415, upload-time = "2025-08-10T21:26:17.535Z" }, + { url = "https://files.pythonhosted.org/packages/26/04/cb83826f313d07dc743359c9914d9bc460e0798da9a0e38b4f4fabc207ed/coverage-7.10.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:b0bac054d45af7cd938834b43a9878b36ea92781bcb009eab040a5b09e9927e3", size = 249575, upload-time = "2025-08-10T21:26:18.921Z" }, + { url = "https://files.pythonhosted.org/packages/2d/fd/ae963c7a8e9581c20fa4355ab8940ca272554d8102e872dbb932a644e410/coverage-7.10.3-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:fe72cbdd12d9e0f4aca873fa6d755e103888a7f9085e4a62d282d9d5b9f7928c", size = 247466, upload-time = "2025-08-10T21:26:20.263Z" }, + { url = "https://files.pythonhosted.org/packages/99/e8/b68d1487c6af370b8d5ef223c6d7e250d952c3acfbfcdbf1a773aa0da9d2/coverage-7.10.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:c1e2e927ab3eadd7c244023927d646e4c15c65bb2ac7ae3c3e9537c013700d21", size = 249084, upload-time = "2025-08-10T21:26:21.638Z" }, + { url = "https://files.pythonhosted.org/packages/66/4d/a0bcb561645c2c1e21758d8200443669d6560d2a2fb03955291110212ec4/coverage-7.10.3-cp313-cp313-win32.whl", hash = "sha256:24d0c13de473b04920ddd6e5da3c08831b1170b8f3b17461d7429b61cad59ae0", size = 218735, upload-time = "2025-08-10T21:26:23.009Z" }, + { url = "https://files.pythonhosted.org/packages/6a/c3/78b4adddbc0feb3b223f62761e5f9b4c5a758037aaf76e0a5845e9e35e48/coverage-7.10.3-cp313-cp313-win_amd64.whl", hash = "sha256:3564aae76bce4b96e2345cf53b4c87e938c4985424a9be6a66ee902626edec4c", size = 219531, upload-time = "2025-08-10T21:26:24.474Z" }, + { url = "https://files.pythonhosted.org/packages/70/1b/1229c0b2a527fa5390db58d164aa896d513a1fbb85a1b6b6676846f00552/coverage-7.10.3-cp313-cp313-win_arm64.whl", hash = "sha256:f35580f19f297455f44afcd773c9c7a058e52eb6eb170aa31222e635f2e38b87", size = 218162, upload-time = "2025-08-10T21:26:25.847Z" }, + { url = "https://files.pythonhosted.org/packages/fc/26/1c1f450e15a3bf3eaecf053ff64538a2612a23f05b21d79ce03be9ff5903/coverage-7.10.3-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:07009152f497a0464ffdf2634586787aea0e69ddd023eafb23fc38267db94b84", size = 217003, upload-time = "2025-08-10T21:26:27.231Z" }, + { url = "https://files.pythonhosted.org/packages/29/96/4b40036181d8c2948454b458750960956a3c4785f26a3c29418bbbee1666/coverage-7.10.3-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:8dd2ba5f0c7e7e8cc418be2f0c14c4d9e3f08b8fb8e4c0f83c2fe87d03eb655e", size = 217238, upload-time = "2025-08-10T21:26:28.83Z" }, + { url = "https://files.pythonhosted.org/packages/62/23/8dfc52e95da20957293fb94d97397a100e63095ec1e0ef5c09dd8c6f591a/coverage-7.10.3-cp313-cp313t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:1ae22b97003c74186e034a93e4f946c75fad8c0ce8d92fbbc168b5e15ee2841f", size = 258561, upload-time = "2025-08-10T21:26:30.475Z" }, + { url = "https://files.pythonhosted.org/packages/59/95/00e7fcbeda3f632232f4c07dde226afe3511a7781a000aa67798feadc535/coverage-7.10.3-cp313-cp313t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:eb329f1046888a36b1dc35504d3029e1dd5afe2196d94315d18c45ee380f67d5", size = 260735, upload-time = "2025-08-10T21:26:32.333Z" }, + { url = "https://files.pythonhosted.org/packages/9e/4c/f4666cbc4571804ba2a65b078ff0de600b0b577dc245389e0bc9b69ae7ca/coverage-7.10.3-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ce01048199a91f07f96ca3074b0c14021f4fe7ffd29a3e6a188ac60a5c3a4af8", size = 262960, upload-time = "2025-08-10T21:26:33.701Z" }, + { url = "https://files.pythonhosted.org/packages/c1/a5/8a9e8a7b12a290ed98b60f73d1d3e5e9ced75a4c94a0d1a671ce3ddfff2a/coverage-7.10.3-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:08b989a06eb9dfacf96d42b7fb4c9a22bafa370d245dc22fa839f2168c6f9fa1", size = 260515, upload-time = "2025-08-10T21:26:35.16Z" }, + { url = "https://files.pythonhosted.org/packages/86/11/bb59f7f33b2cac0c5b17db0d9d0abba9c90d9eda51a6e727b43bd5fce4ae/coverage-7.10.3-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:669fe0d4e69c575c52148511029b722ba8d26e8a3129840c2ce0522e1452b256", size = 258278, upload-time = "2025-08-10T21:26:36.539Z" }, + { url = "https://files.pythonhosted.org/packages/cc/22/3646f8903743c07b3e53fded0700fed06c580a980482f04bf9536657ac17/coverage-7.10.3-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:3262d19092771c83f3413831d9904b1ccc5f98da5de4ffa4ad67f5b20c7aaf7b", size = 259408, upload-time = "2025-08-10T21:26:37.954Z" }, + { url = "https://files.pythonhosted.org/packages/d2/5c/6375e9d905da22ddea41cd85c30994b8b6f6c02e44e4c5744b76d16b026f/coverage-7.10.3-cp313-cp313t-win32.whl", hash = "sha256:cc0ee4b2ccd42cab7ee6be46d8a67d230cb33a0a7cd47a58b587a7063b6c6b0e", size = 219396, upload-time = "2025-08-10T21:26:39.426Z" }, + { url = "https://files.pythonhosted.org/packages/33/3b/7da37fd14412b8c8b6e73c3e7458fef6b1b05a37f990a9776f88e7740c89/coverage-7.10.3-cp313-cp313t-win_amd64.whl", hash = "sha256:03db599f213341e2960430984e04cf35fb179724e052a3ee627a068653cf4a7c", size = 220458, upload-time = "2025-08-10T21:26:40.905Z" }, + { url = "https://files.pythonhosted.org/packages/28/cc/59a9a70f17edab513c844ee7a5c63cf1057041a84cc725b46a51c6f8301b/coverage-7.10.3-cp313-cp313t-win_arm64.whl", hash = "sha256:46eae7893ba65f53c71284585a262f083ef71594f05ec5c85baf79c402369098", size = 218722, upload-time = "2025-08-10T21:26:42.362Z" }, + { url = "https://files.pythonhosted.org/packages/2d/84/bb773b51a06edbf1231b47dc810a23851f2796e913b335a0fa364773b842/coverage-7.10.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:bce8b8180912914032785850d8f3aacb25ec1810f5f54afc4a8b114e7a9b55de", size = 216280, upload-time = "2025-08-10T21:26:44.132Z" }, + { url = "https://files.pythonhosted.org/packages/92/a8/4d8ca9c111d09865f18d56facff64d5fa076a5593c290bd1cfc5dceb8dba/coverage-7.10.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:07790b4b37d56608536f7c1079bd1aa511567ac2966d33d5cec9cf520c50a7c8", size = 216557, upload-time = "2025-08-10T21:26:45.598Z" }, + { url = "https://files.pythonhosted.org/packages/fe/b2/eb668bfc5060194bc5e1ccd6f664e8e045881cfee66c42a2aa6e6c5b26e8/coverage-7.10.3-cp314-cp314-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:e79367ef2cd9166acedcbf136a458dfe9a4a2dd4d1ee95738fb2ee581c56f667", size = 247598, upload-time = "2025-08-10T21:26:47.081Z" }, + { url = "https://files.pythonhosted.org/packages/fd/b0/9faa4ac62c8822219dd83e5d0e73876398af17d7305968aed8d1606d1830/coverage-7.10.3-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:419d2a0f769f26cb1d05e9ccbc5eab4cb5d70231604d47150867c07822acbdf4", size = 250131, upload-time = "2025-08-10T21:26:48.65Z" }, + { url = "https://files.pythonhosted.org/packages/4e/90/203537e310844d4bf1bdcfab89c1e05c25025c06d8489b9e6f937ad1a9e2/coverage-7.10.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ee221cf244757cdc2ac882e3062ab414b8464ad9c884c21e878517ea64b3fa26", size = 251485, upload-time = "2025-08-10T21:26:50.368Z" }, + { url = "https://files.pythonhosted.org/packages/b9/b2/9d894b26bc53c70a1fe503d62240ce6564256d6d35600bdb86b80e516e7d/coverage-7.10.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:c2079d8cdd6f7373d628e14b3357f24d1db02c9dc22e6a007418ca7a2be0435a", size = 249488, upload-time = "2025-08-10T21:26:52.045Z" }, + { url = "https://files.pythonhosted.org/packages/b4/28/af167dbac5281ba6c55c933a0ca6675d68347d5aee39cacc14d44150b922/coverage-7.10.3-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:bd8df1f83c0703fa3ca781b02d36f9ec67ad9cb725b18d486405924f5e4270bd", size = 247419, upload-time = "2025-08-10T21:26:53.533Z" }, + { url = "https://files.pythonhosted.org/packages/f4/1c/9a4ddc9f0dcb150d4cd619e1c4bb39bcf694c6129220bdd1e5895d694dda/coverage-7.10.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:6b4e25e0fa335c8aa26e42a52053f3786a61cc7622b4d54ae2dad994aa754fec", size = 248917, upload-time = "2025-08-10T21:26:55.11Z" }, + { url = "https://files.pythonhosted.org/packages/92/27/c6a60c7cbe10dbcdcd7fc9ee89d531dc04ea4c073800279bb269954c5a9f/coverage-7.10.3-cp314-cp314-win32.whl", hash = "sha256:d7c3d02c2866deb217dce664c71787f4b25420ea3eaf87056f44fb364a3528f5", size = 218999, upload-time = "2025-08-10T21:26:56.637Z" }, + { url = "https://files.pythonhosted.org/packages/36/09/a94c1369964ab31273576615d55e7d14619a1c47a662ed3e2a2fe4dee7d4/coverage-7.10.3-cp314-cp314-win_amd64.whl", hash = "sha256:9c8916d44d9e0fe6cdb2227dc6b0edd8bc6c8ef13438bbbf69af7482d9bb9833", size = 219801, upload-time = "2025-08-10T21:26:58.207Z" }, + { url = "https://files.pythonhosted.org/packages/23/59/f5cd2a80f401c01cf0f3add64a7b791b7d53fd6090a4e3e9ea52691cf3c4/coverage-7.10.3-cp314-cp314-win_arm64.whl", hash = "sha256:1007d6a2b3cf197c57105cc1ba390d9ff7f0bee215ced4dea530181e49c65ab4", size = 218381, upload-time = "2025-08-10T21:26:59.707Z" }, + { url = "https://files.pythonhosted.org/packages/73/3d/89d65baf1ea39e148ee989de6da601469ba93c1d905b17dfb0b83bd39c96/coverage-7.10.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:ebc8791d346410d096818788877d675ca55c91db87d60e8f477bd41c6970ffc6", size = 217019, upload-time = "2025-08-10T21:27:01.242Z" }, + { url = "https://files.pythonhosted.org/packages/7d/7d/d9850230cd9c999ce3a1e600f85c2fff61a81c301334d7a1faa1a5ba19c8/coverage-7.10.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:1f4e4d8e75f6fd3c6940ebeed29e3d9d632e1f18f6fb65d33086d99d4d073241", size = 217237, upload-time = "2025-08-10T21:27:03.442Z" }, + { url = "https://files.pythonhosted.org/packages/36/51/b87002d417202ab27f4a1cd6bd34ee3b78f51b3ddbef51639099661da991/coverage-7.10.3-cp314-cp314t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:24581ed69f132b6225a31b0228ae4885731cddc966f8a33fe5987288bdbbbd5e", size = 258735, upload-time = "2025-08-10T21:27:05.124Z" }, + { url = "https://files.pythonhosted.org/packages/1c/02/1f8612bfcb46fc7ca64a353fff1cd4ed932bb6e0b4e0bb88b699c16794b8/coverage-7.10.3-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:ec151569ddfccbf71bac8c422dce15e176167385a00cd86e887f9a80035ce8a5", size = 260901, upload-time = "2025-08-10T21:27:06.68Z" }, + { url = "https://files.pythonhosted.org/packages/aa/3a/fe39e624ddcb2373908bd922756384bb70ac1c5009b0d1674eb326a3e428/coverage-7.10.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2ae8e7c56290b908ee817200c0b65929b8050bc28530b131fe7c6dfee3e7d86b", size = 263157, upload-time = "2025-08-10T21:27:08.398Z" }, + { url = "https://files.pythonhosted.org/packages/5e/89/496b6d5a10fa0d0691a633bb2b2bcf4f38f0bdfcbde21ad9e32d1af328ed/coverage-7.10.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:5fb742309766d7e48e9eb4dc34bc95a424707bc6140c0e7d9726e794f11b92a0", size = 260597, upload-time = "2025-08-10T21:27:10.237Z" }, + { url = "https://files.pythonhosted.org/packages/b6/a6/8b5bf6a9e8c6aaeb47d5fe9687014148efc05c3588110246d5fdeef9b492/coverage-7.10.3-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:c65e2a5b32fbe1e499f1036efa6eb9cb4ea2bf6f7168d0e7a5852f3024f471b1", size = 258353, upload-time = "2025-08-10T21:27:11.773Z" }, + { url = "https://files.pythonhosted.org/packages/c3/6d/ad131be74f8afd28150a07565dfbdc86592fd61d97e2dc83383d9af219f0/coverage-7.10.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:d48d2cb07d50f12f4f18d2bb75d9d19e3506c26d96fffabf56d22936e5ed8f7c", size = 259504, upload-time = "2025-08-10T21:27:13.254Z" }, + { url = "https://files.pythonhosted.org/packages/ec/30/fc9b5097092758cba3375a8cc4ff61774f8cd733bcfb6c9d21a60077a8d8/coverage-7.10.3-cp314-cp314t-win32.whl", hash = "sha256:dec0d9bc15ee305e09fe2cd1911d3f0371262d3cfdae05d79515d8cb712b4869", size = 219782, upload-time = "2025-08-10T21:27:14.736Z" }, + { url = "https://files.pythonhosted.org/packages/72/9b/27fbf79451b1fac15c4bda6ec6e9deae27cf7c0648c1305aa21a3454f5c4/coverage-7.10.3-cp314-cp314t-win_amd64.whl", hash = "sha256:424ea93a323aa0f7f01174308ea78bde885c3089ec1bef7143a6d93c3e24ef64", size = 220898, upload-time = "2025-08-10T21:27:16.297Z" }, + { url = "https://files.pythonhosted.org/packages/d1/cf/a32bbf92869cbf0b7c8b84325327bfc718ad4b6d2c63374fef3d58e39306/coverage-7.10.3-cp314-cp314t-win_arm64.whl", hash = "sha256:f5983c132a62d93d71c9ef896a0b9bf6e6828d8d2ea32611f58684fba60bba35", size = 218922, upload-time = "2025-08-10T21:27:18.22Z" }, + { url = "https://files.pythonhosted.org/packages/f1/66/c06f4a93c65b6fc6578ef4f1fe51f83d61fc6f2a74ec0ce434ed288d834a/coverage-7.10.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:da749daa7e141985487e1ff90a68315b0845930ed53dc397f4ae8f8bab25b551", size = 215951, upload-time = "2025-08-10T21:27:19.815Z" }, + { url = "https://files.pythonhosted.org/packages/c2/ea/cc18c70a6f72f8e4def212eaebd8388c64f29608da10b3c38c8ec76f5e49/coverage-7.10.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f3126fb6a47d287f461d9b1aa5d1a8c97034d1dffb4f452f2cf211289dae74ef", size = 216335, upload-time = "2025-08-10T21:27:21.737Z" }, + { url = "https://files.pythonhosted.org/packages/f2/fb/9c6d1d67c6d54b149f06b9f374bc9ca03e4d7d7784c8cfd12ceda20e3787/coverage-7.10.3-cp39-cp39-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:3da794db13cc27ca40e1ec8127945b97fab78ba548040047d54e7bfa6d442dca", size = 242772, upload-time = "2025-08-10T21:27:23.884Z" }, + { url = "https://files.pythonhosted.org/packages/5a/e5/4223bdb28b992a19a13ab1410c761e2bfe92ca1e7bba8e85ee2024eeda85/coverage-7.10.3-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:4e27bebbd184ef8d1c1e092b74a2b7109dcbe2618dce6e96b1776d53b14b3fe8", size = 244596, upload-time = "2025-08-10T21:27:25.842Z" }, + { url = "https://files.pythonhosted.org/packages/d2/13/d646ba28613669d487c654a760571c10128247d12d9f50e93f69542679a2/coverage-7.10.3-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8fd4ee2580b9fefbd301b4f8f85b62ac90d1e848bea54f89a5748cf132782118", size = 246370, upload-time = "2025-08-10T21:27:27.503Z" }, + { url = "https://files.pythonhosted.org/packages/02/7c/aff99c67d8c383142b0877ee435caf493765356336211c4899257325d6c7/coverage-7.10.3-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:6999920bdd73259ce11cabfc1307484f071ecc6abdb2ca58d98facbcefc70f16", size = 244254, upload-time = "2025-08-10T21:27:29.357Z" }, + { url = "https://files.pythonhosted.org/packages/b0/13/a51ea145ed51ddfa8717bb29926d9111aca343fab38f04692a843d50be6b/coverage-7.10.3-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:c3623f929db885fab100cb88220a5b193321ed37e03af719efdbaf5d10b6e227", size = 242325, upload-time = "2025-08-10T21:27:30.931Z" }, + { url = "https://files.pythonhosted.org/packages/d8/4b/6119be0089c89ad49d2e5a508d55a1485c878642b706a7f95b26e299137d/coverage-7.10.3-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:25b902c5e15dea056485d782e420bb84621cc08ee75d5131ecb3dbef8bd1365f", size = 243281, upload-time = "2025-08-10T21:27:32.815Z" }, + { url = "https://files.pythonhosted.org/packages/34/c8/1b2e7e53eee4bc1304e56e10361b08197a77a26ceb07201dcc9e759ef132/coverage-7.10.3-cp39-cp39-win32.whl", hash = "sha256:f930a4d92b004b643183451fe9c8fe398ccf866ed37d172ebaccfd443a097f61", size = 218489, upload-time = "2025-08-10T21:27:34.905Z" }, + { url = "https://files.pythonhosted.org/packages/dd/1e/9c0c230a199809c39e2dff0f1f889dfb04dcd07d83c1c26a8ef671660e08/coverage-7.10.3-cp39-cp39-win_amd64.whl", hash = "sha256:08e638a93c8acba13c7842953f92a33d52d73e410329acd472280d2a21a6c0e1", size = 219396, upload-time = "2025-08-10T21:27:36.61Z" }, + { url = "https://files.pythonhosted.org/packages/84/19/e67f4ae24e232c7f713337f3f4f7c9c58afd0c02866fb07c7b9255a19ed7/coverage-7.10.3-py3-none-any.whl", hash = "sha256:416a8d74dc0adfd33944ba2f405897bab87b7e9e84a391e09d241956bd953ce1", size = 207921, upload-time = "2025-08-10T21:27:38.254Z" }, +] + +[[package]] +name = "cryptography" +version = "45.0.7" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cffi", marker = "platform_python_implementation != 'PyPy'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a7/35/c495bffc2056f2dadb32434f1feedd79abde2a7f8363e1974afa9c33c7e2/cryptography-45.0.7.tar.gz", hash = "sha256:4b1654dfc64ea479c242508eb8c724044f1e964a47d1d1cacc5132292d851971", size = 744980, upload-time = "2025-09-01T11:15:03.146Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0c/91/925c0ac74362172ae4516000fe877912e33b5983df735ff290c653de4913/cryptography-45.0.7-cp311-abi3-macosx_10_9_universal2.whl", hash = "sha256:3be4f21c6245930688bd9e162829480de027f8bf962ede33d4f8ba7d67a00cee", size = 7041105, upload-time = "2025-09-01T11:13:59.684Z" }, + { url = "https://files.pythonhosted.org/packages/fc/63/43641c5acce3a6105cf8bd5baeceeb1846bb63067d26dae3e5db59f1513a/cryptography-45.0.7-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:67285f8a611b0ebc0857ced2081e30302909f571a46bfa7a3cc0ad303fe015c6", size = 4205799, upload-time = "2025-09-01T11:14:02.517Z" }, + { url = "https://files.pythonhosted.org/packages/bc/29/c238dd9107f10bfde09a4d1c52fd38828b1aa353ced11f358b5dd2507d24/cryptography-45.0.7-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:577470e39e60a6cd7780793202e63536026d9b8641de011ed9d8174da9ca5339", size = 4430504, upload-time = "2025-09-01T11:14:04.522Z" }, + { url = "https://files.pythonhosted.org/packages/62/62/24203e7cbcc9bd7c94739428cd30680b18ae6b18377ae66075c8e4771b1b/cryptography-45.0.7-cp311-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:4bd3e5c4b9682bc112d634f2c6ccc6736ed3635fc3319ac2bb11d768cc5a00d8", size = 4209542, upload-time = "2025-09-01T11:14:06.309Z" }, + { url = "https://files.pythonhosted.org/packages/cd/e3/e7de4771a08620eef2389b86cd87a2c50326827dea5528feb70595439ce4/cryptography-45.0.7-cp311-abi3-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:465ccac9d70115cd4de7186e60cfe989de73f7bb23e8a7aa45af18f7412e75bf", size = 3889244, upload-time = "2025-09-01T11:14:08.152Z" }, + { url = "https://files.pythonhosted.org/packages/96/b8/bca71059e79a0bb2f8e4ec61d9c205fbe97876318566cde3b5092529faa9/cryptography-45.0.7-cp311-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:16ede8a4f7929b4b7ff3642eba2bf79aa1d71f24ab6ee443935c0d269b6bc513", size = 4461975, upload-time = "2025-09-01T11:14:09.755Z" }, + { url = "https://files.pythonhosted.org/packages/58/67/3f5b26937fe1218c40e95ef4ff8d23c8dc05aa950d54200cc7ea5fb58d28/cryptography-45.0.7-cp311-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:8978132287a9d3ad6b54fcd1e08548033cc09dc6aacacb6c004c73c3eb5d3ac3", size = 4209082, upload-time = "2025-09-01T11:14:11.229Z" }, + { url = "https://files.pythonhosted.org/packages/0e/e4/b3e68a4ac363406a56cf7b741eeb80d05284d8c60ee1a55cdc7587e2a553/cryptography-45.0.7-cp311-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:b6a0e535baec27b528cb07a119f321ac024592388c5681a5ced167ae98e9fff3", size = 4460397, upload-time = "2025-09-01T11:14:12.924Z" }, + { url = "https://files.pythonhosted.org/packages/22/49/2c93f3cd4e3efc8cb22b02678c1fad691cff9dd71bb889e030d100acbfe0/cryptography-45.0.7-cp311-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:a24ee598d10befaec178efdff6054bc4d7e883f615bfbcd08126a0f4931c83a6", size = 4337244, upload-time = "2025-09-01T11:14:14.431Z" }, + { url = "https://files.pythonhosted.org/packages/04/19/030f400de0bccccc09aa262706d90f2ec23d56bc4eb4f4e8268d0ddf3fb8/cryptography-45.0.7-cp311-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:fa26fa54c0a9384c27fcdc905a2fb7d60ac6e47d14bc2692145f2b3b1e2cfdbd", size = 4568862, upload-time = "2025-09-01T11:14:16.185Z" }, + { url = "https://files.pythonhosted.org/packages/29/56/3034a3a353efa65116fa20eb3c990a8c9f0d3db4085429040a7eef9ada5f/cryptography-45.0.7-cp311-abi3-win32.whl", hash = "sha256:bef32a5e327bd8e5af915d3416ffefdbe65ed975b646b3805be81b23580b57b8", size = 2936578, upload-time = "2025-09-01T11:14:17.638Z" }, + { url = "https://files.pythonhosted.org/packages/b3/61/0ab90f421c6194705a99d0fa9f6ee2045d916e4455fdbb095a9c2c9a520f/cryptography-45.0.7-cp311-abi3-win_amd64.whl", hash = "sha256:3808e6b2e5f0b46d981c24d79648e5c25c35e59902ea4391a0dcb3e667bf7443", size = 3405400, upload-time = "2025-09-01T11:14:18.958Z" }, + { url = "https://files.pythonhosted.org/packages/63/e8/c436233ddf19c5f15b25ace33979a9dd2e7aa1a59209a0ee8554179f1cc0/cryptography-45.0.7-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:bfb4c801f65dd61cedfc61a83732327fafbac55a47282e6f26f073ca7a41c3b2", size = 7021824, upload-time = "2025-09-01T11:14:20.954Z" }, + { url = "https://files.pythonhosted.org/packages/bc/4c/8f57f2500d0ccd2675c5d0cc462095adf3faa8c52294ba085c036befb901/cryptography-45.0.7-cp37-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:81823935e2f8d476707e85a78a405953a03ef7b7b4f55f93f7c2d9680e5e0691", size = 4202233, upload-time = "2025-09-01T11:14:22.454Z" }, + { url = "https://files.pythonhosted.org/packages/eb/ac/59b7790b4ccaed739fc44775ce4645c9b8ce54cbec53edf16c74fd80cb2b/cryptography-45.0.7-cp37-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:3994c809c17fc570c2af12c9b840d7cea85a9fd3e5c0e0491f4fa3c029216d59", size = 4423075, upload-time = "2025-09-01T11:14:24.287Z" }, + { url = "https://files.pythonhosted.org/packages/b8/56/d4f07ea21434bf891faa088a6ac15d6d98093a66e75e30ad08e88aa2b9ba/cryptography-45.0.7-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:dad43797959a74103cb59c5dac71409f9c27d34c8a05921341fb64ea8ccb1dd4", size = 4204517, upload-time = "2025-09-01T11:14:25.679Z" }, + { url = "https://files.pythonhosted.org/packages/e8/ac/924a723299848b4c741c1059752c7cfe09473b6fd77d2920398fc26bfb53/cryptography-45.0.7-cp37-abi3-manylinux_2_28_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:ce7a453385e4c4693985b4a4a3533e041558851eae061a58a5405363b098fcd3", size = 3882893, upload-time = "2025-09-01T11:14:27.1Z" }, + { url = "https://files.pythonhosted.org/packages/83/dc/4dab2ff0a871cc2d81d3ae6d780991c0192b259c35e4d83fe1de18b20c70/cryptography-45.0.7-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:b04f85ac3a90c227b6e5890acb0edbaf3140938dbecf07bff618bf3638578cf1", size = 4450132, upload-time = "2025-09-01T11:14:28.58Z" }, + { url = "https://files.pythonhosted.org/packages/12/dd/b2882b65db8fc944585d7fb00d67cf84a9cef4e77d9ba8f69082e911d0de/cryptography-45.0.7-cp37-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:48c41a44ef8b8c2e80ca4527ee81daa4c527df3ecbc9423c41a420a9559d0e27", size = 4204086, upload-time = "2025-09-01T11:14:30.572Z" }, + { url = "https://files.pythonhosted.org/packages/5d/fa/1d5745d878048699b8eb87c984d4ccc5da4f5008dfd3ad7a94040caca23a/cryptography-45.0.7-cp37-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:f3df7b3d0f91b88b2106031fd995802a2e9ae13e02c36c1fc075b43f420f3a17", size = 4449383, upload-time = "2025-09-01T11:14:32.046Z" }, + { url = "https://files.pythonhosted.org/packages/36/8b/fc61f87931bc030598e1876c45b936867bb72777eac693e905ab89832670/cryptography-45.0.7-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:dd342f085542f6eb894ca00ef70236ea46070c8a13824c6bde0dfdcd36065b9b", size = 4332186, upload-time = "2025-09-01T11:14:33.95Z" }, + { url = "https://files.pythonhosted.org/packages/0b/11/09700ddad7443ccb11d674efdbe9a832b4455dc1f16566d9bd3834922ce5/cryptography-45.0.7-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:1993a1bb7e4eccfb922b6cd414f072e08ff5816702a0bdb8941c247a6b1b287c", size = 4561639, upload-time = "2025-09-01T11:14:35.343Z" }, + { url = "https://files.pythonhosted.org/packages/71/ed/8f4c1337e9d3b94d8e50ae0b08ad0304a5709d483bfcadfcc77a23dbcb52/cryptography-45.0.7-cp37-abi3-win32.whl", hash = "sha256:18fcf70f243fe07252dcb1b268a687f2358025ce32f9f88028ca5c364b123ef5", size = 2926552, upload-time = "2025-09-01T11:14:36.929Z" }, + { url = "https://files.pythonhosted.org/packages/bc/ff/026513ecad58dacd45d1d24ebe52b852165a26e287177de1d545325c0c25/cryptography-45.0.7-cp37-abi3-win_amd64.whl", hash = "sha256:7285a89df4900ed3bfaad5679b1e668cb4b38a8de1ccbfc84b05f34512da0a90", size = 3392742, upload-time = "2025-09-01T11:14:38.368Z" }, + { url = "https://files.pythonhosted.org/packages/13/3e/e42f1528ca1ea82256b835191eab1be014e0f9f934b60d98b0be8a38ed70/cryptography-45.0.7-pp310-pypy310_pp73-macosx_10_9_x86_64.whl", hash = "sha256:de58755d723e86175756f463f2f0bddd45cc36fbd62601228a3f8761c9f58252", size = 3572442, upload-time = "2025-09-01T11:14:39.836Z" }, + { url = "https://files.pythonhosted.org/packages/59/aa/e947693ab08674a2663ed2534cd8d345cf17bf6a1facf99273e8ec8986dc/cryptography-45.0.7-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:a20e442e917889d1a6b3c570c9e3fa2fdc398c20868abcea268ea33c024c4083", size = 4142233, upload-time = "2025-09-01T11:14:41.305Z" }, + { url = "https://files.pythonhosted.org/packages/24/06/09b6f6a2fc43474a32b8fe259038eef1500ee3d3c141599b57ac6c57612c/cryptography-45.0.7-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:258e0dff86d1d891169b5af222d362468a9570e2532923088658aa866eb11130", size = 4376202, upload-time = "2025-09-01T11:14:43.047Z" }, + { url = "https://files.pythonhosted.org/packages/00/f2/c166af87e95ce6ae6d38471a7e039d3a0549c2d55d74e059680162052824/cryptography-45.0.7-pp310-pypy310_pp73-manylinux_2_34_aarch64.whl", hash = "sha256:d97cf502abe2ab9eff8bd5e4aca274da8d06dd3ef08b759a8d6143f4ad65d4b4", size = 4141900, upload-time = "2025-09-01T11:14:45.089Z" }, + { url = "https://files.pythonhosted.org/packages/16/b9/e96e0b6cb86eae27ea51fa8a3151535a18e66fe7c451fa90f7f89c85f541/cryptography-45.0.7-pp310-pypy310_pp73-manylinux_2_34_x86_64.whl", hash = "sha256:c987dad82e8c65ebc985f5dae5e74a3beda9d0a2a4daf8a1115f3772b59e5141", size = 4375562, upload-time = "2025-09-01T11:14:47.166Z" }, + { url = "https://files.pythonhosted.org/packages/36/d0/36e8ee39274e9d77baf7d0dafda680cba6e52f3936b846f0d56d64fec915/cryptography-45.0.7-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:c13b1e3afd29a5b3b2656257f14669ca8fa8d7956d509926f0b130b600b50ab7", size = 3322781, upload-time = "2025-09-01T11:14:48.747Z" }, + { url = "https://files.pythonhosted.org/packages/99/4e/49199a4c82946938a3e05d2e8ad9482484ba48bbc1e809e3d506c686d051/cryptography-45.0.7-pp311-pypy311_pp73-macosx_10_9_x86_64.whl", hash = "sha256:4a862753b36620af6fc54209264f92c716367f2f0ff4624952276a6bbd18cbde", size = 3584634, upload-time = "2025-09-01T11:14:50.593Z" }, + { url = "https://files.pythonhosted.org/packages/16/ce/5f6ff59ea9c7779dba51b84871c19962529bdcc12e1a6ea172664916c550/cryptography-45.0.7-pp311-pypy311_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:06ce84dc14df0bf6ea84666f958e6080cdb6fe1231be2a51f3fc1267d9f3fb34", size = 4149533, upload-time = "2025-09-01T11:14:52.091Z" }, + { url = "https://files.pythonhosted.org/packages/ce/13/b3cfbd257ac96da4b88b46372e662009b7a16833bfc5da33bb97dd5631ae/cryptography-45.0.7-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:d0c5c6bac22b177bf8da7435d9d27a6834ee130309749d162b26c3105c0795a9", size = 4385557, upload-time = "2025-09-01T11:14:53.551Z" }, + { url = "https://files.pythonhosted.org/packages/1c/c5/8c59d6b7c7b439ba4fc8d0cab868027fd095f215031bc123c3a070962912/cryptography-45.0.7-pp311-pypy311_pp73-manylinux_2_34_aarch64.whl", hash = "sha256:2f641b64acc00811da98df63df7d59fd4706c0df449da71cb7ac39a0732b40ae", size = 4149023, upload-time = "2025-09-01T11:14:55.022Z" }, + { url = "https://files.pythonhosted.org/packages/55/32/05385c86d6ca9ab0b4d5bb442d2e3d85e727939a11f3e163fc776ce5eb40/cryptography-45.0.7-pp311-pypy311_pp73-manylinux_2_34_x86_64.whl", hash = "sha256:f5414a788ecc6ee6bc58560e85ca624258a55ca434884445440a810796ea0e0b", size = 4385722, upload-time = "2025-09-01T11:14:57.319Z" }, + { url = "https://files.pythonhosted.org/packages/23/87/7ce86f3fa14bc11a5a48c30d8103c26e09b6465f8d8e9d74cf7a0714f043/cryptography-45.0.7-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:1f3d56f73595376f4244646dd5c5870c14c196949807be39e79e7bd9bac3da63", size = 3332908, upload-time = "2025-09-01T11:14:58.78Z" }, ] [[package]] @@ -461,17 +633,20 @@ wheels = [ [[package]] name = "evdev" -version = "1.9.1" +version = "1.9.2" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d1/99/4d24bb6db12fc170a5f209f4c9108054a2c84d289d1e7f743e979b202023/evdev-1.9.1.tar.gz", hash = "sha256:dc640a064cb1c9fe1f8b970dc2039945a2a275d7b7ee62284bf427238abe45ee", size = 33349, upload-time = "2025-02-22T11:07:44.248Z" } +sdist = { url = "https://files.pythonhosted.org/packages/63/fe/a17c106a1f4061ce83f04d14bcedcfb2c38c7793ea56bfb906a6fadae8cb/evdev-1.9.2.tar.gz", hash = "sha256:5d3278892ce1f92a74d6bf888cc8525d9f68af85dbe336c95d1c87fb8f423069", size = 33301, upload-time = "2025-05-01T19:53:47.69Z" } [[package]] name = "exceptiongroup" -version = "1.2.2" +version = "1.3.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/09/35/2495c4ac46b980e4ca1f6ad6db102322ef3ad2410b79fdde159a4b0f3b92/exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc", size = 28883, upload-time = "2024-07-12T22:26:00.161Z" } +dependencies = [ + { name = "typing-extensions", marker = "python_full_version < '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/0b/9f/a65090624ecf468cdca03533906e7c69ed7588582240cfe7cc9e770b50eb/exceptiongroup-1.3.0.tar.gz", hash = "sha256:b241f5885f560bc56a59ee63ca4c6a8bfa46ae4ad651af316d4e81817bb9fd88", size = 29749, upload-time = "2025-05-10T17:42:51.123Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/02/cc/b7e31358aac6ed1ef2bb790a9746ac2c69bcb3c8588b41616914eb106eaf/exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b", size = 16453, upload-time = "2024-07-12T22:25:58.476Z" }, + { url = "https://files.pythonhosted.org/packages/36/f4/c6e662dade71f56cd2f3735141b265c3c79293c109549c1e6933b0651ffc/exceptiongroup-1.3.0-py3-none-any.whl", hash = "sha256:4d111e6e0c13d0644cad6ddaa7ed0261a0b36971f6d23e7ec9b4b9097da78a10", size = 16674, upload-time = "2025-05-10T17:42:49.33Z" }, ] [[package]] @@ -483,18 +658,32 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/7b/8f/c4d9bafc34ad7ad5d8dc16dd1347ee0e507a52c3adb6bfa8887e1c6a26ba/executing-2.2.0-py2.py3-none-any.whl", hash = "sha256:11387150cad388d62750327a53d3339fad4888b39a6fe233c3afbb54ecffd3aa", size = 26702, upload-time = "2025-01-22T15:41:25.929Z" }, ] +[[package]] +name = "fakeredis" +version = "2.31.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "redis" }, + { name = "sortedcontainers" }, + { name = "typing-extensions", marker = "python_full_version < '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/96/1e/27170815a9768d2eaf72e66dfad38047b55ea278df84b539ad0045ca1538/fakeredis-2.31.3.tar.gz", hash = "sha256:76dfb92855f0787a4936a5b4fdb1905c5909ec790e62dff2b8896b412905deb0", size = 170984, upload-time = "2025-09-22T12:24:54.471Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/07/d6/7cad31e16b7d8343ed7abf5ddb039a063b32a300def1aa487d91b4a5c831/fakeredis-2.31.3-py3-none-any.whl", hash = "sha256:12aa54a3fb00984c18b28956addb91683aaf55b2dc2ef4b09d49bd481032e57a", size = 118398, upload-time = "2025-09-22T12:24:52.751Z" }, +] + [[package]] name = "fastapi" -version = "0.115.12" +version = "0.116.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "pydantic" }, { name = "starlette" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/f4/55/ae499352d82338331ca1e28c7f4a63bfd09479b16395dce38cf50a39e2c2/fastapi-0.115.12.tar.gz", hash = "sha256:1e2c2a2646905f9e83d32f04a3f86aff4a286669c6c950ca95b5fd68c2602681", size = 295236, upload-time = "2025-03-23T22:55:43.822Z" } +sdist = { url = "https://files.pythonhosted.org/packages/78/d7/6c8b3bfe33eeffa208183ec037fee0cce9f7f024089ab1c5d12ef04bd27c/fastapi-0.116.1.tar.gz", hash = "sha256:ed52cbf946abfd70c5a0dccb24673f0670deeb517a88b3544d03c2a6bf283143", size = 296485, upload-time = "2025-07-11T16:22:32.057Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/50/b3/b51f09c2ba432a576fe63758bddc81f78f0c6309d9e5c10d194313bf021e/fastapi-0.115.12-py3-none-any.whl", hash = "sha256:e94613d6c05e27be7ffebdd6ea5f388112e5e430c8f7d6494a9d1d88d43e814d", size = 95164, upload-time = "2025-03-23T22:55:42.101Z" }, + { url = "https://files.pythonhosted.org/packages/e5/47/d63c60f59a59467fda0f93f46335c9d18526d7071f025cb5b89d5353ea42/fastapi-0.116.1-py3-none-any.whl", hash = "sha256:c46ac7c312df840f0c9e220f7964bada936781bc4e2e6eb71f1c4d7553786565", size = 95631, upload-time = "2025-07-11T16:22:30.485Z" }, ] [[package]] @@ -508,95 +697,122 @@ wheels = [ [[package]] name = "frozenlist" -version = "1.5.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/8f/ed/0f4cec13a93c02c47ec32d81d11c0c1efbadf4a471e3f3ce7cad366cbbd3/frozenlist-1.5.0.tar.gz", hash = "sha256:81d5af29e61b9c8348e876d442253723928dce6433e0e76cd925cd83f1b4b817", size = 39930, upload-time = "2024-10-23T09:48:29.903Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/54/79/29d44c4af36b2b240725dce566b20f63f9b36ef267aaaa64ee7466f4f2f8/frozenlist-1.5.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:5b6a66c18b5b9dd261ca98dffcb826a525334b2f29e7caa54e182255c5f6a65a", size = 94451, upload-time = "2024-10-23T09:46:20.558Z" }, - { url = "https://files.pythonhosted.org/packages/47/47/0c999aeace6ead8a44441b4f4173e2261b18219e4ad1fe9a479871ca02fc/frozenlist-1.5.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d1b3eb7b05ea246510b43a7e53ed1653e55c2121019a97e60cad7efb881a97bb", size = 54301, upload-time = "2024-10-23T09:46:21.759Z" }, - { url = "https://files.pythonhosted.org/packages/8d/60/107a38c1e54176d12e06e9d4b5d755b677d71d1219217cee063911b1384f/frozenlist-1.5.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:15538c0cbf0e4fa11d1e3a71f823524b0c46299aed6e10ebb4c2089abd8c3bec", size = 52213, upload-time = "2024-10-23T09:46:22.993Z" }, - { url = "https://files.pythonhosted.org/packages/17/62/594a6829ac5679c25755362a9dc93486a8a45241394564309641425d3ff6/frozenlist-1.5.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e79225373c317ff1e35f210dd5f1344ff31066ba8067c307ab60254cd3a78ad5", size = 240946, upload-time = "2024-10-23T09:46:24.661Z" }, - { url = "https://files.pythonhosted.org/packages/7e/75/6c8419d8f92c80dd0ee3f63bdde2702ce6398b0ac8410ff459f9b6f2f9cb/frozenlist-1.5.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9272fa73ca71266702c4c3e2d4a28553ea03418e591e377a03b8e3659d94fa76", size = 264608, upload-time = "2024-10-23T09:46:26.017Z" }, - { url = "https://files.pythonhosted.org/packages/88/3e/82a6f0b84bc6fb7e0be240e52863c6d4ab6098cd62e4f5b972cd31e002e8/frozenlist-1.5.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:498524025a5b8ba81695761d78c8dd7382ac0b052f34e66939c42df860b8ff17", size = 261361, upload-time = "2024-10-23T09:46:27.787Z" }, - { url = "https://files.pythonhosted.org/packages/fd/85/14e5f9ccac1b64ff2f10c927b3ffdf88772aea875882406f9ba0cec8ad84/frozenlist-1.5.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:92b5278ed9d50fe610185ecd23c55d8b307d75ca18e94c0e7de328089ac5dcba", size = 231649, upload-time = "2024-10-23T09:46:28.992Z" }, - { url = "https://files.pythonhosted.org/packages/ee/59/928322800306f6529d1852323014ee9008551e9bb027cc38d276cbc0b0e7/frozenlist-1.5.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f3c8c1dacd037df16e85227bac13cca58c30da836c6f936ba1df0c05d046d8d", size = 241853, upload-time = "2024-10-23T09:46:30.211Z" }, - { url = "https://files.pythonhosted.org/packages/7d/bd/e01fa4f146a6f6c18c5d34cab8abdc4013774a26c4ff851128cd1bd3008e/frozenlist-1.5.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:f2ac49a9bedb996086057b75bf93538240538c6d9b38e57c82d51f75a73409d2", size = 243652, upload-time = "2024-10-23T09:46:31.758Z" }, - { url = "https://files.pythonhosted.org/packages/a5/bd/e4771fd18a8ec6757033f0fa903e447aecc3fbba54e3630397b61596acf0/frozenlist-1.5.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:e66cc454f97053b79c2ab09c17fbe3c825ea6b4de20baf1be28919460dd7877f", size = 241734, upload-time = "2024-10-23T09:46:33.044Z" }, - { url = "https://files.pythonhosted.org/packages/21/13/c83821fa5544af4f60c5d3a65d054af3213c26b14d3f5f48e43e5fb48556/frozenlist-1.5.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:5a3ba5f9a0dfed20337d3e966dc359784c9f96503674c2faf015f7fe8e96798c", size = 260959, upload-time = "2024-10-23T09:46:34.916Z" }, - { url = "https://files.pythonhosted.org/packages/71/f3/1f91c9a9bf7ed0e8edcf52698d23f3c211d8d00291a53c9f115ceb977ab1/frozenlist-1.5.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:6321899477db90bdeb9299ac3627a6a53c7399c8cd58d25da094007402b039ab", size = 262706, upload-time = "2024-10-23T09:46:36.159Z" }, - { url = "https://files.pythonhosted.org/packages/4c/22/4a256fdf5d9bcb3ae32622c796ee5ff9451b3a13a68cfe3f68e2c95588ce/frozenlist-1.5.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:76e4753701248476e6286f2ef492af900ea67d9706a0155335a40ea21bf3b2f5", size = 250401, upload-time = "2024-10-23T09:46:37.327Z" }, - { url = "https://files.pythonhosted.org/packages/af/89/c48ebe1f7991bd2be6d5f4ed202d94960c01b3017a03d6954dd5fa9ea1e8/frozenlist-1.5.0-cp310-cp310-win32.whl", hash = "sha256:977701c081c0241d0955c9586ffdd9ce44f7a7795df39b9151cd9a6fd0ce4cfb", size = 45498, upload-time = "2024-10-23T09:46:38.552Z" }, - { url = "https://files.pythonhosted.org/packages/28/2f/cc27d5f43e023d21fe5c19538e08894db3d7e081cbf582ad5ed366c24446/frozenlist-1.5.0-cp310-cp310-win_amd64.whl", hash = "sha256:189f03b53e64144f90990d29a27ec4f7997d91ed3d01b51fa39d2dbe77540fd4", size = 51622, upload-time = "2024-10-23T09:46:39.513Z" }, - { url = "https://files.pythonhosted.org/packages/79/43/0bed28bf5eb1c9e4301003b74453b8e7aa85fb293b31dde352aac528dafc/frozenlist-1.5.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:fd74520371c3c4175142d02a976aee0b4cb4a7cc912a60586ffd8d5929979b30", size = 94987, upload-time = "2024-10-23T09:46:40.487Z" }, - { url = "https://files.pythonhosted.org/packages/bb/bf/b74e38f09a246e8abbe1e90eb65787ed745ccab6eaa58b9c9308e052323d/frozenlist-1.5.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2f3f7a0fbc219fb4455264cae4d9f01ad41ae6ee8524500f381de64ffaa077d5", size = 54584, upload-time = "2024-10-23T09:46:41.463Z" }, - { url = "https://files.pythonhosted.org/packages/2c/31/ab01375682f14f7613a1ade30149f684c84f9b8823a4391ed950c8285656/frozenlist-1.5.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f47c9c9028f55a04ac254346e92977bf0f166c483c74b4232bee19a6697e4778", size = 52499, upload-time = "2024-10-23T09:46:42.451Z" }, - { url = "https://files.pythonhosted.org/packages/98/a8/d0ac0b9276e1404f58fec3ab6e90a4f76b778a49373ccaf6a563f100dfbc/frozenlist-1.5.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0996c66760924da6e88922756d99b47512a71cfd45215f3570bf1e0b694c206a", size = 276357, upload-time = "2024-10-23T09:46:44.166Z" }, - { url = "https://files.pythonhosted.org/packages/ad/c9/c7761084fa822f07dac38ac29f841d4587570dd211e2262544aa0b791d21/frozenlist-1.5.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a2fe128eb4edeabe11896cb6af88fca5346059f6c8d807e3b910069f39157869", size = 287516, upload-time = "2024-10-23T09:46:45.369Z" }, - { url = "https://files.pythonhosted.org/packages/a1/ff/cd7479e703c39df7bdab431798cef89dc75010d8aa0ca2514c5b9321db27/frozenlist-1.5.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1a8ea951bbb6cacd492e3948b8da8c502a3f814f5d20935aae74b5df2b19cf3d", size = 283131, upload-time = "2024-10-23T09:46:46.654Z" }, - { url = "https://files.pythonhosted.org/packages/59/a0/370941beb47d237eca4fbf27e4e91389fd68699e6f4b0ebcc95da463835b/frozenlist-1.5.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:de537c11e4aa01d37db0d403b57bd6f0546e71a82347a97c6a9f0dcc532b3a45", size = 261320, upload-time = "2024-10-23T09:46:47.825Z" }, - { url = "https://files.pythonhosted.org/packages/b8/5f/c10123e8d64867bc9b4f2f510a32042a306ff5fcd7e2e09e5ae5100ee333/frozenlist-1.5.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9c2623347b933fcb9095841f1cc5d4ff0b278addd743e0e966cb3d460278840d", size = 274877, upload-time = "2024-10-23T09:46:48.989Z" }, - { url = "https://files.pythonhosted.org/packages/fa/79/38c505601ae29d4348f21706c5d89755ceded02a745016ba2f58bd5f1ea6/frozenlist-1.5.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:cee6798eaf8b1416ef6909b06f7dc04b60755206bddc599f52232606e18179d3", size = 269592, upload-time = "2024-10-23T09:46:50.235Z" }, - { url = "https://files.pythonhosted.org/packages/19/e2/39f3a53191b8204ba9f0bb574b926b73dd2efba2a2b9d2d730517e8f7622/frozenlist-1.5.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:f5f9da7f5dbc00a604fe74aa02ae7c98bcede8a3b8b9666f9f86fc13993bc71a", size = 265934, upload-time = "2024-10-23T09:46:51.829Z" }, - { url = "https://files.pythonhosted.org/packages/d5/c9/3075eb7f7f3a91f1a6b00284af4de0a65a9ae47084930916f5528144c9dd/frozenlist-1.5.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:90646abbc7a5d5c7c19461d2e3eeb76eb0b204919e6ece342feb6032c9325ae9", size = 283859, upload-time = "2024-10-23T09:46:52.947Z" }, - { url = "https://files.pythonhosted.org/packages/05/f5/549f44d314c29408b962fa2b0e69a1a67c59379fb143b92a0a065ffd1f0f/frozenlist-1.5.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:bdac3c7d9b705d253b2ce370fde941836a5f8b3c5c2b8fd70940a3ea3af7f4f2", size = 287560, upload-time = "2024-10-23T09:46:54.162Z" }, - { url = "https://files.pythonhosted.org/packages/9d/f8/cb09b3c24a3eac02c4c07a9558e11e9e244fb02bf62c85ac2106d1eb0c0b/frozenlist-1.5.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:03d33c2ddbc1816237a67f66336616416e2bbb6beb306e5f890f2eb22b959cdf", size = 277150, upload-time = "2024-10-23T09:46:55.361Z" }, - { url = "https://files.pythonhosted.org/packages/37/48/38c2db3f54d1501e692d6fe058f45b6ad1b358d82cd19436efab80cfc965/frozenlist-1.5.0-cp311-cp311-win32.whl", hash = "sha256:237f6b23ee0f44066219dae14c70ae38a63f0440ce6750f868ee08775073f942", size = 45244, upload-time = "2024-10-23T09:46:56.578Z" }, - { url = "https://files.pythonhosted.org/packages/ca/8c/2ddffeb8b60a4bce3b196c32fcc30d8830d4615e7b492ec2071da801b8ad/frozenlist-1.5.0-cp311-cp311-win_amd64.whl", hash = "sha256:0cc974cc93d32c42e7b0f6cf242a6bd941c57c61b618e78b6c0a96cb72788c1d", size = 51634, upload-time = "2024-10-23T09:46:57.6Z" }, - { url = "https://files.pythonhosted.org/packages/79/73/fa6d1a96ab7fd6e6d1c3500700963eab46813847f01ef0ccbaa726181dd5/frozenlist-1.5.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:31115ba75889723431aa9a4e77d5f398f5cf976eea3bdf61749731f62d4a4a21", size = 94026, upload-time = "2024-10-23T09:46:58.601Z" }, - { url = "https://files.pythonhosted.org/packages/ab/04/ea8bf62c8868b8eada363f20ff1b647cf2e93377a7b284d36062d21d81d1/frozenlist-1.5.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7437601c4d89d070eac8323f121fcf25f88674627505334654fd027b091db09d", size = 54150, upload-time = "2024-10-23T09:46:59.608Z" }, - { url = "https://files.pythonhosted.org/packages/d0/9a/8e479b482a6f2070b26bda572c5e6889bb3ba48977e81beea35b5ae13ece/frozenlist-1.5.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7948140d9f8ece1745be806f2bfdf390127cf1a763b925c4a805c603df5e697e", size = 51927, upload-time = "2024-10-23T09:47:00.625Z" }, - { url = "https://files.pythonhosted.org/packages/e3/12/2aad87deb08a4e7ccfb33600871bbe8f0e08cb6d8224371387f3303654d7/frozenlist-1.5.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:feeb64bc9bcc6b45c6311c9e9b99406660a9c05ca8a5b30d14a78555088b0b3a", size = 282647, upload-time = "2024-10-23T09:47:01.992Z" }, - { url = "https://files.pythonhosted.org/packages/77/f2/07f06b05d8a427ea0060a9cef6e63405ea9e0d761846b95ef3fb3be57111/frozenlist-1.5.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:683173d371daad49cffb8309779e886e59c2f369430ad28fe715f66d08d4ab1a", size = 289052, upload-time = "2024-10-23T09:47:04.039Z" }, - { url = "https://files.pythonhosted.org/packages/bd/9f/8bf45a2f1cd4aa401acd271b077989c9267ae8463e7c8b1eb0d3f561b65e/frozenlist-1.5.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7d57d8f702221405a9d9b40f9da8ac2e4a1a8b5285aac6100f3393675f0a85ee", size = 291719, upload-time = "2024-10-23T09:47:05.58Z" }, - { url = "https://files.pythonhosted.org/packages/41/d1/1f20fd05a6c42d3868709b7604c9f15538a29e4f734c694c6bcfc3d3b935/frozenlist-1.5.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:30c72000fbcc35b129cb09956836c7d7abf78ab5416595e4857d1cae8d6251a6", size = 267433, upload-time = "2024-10-23T09:47:07.807Z" }, - { url = "https://files.pythonhosted.org/packages/af/f2/64b73a9bb86f5a89fb55450e97cd5c1f84a862d4ff90d9fd1a73ab0f64a5/frozenlist-1.5.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:000a77d6034fbad9b6bb880f7ec073027908f1b40254b5d6f26210d2dab1240e", size = 283591, upload-time = "2024-10-23T09:47:09.645Z" }, - { url = "https://files.pythonhosted.org/packages/29/e2/ffbb1fae55a791fd6c2938dd9ea779509c977435ba3940b9f2e8dc9d5316/frozenlist-1.5.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:5d7f5a50342475962eb18b740f3beecc685a15b52c91f7d975257e13e029eca9", size = 273249, upload-time = "2024-10-23T09:47:10.808Z" }, - { url = "https://files.pythonhosted.org/packages/2e/6e/008136a30798bb63618a114b9321b5971172a5abddff44a100c7edc5ad4f/frozenlist-1.5.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:87f724d055eb4785d9be84e9ebf0f24e392ddfad00b3fe036e43f489fafc9039", size = 271075, upload-time = "2024-10-23T09:47:11.938Z" }, - { url = "https://files.pythonhosted.org/packages/ae/f0/4e71e54a026b06724cec9b6c54f0b13a4e9e298cc8db0f82ec70e151f5ce/frozenlist-1.5.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:6e9080bb2fb195a046e5177f10d9d82b8a204c0736a97a153c2466127de87784", size = 285398, upload-time = "2024-10-23T09:47:14.071Z" }, - { url = "https://files.pythonhosted.org/packages/4d/36/70ec246851478b1c0b59f11ef8ade9c482ff447c1363c2bd5fad45098b12/frozenlist-1.5.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:9b93d7aaa36c966fa42efcaf716e6b3900438632a626fb09c049f6a2f09fc631", size = 294445, upload-time = "2024-10-23T09:47:15.318Z" }, - { url = "https://files.pythonhosted.org/packages/37/e0/47f87544055b3349b633a03c4d94b405956cf2437f4ab46d0928b74b7526/frozenlist-1.5.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:52ef692a4bc60a6dd57f507429636c2af8b6046db8b31b18dac02cbc8f507f7f", size = 280569, upload-time = "2024-10-23T09:47:17.149Z" }, - { url = "https://files.pythonhosted.org/packages/f9/7c/490133c160fb6b84ed374c266f42800e33b50c3bbab1652764e6e1fc498a/frozenlist-1.5.0-cp312-cp312-win32.whl", hash = "sha256:29d94c256679247b33a3dc96cce0f93cbc69c23bf75ff715919332fdbb6a32b8", size = 44721, upload-time = "2024-10-23T09:47:19.012Z" }, - { url = "https://files.pythonhosted.org/packages/b1/56/4e45136ffc6bdbfa68c29ca56ef53783ef4c2fd395f7cbf99a2624aa9aaa/frozenlist-1.5.0-cp312-cp312-win_amd64.whl", hash = "sha256:8969190d709e7c48ea386db202d708eb94bdb29207a1f269bab1196ce0dcca1f", size = 51329, upload-time = "2024-10-23T09:47:20.177Z" }, - { url = "https://files.pythonhosted.org/packages/da/3b/915f0bca8a7ea04483622e84a9bd90033bab54bdf485479556c74fd5eaf5/frozenlist-1.5.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:7a1a048f9215c90973402e26c01d1cff8a209e1f1b53f72b95c13db61b00f953", size = 91538, upload-time = "2024-10-23T09:47:21.176Z" }, - { url = "https://files.pythonhosted.org/packages/c7/d1/a7c98aad7e44afe5306a2b068434a5830f1470675f0e715abb86eb15f15b/frozenlist-1.5.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:dd47a5181ce5fcb463b5d9e17ecfdb02b678cca31280639255ce9d0e5aa67af0", size = 52849, upload-time = "2024-10-23T09:47:22.439Z" }, - { url = "https://files.pythonhosted.org/packages/3a/c8/76f23bf9ab15d5f760eb48701909645f686f9c64fbb8982674c241fbef14/frozenlist-1.5.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:1431d60b36d15cda188ea222033eec8e0eab488f39a272461f2e6d9e1a8e63c2", size = 50583, upload-time = "2024-10-23T09:47:23.44Z" }, - { url = "https://files.pythonhosted.org/packages/1f/22/462a3dd093d11df623179d7754a3b3269de3b42de2808cddef50ee0f4f48/frozenlist-1.5.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6482a5851f5d72767fbd0e507e80737f9c8646ae7fd303def99bfe813f76cf7f", size = 265636, upload-time = "2024-10-23T09:47:24.82Z" }, - { url = "https://files.pythonhosted.org/packages/80/cf/e075e407fc2ae7328155a1cd7e22f932773c8073c1fc78016607d19cc3e5/frozenlist-1.5.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:44c49271a937625619e862baacbd037a7ef86dd1ee215afc298a417ff3270608", size = 270214, upload-time = "2024-10-23T09:47:26.156Z" }, - { url = "https://files.pythonhosted.org/packages/a1/58/0642d061d5de779f39c50cbb00df49682832923f3d2ebfb0fedf02d05f7f/frozenlist-1.5.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:12f78f98c2f1c2429d42e6a485f433722b0061d5c0b0139efa64f396efb5886b", size = 273905, upload-time = "2024-10-23T09:47:27.741Z" }, - { url = "https://files.pythonhosted.org/packages/ab/66/3fe0f5f8f2add5b4ab7aa4e199f767fd3b55da26e3ca4ce2cc36698e50c4/frozenlist-1.5.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ce3aa154c452d2467487765e3adc730a8c153af77ad84096bc19ce19a2400840", size = 250542, upload-time = "2024-10-23T09:47:28.938Z" }, - { url = "https://files.pythonhosted.org/packages/f6/b8/260791bde9198c87a465224e0e2bb62c4e716f5d198fc3a1dacc4895dbd1/frozenlist-1.5.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9b7dc0c4338e6b8b091e8faf0db3168a37101943e687f373dce00959583f7439", size = 267026, upload-time = "2024-10-23T09:47:30.283Z" }, - { url = "https://files.pythonhosted.org/packages/2e/a4/3d24f88c527f08f8d44ade24eaee83b2627793fa62fa07cbb7ff7a2f7d42/frozenlist-1.5.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:45e0896250900b5aa25180f9aec243e84e92ac84bd4a74d9ad4138ef3f5c97de", size = 257690, upload-time = "2024-10-23T09:47:32.388Z" }, - { url = "https://files.pythonhosted.org/packages/de/9a/d311d660420b2beeff3459b6626f2ab4fb236d07afbdac034a4371fe696e/frozenlist-1.5.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:561eb1c9579d495fddb6da8959fd2a1fca2c6d060d4113f5844b433fc02f2641", size = 253893, upload-time = "2024-10-23T09:47:34.274Z" }, - { url = "https://files.pythonhosted.org/packages/c6/23/e491aadc25b56eabd0f18c53bb19f3cdc6de30b2129ee0bc39cd387cd560/frozenlist-1.5.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:df6e2f325bfee1f49f81aaac97d2aa757c7646534a06f8f577ce184afe2f0a9e", size = 267006, upload-time = "2024-10-23T09:47:35.499Z" }, - { url = "https://files.pythonhosted.org/packages/08/c4/ab918ce636a35fb974d13d666dcbe03969592aeca6c3ab3835acff01f79c/frozenlist-1.5.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:140228863501b44b809fb39ec56b5d4071f4d0aa6d216c19cbb08b8c5a7eadb9", size = 276157, upload-time = "2024-10-23T09:47:37.522Z" }, - { url = "https://files.pythonhosted.org/packages/c0/29/3b7a0bbbbe5a34833ba26f686aabfe982924adbdcafdc294a7a129c31688/frozenlist-1.5.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:7707a25d6a77f5d27ea7dc7d1fc608aa0a478193823f88511ef5e6b8a48f9d03", size = 264642, upload-time = "2024-10-23T09:47:38.75Z" }, - { url = "https://files.pythonhosted.org/packages/ab/42/0595b3dbffc2e82d7fe658c12d5a5bafcd7516c6bf2d1d1feb5387caa9c1/frozenlist-1.5.0-cp313-cp313-win32.whl", hash = "sha256:31a9ac2b38ab9b5a8933b693db4939764ad3f299fcaa931a3e605bc3460e693c", size = 44914, upload-time = "2024-10-23T09:47:40.145Z" }, - { url = "https://files.pythonhosted.org/packages/17/c4/b7db1206a3fea44bf3b838ca61deb6f74424a8a5db1dd53ecb21da669be6/frozenlist-1.5.0-cp313-cp313-win_amd64.whl", hash = "sha256:11aabdd62b8b9c4b84081a3c246506d1cddd2dd93ff0ad53ede5defec7886b28", size = 51167, upload-time = "2024-10-23T09:47:41.812Z" }, - { url = "https://files.pythonhosted.org/packages/da/4d/d94ff0fb0f5313902c132817c62d19cdc5bdcd0c195d392006ef4b779fc6/frozenlist-1.5.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:9bbcdfaf4af7ce002694a4e10a0159d5a8d20056a12b05b45cea944a4953f972", size = 95319, upload-time = "2024-10-23T09:48:06.405Z" }, - { url = "https://files.pythonhosted.org/packages/8c/1b/d90e554ca2b483d31cb2296e393f72c25bdc38d64526579e95576bfda587/frozenlist-1.5.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1893f948bf6681733aaccf36c5232c231e3b5166d607c5fa77773611df6dc336", size = 54749, upload-time = "2024-10-23T09:48:07.48Z" }, - { url = "https://files.pythonhosted.org/packages/f8/66/7fdecc9ef49f8db2aa4d9da916e4ecf357d867d87aea292efc11e1b2e932/frozenlist-1.5.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:2b5e23253bb709ef57a8e95e6ae48daa9ac5f265637529e4ce6b003a37b2621f", size = 52718, upload-time = "2024-10-23T09:48:08.725Z" }, - { url = "https://files.pythonhosted.org/packages/08/04/e2fddc92135276e07addbc1cf413acffa0c2d848b3e54cacf684e146df49/frozenlist-1.5.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0f253985bb515ecd89629db13cb58d702035ecd8cfbca7d7a7e29a0e6d39af5f", size = 241756, upload-time = "2024-10-23T09:48:09.843Z" }, - { url = "https://files.pythonhosted.org/packages/c6/52/be5ff200815d8a341aee5b16b6b707355e0ca3652953852238eb92b120c2/frozenlist-1.5.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:04a5c6babd5e8fb7d3c871dc8b321166b80e41b637c31a995ed844a6139942b6", size = 267718, upload-time = "2024-10-23T09:48:11.828Z" }, - { url = "https://files.pythonhosted.org/packages/88/be/4bd93a58be57a3722fc544c36debdf9dcc6758f761092e894d78f18b8f20/frozenlist-1.5.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a9fe0f1c29ba24ba6ff6abf688cb0b7cf1efab6b6aa6adc55441773c252f7411", size = 263494, upload-time = "2024-10-23T09:48:13.424Z" }, - { url = "https://files.pythonhosted.org/packages/32/ba/58348b90193caa096ce9e9befea6ae67f38dabfd3aacb47e46137a6250a8/frozenlist-1.5.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:226d72559fa19babe2ccd920273e767c96a49b9d3d38badd7c91a0fdeda8ea08", size = 232838, upload-time = "2024-10-23T09:48:14.792Z" }, - { url = "https://files.pythonhosted.org/packages/f6/33/9f152105227630246135188901373c4f322cc026565ca6215b063f4c82f4/frozenlist-1.5.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15b731db116ab3aedec558573c1a5eec78822b32292fe4f2f0345b7f697745c2", size = 242912, upload-time = "2024-10-23T09:48:16.249Z" }, - { url = "https://files.pythonhosted.org/packages/a0/10/3db38fb3ccbafadd80a1b0d6800c987b0e3fe3ef2d117c6ced0246eea17a/frozenlist-1.5.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:366d8f93e3edfe5a918c874702f78faac300209a4d5bf38352b2c1bdc07a766d", size = 244763, upload-time = "2024-10-23T09:48:17.781Z" }, - { url = "https://files.pythonhosted.org/packages/e2/cd/1df468fdce2f66a4608dffe44c40cdc35eeaa67ef7fd1d813f99a9a37842/frozenlist-1.5.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:1b96af8c582b94d381a1c1f51ffaedeb77c821c690ea5f01da3d70a487dd0a9b", size = 242841, upload-time = "2024-10-23T09:48:19.507Z" }, - { url = "https://files.pythonhosted.org/packages/ee/5f/16097a5ca0bb6b6779c02cc9379c72fe98d56115d4c54d059fb233168fb6/frozenlist-1.5.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:c03eff4a41bd4e38415cbed054bbaff4a075b093e2394b6915dca34a40d1e38b", size = 263407, upload-time = "2024-10-23T09:48:21.467Z" }, - { url = "https://files.pythonhosted.org/packages/0f/f7/58cd220ee1c2248ee65a32f5b4b93689e3fe1764d85537eee9fc392543bc/frozenlist-1.5.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:50cf5e7ee9b98f22bdecbabf3800ae78ddcc26e4a435515fc72d97903e8488e0", size = 265083, upload-time = "2024-10-23T09:48:22.725Z" }, - { url = "https://files.pythonhosted.org/packages/62/b8/49768980caabf81ac4a2d156008f7cbd0107e6b36d08a313bb31035d9201/frozenlist-1.5.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:1e76bfbc72353269c44e0bc2cfe171900fbf7f722ad74c9a7b638052afe6a00c", size = 251564, upload-time = "2024-10-23T09:48:24.272Z" }, - { url = "https://files.pythonhosted.org/packages/cb/83/619327da3b86ef957ee7a0cbf3c166a09ed1e87a3f7f1ff487d7d0284683/frozenlist-1.5.0-cp39-cp39-win32.whl", hash = "sha256:666534d15ba8f0fda3f53969117383d5dc021266b3c1a42c9ec4855e4b58b9d3", size = 45691, upload-time = "2024-10-23T09:48:26.317Z" }, - { url = "https://files.pythonhosted.org/packages/8b/28/407bc34a745151ed2322c690b6e7d83d7101472e81ed76e1ebdac0b70a78/frozenlist-1.5.0-cp39-cp39-win_amd64.whl", hash = "sha256:5c28f4b5dbef8a0d8aad0d4de24d1e9e981728628afaf4ea0792f5d0939372f0", size = 51767, upload-time = "2024-10-23T09:48:27.427Z" }, - { url = "https://files.pythonhosted.org/packages/c6/c8/a5be5b7550c10858fcf9b0ea054baccab474da77d37f1e828ce043a3a5d4/frozenlist-1.5.0-py3-none-any.whl", hash = "sha256:d994863bba198a4a518b467bb971c56e1db3f180a25c6cf7bb1949c267f748c3", size = 11901, upload-time = "2024-10-23T09:48:28.851Z" }, +version = "1.7.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/79/b1/b64018016eeb087db503b038296fd782586432b9c077fc5c7839e9cb6ef6/frozenlist-1.7.0.tar.gz", hash = "sha256:2e310d81923c2437ea8670467121cc3e9b0f76d3043cc1d2331d56c7fb7a3a8f", size = 45078, upload-time = "2025-06-09T23:02:35.538Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/af/36/0da0a49409f6b47cc2d060dc8c9040b897b5902a8a4e37d9bc1deb11f680/frozenlist-1.7.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:cc4df77d638aa2ed703b878dd093725b72a824c3c546c076e8fdf276f78ee84a", size = 81304, upload-time = "2025-06-09T22:59:46.226Z" }, + { url = "https://files.pythonhosted.org/packages/77/f0/77c11d13d39513b298e267b22eb6cb559c103d56f155aa9a49097221f0b6/frozenlist-1.7.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:716a9973a2cc963160394f701964fe25012600f3d311f60c790400b00e568b61", size = 47735, upload-time = "2025-06-09T22:59:48.133Z" }, + { url = "https://files.pythonhosted.org/packages/37/12/9d07fa18971a44150593de56b2f2947c46604819976784bcf6ea0d5db43b/frozenlist-1.7.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a0fd1bad056a3600047fb9462cff4c5322cebc59ebf5d0a3725e0ee78955001d", size = 46775, upload-time = "2025-06-09T22:59:49.564Z" }, + { url = "https://files.pythonhosted.org/packages/70/34/f73539227e06288fcd1f8a76853e755b2b48bca6747e99e283111c18bcd4/frozenlist-1.7.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3789ebc19cb811163e70fe2bd354cea097254ce6e707ae42e56f45e31e96cb8e", size = 224644, upload-time = "2025-06-09T22:59:51.35Z" }, + { url = "https://files.pythonhosted.org/packages/fb/68/c1d9c2f4a6e438e14613bad0f2973567586610cc22dcb1e1241da71de9d3/frozenlist-1.7.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:af369aa35ee34f132fcfad5be45fbfcde0e3a5f6a1ec0712857f286b7d20cca9", size = 222125, upload-time = "2025-06-09T22:59:52.884Z" }, + { url = "https://files.pythonhosted.org/packages/b9/d0/98e8f9a515228d708344d7c6986752be3e3192d1795f748c24bcf154ad99/frozenlist-1.7.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ac64b6478722eeb7a3313d494f8342ef3478dff539d17002f849101b212ef97c", size = 233455, upload-time = "2025-06-09T22:59:54.74Z" }, + { url = "https://files.pythonhosted.org/packages/79/df/8a11bcec5600557f40338407d3e5bea80376ed1c01a6c0910fcfdc4b8993/frozenlist-1.7.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f89f65d85774f1797239693cef07ad4c97fdd0639544bad9ac4b869782eb1981", size = 227339, upload-time = "2025-06-09T22:59:56.187Z" }, + { url = "https://files.pythonhosted.org/packages/50/82/41cb97d9c9a5ff94438c63cc343eb7980dac4187eb625a51bdfdb7707314/frozenlist-1.7.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1073557c941395fdfcfac13eb2456cb8aad89f9de27bae29fabca8e563b12615", size = 212969, upload-time = "2025-06-09T22:59:57.604Z" }, + { url = "https://files.pythonhosted.org/packages/13/47/f9179ee5ee4f55629e4f28c660b3fdf2775c8bfde8f9c53f2de2d93f52a9/frozenlist-1.7.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1ed8d2fa095aae4bdc7fdd80351009a48d286635edffee66bf865e37a9125c50", size = 222862, upload-time = "2025-06-09T22:59:59.498Z" }, + { url = "https://files.pythonhosted.org/packages/1a/52/df81e41ec6b953902c8b7e3a83bee48b195cb0e5ec2eabae5d8330c78038/frozenlist-1.7.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:24c34bea555fe42d9f928ba0a740c553088500377448febecaa82cc3e88aa1fa", size = 222492, upload-time = "2025-06-09T23:00:01.026Z" }, + { url = "https://files.pythonhosted.org/packages/84/17/30d6ea87fa95a9408245a948604b82c1a4b8b3e153cea596421a2aef2754/frozenlist-1.7.0-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:69cac419ac6a6baad202c85aaf467b65ac860ac2e7f2ac1686dc40dbb52f6577", size = 238250, upload-time = "2025-06-09T23:00:03.401Z" }, + { url = "https://files.pythonhosted.org/packages/8f/00/ecbeb51669e3c3df76cf2ddd66ae3e48345ec213a55e3887d216eb4fbab3/frozenlist-1.7.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:960d67d0611f4c87da7e2ae2eacf7ea81a5be967861e0c63cf205215afbfac59", size = 218720, upload-time = "2025-06-09T23:00:05.282Z" }, + { url = "https://files.pythonhosted.org/packages/1a/c0/c224ce0e0eb31cc57f67742071bb470ba8246623c1823a7530be0e76164c/frozenlist-1.7.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:41be2964bd4b15bf575e5daee5a5ce7ed3115320fb3c2b71fca05582ffa4dc9e", size = 232585, upload-time = "2025-06-09T23:00:07.962Z" }, + { url = "https://files.pythonhosted.org/packages/55/3c/34cb694abf532f31f365106deebdeac9e45c19304d83cf7d51ebbb4ca4d1/frozenlist-1.7.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:46d84d49e00c9429238a7ce02dc0be8f6d7cd0cd405abd1bebdc991bf27c15bd", size = 234248, upload-time = "2025-06-09T23:00:09.428Z" }, + { url = "https://files.pythonhosted.org/packages/98/c0/2052d8b6cecda2e70bd81299e3512fa332abb6dcd2969b9c80dfcdddbf75/frozenlist-1.7.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:15900082e886edb37480335d9d518cec978afc69ccbc30bd18610b7c1b22a718", size = 221621, upload-time = "2025-06-09T23:00:11.32Z" }, + { url = "https://files.pythonhosted.org/packages/c5/bf/7dcebae315436903b1d98ffb791a09d674c88480c158aa171958a3ac07f0/frozenlist-1.7.0-cp310-cp310-win32.whl", hash = "sha256:400ddd24ab4e55014bba442d917203c73b2846391dd42ca5e38ff52bb18c3c5e", size = 39578, upload-time = "2025-06-09T23:00:13.526Z" }, + { url = "https://files.pythonhosted.org/packages/8f/5f/f69818f017fa9a3d24d1ae39763e29b7f60a59e46d5f91b9c6b21622f4cd/frozenlist-1.7.0-cp310-cp310-win_amd64.whl", hash = "sha256:6eb93efb8101ef39d32d50bce242c84bcbddb4f7e9febfa7b524532a239b4464", size = 43830, upload-time = "2025-06-09T23:00:14.98Z" }, + { url = "https://files.pythonhosted.org/packages/34/7e/803dde33760128acd393a27eb002f2020ddb8d99d30a44bfbaab31c5f08a/frozenlist-1.7.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:aa51e147a66b2d74de1e6e2cf5921890de6b0f4820b257465101d7f37b49fb5a", size = 82251, upload-time = "2025-06-09T23:00:16.279Z" }, + { url = "https://files.pythonhosted.org/packages/75/a9/9c2c5760b6ba45eae11334db454c189d43d34a4c0b489feb2175e5e64277/frozenlist-1.7.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:9b35db7ce1cd71d36ba24f80f0c9e7cff73a28d7a74e91fe83e23d27c7828750", size = 48183, upload-time = "2025-06-09T23:00:17.698Z" }, + { url = "https://files.pythonhosted.org/packages/47/be/4038e2d869f8a2da165f35a6befb9158c259819be22eeaf9c9a8f6a87771/frozenlist-1.7.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:34a69a85e34ff37791e94542065c8416c1afbf820b68f720452f636d5fb990cd", size = 47107, upload-time = "2025-06-09T23:00:18.952Z" }, + { url = "https://files.pythonhosted.org/packages/79/26/85314b8a83187c76a37183ceed886381a5f992975786f883472fcb6dc5f2/frozenlist-1.7.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4a646531fa8d82c87fe4bb2e596f23173caec9185bfbca5d583b4ccfb95183e2", size = 237333, upload-time = "2025-06-09T23:00:20.275Z" }, + { url = "https://files.pythonhosted.org/packages/1f/fd/e5b64f7d2c92a41639ffb2ad44a6a82f347787abc0c7df5f49057cf11770/frozenlist-1.7.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:79b2ffbba483f4ed36a0f236ccb85fbb16e670c9238313709638167670ba235f", size = 231724, upload-time = "2025-06-09T23:00:21.705Z" }, + { url = "https://files.pythonhosted.org/packages/20/fb/03395c0a43a5976af4bf7534759d214405fbbb4c114683f434dfdd3128ef/frozenlist-1.7.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a26f205c9ca5829cbf82bb2a84b5c36f7184c4316617d7ef1b271a56720d6b30", size = 245842, upload-time = "2025-06-09T23:00:23.148Z" }, + { url = "https://files.pythonhosted.org/packages/d0/15/c01c8e1dffdac5d9803507d824f27aed2ba76b6ed0026fab4d9866e82f1f/frozenlist-1.7.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bcacfad3185a623fa11ea0e0634aac7b691aa925d50a440f39b458e41c561d98", size = 239767, upload-time = "2025-06-09T23:00:25.103Z" }, + { url = "https://files.pythonhosted.org/packages/14/99/3f4c6fe882c1f5514b6848aa0a69b20cb5e5d8e8f51a339d48c0e9305ed0/frozenlist-1.7.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:72c1b0fe8fe451b34f12dce46445ddf14bd2a5bcad7e324987194dc8e3a74c86", size = 224130, upload-time = "2025-06-09T23:00:27.061Z" }, + { url = "https://files.pythonhosted.org/packages/4d/83/220a374bd7b2aeba9d0725130665afe11de347d95c3620b9b82cc2fcab97/frozenlist-1.7.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:61d1a5baeaac6c0798ff6edfaeaa00e0e412d49946c53fae8d4b8e8b3566c4ae", size = 235301, upload-time = "2025-06-09T23:00:29.02Z" }, + { url = "https://files.pythonhosted.org/packages/03/3c/3e3390d75334a063181625343e8daab61b77e1b8214802cc4e8a1bb678fc/frozenlist-1.7.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:7edf5c043c062462f09b6820de9854bf28cc6cc5b6714b383149745e287181a8", size = 234606, upload-time = "2025-06-09T23:00:30.514Z" }, + { url = "https://files.pythonhosted.org/packages/23/1e/58232c19608b7a549d72d9903005e2d82488f12554a32de2d5fb59b9b1ba/frozenlist-1.7.0-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:d50ac7627b3a1bd2dcef6f9da89a772694ec04d9a61b66cf87f7d9446b4a0c31", size = 248372, upload-time = "2025-06-09T23:00:31.966Z" }, + { url = "https://files.pythonhosted.org/packages/c0/a4/e4a567e01702a88a74ce8a324691e62a629bf47d4f8607f24bf1c7216e7f/frozenlist-1.7.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:ce48b2fece5aeb45265bb7a58259f45027db0abff478e3077e12b05b17fb9da7", size = 229860, upload-time = "2025-06-09T23:00:33.375Z" }, + { url = "https://files.pythonhosted.org/packages/73/a6/63b3374f7d22268b41a9db73d68a8233afa30ed164c46107b33c4d18ecdd/frozenlist-1.7.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:fe2365ae915a1fafd982c146754e1de6ab3478def8a59c86e1f7242d794f97d5", size = 245893, upload-time = "2025-06-09T23:00:35.002Z" }, + { url = "https://files.pythonhosted.org/packages/6d/eb/d18b3f6e64799a79673c4ba0b45e4cfbe49c240edfd03a68be20002eaeaa/frozenlist-1.7.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:45a6f2fdbd10e074e8814eb98b05292f27bad7d1883afbe009d96abdcf3bc898", size = 246323, upload-time = "2025-06-09T23:00:36.468Z" }, + { url = "https://files.pythonhosted.org/packages/5a/f5/720f3812e3d06cd89a1d5db9ff6450088b8f5c449dae8ffb2971a44da506/frozenlist-1.7.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:21884e23cffabb157a9dd7e353779077bf5b8f9a58e9b262c6caad2ef5f80a56", size = 233149, upload-time = "2025-06-09T23:00:37.963Z" }, + { url = "https://files.pythonhosted.org/packages/69/68/03efbf545e217d5db8446acfd4c447c15b7c8cf4dbd4a58403111df9322d/frozenlist-1.7.0-cp311-cp311-win32.whl", hash = "sha256:284d233a8953d7b24f9159b8a3496fc1ddc00f4db99c324bd5fb5f22d8698ea7", size = 39565, upload-time = "2025-06-09T23:00:39.753Z" }, + { url = "https://files.pythonhosted.org/packages/58/17/fe61124c5c333ae87f09bb67186d65038834a47d974fc10a5fadb4cc5ae1/frozenlist-1.7.0-cp311-cp311-win_amd64.whl", hash = "sha256:387cbfdcde2f2353f19c2f66bbb52406d06ed77519ac7ee21be0232147c2592d", size = 44019, upload-time = "2025-06-09T23:00:40.988Z" }, + { url = "https://files.pythonhosted.org/packages/ef/a2/c8131383f1e66adad5f6ecfcce383d584ca94055a34d683bbb24ac5f2f1c/frozenlist-1.7.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:3dbf9952c4bb0e90e98aec1bd992b3318685005702656bc6f67c1a32b76787f2", size = 81424, upload-time = "2025-06-09T23:00:42.24Z" }, + { url = "https://files.pythonhosted.org/packages/4c/9d/02754159955088cb52567337d1113f945b9e444c4960771ea90eb73de8db/frozenlist-1.7.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:1f5906d3359300b8a9bb194239491122e6cf1444c2efb88865426f170c262cdb", size = 47952, upload-time = "2025-06-09T23:00:43.481Z" }, + { url = "https://files.pythonhosted.org/packages/01/7a/0046ef1bd6699b40acd2067ed6d6670b4db2f425c56980fa21c982c2a9db/frozenlist-1.7.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:3dabd5a8f84573c8d10d8859a50ea2dec01eea372031929871368c09fa103478", size = 46688, upload-time = "2025-06-09T23:00:44.793Z" }, + { url = "https://files.pythonhosted.org/packages/d6/a2/a910bafe29c86997363fb4c02069df4ff0b5bc39d33c5198b4e9dd42d8f8/frozenlist-1.7.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aa57daa5917f1738064f302bf2626281a1cb01920c32f711fbc7bc36111058a8", size = 243084, upload-time = "2025-06-09T23:00:46.125Z" }, + { url = "https://files.pythonhosted.org/packages/64/3e/5036af9d5031374c64c387469bfcc3af537fc0f5b1187d83a1cf6fab1639/frozenlist-1.7.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c193dda2b6d49f4c4398962810fa7d7c78f032bf45572b3e04dd5249dff27e08", size = 233524, upload-time = "2025-06-09T23:00:47.73Z" }, + { url = "https://files.pythonhosted.org/packages/06/39/6a17b7c107a2887e781a48ecf20ad20f1c39d94b2a548c83615b5b879f28/frozenlist-1.7.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bfe2b675cf0aaa6d61bf8fbffd3c274b3c9b7b1623beb3809df8a81399a4a9c4", size = 248493, upload-time = "2025-06-09T23:00:49.742Z" }, + { url = "https://files.pythonhosted.org/packages/be/00/711d1337c7327d88c44d91dd0f556a1c47fb99afc060ae0ef66b4d24793d/frozenlist-1.7.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8fc5d5cda37f62b262405cf9652cf0856839c4be8ee41be0afe8858f17f4c94b", size = 244116, upload-time = "2025-06-09T23:00:51.352Z" }, + { url = "https://files.pythonhosted.org/packages/24/fe/74e6ec0639c115df13d5850e75722750adabdc7de24e37e05a40527ca539/frozenlist-1.7.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b0d5ce521d1dd7d620198829b87ea002956e4319002ef0bc8d3e6d045cb4646e", size = 224557, upload-time = "2025-06-09T23:00:52.855Z" }, + { url = "https://files.pythonhosted.org/packages/8d/db/48421f62a6f77c553575201e89048e97198046b793f4a089c79a6e3268bd/frozenlist-1.7.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:488d0a7d6a0008ca0db273c542098a0fa9e7dfaa7e57f70acef43f32b3f69dca", size = 241820, upload-time = "2025-06-09T23:00:54.43Z" }, + { url = "https://files.pythonhosted.org/packages/1d/fa/cb4a76bea23047c8462976ea7b7a2bf53997a0ca171302deae9d6dd12096/frozenlist-1.7.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:15a7eaba63983d22c54d255b854e8108e7e5f3e89f647fc854bd77a237e767df", size = 236542, upload-time = "2025-06-09T23:00:56.409Z" }, + { url = "https://files.pythonhosted.org/packages/5d/32/476a4b5cfaa0ec94d3f808f193301debff2ea42288a099afe60757ef6282/frozenlist-1.7.0-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:1eaa7e9c6d15df825bf255649e05bd8a74b04a4d2baa1ae46d9c2d00b2ca2cb5", size = 249350, upload-time = "2025-06-09T23:00:58.468Z" }, + { url = "https://files.pythonhosted.org/packages/8d/ba/9a28042f84a6bf8ea5dbc81cfff8eaef18d78b2a1ad9d51c7bc5b029ad16/frozenlist-1.7.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:e4389e06714cfa9d47ab87f784a7c5be91d3934cd6e9a7b85beef808297cc025", size = 225093, upload-time = "2025-06-09T23:01:00.015Z" }, + { url = "https://files.pythonhosted.org/packages/bc/29/3a32959e68f9cf000b04e79ba574527c17e8842e38c91d68214a37455786/frozenlist-1.7.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:73bd45e1488c40b63fe5a7df892baf9e2a4d4bb6409a2b3b78ac1c6236178e01", size = 245482, upload-time = "2025-06-09T23:01:01.474Z" }, + { url = "https://files.pythonhosted.org/packages/80/e8/edf2f9e00da553f07f5fa165325cfc302dead715cab6ac8336a5f3d0adc2/frozenlist-1.7.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:99886d98e1643269760e5fe0df31e5ae7050788dd288947f7f007209b8c33f08", size = 249590, upload-time = "2025-06-09T23:01:02.961Z" }, + { url = "https://files.pythonhosted.org/packages/1c/80/9a0eb48b944050f94cc51ee1c413eb14a39543cc4f760ed12657a5a3c45a/frozenlist-1.7.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:290a172aae5a4c278c6da8a96222e6337744cd9c77313efe33d5670b9f65fc43", size = 237785, upload-time = "2025-06-09T23:01:05.095Z" }, + { url = "https://files.pythonhosted.org/packages/f3/74/87601e0fb0369b7a2baf404ea921769c53b7ae00dee7dcfe5162c8c6dbf0/frozenlist-1.7.0-cp312-cp312-win32.whl", hash = "sha256:426c7bc70e07cfebc178bc4c2bf2d861d720c4fff172181eeb4a4c41d4ca2ad3", size = 39487, upload-time = "2025-06-09T23:01:06.54Z" }, + { url = "https://files.pythonhosted.org/packages/0b/15/c026e9a9fc17585a9d461f65d8593d281fedf55fbf7eb53f16c6df2392f9/frozenlist-1.7.0-cp312-cp312-win_amd64.whl", hash = "sha256:563b72efe5da92e02eb68c59cb37205457c977aa7a449ed1b37e6939e5c47c6a", size = 43874, upload-time = "2025-06-09T23:01:07.752Z" }, + { url = "https://files.pythonhosted.org/packages/24/90/6b2cebdabdbd50367273c20ff6b57a3dfa89bd0762de02c3a1eb42cb6462/frozenlist-1.7.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ee80eeda5e2a4e660651370ebffd1286542b67e268aa1ac8d6dbe973120ef7ee", size = 79791, upload-time = "2025-06-09T23:01:09.368Z" }, + { url = "https://files.pythonhosted.org/packages/83/2e/5b70b6a3325363293fe5fc3ae74cdcbc3e996c2a11dde2fd9f1fb0776d19/frozenlist-1.7.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:d1a81c85417b914139e3a9b995d4a1c84559afc839a93cf2cb7f15e6e5f6ed2d", size = 47165, upload-time = "2025-06-09T23:01:10.653Z" }, + { url = "https://files.pythonhosted.org/packages/f4/25/a0895c99270ca6966110f4ad98e87e5662eab416a17e7fd53c364bf8b954/frozenlist-1.7.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:cbb65198a9132ebc334f237d7b0df163e4de83fb4f2bdfe46c1e654bdb0c5d43", size = 45881, upload-time = "2025-06-09T23:01:12.296Z" }, + { url = "https://files.pythonhosted.org/packages/19/7c/71bb0bbe0832793c601fff68cd0cf6143753d0c667f9aec93d3c323f4b55/frozenlist-1.7.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dab46c723eeb2c255a64f9dc05b8dd601fde66d6b19cdb82b2e09cc6ff8d8b5d", size = 232409, upload-time = "2025-06-09T23:01:13.641Z" }, + { url = "https://files.pythonhosted.org/packages/c0/45/ed2798718910fe6eb3ba574082aaceff4528e6323f9a8570be0f7028d8e9/frozenlist-1.7.0-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:6aeac207a759d0dedd2e40745575ae32ab30926ff4fa49b1635def65806fddee", size = 225132, upload-time = "2025-06-09T23:01:15.264Z" }, + { url = "https://files.pythonhosted.org/packages/ba/e2/8417ae0f8eacb1d071d4950f32f229aa6bf68ab69aab797b72a07ea68d4f/frozenlist-1.7.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bd8c4e58ad14b4fa7802b8be49d47993182fdd4023393899632c88fd8cd994eb", size = 237638, upload-time = "2025-06-09T23:01:16.752Z" }, + { url = "https://files.pythonhosted.org/packages/f8/b7/2ace5450ce85f2af05a871b8c8719b341294775a0a6c5585d5e6170f2ce7/frozenlist-1.7.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:04fb24d104f425da3540ed83cbfc31388a586a7696142004c577fa61c6298c3f", size = 233539, upload-time = "2025-06-09T23:01:18.202Z" }, + { url = "https://files.pythonhosted.org/packages/46/b9/6989292c5539553dba63f3c83dc4598186ab2888f67c0dc1d917e6887db6/frozenlist-1.7.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6a5c505156368e4ea6b53b5ac23c92d7edc864537ff911d2fb24c140bb175e60", size = 215646, upload-time = "2025-06-09T23:01:19.649Z" }, + { url = "https://files.pythonhosted.org/packages/72/31/bc8c5c99c7818293458fe745dab4fd5730ff49697ccc82b554eb69f16a24/frozenlist-1.7.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8bd7eb96a675f18aa5c553eb7ddc24a43c8c18f22e1f9925528128c052cdbe00", size = 232233, upload-time = "2025-06-09T23:01:21.175Z" }, + { url = "https://files.pythonhosted.org/packages/59/52/460db4d7ba0811b9ccb85af996019f5d70831f2f5f255f7cc61f86199795/frozenlist-1.7.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:05579bf020096fe05a764f1f84cd104a12f78eaab68842d036772dc6d4870b4b", size = 227996, upload-time = "2025-06-09T23:01:23.098Z" }, + { url = "https://files.pythonhosted.org/packages/ba/c9/f4b39e904c03927b7ecf891804fd3b4df3db29b9e487c6418e37988d6e9d/frozenlist-1.7.0-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:376b6222d114e97eeec13d46c486facd41d4f43bab626b7c3f6a8b4e81a5192c", size = 242280, upload-time = "2025-06-09T23:01:24.808Z" }, + { url = "https://files.pythonhosted.org/packages/b8/33/3f8d6ced42f162d743e3517781566b8481322be321b486d9d262adf70bfb/frozenlist-1.7.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:0aa7e176ebe115379b5b1c95b4096fb1c17cce0847402e227e712c27bdb5a949", size = 217717, upload-time = "2025-06-09T23:01:26.28Z" }, + { url = "https://files.pythonhosted.org/packages/3e/e8/ad683e75da6ccef50d0ab0c2b2324b32f84fc88ceee778ed79b8e2d2fe2e/frozenlist-1.7.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:3fbba20e662b9c2130dc771e332a99eff5da078b2b2648153a40669a6d0e36ca", size = 236644, upload-time = "2025-06-09T23:01:27.887Z" }, + { url = "https://files.pythonhosted.org/packages/b2/14/8d19ccdd3799310722195a72ac94ddc677541fb4bef4091d8e7775752360/frozenlist-1.7.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:f3f4410a0a601d349dd406b5713fec59b4cee7e71678d5b17edda7f4655a940b", size = 238879, upload-time = "2025-06-09T23:01:29.524Z" }, + { url = "https://files.pythonhosted.org/packages/ce/13/c12bf657494c2fd1079a48b2db49fa4196325909249a52d8f09bc9123fd7/frozenlist-1.7.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e2cdfaaec6a2f9327bf43c933c0319a7c429058e8537c508964a133dffee412e", size = 232502, upload-time = "2025-06-09T23:01:31.287Z" }, + { url = "https://files.pythonhosted.org/packages/d7/8b/e7f9dfde869825489382bc0d512c15e96d3964180c9499efcec72e85db7e/frozenlist-1.7.0-cp313-cp313-win32.whl", hash = "sha256:5fc4df05a6591c7768459caba1b342d9ec23fa16195e744939ba5914596ae3e1", size = 39169, upload-time = "2025-06-09T23:01:35.503Z" }, + { url = "https://files.pythonhosted.org/packages/35/89/a487a98d94205d85745080a37860ff5744b9820a2c9acbcdd9440bfddf98/frozenlist-1.7.0-cp313-cp313-win_amd64.whl", hash = "sha256:52109052b9791a3e6b5d1b65f4b909703984b770694d3eb64fad124c835d7cba", size = 43219, upload-time = "2025-06-09T23:01:36.784Z" }, + { url = "https://files.pythonhosted.org/packages/56/d5/5c4cf2319a49eddd9dd7145e66c4866bdc6f3dbc67ca3d59685149c11e0d/frozenlist-1.7.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:a6f86e4193bb0e235ef6ce3dde5cbabed887e0b11f516ce8a0f4d3b33078ec2d", size = 84345, upload-time = "2025-06-09T23:01:38.295Z" }, + { url = "https://files.pythonhosted.org/packages/a4/7d/ec2c1e1dc16b85bc9d526009961953df9cec8481b6886debb36ec9107799/frozenlist-1.7.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:82d664628865abeb32d90ae497fb93df398a69bb3434463d172b80fc25b0dd7d", size = 48880, upload-time = "2025-06-09T23:01:39.887Z" }, + { url = "https://files.pythonhosted.org/packages/69/86/f9596807b03de126e11e7d42ac91e3d0b19a6599c714a1989a4e85eeefc4/frozenlist-1.7.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:912a7e8375a1c9a68325a902f3953191b7b292aa3c3fb0d71a216221deca460b", size = 48498, upload-time = "2025-06-09T23:01:41.318Z" }, + { url = "https://files.pythonhosted.org/packages/5e/cb/df6de220f5036001005f2d726b789b2c0b65f2363b104bbc16f5be8084f8/frozenlist-1.7.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9537c2777167488d539bc5de2ad262efc44388230e5118868e172dd4a552b146", size = 292296, upload-time = "2025-06-09T23:01:42.685Z" }, + { url = "https://files.pythonhosted.org/packages/83/1f/de84c642f17c8f851a2905cee2dae401e5e0daca9b5ef121e120e19aa825/frozenlist-1.7.0-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:f34560fb1b4c3e30ba35fa9a13894ba39e5acfc5f60f57d8accde65f46cc5e74", size = 273103, upload-time = "2025-06-09T23:01:44.166Z" }, + { url = "https://files.pythonhosted.org/packages/88/3c/c840bfa474ba3fa13c772b93070893c6e9d5c0350885760376cbe3b6c1b3/frozenlist-1.7.0-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:acd03d224b0175f5a850edc104ac19040d35419eddad04e7cf2d5986d98427f1", size = 292869, upload-time = "2025-06-09T23:01:45.681Z" }, + { url = "https://files.pythonhosted.org/packages/a6/1c/3efa6e7d5a39a1d5ef0abeb51c48fb657765794a46cf124e5aca2c7a592c/frozenlist-1.7.0-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f2038310bc582f3d6a09b3816ab01737d60bf7b1ec70f5356b09e84fb7408ab1", size = 291467, upload-time = "2025-06-09T23:01:47.234Z" }, + { url = "https://files.pythonhosted.org/packages/4f/00/d5c5e09d4922c395e2f2f6b79b9a20dab4b67daaf78ab92e7729341f61f6/frozenlist-1.7.0-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b8c05e4c8e5f36e5e088caa1bf78a687528f83c043706640a92cb76cd6999384", size = 266028, upload-time = "2025-06-09T23:01:48.819Z" }, + { url = "https://files.pythonhosted.org/packages/4e/27/72765be905619dfde25a7f33813ac0341eb6b076abede17a2e3fbfade0cb/frozenlist-1.7.0-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:765bb588c86e47d0b68f23c1bee323d4b703218037765dcf3f25c838c6fecceb", size = 284294, upload-time = "2025-06-09T23:01:50.394Z" }, + { url = "https://files.pythonhosted.org/packages/88/67/c94103a23001b17808eb7dd1200c156bb69fb68e63fcf0693dde4cd6228c/frozenlist-1.7.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:32dc2e08c67d86d0969714dd484fd60ff08ff81d1a1e40a77dd34a387e6ebc0c", size = 281898, upload-time = "2025-06-09T23:01:52.234Z" }, + { url = "https://files.pythonhosted.org/packages/42/34/a3e2c00c00f9e2a9db5653bca3fec306349e71aff14ae45ecc6d0951dd24/frozenlist-1.7.0-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:c0303e597eb5a5321b4de9c68e9845ac8f290d2ab3f3e2c864437d3c5a30cd65", size = 290465, upload-time = "2025-06-09T23:01:53.788Z" }, + { url = "https://files.pythonhosted.org/packages/bb/73/f89b7fbce8b0b0c095d82b008afd0590f71ccb3dee6eee41791cf8cd25fd/frozenlist-1.7.0-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:a47f2abb4e29b3a8d0b530f7c3598badc6b134562b1a5caee867f7c62fee51e3", size = 266385, upload-time = "2025-06-09T23:01:55.769Z" }, + { url = "https://files.pythonhosted.org/packages/cd/45/e365fdb554159462ca12df54bc59bfa7a9a273ecc21e99e72e597564d1ae/frozenlist-1.7.0-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:3d688126c242a6fabbd92e02633414d40f50bb6002fa4cf995a1d18051525657", size = 288771, upload-time = "2025-06-09T23:01:57.4Z" }, + { url = "https://files.pythonhosted.org/packages/00/11/47b6117002a0e904f004d70ec5194fe9144f117c33c851e3d51c765962d0/frozenlist-1.7.0-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:4e7e9652b3d367c7bd449a727dc79d5043f48b88d0cbfd4f9f1060cf2b414104", size = 288206, upload-time = "2025-06-09T23:01:58.936Z" }, + { url = "https://files.pythonhosted.org/packages/40/37/5f9f3c3fd7f7746082ec67bcdc204db72dad081f4f83a503d33220a92973/frozenlist-1.7.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:1a85e345b4c43db8b842cab1feb41be5cc0b10a1830e6295b69d7310f99becaf", size = 282620, upload-time = "2025-06-09T23:02:00.493Z" }, + { url = "https://files.pythonhosted.org/packages/0b/31/8fbc5af2d183bff20f21aa743b4088eac4445d2bb1cdece449ae80e4e2d1/frozenlist-1.7.0-cp313-cp313t-win32.whl", hash = "sha256:3a14027124ddb70dfcee5148979998066897e79f89f64b13328595c4bdf77c81", size = 43059, upload-time = "2025-06-09T23:02:02.072Z" }, + { url = "https://files.pythonhosted.org/packages/bb/ed/41956f52105b8dbc26e457c5705340c67c8cc2b79f394b79bffc09d0e938/frozenlist-1.7.0-cp313-cp313t-win_amd64.whl", hash = "sha256:3bf8010d71d4507775f658e9823210b7427be36625b387221642725b515dcf3e", size = 47516, upload-time = "2025-06-09T23:02:03.779Z" }, + { url = "https://files.pythonhosted.org/packages/dd/b1/ee59496f51cd244039330015d60f13ce5a54a0f2bd8d79e4a4a375ab7469/frozenlist-1.7.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:cea3dbd15aea1341ea2de490574a4a37ca080b2ae24e4b4f4b51b9057b4c3630", size = 82434, upload-time = "2025-06-09T23:02:05.195Z" }, + { url = "https://files.pythonhosted.org/packages/75/e1/d518391ce36a6279b3fa5bc14327dde80bcb646bb50d059c6ca0756b8d05/frozenlist-1.7.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7d536ee086b23fecc36c2073c371572374ff50ef4db515e4e503925361c24f71", size = 48232, upload-time = "2025-06-09T23:02:07.728Z" }, + { url = "https://files.pythonhosted.org/packages/b7/8d/a0d04f28b6e821a9685c22e67b5fb798a5a7b68752f104bfbc2dccf080c4/frozenlist-1.7.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:dfcebf56f703cb2e346315431699f00db126d158455e513bd14089d992101e44", size = 47186, upload-time = "2025-06-09T23:02:09.243Z" }, + { url = "https://files.pythonhosted.org/packages/93/3a/a5334c0535c8b7c78eeabda1579179e44fe3d644e07118e59a2276dedaf1/frozenlist-1.7.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:974c5336e61d6e7eb1ea5b929cb645e882aadab0095c5a6974a111e6479f8878", size = 226617, upload-time = "2025-06-09T23:02:10.949Z" }, + { url = "https://files.pythonhosted.org/packages/0a/67/8258d971f519dc3f278c55069a775096cda6610a267b53f6248152b72b2f/frozenlist-1.7.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c70db4a0ab5ab20878432c40563573229a7ed9241506181bba12f6b7d0dc41cb", size = 224179, upload-time = "2025-06-09T23:02:12.603Z" }, + { url = "https://files.pythonhosted.org/packages/fc/89/8225905bf889b97c6d935dd3aeb45668461e59d415cb019619383a8a7c3b/frozenlist-1.7.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1137b78384eebaf70560a36b7b229f752fb64d463d38d1304939984d5cb887b6", size = 235783, upload-time = "2025-06-09T23:02:14.678Z" }, + { url = "https://files.pythonhosted.org/packages/54/6e/ef52375aa93d4bc510d061df06205fa6dcfd94cd631dd22956b09128f0d4/frozenlist-1.7.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e793a9f01b3e8b5c0bc646fb59140ce0efcc580d22a3468d70766091beb81b35", size = 229210, upload-time = "2025-06-09T23:02:16.313Z" }, + { url = "https://files.pythonhosted.org/packages/ee/55/62c87d1a6547bfbcd645df10432c129100c5bd0fd92a384de6e3378b07c1/frozenlist-1.7.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:74739ba8e4e38221d2c5c03d90a7e542cb8ad681915f4ca8f68d04f810ee0a87", size = 215994, upload-time = "2025-06-09T23:02:17.9Z" }, + { url = "https://files.pythonhosted.org/packages/45/d2/263fea1f658b8ad648c7d94d18a87bca7e8c67bd6a1bbf5445b1bd5b158c/frozenlist-1.7.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1e63344c4e929b1a01e29bc184bbb5fd82954869033765bfe8d65d09e336a677", size = 225122, upload-time = "2025-06-09T23:02:19.479Z" }, + { url = "https://files.pythonhosted.org/packages/7b/22/7145e35d12fb368d92124f679bea87309495e2e9ddf14c6533990cb69218/frozenlist-1.7.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:2ea2a7369eb76de2217a842f22087913cdf75f63cf1307b9024ab82dfb525938", size = 224019, upload-time = "2025-06-09T23:02:20.969Z" }, + { url = "https://files.pythonhosted.org/packages/44/1e/7dae8c54301beb87bcafc6144b9a103bfd2c8f38078c7902984c9a0c4e5b/frozenlist-1.7.0-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:836b42f472a0e006e02499cef9352ce8097f33df43baaba3e0a28a964c26c7d2", size = 239925, upload-time = "2025-06-09T23:02:22.466Z" }, + { url = "https://files.pythonhosted.org/packages/4b/1e/99c93e54aa382e949a98976a73b9b20c3aae6d9d893f31bbe4991f64e3a8/frozenlist-1.7.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:e22b9a99741294b2571667c07d9f8cceec07cb92aae5ccda39ea1b6052ed4319", size = 220881, upload-time = "2025-06-09T23:02:24.521Z" }, + { url = "https://files.pythonhosted.org/packages/5e/9c/ca5105fa7fb5abdfa8837581be790447ae051da75d32f25c8f81082ffc45/frozenlist-1.7.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:9a19e85cc503d958abe5218953df722748d87172f71b73cf3c9257a91b999890", size = 234046, upload-time = "2025-06-09T23:02:26.206Z" }, + { url = "https://files.pythonhosted.org/packages/8d/4d/e99014756093b4ddbb67fb8f0df11fe7a415760d69ace98e2ac6d5d43402/frozenlist-1.7.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:f22dac33bb3ee8fe3e013aa7b91dc12f60d61d05b7fe32191ffa84c3aafe77bd", size = 235756, upload-time = "2025-06-09T23:02:27.79Z" }, + { url = "https://files.pythonhosted.org/packages/8b/72/a19a40bcdaa28a51add2aaa3a1a294ec357f36f27bd836a012e070c5e8a5/frozenlist-1.7.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:9ccec739a99e4ccf664ea0775149f2749b8a6418eb5b8384b4dc0a7d15d304cb", size = 222894, upload-time = "2025-06-09T23:02:29.848Z" }, + { url = "https://files.pythonhosted.org/packages/08/49/0042469993e023a758af81db68c76907cd29e847d772334d4d201cbe9a42/frozenlist-1.7.0-cp39-cp39-win32.whl", hash = "sha256:b3950f11058310008a87757f3eee16a8e1ca97979833239439586857bc25482e", size = 39848, upload-time = "2025-06-09T23:02:31.413Z" }, + { url = "https://files.pythonhosted.org/packages/5a/45/827d86ee475c877f5f766fbc23fb6acb6fada9e52f1c9720e2ba3eae32da/frozenlist-1.7.0-cp39-cp39-win_amd64.whl", hash = "sha256:43a82fce6769c70f2f5a06248b614a7d268080a9d20f7457ef10ecee5af82b63", size = 44102, upload-time = "2025-06-09T23:02:32.808Z" }, + { url = "https://files.pythonhosted.org/packages/ee/45/b82e3c16be2182bff01179db177fe144d58b5dc787a7d4492c6ed8b9317f/frozenlist-1.7.0-py3-none-any.whl", hash = "sha256:9a5af342e34f7e97caf8c995864c7a396418ae2859cc6fdf1b1073020d516a7e", size = 13106, upload-time = "2025-06-09T23:02:34.204Z" }, ] [[package]] name = "fsspec" -version = "2025.3.2" +version = "2025.7.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/45/d8/8425e6ba5fcec61a1d16e41b1b71d2bf9344f1fe48012c2b48b9620feae5/fsspec-2025.3.2.tar.gz", hash = "sha256:e52c77ef398680bbd6a98c0e628fbc469491282981209907bbc8aea76a04fdc6", size = 299281, upload-time = "2025-03-31T15:27:08.524Z" } +sdist = { url = "https://files.pythonhosted.org/packages/8b/02/0835e6ab9cfc03916fe3f78c0956cfcdb6ff2669ffa6651065d5ebf7fc98/fsspec-2025.7.0.tar.gz", hash = "sha256:786120687ffa54b8283d942929540d8bc5ccfa820deb555a2b5d0ed2b737bf58", size = 304432, upload-time = "2025-07-15T16:05:21.19Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/44/4b/e0cfc1a6f17e990f3e64b7d941ddc4acdc7b19d6edd51abf495f32b1a9e4/fsspec-2025.3.2-py3-none-any.whl", hash = "sha256:2daf8dc3d1dfa65b6aa37748d112773a7a08416f6c70d96b264c96476ecaf711", size = 194435, upload-time = "2025-03-31T15:27:07.028Z" }, + { url = "https://files.pythonhosted.org/packages/2f/e0/014d5d9d7a4564cf1c40b5039bc882db69fd881111e03ab3657ac0b218e2/fsspec-2025.7.0-py3-none-any.whl", hash = "sha256:8b012e39f63c7d5f10474de957f3ab793b47b45ae7d39f2fb735f8bbe25c0e21", size = 199597, upload-time = "2025-07-15T16:05:19.529Z" }, ] [[package]] @@ -613,107 +829,121 @@ wheels = [ [[package]] name = "graphviz" -version = "0.20.3" +version = "0.21" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/fa/83/5a40d19b8347f017e417710907f824915fba411a9befd092e52746b63e9f/graphviz-0.20.3.zip", hash = "sha256:09d6bc81e6a9fa392e7ba52135a9d49f1ed62526f96499325930e87ca1b5925d", size = 256455, upload-time = "2024-03-21T07:50:45.772Z" } +sdist = { url = "https://files.pythonhosted.org/packages/f8/b3/3ac91e9be6b761a4b30d66ff165e54439dcd48b83f4e20d644867215f6ca/graphviz-0.21.tar.gz", hash = "sha256:20743e7183be82aaaa8ad6c93f8893c923bd6658a04c32ee115edb3c8a835f78", size = 200434, upload-time = "2025-06-15T09:35:05.824Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/00/be/d59db2d1d52697c6adc9eacaf50e8965b6345cc143f671e1ed068818d5cf/graphviz-0.20.3-py3-none-any.whl", hash = "sha256:81f848f2904515d8cd359cc611faba817598d2feaac4027b266aa3eda7b3dde5", size = 47126, upload-time = "2024-03-21T07:50:43.091Z" }, + { url = "https://files.pythonhosted.org/packages/91/4c/e0ce1ef95d4000ebc1c11801f9b944fa5910ecc15b5e351865763d8657f8/graphviz-0.21-py3-none-any.whl", hash = "sha256:54f33de9f4f911d7e84e4191749cac8cc5653f815b06738c54db9a15ab8b1e42", size = 47300, upload-time = "2025-06-15T09:35:04.433Z" }, ] [[package]] name = "greenlet" -version = "3.2.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/b0/9c/666d8c71b18d0189cf801c0e0b31c4bfc609ac823883286045b1f3ae8994/greenlet-3.2.0.tar.gz", hash = "sha256:1d2d43bd711a43db8d9b9187500e6432ddb4fafe112d082ffabca8660a9e01a7", size = 183685, upload-time = "2025-04-15T16:21:26.141Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/96/bd/1d330ca53f844c463cb63cf4ca1ed1798a50b8fd1e1db576cbb473b8c1b3/greenlet-3.2.0-cp310-cp310-macosx_11_0_universal2.whl", hash = "sha256:b7a7b7f2bad3ca72eb2fa14643f1c4ca11d115614047299d89bc24a3b11ddd09", size = 267375, upload-time = "2025-04-15T16:19:16.05Z" }, - { url = "https://files.pythonhosted.org/packages/a3/a7/7ec4461f7a6a9f8963f2be793a99763e9cd66bc07599011620a75bb3900e/greenlet-3.2.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:60e77242e38e99ecaede853755bbd8165e0b20a2f1f3abcaa6f0dceb826a7411", size = 625728, upload-time = "2025-04-15T16:48:56.508Z" }, - { url = "https://files.pythonhosted.org/packages/59/8a/70b63c74b3e27df7827777e206395ee190a0cf8f85cd1b3674b7992651f1/greenlet-3.2.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d3f32d7c70b1c26844fd0e4e56a1da852b493e4e1c30df7b07274a1e5a9b599e", size = 636992, upload-time = "2025-04-15T16:50:39.19Z" }, - { url = "https://files.pythonhosted.org/packages/5e/d8/dc3e8157b045423f75e2fb327d4c6f20246b5cc12a09f0c7f28860be5dea/greenlet-3.2.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d97bc1be4bad83b70d8b8627ada6724091af41139616696e59b7088f358583b9", size = 632888, upload-time = "2025-04-15T16:54:59.395Z" }, - { url = "https://files.pythonhosted.org/packages/2c/fb/6868c1c796ff6f9893d5b312c36c6c9d31c8be98e435210bfe1e5e6f8624/greenlet-3.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:23f56a0103deb5570c8d6a0bb4ddf8a7a28931973ad7ed7a883460a67e599b32", size = 631647, upload-time = "2025-04-15T16:22:33.69Z" }, - { url = "https://files.pythonhosted.org/packages/56/54/a4bdefd2664382c7652fde5d7c2d8851b88161c65fbeeed15b351e5d9fc6/greenlet-3.2.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2919b126eeb63ca5fa971501cd20cd6cdb5522369a8e39548bbc73a3e10b8b41", size = 580585, upload-time = "2025-04-15T16:22:32.952Z" }, - { url = "https://files.pythonhosted.org/packages/e9/20/53a45e165c228b4d490a15918377a6ef16cf4ea9ddf5974d4b49e5c81650/greenlet-3.2.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:844acfd479ee380f3810415e682c9ee941725fb90b45e139bb7fd6f85c6c9a30", size = 1109798, upload-time = "2025-04-15T16:52:48.808Z" }, - { url = "https://files.pythonhosted.org/packages/95/c4/f9be6264cc19b8ea2c868e1a0b06546de7da2aa296400845cd4abdbb877b/greenlet-3.2.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:2b986f1a6467710e7ffeeeac1777da0318c95bbfcc467acbd0bd35abc775f558", size = 1133421, upload-time = "2025-04-15T16:22:58.333Z" }, - { url = "https://files.pythonhosted.org/packages/0a/d6/14648d06627db2db62d633d5d6af96866cea7e38b02b8e4992cd33c58e00/greenlet-3.2.0-cp310-cp310-win_amd64.whl", hash = "sha256:29449a2b82ed7ce11f8668c31ef20d31e9d88cd8329eb933098fab5a8608a93a", size = 294968, upload-time = "2025-04-15T17:09:24.385Z" }, - { url = "https://files.pythonhosted.org/packages/2d/d3/0a25528e54eca3c57524d2ef1f63283c8c6db466c785218036ab7fc2d4ff/greenlet-3.2.0-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:b99de16560097b9984409ded0032f101f9555e1ab029440fc6a8b5e76dbba7ac", size = 268620, upload-time = "2025-04-15T16:19:14.102Z" }, - { url = "https://files.pythonhosted.org/packages/ff/40/f937eb7c1e641ca12089265c57874fcdd173c6c8aabdec3a494641d81eb9/greenlet-3.2.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0bc5776ac2831c022e029839bf1b9d3052332dcf5f431bb88c8503e27398e31", size = 628787, upload-time = "2025-04-15T16:48:58.979Z" }, - { url = "https://files.pythonhosted.org/packages/12/8d/f248691502cb85ce8b18d442032dbde5d3dd16ff2d15593cbee33c40f29c/greenlet-3.2.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1dcb1108449b55ff6bc0edac9616468f71db261a4571f27c47ccf3530a7f8b97", size = 640838, upload-time = "2025-04-15T16:50:40.572Z" }, - { url = "https://files.pythonhosted.org/packages/d5/f1/2a572bf4fc667e8835ed8c4ef8b729eccd0666ed9e6db8c61c5796fd2dc9/greenlet-3.2.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:82a68a25a08f51fc8b66b113d1d9863ee123cdb0e8f1439aed9fc795cd6f85cf", size = 636760, upload-time = "2025-04-15T16:55:01.045Z" }, - { url = "https://files.pythonhosted.org/packages/12/d6/f9ecc8dcb17516a0f4ab91df28497303e8d2d090d509fe3e1b1a85b23e90/greenlet-3.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7fee6f518868e8206c617f4084a83ad4d7a3750b541bf04e692dfa02e52e805d", size = 636001, upload-time = "2025-04-15T16:22:37.951Z" }, - { url = "https://files.pythonhosted.org/packages/fc/b2/28ab943ff898d6aad3e0ab88fad722c892a43375fabb9789dcc29075da36/greenlet-3.2.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6fad8a9ca98b37951a053d7d2d2553569b151cd8c4ede744806b94d50d7f8f73", size = 583936, upload-time = "2025-04-15T16:22:35.483Z" }, - { url = "https://files.pythonhosted.org/packages/44/a8/dedd1517fae684c3c08ff53ab8b03e328015da4b52d2bd993279ac3a8c3d/greenlet-3.2.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:0e14541f9024a280adb9645143d6a0a51fda6f7c5695fd96cb4d542bb563442f", size = 1112901, upload-time = "2025-04-15T16:52:50.061Z" }, - { url = "https://files.pythonhosted.org/packages/45/23/15cf5d4bc864c3dc0dcb708bcaa81cd1a3dc2012326d32ad8a46d77a645e/greenlet-3.2.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:7f163d04f777e7bd229a50b937ecc1ae2a5b25296e6001445e5433e4f51f5191", size = 1138328, upload-time = "2025-04-15T16:22:59.493Z" }, - { url = "https://files.pythonhosted.org/packages/ba/82/c7cf91e89451a922c049ac1f0123de091260697e26e8b98d299555ad96a5/greenlet-3.2.0-cp311-cp311-win_amd64.whl", hash = "sha256:39801e633a978c3f829f21022501e7b0c3872683d7495c1850558d1a6fb95ed0", size = 295415, upload-time = "2025-04-15T17:05:23.665Z" }, - { url = "https://files.pythonhosted.org/packages/0e/8d/3c55e88ab01866fb696f68d6c94587a1b7ec8c8a9c56b1383ad05bc14811/greenlet-3.2.0-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:7d08b88ee8d506ca1f5b2a58744e934d33c6a1686dd83b81e7999dfc704a912f", size = 270391, upload-time = "2025-04-15T16:19:15.913Z" }, - { url = "https://files.pythonhosted.org/packages/8b/6f/4a15185a386992ba4fbb55f88c1a189b75c7ce6e145b43ae4e50754d1969/greenlet-3.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:58ef3d637c54e2f079064ca936556c4af3989144e4154d80cfd4e2a59fc3769c", size = 637202, upload-time = "2025-04-15T16:49:00.79Z" }, - { url = "https://files.pythonhosted.org/packages/71/f8/60214debfe3b9670bafac97bfc40e318cbddb4ff4b5cf07df119c4a56dcd/greenlet-3.2.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:33ea7e7269d6f7275ce31f593d6dcfedd97539c01f63fbdc8d84e493e20b1b2c", size = 651391, upload-time = "2025-04-15T16:50:42.011Z" }, - { url = "https://files.pythonhosted.org/packages/a9/44/fb5e067a728a4df73a30863973912ba6eb01f3d910caaf129ef789ca222d/greenlet-3.2.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e61d426969b68b2170a9f853cc36d5318030494576e9ec0bfe2dc2e2afa15a68", size = 646118, upload-time = "2025-04-15T16:55:02.46Z" }, - { url = "https://files.pythonhosted.org/packages/f0/3e/f329b452869d8bc07dbaa112c0175de5e666a7d15eb243781481fb59b863/greenlet-3.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:04e781447a4722e30b4861af728cb878d73a3df79509dc19ea498090cea5d204", size = 648079, upload-time = "2025-04-15T16:22:39.91Z" }, - { url = "https://files.pythonhosted.org/packages/56/e5/813a2e8e842289579391cbd3ae6e6e6a3d2fcad8bdd89bd549a4035ab057/greenlet-3.2.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b2392cc41eeed4055978c6b52549ccd9effd263bb780ffd639c0e1e7e2055ab0", size = 603825, upload-time = "2025-04-15T16:22:39.344Z" }, - { url = "https://files.pythonhosted.org/packages/4a/11/0bad66138622d0c1463b0b87935cefd397f9f04fac325a838525a3aa4da7/greenlet-3.2.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:430cba962c85e339767235a93450a6aaffed6f9c567e73874ea2075f5aae51e1", size = 1119582, upload-time = "2025-04-15T16:52:51.988Z" }, - { url = "https://files.pythonhosted.org/packages/17/26/0f8a4d222b9014af88bb8b5d921305308dd44de667c01714817dc9fb91fb/greenlet-3.2.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:5e57ff52315bfc0c5493917f328b8ba3ae0c0515d94524453c4d24e7638cbb53", size = 1147452, upload-time = "2025-04-15T16:23:00.718Z" }, - { url = "https://files.pythonhosted.org/packages/8a/d4/70d262492338c4939f97dca310c45b002a3af84b265720f0e9b135bc85b2/greenlet-3.2.0-cp312-cp312-win_amd64.whl", hash = "sha256:211a9721f540e454a02e62db7956263e9a28a6cf776d4b9a7213844e36426333", size = 296217, upload-time = "2025-04-15T16:59:58.956Z" }, - { url = "https://files.pythonhosted.org/packages/c9/43/c0b655d4d7eae19282b028bcec449e5c80626ad0d8d0ca3703f9b1c29258/greenlet-3.2.0-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:b86a3ccc865ae601f446af042707b749eebc297928ea7bd0c5f60c56525850be", size = 269131, upload-time = "2025-04-15T16:19:19.469Z" }, - { url = "https://files.pythonhosted.org/packages/7c/7d/c8f51c373c7f7ac0f73d04a6fd77ab34f6f643cb41a0d186d05ba96708e7/greenlet-3.2.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:144283ad88ed77f3ebd74710dd419b55dd15d18704b0ae05935766a93f5671c5", size = 637323, upload-time = "2025-04-15T16:49:02.677Z" }, - { url = "https://files.pythonhosted.org/packages/89/65/c3ee41b2e56586737d6e124b250583695628ffa6b324855b3a1267a8d1d9/greenlet-3.2.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5be69cd50994b8465c3ad1467f9e63001f76e53a89440ad4440d1b6d52591280", size = 651430, upload-time = "2025-04-15T16:50:43.445Z" }, - { url = "https://files.pythonhosted.org/packages/f0/07/33bd7a3dcde1db7259371d026ce76be1eb653d2d892334fc79a500b3c5ee/greenlet-3.2.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:47aeadd1e8fbdef8fdceb8fb4edc0cbb398a57568d56fd68f2bc00d0d809e6b6", size = 645798, upload-time = "2025-04-15T16:55:03.795Z" }, - { url = "https://files.pythonhosted.org/packages/35/5b/33c221a6a867030b0b770513a1b78f6c30e04294131dafdc8da78906bbe6/greenlet-3.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:18adc14ab154ca6e53eecc9dc50ff17aeb7ba70b7e14779b26e16d71efa90038", size = 648271, upload-time = "2025-04-15T16:22:42.458Z" }, - { url = "https://files.pythonhosted.org/packages/4d/dd/d6452248fa6093504e3b7525dc2bdc4e55a4296ec6ee74ba241a51d852e2/greenlet-3.2.0-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e8622b33d8694ec373ad55050c3d4e49818132b44852158442e1931bb02af336", size = 606779, upload-time = "2025-04-15T16:22:41.417Z" }, - { url = "https://files.pythonhosted.org/packages/9d/24/160f04d2589bcb15b8661dcd1763437b22e01643626899a4139bf98f02af/greenlet-3.2.0-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:e8ac9a2c20fbff3d0b853e9ef705cdedb70d9276af977d1ec1cde86a87a4c821", size = 1117968, upload-time = "2025-04-15T16:52:53.627Z" }, - { url = "https://files.pythonhosted.org/packages/6c/ff/c6e3f3a5168fef5209cfd9498b2b5dd77a0bf29dfc686a03dcc614cf4432/greenlet-3.2.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:cd37273dc7ca1d5da149b58c8b3ce0711181672ba1b09969663905a765affe21", size = 1145510, upload-time = "2025-04-15T16:23:01.873Z" }, - { url = "https://files.pythonhosted.org/packages/dc/62/5215e374819052e542b5bde06bd7d4a171454b6938c96a2384f21cb94279/greenlet-3.2.0-cp313-cp313-win_amd64.whl", hash = "sha256:8a8940a8d301828acd8b9f3f85db23069a692ff2933358861b19936e29946b95", size = 296004, upload-time = "2025-04-15T16:55:46.007Z" }, - { url = "https://files.pythonhosted.org/packages/62/6d/dc9c909cba5cbf4b0833fce69912927a8ca74791c23c47b9fd4f28092108/greenlet-3.2.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ee59db626760f1ca8da697a086454210d36a19f7abecc9922a2374c04b47735b", size = 629900, upload-time = "2025-04-15T16:49:04.099Z" }, - { url = "https://files.pythonhosted.org/packages/5e/a9/f3f304fbbbd604858ff3df303d7fa1d8f7f9e45a6ef74481aaf03aaac021/greenlet-3.2.0-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7154b13ef87a8b62fc05419f12d75532d7783586ad016c57b5de8a1c6feeb517", size = 635270, upload-time = "2025-04-15T16:50:44.769Z" }, - { url = "https://files.pythonhosted.org/packages/34/92/4b7b4e2e23ecc723cceef9fe3898e78c8e14e106cc7ba2f276a66161da3e/greenlet-3.2.0-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:199453d64b02d0c9d139e36d29681efd0e407ed8e2c0bf89d88878d6a787c28f", size = 632534, upload-time = "2025-04-15T16:55:05.203Z" }, - { url = "https://files.pythonhosted.org/packages/da/7f/91f0ecbe72c9d789fb7f400b39da9d1e87fcc2cf8746a9636479ba79ab01/greenlet-3.2.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0010e928e1901d36625f21d008618273f9dda26b516dbdecf873937d39c9dff0", size = 628826, upload-time = "2025-04-15T16:22:44.545Z" }, - { url = "https://files.pythonhosted.org/packages/9f/59/e449a44ce52b13751f55376d85adc155dd311608f6d2aa5b6bd2c8d15486/greenlet-3.2.0-cp313-cp313t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6005f7a86de836a1dc4b8d824a2339cdd5a1ca7cb1af55ea92575401f9952f4c", size = 593697, upload-time = "2025-04-15T16:22:43.796Z" }, - { url = "https://files.pythonhosted.org/packages/bb/09/cca3392927c5c990b7a8ede64ccd0712808438d6490d63ce6b8704d6df5f/greenlet-3.2.0-cp313-cp313t-musllinux_1_1_aarch64.whl", hash = "sha256:17fd241c0d50bacb7ce8ff77a30f94a2d0ca69434ba2e0187cf95a5414aeb7e1", size = 1105762, upload-time = "2025-04-15T16:52:55.245Z" }, - { url = "https://files.pythonhosted.org/packages/4d/b9/3d201f819afc3b7a8cd7ebe645f1a17799603e2d62c968154518f79f4881/greenlet-3.2.0-cp313-cp313t-musllinux_1_1_x86_64.whl", hash = "sha256:7b17a26abc6a1890bf77d5d6b71c0999705386b00060d15c10b8182679ff2790", size = 1125173, upload-time = "2025-04-15T16:23:03.009Z" }, - { url = "https://files.pythonhosted.org/packages/80/7b/773a30602234597fc2882091f8e1d1a38ea0b4419d99ca7ed82c827e2c3a/greenlet-3.2.0-cp314-cp314-macosx_11_0_universal2.whl", hash = "sha256:397b6bbda06f8fe895893d96218cd6f6d855a6701dc45012ebe12262423cec8b", size = 269908, upload-time = "2025-04-15T16:20:33.58Z" }, - { url = "https://files.pythonhosted.org/packages/e6/35/06d5fca767ae4660d0f8087bd0552bf7a70e590bad16d0dbd94e1628f4ba/greenlet-3.2.0-cp39-cp39-macosx_11_0_universal2.whl", hash = "sha256:4174fa6fa214e8924cedf332b6f2395ba2b9879f250dacd3c361b2fca86f58af", size = 266169, upload-time = "2025-04-15T16:19:42.91Z" }, - { url = "https://files.pythonhosted.org/packages/00/0a/009c70774c23dd5c353cff5da84320f3c3e92a4e7ee39cf42e0ae2186030/greenlet-3.2.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6017a4d430fad5229e397ad464db504ae70cb7b903757c4688cee6c25d6ce8d8", size = 623864, upload-time = "2025-04-15T16:49:05.942Z" }, - { url = "https://files.pythonhosted.org/packages/04/e2/df53870438ec52e9a1a0fe7da97d25292dd11e1626a13496e27c18eced0d/greenlet-3.2.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:78b721dfadc60e3639141c0e1f19d23953c5b4b98bfcaf04ce40f79e4f01751c", size = 635665, upload-time = "2025-04-15T16:50:46.617Z" }, - { url = "https://files.pythonhosted.org/packages/c0/c5/ec035ba7b6c66b475ac12a06d544cae211d65afb6ac3af39215d422bf679/greenlet-3.2.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8fd2583024ff6cd5d4f842d446d001de4c4fe1264fdb5f28ddea28f6488866df", size = 630948, upload-time = "2025-04-15T16:55:06.566Z" }, - { url = "https://files.pythonhosted.org/packages/c5/06/3d98e958b27c06b23c531761eef75f2efea7c3a446ab1eb57b70bad8528e/greenlet-3.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:598da3bd464c2cc411b723e3d4afc27b13c219ac077ba897bac88443ae45f5ec", size = 630224, upload-time = "2025-04-15T16:22:46.393Z" }, - { url = "https://files.pythonhosted.org/packages/28/68/bba631f01f3a4df8f45fb4cd3888c54a113829df0612fc380bef20d35664/greenlet-3.2.0-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2688b3bd3198cc4bad7a79648a95fee088c24a0f6abd05d3639e6c3040ded015", size = 579090, upload-time = "2025-04-15T16:22:45.631Z" }, - { url = "https://files.pythonhosted.org/packages/4b/8a/bf0a3c944b446716954a9a6f97f51fdd64ed38864d4fba16835e95be0f06/greenlet-3.2.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:1cf89e2d92bae0d7e2d6093ce0bed26feeaf59a5d588e3984e35fcd46fc41090", size = 1108320, upload-time = "2025-04-15T16:52:57.346Z" }, - { url = "https://files.pythonhosted.org/packages/1e/fe/4c2daea17f56d41df38af74a7e50fed718a618bfb7e86ac9399560c48d97/greenlet-3.2.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8b3538711e7c0efd5f7a8fc1096c4db9598d6ed99dc87286b31e4ce9f8a8da67", size = 1132392, upload-time = "2025-04-15T16:23:04.768Z" }, - { url = "https://files.pythonhosted.org/packages/98/96/c44981a880025a1731ac0c5d83bdb36b1a184c59266c22a4d19041aef19b/greenlet-3.2.0-cp39-cp39-win32.whl", hash = "sha256:ce531d7c424ef327a391de7a9777a6c93a38e1f89e18efa903a1c4ba11f85905", size = 277720, upload-time = "2025-04-15T17:13:23.749Z" }, - { url = "https://files.pythonhosted.org/packages/7b/9d/7448f8ba7cc29c7113aeb06b70b28be910a3d19a112e5c56885cff7977e5/greenlet-3.2.0-cp39-cp39-win_amd64.whl", hash = "sha256:7b162de2fb61b4c7f4b5d749408bf3280cae65db9b5a6aaf7f922ac829faa67c", size = 294842, upload-time = "2025-04-15T17:17:14.833Z" }, +version = "3.2.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/03/b8/704d753a5a45507a7aab61f18db9509302ed3d0a27ac7e0359ec2905b1a6/greenlet-3.2.4.tar.gz", hash = "sha256:0dca0d95ff849f9a364385f36ab49f50065d76964944638be9691e1832e9f86d", size = 188260, upload-time = "2025-08-07T13:24:33.51Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7d/ed/6bfa4109fcb23a58819600392564fea69cdc6551ffd5e69ccf1d52a40cbc/greenlet-3.2.4-cp310-cp310-macosx_11_0_universal2.whl", hash = "sha256:8c68325b0d0acf8d91dde4e6f930967dd52a5302cd4062932a6b2e7c2969f47c", size = 271061, upload-time = "2025-08-07T13:17:15.373Z" }, + { url = "https://files.pythonhosted.org/packages/2a/fc/102ec1a2fc015b3a7652abab7acf3541d58c04d3d17a8d3d6a44adae1eb1/greenlet-3.2.4-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:94385f101946790ae13da500603491f04a76b6e4c059dab271b3ce2e283b2590", size = 629475, upload-time = "2025-08-07T13:42:54.009Z" }, + { url = "https://files.pythonhosted.org/packages/c5/26/80383131d55a4ac0fb08d71660fd77e7660b9db6bdb4e8884f46d9f2cc04/greenlet-3.2.4-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:f10fd42b5ee276335863712fa3da6608e93f70629c631bf77145021600abc23c", size = 640802, upload-time = "2025-08-07T13:45:25.52Z" }, + { url = "https://files.pythonhosted.org/packages/9f/7c/e7833dbcd8f376f3326bd728c845d31dcde4c84268d3921afcae77d90d08/greenlet-3.2.4-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:c8c9e331e58180d0d83c5b7999255721b725913ff6bc6cf39fa2a45841a4fd4b", size = 636703, upload-time = "2025-08-07T13:53:12.622Z" }, + { url = "https://files.pythonhosted.org/packages/e9/49/547b93b7c0428ede7b3f309bc965986874759f7d89e4e04aeddbc9699acb/greenlet-3.2.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:58b97143c9cc7b86fc458f215bd0932f1757ce649e05b640fea2e79b54cedb31", size = 635417, upload-time = "2025-08-07T13:18:25.189Z" }, + { url = "https://files.pythonhosted.org/packages/7f/91/ae2eb6b7979e2f9b035a9f612cf70f1bf54aad4e1d125129bef1eae96f19/greenlet-3.2.4-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c2ca18a03a8cfb5b25bc1cbe20f3d9a4c80d8c3b13ba3df49ac3961af0b1018d", size = 584358, upload-time = "2025-08-07T13:18:23.708Z" }, + { url = "https://files.pythonhosted.org/packages/f7/85/433de0c9c0252b22b16d413c9407e6cb3b41df7389afc366ca204dbc1393/greenlet-3.2.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:9fe0a28a7b952a21e2c062cd5756d34354117796c6d9215a87f55e38d15402c5", size = 1113550, upload-time = "2025-08-07T13:42:37.467Z" }, + { url = "https://files.pythonhosted.org/packages/a1/8d/88f3ebd2bc96bf7747093696f4335a0a8a4c5acfcf1b757717c0d2474ba3/greenlet-3.2.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:8854167e06950ca75b898b104b63cc646573aa5fef1353d4508ecdd1ee76254f", size = 1137126, upload-time = "2025-08-07T13:18:20.239Z" }, + { url = "https://files.pythonhosted.org/packages/d6/6f/b60b0291d9623c496638c582297ead61f43c4b72eef5e9c926ef4565ec13/greenlet-3.2.4-cp310-cp310-win_amd64.whl", hash = "sha256:73f49b5368b5359d04e18d15828eecc1806033db5233397748f4ca813ff1056c", size = 298654, upload-time = "2025-08-07T13:50:00.469Z" }, + { url = "https://files.pythonhosted.org/packages/a4/de/f28ced0a67749cac23fecb02b694f6473f47686dff6afaa211d186e2ef9c/greenlet-3.2.4-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:96378df1de302bc38e99c3a9aa311967b7dc80ced1dcc6f171e99842987882a2", size = 272305, upload-time = "2025-08-07T13:15:41.288Z" }, + { url = "https://files.pythonhosted.org/packages/09/16/2c3792cba130000bf2a31c5272999113f4764fd9d874fb257ff588ac779a/greenlet-3.2.4-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:1ee8fae0519a337f2329cb78bd7a8e128ec0f881073d43f023c7b8d4831d5246", size = 632472, upload-time = "2025-08-07T13:42:55.044Z" }, + { url = "https://files.pythonhosted.org/packages/ae/8f/95d48d7e3d433e6dae5b1682e4292242a53f22df82e6d3dda81b1701a960/greenlet-3.2.4-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:94abf90142c2a18151632371140b3dba4dee031633fe614cb592dbb6c9e17bc3", size = 644646, upload-time = "2025-08-07T13:45:26.523Z" }, + { url = "https://files.pythonhosted.org/packages/d5/5e/405965351aef8c76b8ef7ad370e5da58d57ef6068df197548b015464001a/greenlet-3.2.4-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:4d1378601b85e2e5171b99be8d2dc85f594c79967599328f95c1dc1a40f1c633", size = 640519, upload-time = "2025-08-07T13:53:13.928Z" }, + { url = "https://files.pythonhosted.org/packages/25/5d/382753b52006ce0218297ec1b628e048c4e64b155379331f25a7316eb749/greenlet-3.2.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:0db5594dce18db94f7d1650d7489909b57afde4c580806b8d9203b6e79cdc079", size = 639707, upload-time = "2025-08-07T13:18:27.146Z" }, + { url = "https://files.pythonhosted.org/packages/1f/8e/abdd3f14d735b2929290a018ecf133c901be4874b858dd1c604b9319f064/greenlet-3.2.4-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2523e5246274f54fdadbce8494458a2ebdcdbc7b802318466ac5606d3cded1f8", size = 587684, upload-time = "2025-08-07T13:18:25.164Z" }, + { url = "https://files.pythonhosted.org/packages/5d/65/deb2a69c3e5996439b0176f6651e0052542bb6c8f8ec2e3fba97c9768805/greenlet-3.2.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:1987de92fec508535687fb807a5cea1560f6196285a4cde35c100b8cd632cc52", size = 1116647, upload-time = "2025-08-07T13:42:38.655Z" }, + { url = "https://files.pythonhosted.org/packages/3f/cc/b07000438a29ac5cfb2194bfc128151d52f333cee74dd7dfe3fb733fc16c/greenlet-3.2.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:55e9c5affaa6775e2c6b67659f3a71684de4c549b3dd9afca3bc773533d284fa", size = 1142073, upload-time = "2025-08-07T13:18:21.737Z" }, + { url = "https://files.pythonhosted.org/packages/d8/0f/30aef242fcab550b0b3520b8e3561156857c94288f0332a79928c31a52cf/greenlet-3.2.4-cp311-cp311-win_amd64.whl", hash = "sha256:9c40adce87eaa9ddb593ccb0fa6a07caf34015a29bf8d344811665b573138db9", size = 299100, upload-time = "2025-08-07T13:44:12.287Z" }, + { url = "https://files.pythonhosted.org/packages/44/69/9b804adb5fd0671f367781560eb5eb586c4d495277c93bde4307b9e28068/greenlet-3.2.4-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:3b67ca49f54cede0186854a008109d6ee71f66bd57bb36abd6d0a0267b540cdd", size = 274079, upload-time = "2025-08-07T13:15:45.033Z" }, + { url = "https://files.pythonhosted.org/packages/46/e9/d2a80c99f19a153eff70bc451ab78615583b8dac0754cfb942223d2c1a0d/greenlet-3.2.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:ddf9164e7a5b08e9d22511526865780a576f19ddd00d62f8a665949327fde8bb", size = 640997, upload-time = "2025-08-07T13:42:56.234Z" }, + { url = "https://files.pythonhosted.org/packages/3b/16/035dcfcc48715ccd345f3a93183267167cdd162ad123cd93067d86f27ce4/greenlet-3.2.4-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:f28588772bb5fb869a8eb331374ec06f24a83a9c25bfa1f38b6993afe9c1e968", size = 655185, upload-time = "2025-08-07T13:45:27.624Z" }, + { url = "https://files.pythonhosted.org/packages/31/da/0386695eef69ffae1ad726881571dfe28b41970173947e7c558d9998de0f/greenlet-3.2.4-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:5c9320971821a7cb77cfab8d956fa8e39cd07ca44b6070db358ceb7f8797c8c9", size = 649926, upload-time = "2025-08-07T13:53:15.251Z" }, + { url = "https://files.pythonhosted.org/packages/68/88/69bf19fd4dc19981928ceacbc5fd4bb6bc2215d53199e367832e98d1d8fe/greenlet-3.2.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:c60a6d84229b271d44b70fb6e5fa23781abb5d742af7b808ae3f6efd7c9c60f6", size = 651839, upload-time = "2025-08-07T13:18:30.281Z" }, + { url = "https://files.pythonhosted.org/packages/19/0d/6660d55f7373b2ff8152401a83e02084956da23ae58cddbfb0b330978fe9/greenlet-3.2.4-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3b3812d8d0c9579967815af437d96623f45c0f2ae5f04e366de62a12d83a8fb0", size = 607586, upload-time = "2025-08-07T13:18:28.544Z" }, + { url = "https://files.pythonhosted.org/packages/8e/1a/c953fdedd22d81ee4629afbb38d2f9d71e37d23caace44775a3a969147d4/greenlet-3.2.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:abbf57b5a870d30c4675928c37278493044d7c14378350b3aa5d484fa65575f0", size = 1123281, upload-time = "2025-08-07T13:42:39.858Z" }, + { url = "https://files.pythonhosted.org/packages/3f/c7/12381b18e21aef2c6bd3a636da1088b888b97b7a0362fac2e4de92405f97/greenlet-3.2.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:20fb936b4652b6e307b8f347665e2c615540d4b42b3b4c8a321d8286da7e520f", size = 1151142, upload-time = "2025-08-07T13:18:22.981Z" }, + { url = "https://files.pythonhosted.org/packages/e9/08/b0814846b79399e585f974bbeebf5580fbe59e258ea7be64d9dfb253c84f/greenlet-3.2.4-cp312-cp312-win_amd64.whl", hash = "sha256:a7d4e128405eea3814a12cc2605e0e6aedb4035bf32697f72deca74de4105e02", size = 299899, upload-time = "2025-08-07T13:38:53.448Z" }, + { url = "https://files.pythonhosted.org/packages/49/e8/58c7f85958bda41dafea50497cbd59738c5c43dbbea5ee83d651234398f4/greenlet-3.2.4-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:1a921e542453fe531144e91e1feedf12e07351b1cf6c9e8a3325ea600a715a31", size = 272814, upload-time = "2025-08-07T13:15:50.011Z" }, + { url = "https://files.pythonhosted.org/packages/62/dd/b9f59862e9e257a16e4e610480cfffd29e3fae018a68c2332090b53aac3d/greenlet-3.2.4-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:cd3c8e693bff0fff6ba55f140bf390fa92c994083f838fece0f63be121334945", size = 641073, upload-time = "2025-08-07T13:42:57.23Z" }, + { url = "https://files.pythonhosted.org/packages/f7/0b/bc13f787394920b23073ca3b6c4a7a21396301ed75a655bcb47196b50e6e/greenlet-3.2.4-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:710638eb93b1fa52823aa91bf75326f9ecdfd5e0466f00789246a5280f4ba0fc", size = 655191, upload-time = "2025-08-07T13:45:29.752Z" }, + { url = "https://files.pythonhosted.org/packages/f2/d6/6adde57d1345a8d0f14d31e4ab9c23cfe8e2cd39c3baf7674b4b0338d266/greenlet-3.2.4-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:c5111ccdc9c88f423426df3fd1811bfc40ed66264d35aa373420a34377efc98a", size = 649516, upload-time = "2025-08-07T13:53:16.314Z" }, + { url = "https://files.pythonhosted.org/packages/7f/3b/3a3328a788d4a473889a2d403199932be55b1b0060f4ddd96ee7cdfcad10/greenlet-3.2.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:d76383238584e9711e20ebe14db6c88ddcedc1829a9ad31a584389463b5aa504", size = 652169, upload-time = "2025-08-07T13:18:32.861Z" }, + { url = "https://files.pythonhosted.org/packages/ee/43/3cecdc0349359e1a527cbf2e3e28e5f8f06d3343aaf82ca13437a9aa290f/greenlet-3.2.4-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:23768528f2911bcd7e475210822ffb5254ed10d71f4028387e5a99b4c6699671", size = 610497, upload-time = "2025-08-07T13:18:31.636Z" }, + { url = "https://files.pythonhosted.org/packages/b8/19/06b6cf5d604e2c382a6f31cafafd6f33d5dea706f4db7bdab184bad2b21d/greenlet-3.2.4-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:00fadb3fedccc447f517ee0d3fd8fe49eae949e1cd0f6a611818f4f6fb7dc83b", size = 1121662, upload-time = "2025-08-07T13:42:41.117Z" }, + { url = "https://files.pythonhosted.org/packages/a2/15/0d5e4e1a66fab130d98168fe984c509249c833c1a3c16806b90f253ce7b9/greenlet-3.2.4-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:d25c5091190f2dc0eaa3f950252122edbbadbb682aa7b1ef2f8af0f8c0afefae", size = 1149210, upload-time = "2025-08-07T13:18:24.072Z" }, + { url = "https://files.pythonhosted.org/packages/0b/55/2321e43595e6801e105fcfdee02b34c0f996eb71e6ddffca6b10b7e1d771/greenlet-3.2.4-cp313-cp313-win_amd64.whl", hash = "sha256:554b03b6e73aaabec3745364d6239e9e012d64c68ccd0b8430c64ccc14939a8b", size = 299685, upload-time = "2025-08-07T13:24:38.824Z" }, + { url = "https://files.pythonhosted.org/packages/22/5c/85273fd7cc388285632b0498dbbab97596e04b154933dfe0f3e68156c68c/greenlet-3.2.4-cp314-cp314-macosx_11_0_universal2.whl", hash = "sha256:49a30d5fda2507ae77be16479bdb62a660fa51b1eb4928b524975b3bde77b3c0", size = 273586, upload-time = "2025-08-07T13:16:08.004Z" }, + { url = "https://files.pythonhosted.org/packages/d1/75/10aeeaa3da9332c2e761e4c50d4c3556c21113ee3f0afa2cf5769946f7a3/greenlet-3.2.4-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:299fd615cd8fc86267b47597123e3f43ad79c9d8a22bebdce535e53550763e2f", size = 686346, upload-time = "2025-08-07T13:42:59.944Z" }, + { url = "https://files.pythonhosted.org/packages/c0/aa/687d6b12ffb505a4447567d1f3abea23bd20e73a5bed63871178e0831b7a/greenlet-3.2.4-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:c17b6b34111ea72fc5a4e4beec9711d2226285f0386ea83477cbb97c30a3f3a5", size = 699218, upload-time = "2025-08-07T13:45:30.969Z" }, + { url = "https://files.pythonhosted.org/packages/dc/8b/29aae55436521f1d6f8ff4e12fb676f3400de7fcf27fccd1d4d17fd8fecd/greenlet-3.2.4-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:b4a1870c51720687af7fa3e7cda6d08d801dae660f75a76f3845b642b4da6ee1", size = 694659, upload-time = "2025-08-07T13:53:17.759Z" }, + { url = "https://files.pythonhosted.org/packages/92/2e/ea25914b1ebfde93b6fc4ff46d6864564fba59024e928bdc7de475affc25/greenlet-3.2.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:061dc4cf2c34852b052a8620d40f36324554bc192be474b9e9770e8c042fd735", size = 695355, upload-time = "2025-08-07T13:18:34.517Z" }, + { url = "https://files.pythonhosted.org/packages/72/60/fc56c62046ec17f6b0d3060564562c64c862948c9d4bc8aa807cf5bd74f4/greenlet-3.2.4-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:44358b9bf66c8576a9f57a590d5f5d6e72fa4228b763d0e43fee6d3b06d3a337", size = 657512, upload-time = "2025-08-07T13:18:33.969Z" }, + { url = "https://files.pythonhosted.org/packages/e3/a5/6ddab2b4c112be95601c13428db1d8b6608a8b6039816f2ba09c346c08fc/greenlet-3.2.4-cp314-cp314-win_amd64.whl", hash = "sha256:e37ab26028f12dbb0ff65f29a8d3d44a765c61e729647bf2ddfbbed621726f01", size = 303425, upload-time = "2025-08-07T13:32:27.59Z" }, + { url = "https://files.pythonhosted.org/packages/f7/c0/93885c4106d2626bf51fdec377d6aef740dfa5c4877461889a7cf8e565cc/greenlet-3.2.4-cp39-cp39-macosx_11_0_universal2.whl", hash = "sha256:b6a7c19cf0d2742d0809a4c05975db036fdff50cd294a93632d6a310bf9ac02c", size = 269859, upload-time = "2025-08-07T13:16:16.003Z" }, + { url = "https://files.pythonhosted.org/packages/4d/f5/33f05dc3ba10a02dedb1485870cf81c109227d3d3aa280f0e48486cac248/greenlet-3.2.4-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:27890167f55d2387576d1f41d9487ef171849ea0359ce1510ca6e06c8bece11d", size = 627610, upload-time = "2025-08-07T13:43:01.345Z" }, + { url = "https://files.pythonhosted.org/packages/b2/a7/9476decef51a0844195f99ed5dc611d212e9b3515512ecdf7321543a7225/greenlet-3.2.4-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:18d9260df2b5fbf41ae5139e1be4e796d99655f023a636cd0e11e6406cca7d58", size = 639417, upload-time = "2025-08-07T13:45:32.094Z" }, + { url = "https://files.pythonhosted.org/packages/bd/e0/849b9159cbb176f8c0af5caaff1faffdece7a8417fcc6fe1869770e33e21/greenlet-3.2.4-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:671df96c1f23c4a0d4077a325483c1503c96a1b7d9db26592ae770daa41233d4", size = 634751, upload-time = "2025-08-07T13:53:18.848Z" }, + { url = "https://files.pythonhosted.org/packages/5f/d3/844e714a9bbd39034144dca8b658dcd01839b72bb0ec7d8014e33e3705f0/greenlet-3.2.4-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:16458c245a38991aa19676900d48bd1a6f2ce3e16595051a4db9d012154e8433", size = 634020, upload-time = "2025-08-07T13:18:36.841Z" }, + { url = "https://files.pythonhosted.org/packages/6b/4c/f3de2a8de0e840ecb0253ad0dc7e2bb3747348e798ec7e397d783a3cb380/greenlet-3.2.4-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c9913f1a30e4526f432991f89ae263459b1c64d1608c0d22a5c79c287b3c70df", size = 582817, upload-time = "2025-08-07T13:18:35.48Z" }, + { url = "https://files.pythonhosted.org/packages/89/80/7332915adc766035c8980b161c2e5d50b2f941f453af232c164cff5e0aeb/greenlet-3.2.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:b90654e092f928f110e0007f572007c9727b5265f7632c2fa7415b4689351594", size = 1111985, upload-time = "2025-08-07T13:42:42.425Z" }, + { url = "https://files.pythonhosted.org/packages/66/71/1928e2c80197353bcb9b50aa19c4d8e26ee6d7a900c564907665cf4b9a41/greenlet-3.2.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:81701fd84f26330f0d5f4944d4e92e61afe6319dcd9775e39396e39d7c3e5f98", size = 1136137, upload-time = "2025-08-07T13:18:26.168Z" }, + { url = "https://files.pythonhosted.org/packages/89/48/a5dc74dde38aeb2b15d418cec76ed50e1dd3d620ccda84d8199703248968/greenlet-3.2.4-cp39-cp39-win32.whl", hash = "sha256:65458b409c1ed459ea899e939f0e1cdb14f58dbc803f2f93c5eab5694d32671b", size = 281400, upload-time = "2025-08-07T14:02:20.263Z" }, + { url = "https://files.pythonhosted.org/packages/e5/44/342c4591db50db1076b8bda86ed0ad59240e3e1da17806a4cf10a6d0e447/greenlet-3.2.4-cp39-cp39-win_amd64.whl", hash = "sha256:d2e685ade4dafd447ede19c31277a224a239a0a1a4eca4e6390efedf20260cfb", size = 298533, upload-time = "2025-08-07T13:56:34.168Z" }, ] [[package]] name = "griffe" -version = "1.7.2" +version = "1.11.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "colorama" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/59/08/7df7e90e34d08ad890bd71d7ba19451052f88dc3d2c483d228d1331a4736/griffe-1.7.2.tar.gz", hash = "sha256:98d396d803fab3b680c2608f300872fd57019ed82f0672f5b5323a9ad18c540c", size = 394919, upload-time = "2025-04-01T14:38:44.887Z" } +sdist = { url = "https://files.pythonhosted.org/packages/18/0f/9cbd56eb047de77a4b93d8d4674e70cd19a1ff64d7410651b514a1ed93d5/griffe-1.11.1.tar.gz", hash = "sha256:d54ffad1ec4da9658901eb5521e9cddcdb7a496604f67d8ae71077f03f549b7e", size = 410996, upload-time = "2025-08-11T11:38:35.528Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/b1/5e/38b408f41064c9fcdbb0ea27c1bd13a1c8657c4846e04dab9f5ea770602c/griffe-1.7.2-py3-none-any.whl", hash = "sha256:1ed9c2e338a75741fc82083fe5a1bc89cb6142efe126194cc313e34ee6af5423", size = 129187, upload-time = "2025-04-01T14:38:43.227Z" }, + { url = "https://files.pythonhosted.org/packages/e6/a3/451ffd422ce143758a39c0290aaa7c9727ecc2bcc19debd7a8f3c6075ce9/griffe-1.11.1-py3-none-any.whl", hash = "sha256:5799cf7c513e4b928cfc6107ee6c4bc4a92e001f07022d97fd8dee2f612b6064", size = 138745, upload-time = "2025-08-11T11:38:33.964Z" }, ] [[package]] name = "h11" -version = "0.14.0" +version = "0.16.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" }, +] + +[[package]] +name = "hf-xet" +version = "1.1.7" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/f5/38/3af3d3633a34a3316095b39c8e8fb4853a28a536e55d347bd8d8e9a14b03/h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d", size = 100418, upload-time = "2022-09-25T15:40:01.519Z" } +sdist = { url = "https://files.pythonhosted.org/packages/b2/0a/a0f56735940fde6dd627602fec9ab3bad23f66a272397560abd65aba416e/hf_xet-1.1.7.tar.gz", hash = "sha256:20cec8db4561338824a3b5f8c19774055b04a8df7fff0cb1ff2cb1a0c1607b80", size = 477719, upload-time = "2025-08-06T00:30:55.741Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/95/04/ff642e65ad6b90db43e668d70ffb6736436c7ce41fcc549f4e9472234127/h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761", size = 58259, upload-time = "2022-09-25T15:39:59.68Z" }, + { url = "https://files.pythonhosted.org/packages/b1/7c/8d7803995caf14e7d19a392a486a040f923e2cfeff824e9b800b92072f76/hf_xet-1.1.7-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:60dae4b44d520819e54e216a2505685248ec0adbdb2dd4848b17aa85a0375cde", size = 2761743, upload-time = "2025-08-06T00:30:50.634Z" }, + { url = "https://files.pythonhosted.org/packages/51/a3/fa5897099454aa287022a34a30e68dbff0e617760f774f8bd1db17f06bd4/hf_xet-1.1.7-cp37-abi3-macosx_11_0_arm64.whl", hash = "sha256:b109f4c11e01c057fc82004c9e51e6cdfe2cb230637644ade40c599739067b2e", size = 2624331, upload-time = "2025-08-06T00:30:49.212Z" }, + { url = "https://files.pythonhosted.org/packages/86/50/2446a132267e60b8a48b2e5835d6e24fd988000d0f5b9b15ebd6d64ef769/hf_xet-1.1.7-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6efaaf1a5a9fc3a501d3e71e88a6bfebc69ee3a716d0e713a931c8b8d920038f", size = 3183844, upload-time = "2025-08-06T00:30:47.582Z" }, + { url = "https://files.pythonhosted.org/packages/20/8f/ccc670616bb9beee867c6bb7139f7eab2b1370fe426503c25f5cbb27b148/hf_xet-1.1.7-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:751571540f9c1fbad9afcf222a5fb96daf2384bf821317b8bfb0c59d86078513", size = 3074209, upload-time = "2025-08-06T00:30:45.509Z" }, + { url = "https://files.pythonhosted.org/packages/21/0a/4c30e1eb77205565b854f5e4a82cf1f056214e4dc87f2918ebf83d47ae14/hf_xet-1.1.7-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:18b61bbae92d56ae731b92087c44efcac216071182c603fc535f8e29ec4b09b8", size = 3239602, upload-time = "2025-08-06T00:30:52.41Z" }, + { url = "https://files.pythonhosted.org/packages/f5/1e/fc7e9baf14152662ef0b35fa52a6e889f770a7ed14ac239de3c829ecb47e/hf_xet-1.1.7-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:713f2bff61b252f8523739969f247aa354ad8e6d869b8281e174e2ea1bb8d604", size = 3348184, upload-time = "2025-08-06T00:30:54.105Z" }, + { url = "https://files.pythonhosted.org/packages/a3/73/e354eae84ceff117ec3560141224724794828927fcc013c5b449bf0b8745/hf_xet-1.1.7-cp37-abi3-win_amd64.whl", hash = "sha256:2e356da7d284479ae0f1dea3cf5a2f74fdf925d6dca84ac4341930d892c7cb34", size = 2820008, upload-time = "2025-08-06T00:30:57.056Z" }, ] [[package]] name = "httpcore" -version = "1.0.8" +version = "1.0.9" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "certifi" }, { name = "h11" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/9f/45/ad3e1b4d448f22c0cff4f5692f5ed0666658578e358b8d58a19846048059/httpcore-1.0.8.tar.gz", hash = "sha256:86e94505ed24ea06514883fd44d2bc02d90e77e7979c8eb71b90f41d364a1bad", size = 85385, upload-time = "2025-04-11T14:42:46.661Z" } +sdist = { url = "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8", size = 85484, upload-time = "2025-04-24T22:06:22.219Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/18/8d/f052b1e336bb2c1fc7ed1aaed898aa570c0b61a09707b108979d9fc6e308/httpcore-1.0.8-py3-none-any.whl", hash = "sha256:5254cf149bcb5f75e9d1b2b9f729ea4a4b883d1ad7379fc632b727cec23674be", size = 78732, upload-time = "2025-04-11T14:42:44.896Z" }, + { url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784, upload-time = "2025-04-24T22:06:20.566Z" }, ] [[package]] @@ -733,29 +963,30 @@ wheels = [ [[package]] name = "httpx-sse" -version = "0.4.0" +version = "0.4.1" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/4c/60/8f4281fa9bbf3c8034fd54c0e7412e66edbab6bc74c4996bd616f8d0406e/httpx-sse-0.4.0.tar.gz", hash = "sha256:1e81a3a3070ce322add1d3529ed42eb5f70817f45ed6ec915ab753f961139721", size = 12624, upload-time = "2023-12-22T08:01:21.083Z" } +sdist = { url = "https://files.pythonhosted.org/packages/6e/fa/66bd985dd0b7c109a3bcb89272ee0bfb7e2b4d06309ad7b38ff866734b2a/httpx_sse-0.4.1.tar.gz", hash = "sha256:8f44d34414bc7b21bf3602713005c5df4917884f76072479b21f68befa4ea26e", size = 12998, upload-time = "2025-06-24T13:21:05.71Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/e1/9b/a181f281f65d776426002f330c31849b86b31fc9d848db62e16f03ff739f/httpx_sse-0.4.0-py3-none-any.whl", hash = "sha256:f329af6eae57eaa2bdfd962b42524764af68075ea87370a2de920af5341e318f", size = 7819, upload-time = "2023-12-22T08:01:19.89Z" }, + { url = "https://files.pythonhosted.org/packages/25/0a/6269e3473b09aed2dab8aa1a600c70f31f00ae1349bee30658f7e358a159/httpx_sse-0.4.1-py3-none-any.whl", hash = "sha256:cba42174344c3a5b06f255ce65b350880f962d99ead85e776f23c6618a377a37", size = 8054, upload-time = "2025-06-24T13:21:04.772Z" }, ] [[package]] name = "huggingface-hub" -version = "0.30.2" +version = "0.34.4" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "filelock" }, { name = "fsspec" }, + { name = "hf-xet", marker = "platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'arm64' or platform_machine == 'x86_64'" }, { name = "packaging" }, { name = "pyyaml" }, { name = "requests" }, { name = "tqdm" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/df/22/8eb91736b1dcb83d879bd49050a09df29a57cc5cd9f38e48a4b1c45ee890/huggingface_hub-0.30.2.tar.gz", hash = "sha256:9a7897c5b6fd9dad3168a794a8998d6378210f5b9688d0dfc180b1a228dc2466", size = 400868, upload-time = "2025-04-08T08:32:45.26Z" } +sdist = { url = "https://files.pythonhosted.org/packages/45/c9/bdbe19339f76d12985bc03572f330a01a93c04dffecaaea3061bdd7fb892/huggingface_hub-0.34.4.tar.gz", hash = "sha256:a4228daa6fb001be3f4f4bdaf9a0db00e1739235702848df00885c9b5742c85c", size = 459768, upload-time = "2025-08-08T09:14:52.365Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/93/27/1fb384a841e9661faad1c31cbfa62864f59632e876df5d795234da51c395/huggingface_hub-0.30.2-py3-none-any.whl", hash = "sha256:68ff05969927058cfa41df4f2155d4bb48f5f54f719dd0390103eefa9b191e28", size = 481433, upload-time = "2025-04-08T08:32:43.305Z" }, + { url = "https://files.pythonhosted.org/packages/39/7b/bb06b061991107cd8783f300adff3e7b7f284e330fd82f507f2a1417b11d/huggingface_hub-0.34.4-py3-none-any.whl", hash = "sha256:9b365d781739c93ff90c359844221beef048403f1bc1f1c123c191257c3c890a", size = 561452, upload-time = "2025-08-08T09:14:50.159Z" }, ] [[package]] @@ -769,14 +1000,14 @@ wheels = [ [[package]] name = "importlib-metadata" -version = "8.6.1" +version = "8.7.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "zipp" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/33/08/c1395a292bb23fd03bdf572a1357c5a733d3eecbab877641ceacab23db6e/importlib_metadata-8.6.1.tar.gz", hash = "sha256:310b41d755445d74569f993ccfc22838295d9fe005425094fad953d7f15c8580", size = 55767, upload-time = "2025-01-20T22:21:30.429Z" } +sdist = { url = "https://files.pythonhosted.org/packages/76/66/650a33bd90f786193e4de4b3ad86ea60b53c89b669a5c7be931fac31cdb0/importlib_metadata-8.7.0.tar.gz", hash = "sha256:d13b81ad223b890aa16c5471f2ac3056cf76c5f10f82d6f9292f0b415f389000", size = 56641, upload-time = "2025-04-27T15:29:01.736Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/79/9d/0fb148dc4d6fa4a7dd1d8378168d9b4cd8d4560a6fbf6f0121c5fc34eb68/importlib_metadata-8.6.1-py3-none-any.whl", hash = "sha256:02a89390c1e15fdfdc0d7c6b25cb3e62650d0494005c97d6f148bf5b9787525e", size = 26971, upload-time = "2025-01-20T22:21:29.177Z" }, + { url = "https://files.pythonhosted.org/packages/20/b0/36bd937216ec521246249be3bf9855081de4c5e06a0c9b4219dbeda50373/importlib_metadata-8.7.0-py3-none-any.whl", hash = "sha256:e5dd1551894c77868a30651cef00984d50e1002d06942a7101d34870c5f02afd", size = 27656, upload-time = "2025-04-27T15:29:00.214Z" }, ] [[package]] @@ -790,7 +1021,7 @@ wheels = [ [[package]] name = "inline-snapshot" -version = "0.22.3" +version = "0.27.2" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "asttokens" }, @@ -799,9 +1030,9 @@ dependencies = [ { name = "rich" }, { name = "tomli", marker = "python_full_version < '3.11'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/f9/a9/f5c35bdf19f4a93adc281a89cd6cbc19114db649fee5d509257712c6c5b2/inline_snapshot-0.22.3.tar.gz", hash = "sha256:34c02a8567dafc88bb720872edde792ff5e665c8726f6af3bfc5fa85dd0016be", size = 259515, upload-time = "2025-04-14T20:29:35.23Z" } +sdist = { url = "https://files.pythonhosted.org/packages/b9/93/3caece250cdf267fcb39e6a82ada0e7e8e8fb37207331309dbf6865d7497/inline_snapshot-0.27.2.tar.gz", hash = "sha256:5ecc7ccfdcbf8d9273d3fa9fb55b829720680ef51bb1db12795fd1b0f4a3783c", size = 347133, upload-time = "2025-08-11T07:49:55.134Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/d8/35/dde6c4fcc46ba87cfe8521ac909174d51d46f1c2490673e0077c3bb0091d/inline_snapshot-0.22.3-py3-none-any.whl", hash = "sha256:2e3f076664a61742a615aa769d30f560acf37c640340a93caf0fe410b4ab8495", size = 50291, upload-time = "2025-04-14T20:29:31.047Z" }, + { url = "https://files.pythonhosted.org/packages/8f/7f/9e41fd793827af8cbe812fff625d62b3b47603d62145b718307ef4e381eb/inline_snapshot-0.27.2-py3-none-any.whl", hash = "sha256:7c11f78ad560669bccd38d6d3aa3ef33d6a8618d53bd959019dca3a452272b7e", size = 68004, upload-time = "2025-08-11T07:49:53.904Z" }, ] [[package]] @@ -818,78 +1049,91 @@ wheels = [ [[package]] name = "jiter" -version = "0.9.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/1e/c2/e4562507f52f0af7036da125bb699602ead37a2332af0788f8e0a3417f36/jiter-0.9.0.tar.gz", hash = "sha256:aadba0964deb424daa24492abc3d229c60c4a31bfee205aedbf1acc7639d7893", size = 162604, upload-time = "2025-03-10T21:37:03.278Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/b0/82/39f7c9e67b3b0121f02a0b90d433626caa95a565c3d2449fea6bcfa3f5f5/jiter-0.9.0-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:816ec9b60fdfd1fec87da1d7ed46c66c44ffec37ab2ef7de5b147b2fce3fd5ad", size = 314540, upload-time = "2025-03-10T21:35:02.218Z" }, - { url = "https://files.pythonhosted.org/packages/01/07/7bf6022c5a152fca767cf5c086bb41f7c28f70cf33ad259d023b53c0b858/jiter-0.9.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9b1d3086f8a3ee0194ecf2008cf81286a5c3e540d977fa038ff23576c023c0ea", size = 321065, upload-time = "2025-03-10T21:35:04.274Z" }, - { url = "https://files.pythonhosted.org/packages/6c/b2/de3f3446ecba7c48f317568e111cc112613da36c7b29a6de45a1df365556/jiter-0.9.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1339f839b91ae30b37c409bf16ccd3dc453e8b8c3ed4bd1d6a567193651a4a51", size = 341664, upload-time = "2025-03-10T21:35:06.032Z" }, - { url = "https://files.pythonhosted.org/packages/13/cf/6485a4012af5d407689c91296105fcdb080a3538e0658d2abf679619c72f/jiter-0.9.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ffba79584b3b670fefae66ceb3a28822365d25b7bf811e030609a3d5b876f538", size = 364635, upload-time = "2025-03-10T21:35:07.749Z" }, - { url = "https://files.pythonhosted.org/packages/0d/f7/4a491c568f005553240b486f8e05c82547340572d5018ef79414b4449327/jiter-0.9.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5cfc7d0a8e899089d11f065e289cb5b2daf3d82fbe028f49b20d7b809193958d", size = 406288, upload-time = "2025-03-10T21:35:09.238Z" }, - { url = "https://files.pythonhosted.org/packages/d3/ca/f4263ecbce7f5e6bded8f52a9f1a66540b270c300b5c9f5353d163f9ac61/jiter-0.9.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e00a1a2bbfaaf237e13c3d1592356eab3e9015d7efd59359ac8b51eb56390a12", size = 397499, upload-time = "2025-03-10T21:35:12.463Z" }, - { url = "https://files.pythonhosted.org/packages/ac/a2/522039e522a10bac2f2194f50e183a49a360d5f63ebf46f6d890ef8aa3f9/jiter-0.9.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d1d9870561eb26b11448854dce0ff27a9a27cb616b632468cafc938de25e9e51", size = 352926, upload-time = "2025-03-10T21:35:13.85Z" }, - { url = "https://files.pythonhosted.org/packages/b1/67/306a5c5abc82f2e32bd47333a1c9799499c1c3a415f8dde19dbf876f00cb/jiter-0.9.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9872aeff3f21e437651df378cb75aeb7043e5297261222b6441a620218b58708", size = 384506, upload-time = "2025-03-10T21:35:15.735Z" }, - { url = "https://files.pythonhosted.org/packages/0f/89/c12fe7b65a4fb74f6c0d7b5119576f1f16c79fc2953641f31b288fad8a04/jiter-0.9.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:1fd19112d1049bdd47f17bfbb44a2c0001061312dcf0e72765bfa8abd4aa30e5", size = 520621, upload-time = "2025-03-10T21:35:17.55Z" }, - { url = "https://files.pythonhosted.org/packages/c4/2b/d57900c5c06e6273fbaa76a19efa74dbc6e70c7427ab421bf0095dfe5d4a/jiter-0.9.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:6ef5da104664e526836070e4a23b5f68dec1cc673b60bf1edb1bfbe8a55d0678", size = 512613, upload-time = "2025-03-10T21:35:19.178Z" }, - { url = "https://files.pythonhosted.org/packages/89/05/d8b90bfb21e58097d5a4e0224f2940568366f68488a079ae77d4b2653500/jiter-0.9.0-cp310-cp310-win32.whl", hash = "sha256:cb12e6d65ebbefe5518de819f3eda53b73187b7089040b2d17f5b39001ff31c4", size = 206613, upload-time = "2025-03-10T21:35:21.039Z" }, - { url = "https://files.pythonhosted.org/packages/2c/1d/5767f23f88e4f885090d74bbd2755518050a63040c0f59aa059947035711/jiter-0.9.0-cp310-cp310-win_amd64.whl", hash = "sha256:c43ca669493626d8672be3b645dbb406ef25af3f4b6384cfd306da7eb2e70322", size = 208371, upload-time = "2025-03-10T21:35:22.536Z" }, - { url = "https://files.pythonhosted.org/packages/23/44/e241a043f114299254e44d7e777ead311da400517f179665e59611ab0ee4/jiter-0.9.0-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:6c4d99c71508912a7e556d631768dcdef43648a93660670986916b297f1c54af", size = 314654, upload-time = "2025-03-10T21:35:23.939Z" }, - { url = "https://files.pythonhosted.org/packages/fb/1b/a7e5e42db9fa262baaa9489d8d14ca93f8663e7f164ed5e9acc9f467fc00/jiter-0.9.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:8f60fb8ce7df529812bf6c625635a19d27f30806885139e367af93f6e734ef58", size = 320909, upload-time = "2025-03-10T21:35:26.127Z" }, - { url = "https://files.pythonhosted.org/packages/60/bf/8ebdfce77bc04b81abf2ea316e9c03b4a866a7d739cf355eae4d6fd9f6fe/jiter-0.9.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:51c4e1a4f8ea84d98b7b98912aa4290ac3d1eabfde8e3c34541fae30e9d1f08b", size = 341733, upload-time = "2025-03-10T21:35:27.94Z" }, - { url = "https://files.pythonhosted.org/packages/a8/4e/754ebce77cff9ab34d1d0fa0fe98f5d42590fd33622509a3ba6ec37ff466/jiter-0.9.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f4c677c424dc76684fea3e7285a7a2a7493424bea89ac441045e6a1fb1d7b3b", size = 365097, upload-time = "2025-03-10T21:35:29.605Z" }, - { url = "https://files.pythonhosted.org/packages/32/2c/6019587e6f5844c612ae18ca892f4cd7b3d8bbf49461ed29e384a0f13d98/jiter-0.9.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2221176dfec87f3470b21e6abca056e6b04ce9bff72315cb0b243ca9e835a4b5", size = 406603, upload-time = "2025-03-10T21:35:31.696Z" }, - { url = "https://files.pythonhosted.org/packages/da/e9/c9e6546c817ab75a1a7dab6dcc698e62e375e1017113e8e983fccbd56115/jiter-0.9.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3c7adb66f899ffa25e3c92bfcb593391ee1947dbdd6a9a970e0d7e713237d572", size = 396625, upload-time = "2025-03-10T21:35:33.182Z" }, - { url = "https://files.pythonhosted.org/packages/be/bd/976b458add04271ebb5a255e992bd008546ea04bb4dcadc042a16279b4b4/jiter-0.9.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c98d27330fdfb77913c1097a7aab07f38ff2259048949f499c9901700789ac15", size = 351832, upload-time = "2025-03-10T21:35:35.394Z" }, - { url = "https://files.pythonhosted.org/packages/07/51/fe59e307aaebec9265dbad44d9d4381d030947e47b0f23531579b9a7c2df/jiter-0.9.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:eda3f8cc74df66892b1d06b5d41a71670c22d95a1ca2cbab73654745ce9d0419", size = 384590, upload-time = "2025-03-10T21:35:37.171Z" }, - { url = "https://files.pythonhosted.org/packages/db/55/5dcd2693794d8e6f4889389ff66ef3be557a77f8aeeca8973a97a7c00557/jiter-0.9.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:dd5ab5ddc11418dce28343123644a100f487eaccf1de27a459ab36d6cca31043", size = 520690, upload-time = "2025-03-10T21:35:38.717Z" }, - { url = "https://files.pythonhosted.org/packages/54/d5/9f51dc90985e9eb251fbbb747ab2b13b26601f16c595a7b8baba964043bd/jiter-0.9.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:42f8a68a69f047b310319ef8e2f52fdb2e7976fb3313ef27df495cf77bcad965", size = 512649, upload-time = "2025-03-10T21:35:40.157Z" }, - { url = "https://files.pythonhosted.org/packages/a6/e5/4e385945179bcf128fa10ad8dca9053d717cbe09e258110e39045c881fe5/jiter-0.9.0-cp311-cp311-win32.whl", hash = "sha256:a25519efb78a42254d59326ee417d6f5161b06f5da827d94cf521fed961b1ff2", size = 206920, upload-time = "2025-03-10T21:35:41.72Z" }, - { url = "https://files.pythonhosted.org/packages/4c/47/5e0b94c603d8e54dd1faab439b40b832c277d3b90743e7835879ab663757/jiter-0.9.0-cp311-cp311-win_amd64.whl", hash = "sha256:923b54afdd697dfd00d368b7ccad008cccfeb1efb4e621f32860c75e9f25edbd", size = 210119, upload-time = "2025-03-10T21:35:43.46Z" }, - { url = "https://files.pythonhosted.org/packages/af/d7/c55086103d6f29b694ec79156242304adf521577530d9031317ce5338c59/jiter-0.9.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:7b46249cfd6c48da28f89eb0be3f52d6fdb40ab88e2c66804f546674e539ec11", size = 309203, upload-time = "2025-03-10T21:35:44.852Z" }, - { url = "https://files.pythonhosted.org/packages/b0/01/f775dfee50beb420adfd6baf58d1c4d437de41c9b666ddf127c065e5a488/jiter-0.9.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:609cf3c78852f1189894383cf0b0b977665f54cb38788e3e6b941fa6d982c00e", size = 319678, upload-time = "2025-03-10T21:35:46.365Z" }, - { url = "https://files.pythonhosted.org/packages/ab/b8/09b73a793714726893e5d46d5c534a63709261af3d24444ad07885ce87cb/jiter-0.9.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d726a3890a54561e55a9c5faea1f7655eda7f105bd165067575ace6e65f80bb2", size = 341816, upload-time = "2025-03-10T21:35:47.856Z" }, - { url = "https://files.pythonhosted.org/packages/35/6f/b8f89ec5398b2b0d344257138182cc090302854ed63ed9c9051e9c673441/jiter-0.9.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2e89dc075c1fef8fa9be219e249f14040270dbc507df4215c324a1839522ea75", size = 364152, upload-time = "2025-03-10T21:35:49.397Z" }, - { url = "https://files.pythonhosted.org/packages/9b/ca/978cc3183113b8e4484cc7e210a9ad3c6614396e7abd5407ea8aa1458eef/jiter-0.9.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:04e8ffa3c353b1bc4134f96f167a2082494351e42888dfcf06e944f2729cbe1d", size = 406991, upload-time = "2025-03-10T21:35:50.745Z" }, - { url = "https://files.pythonhosted.org/packages/13/3a/72861883e11a36d6aa314b4922125f6ae90bdccc225cd96d24cc78a66385/jiter-0.9.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:203f28a72a05ae0e129b3ed1f75f56bc419d5f91dfacd057519a8bd137b00c42", size = 395824, upload-time = "2025-03-10T21:35:52.162Z" }, - { url = "https://files.pythonhosted.org/packages/87/67/22728a86ef53589c3720225778f7c5fdb617080e3deaed58b04789418212/jiter-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fca1a02ad60ec30bb230f65bc01f611c8608b02d269f998bc29cca8619a919dc", size = 351318, upload-time = "2025-03-10T21:35:53.566Z" }, - { url = "https://files.pythonhosted.org/packages/69/b9/f39728e2e2007276806d7a6609cda7fac44ffa28ca0d02c49a4f397cc0d9/jiter-0.9.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:237e5cee4d5d2659aaf91bbf8ec45052cc217d9446070699441a91b386ae27dc", size = 384591, upload-time = "2025-03-10T21:35:54.95Z" }, - { url = "https://files.pythonhosted.org/packages/eb/8f/8a708bc7fd87b8a5d861f1c118a995eccbe6d672fe10c9753e67362d0dd0/jiter-0.9.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:528b6b71745e7326eed73c53d4aa57e2a522242320b6f7d65b9c5af83cf49b6e", size = 520746, upload-time = "2025-03-10T21:35:56.444Z" }, - { url = "https://files.pythonhosted.org/packages/95/1e/65680c7488bd2365dbd2980adaf63c562d3d41d3faac192ebc7ef5b4ae25/jiter-0.9.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:9f48e86b57bc711eb5acdfd12b6cb580a59cc9a993f6e7dcb6d8b50522dcd50d", size = 512754, upload-time = "2025-03-10T21:35:58.789Z" }, - { url = "https://files.pythonhosted.org/packages/78/f3/fdc43547a9ee6e93c837685da704fb6da7dba311fc022e2766d5277dfde5/jiter-0.9.0-cp312-cp312-win32.whl", hash = "sha256:699edfde481e191d81f9cf6d2211debbfe4bd92f06410e7637dffb8dd5dfde06", size = 207075, upload-time = "2025-03-10T21:36:00.616Z" }, - { url = "https://files.pythonhosted.org/packages/cd/9d/742b289016d155f49028fe1bfbeb935c9bf0ffeefdf77daf4a63a42bb72b/jiter-0.9.0-cp312-cp312-win_amd64.whl", hash = "sha256:099500d07b43f61d8bd780466d429c45a7b25411b334c60ca875fa775f68ccb0", size = 207999, upload-time = "2025-03-10T21:36:02.366Z" }, - { url = "https://files.pythonhosted.org/packages/e7/1b/4cd165c362e8f2f520fdb43245e2b414f42a255921248b4f8b9c8d871ff1/jiter-0.9.0-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:2764891d3f3e8b18dce2cff24949153ee30c9239da7c00f032511091ba688ff7", size = 308197, upload-time = "2025-03-10T21:36:03.828Z" }, - { url = "https://files.pythonhosted.org/packages/13/aa/7a890dfe29c84c9a82064a9fe36079c7c0309c91b70c380dc138f9bea44a/jiter-0.9.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:387b22fbfd7a62418d5212b4638026d01723761c75c1c8232a8b8c37c2f1003b", size = 318160, upload-time = "2025-03-10T21:36:05.281Z" }, - { url = "https://files.pythonhosted.org/packages/6a/38/5888b43fc01102f733f085673c4f0be5a298f69808ec63de55051754e390/jiter-0.9.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:40d8da8629ccae3606c61d9184970423655fb4e33d03330bcdfe52d234d32f69", size = 341259, upload-time = "2025-03-10T21:36:06.716Z" }, - { url = "https://files.pythonhosted.org/packages/3d/5e/bbdbb63305bcc01006de683b6228cd061458b9b7bb9b8d9bc348a58e5dc2/jiter-0.9.0-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a1be73d8982bdc278b7b9377426a4b44ceb5c7952073dd7488e4ae96b88e1103", size = 363730, upload-time = "2025-03-10T21:36:08.138Z" }, - { url = "https://files.pythonhosted.org/packages/75/85/53a3edc616992fe4af6814c25f91ee3b1e22f7678e979b6ea82d3bc0667e/jiter-0.9.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2228eaaaa111ec54b9e89f7481bffb3972e9059301a878d085b2b449fbbde635", size = 405126, upload-time = "2025-03-10T21:36:10.934Z" }, - { url = "https://files.pythonhosted.org/packages/ae/b3/1ee26b12b2693bd3f0b71d3188e4e5d817b12e3c630a09e099e0a89e28fa/jiter-0.9.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:11509bfecbc319459647d4ac3fd391d26fdf530dad00c13c4dadabf5b81f01a4", size = 393668, upload-time = "2025-03-10T21:36:12.468Z" }, - { url = "https://files.pythonhosted.org/packages/11/87/e084ce261950c1861773ab534d49127d1517b629478304d328493f980791/jiter-0.9.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3f22238da568be8bbd8e0650e12feeb2cfea15eda4f9fc271d3b362a4fa0604d", size = 352350, upload-time = "2025-03-10T21:36:14.148Z" }, - { url = "https://files.pythonhosted.org/packages/f0/06/7dca84b04987e9df563610aa0bc154ea176e50358af532ab40ffb87434df/jiter-0.9.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:17f5d55eb856597607562257c8e36c42bc87f16bef52ef7129b7da11afc779f3", size = 384204, upload-time = "2025-03-10T21:36:15.545Z" }, - { url = "https://files.pythonhosted.org/packages/16/2f/82e1c6020db72f397dd070eec0c85ebc4df7c88967bc86d3ce9864148f28/jiter-0.9.0-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:6a99bed9fbb02f5bed416d137944419a69aa4c423e44189bc49718859ea83bc5", size = 520322, upload-time = "2025-03-10T21:36:17.016Z" }, - { url = "https://files.pythonhosted.org/packages/36/fd/4f0cd3abe83ce208991ca61e7e5df915aa35b67f1c0633eb7cf2f2e88ec7/jiter-0.9.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:e057adb0cd1bd39606100be0eafe742de2de88c79df632955b9ab53a086b3c8d", size = 512184, upload-time = "2025-03-10T21:36:18.47Z" }, - { url = "https://files.pythonhosted.org/packages/a0/3c/8a56f6d547731a0b4410a2d9d16bf39c861046f91f57c98f7cab3d2aa9ce/jiter-0.9.0-cp313-cp313-win32.whl", hash = "sha256:f7e6850991f3940f62d387ccfa54d1a92bd4bb9f89690b53aea36b4364bcab53", size = 206504, upload-time = "2025-03-10T21:36:19.809Z" }, - { url = "https://files.pythonhosted.org/packages/f4/1c/0c996fd90639acda75ed7fa698ee5fd7d80243057185dc2f63d4c1c9f6b9/jiter-0.9.0-cp313-cp313-win_amd64.whl", hash = "sha256:c8ae3bf27cd1ac5e6e8b7a27487bf3ab5f82318211ec2e1346a5b058756361f7", size = 204943, upload-time = "2025-03-10T21:36:21.536Z" }, - { url = "https://files.pythonhosted.org/packages/78/0f/77a63ca7aa5fed9a1b9135af57e190d905bcd3702b36aca46a01090d39ad/jiter-0.9.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:f0b2827fb88dda2cbecbbc3e596ef08d69bda06c6f57930aec8e79505dc17001", size = 317281, upload-time = "2025-03-10T21:36:22.959Z" }, - { url = "https://files.pythonhosted.org/packages/f9/39/a3a1571712c2bf6ec4c657f0d66da114a63a2e32b7e4eb8e0b83295ee034/jiter-0.9.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:062b756ceb1d40b0b28f326cba26cfd575a4918415b036464a52f08632731e5a", size = 350273, upload-time = "2025-03-10T21:36:24.414Z" }, - { url = "https://files.pythonhosted.org/packages/ee/47/3729f00f35a696e68da15d64eb9283c330e776f3b5789bac7f2c0c4df209/jiter-0.9.0-cp313-cp313t-win_amd64.whl", hash = "sha256:6f7838bc467ab7e8ef9f387bd6de195c43bad82a569c1699cb822f6609dd4cdf", size = 206867, upload-time = "2025-03-10T21:36:25.843Z" }, - { url = "https://files.pythonhosted.org/packages/aa/2c/9bee940db68d8cefb84178f8b15220c836276db8c6e09cbd422071c01c33/jiter-0.9.0-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:9ef340fae98065071ccd5805fe81c99c8f80484e820e40043689cf97fb66b3e2", size = 315246, upload-time = "2025-03-10T21:36:44.958Z" }, - { url = "https://files.pythonhosted.org/packages/d0/9b/42d5d59585d9af4fe207e96c6edac2a62bca26d76e2471e78c2f5da28bb8/jiter-0.9.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:efb767d92c63b2cd9ec9f24feeb48f49574a713870ec87e9ba0c2c6e9329c3e2", size = 312621, upload-time = "2025-03-10T21:36:46.826Z" }, - { url = "https://files.pythonhosted.org/packages/2e/a5/a64de757516e5531f8d147a32251905f0e23641738d3520a0a0724fe9651/jiter-0.9.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:113f30f87fb1f412510c6d7ed13e91422cfd329436364a690c34c8b8bd880c42", size = 343006, upload-time = "2025-03-10T21:36:48.299Z" }, - { url = "https://files.pythonhosted.org/packages/89/be/08d2bae711200d558ab8c5771f05f47cd09b82b2258a8d6fad0ee2c6a1f3/jiter-0.9.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8793b6df019b988526f5a633fdc7456ea75e4a79bd8396a3373c371fc59f5c9b", size = 365099, upload-time = "2025-03-10T21:36:49.701Z" }, - { url = "https://files.pythonhosted.org/packages/03/9e/d137a0088be90ba5081f7d5d2383374bd77a1447158e44c3ec4e142f902c/jiter-0.9.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7a9aaa5102dba4e079bb728076fadd5a2dca94c05c04ce68004cfd96f128ea34", size = 407834, upload-time = "2025-03-10T21:36:51.144Z" }, - { url = "https://files.pythonhosted.org/packages/04/4c/b6bee52a5b327830abea13eba4222f33f88895a1055eff8870ab3ebbde41/jiter-0.9.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d838650f6ebaf4ccadfb04522463e74a4c378d7e667e0eb1865cfe3990bfac49", size = 399255, upload-time = "2025-03-10T21:36:52.581Z" }, - { url = "https://files.pythonhosted.org/packages/12/b7/364b615a35f99d01cc27d3caea8c3a3ac5451bd5cadf8e5dc4355b102aba/jiter-0.9.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c0194f813efdf4b8865ad5f5c5f50f8566df7d770a82c51ef593d09e0b347020", size = 354142, upload-time = "2025-03-10T21:36:54.138Z" }, - { url = "https://files.pythonhosted.org/packages/65/cc/5156f75c496aac65080e2995910104d0e46644df1452c20d963cb904b4b1/jiter-0.9.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a7954a401d0a8a0b8bc669199db78af435aae1e3569187c2939c477c53cb6a0a", size = 385142, upload-time = "2025-03-10T21:36:55.631Z" }, - { url = "https://files.pythonhosted.org/packages/46/cf/370be59c38e56a6fed0308ca266b12d8178b8d6630284cc88ae5af110764/jiter-0.9.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:4feafe787eb8a8d98168ab15637ca2577f6ddf77ac6c8c66242c2d028aa5420e", size = 522035, upload-time = "2025-03-10T21:36:57.082Z" }, - { url = "https://files.pythonhosted.org/packages/ff/f5/c462d994dcbff43de8a3c953548d609c73a5db8138182408944fce2b68c1/jiter-0.9.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:27cd1f2e8bb377f31d3190b34e4328d280325ad7ef55c6ac9abde72f79e84d2e", size = 513844, upload-time = "2025-03-10T21:36:58.827Z" }, - { url = "https://files.pythonhosted.org/packages/15/39/60d8f17de27586fa1e7c8215ead8222556d40a6b96b20f1ad70528961f99/jiter-0.9.0-cp39-cp39-win32.whl", hash = "sha256:161d461dcbe658cf0bd0aa375b30a968b087cdddc624fc585f3867c63c6eca95", size = 207147, upload-time = "2025-03-10T21:37:00.227Z" }, - { url = "https://files.pythonhosted.org/packages/4b/13/c10f17dcddd1b4c1313418e64ace5e77cc4f7313246140fb09044516a62c/jiter-0.9.0-cp39-cp39-win_amd64.whl", hash = "sha256:e8b36d8a16a61993be33e75126ad3d8aa29cf450b09576f3c427d27647fcb4aa", size = 208879, upload-time = "2025-03-10T21:37:01.582Z" }, +version = "0.10.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ee/9d/ae7ddb4b8ab3fb1b51faf4deb36cb48a4fbbd7cb36bad6a5fca4741306f7/jiter-0.10.0.tar.gz", hash = "sha256:07a7142c38aacc85194391108dc91b5b57093c978a9932bd86a36862759d9500", size = 162759, upload-time = "2025-05-18T19:04:59.73Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/be/7e/4011b5c77bec97cb2b572f566220364e3e21b51c48c5bd9c4a9c26b41b67/jiter-0.10.0-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:cd2fb72b02478f06a900a5782de2ef47e0396b3e1f7d5aba30daeb1fce66f303", size = 317215, upload-time = "2025-05-18T19:03:04.303Z" }, + { url = "https://files.pythonhosted.org/packages/8a/4f/144c1b57c39692efc7ea7d8e247acf28e47d0912800b34d0ad815f6b2824/jiter-0.10.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:32bb468e3af278f095d3fa5b90314728a6916d89ba3d0ffb726dd9bf7367285e", size = 322814, upload-time = "2025-05-18T19:03:06.433Z" }, + { url = "https://files.pythonhosted.org/packages/63/1f/db977336d332a9406c0b1f0b82be6f71f72526a806cbb2281baf201d38e3/jiter-0.10.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aa8b3e0068c26ddedc7abc6fac37da2d0af16b921e288a5a613f4b86f050354f", size = 345237, upload-time = "2025-05-18T19:03:07.833Z" }, + { url = "https://files.pythonhosted.org/packages/d7/1c/aa30a4a775e8a672ad7f21532bdbfb269f0706b39c6ff14e1f86bdd9e5ff/jiter-0.10.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:286299b74cc49e25cd42eea19b72aa82c515d2f2ee12d11392c56d8701f52224", size = 370999, upload-time = "2025-05-18T19:03:09.338Z" }, + { url = "https://files.pythonhosted.org/packages/35/df/f8257abc4207830cb18880781b5f5b716bad5b2a22fb4330cfd357407c5b/jiter-0.10.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6ed5649ceeaeffc28d87fb012d25a4cd356dcd53eff5acff1f0466b831dda2a7", size = 491109, upload-time = "2025-05-18T19:03:11.13Z" }, + { url = "https://files.pythonhosted.org/packages/06/76/9e1516fd7b4278aa13a2cc7f159e56befbea9aa65c71586305e7afa8b0b3/jiter-0.10.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b2ab0051160cb758a70716448908ef14ad476c3774bd03ddce075f3c1f90a3d6", size = 388608, upload-time = "2025-05-18T19:03:12.911Z" }, + { url = "https://files.pythonhosted.org/packages/6d/64/67750672b4354ca20ca18d3d1ccf2c62a072e8a2d452ac3cf8ced73571ef/jiter-0.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:03997d2f37f6b67d2f5c475da4412be584e1cec273c1cfc03d642c46db43f8cf", size = 352454, upload-time = "2025-05-18T19:03:14.741Z" }, + { url = "https://files.pythonhosted.org/packages/96/4d/5c4e36d48f169a54b53a305114be3efa2bbffd33b648cd1478a688f639c1/jiter-0.10.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c404a99352d839fed80d6afd6c1d66071f3bacaaa5c4268983fc10f769112e90", size = 391833, upload-time = "2025-05-18T19:03:16.426Z" }, + { url = "https://files.pythonhosted.org/packages/0b/de/ce4a6166a78810bd83763d2fa13f85f73cbd3743a325469a4a9289af6dae/jiter-0.10.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:66e989410b6666d3ddb27a74c7e50d0829704ede652fd4c858e91f8d64b403d0", size = 523646, upload-time = "2025-05-18T19:03:17.704Z" }, + { url = "https://files.pythonhosted.org/packages/a2/a6/3bc9acce53466972964cf4ad85efecb94f9244539ab6da1107f7aed82934/jiter-0.10.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b532d3af9ef4f6374609a3bcb5e05a1951d3bf6190dc6b176fdb277c9bbf15ee", size = 514735, upload-time = "2025-05-18T19:03:19.44Z" }, + { url = "https://files.pythonhosted.org/packages/b4/d8/243c2ab8426a2a4dea85ba2a2ba43df379ccece2145320dfd4799b9633c5/jiter-0.10.0-cp310-cp310-win32.whl", hash = "sha256:da9be20b333970e28b72edc4dff63d4fec3398e05770fb3205f7fb460eb48dd4", size = 210747, upload-time = "2025-05-18T19:03:21.184Z" }, + { url = "https://files.pythonhosted.org/packages/37/7a/8021bd615ef7788b98fc76ff533eaac846322c170e93cbffa01979197a45/jiter-0.10.0-cp310-cp310-win_amd64.whl", hash = "sha256:f59e533afed0c5b0ac3eba20d2548c4a550336d8282ee69eb07b37ea526ee4e5", size = 207484, upload-time = "2025-05-18T19:03:23.046Z" }, + { url = "https://files.pythonhosted.org/packages/1b/dd/6cefc6bd68b1c3c979cecfa7029ab582b57690a31cd2f346c4d0ce7951b6/jiter-0.10.0-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:3bebe0c558e19902c96e99217e0b8e8b17d570906e72ed8a87170bc290b1e978", size = 317473, upload-time = "2025-05-18T19:03:25.942Z" }, + { url = "https://files.pythonhosted.org/packages/be/cf/fc33f5159ce132be1d8dd57251a1ec7a631c7df4bd11e1cd198308c6ae32/jiter-0.10.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:558cc7e44fd8e507a236bee6a02fa17199ba752874400a0ca6cd6e2196cdb7dc", size = 321971, upload-time = "2025-05-18T19:03:27.255Z" }, + { url = "https://files.pythonhosted.org/packages/68/a4/da3f150cf1d51f6c472616fb7650429c7ce053e0c962b41b68557fdf6379/jiter-0.10.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4d613e4b379a07d7c8453c5712ce7014e86c6ac93d990a0b8e7377e18505e98d", size = 345574, upload-time = "2025-05-18T19:03:28.63Z" }, + { url = "https://files.pythonhosted.org/packages/84/34/6e8d412e60ff06b186040e77da5f83bc158e9735759fcae65b37d681f28b/jiter-0.10.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f62cf8ba0618eda841b9bf61797f21c5ebd15a7a1e19daab76e4e4b498d515b2", size = 371028, upload-time = "2025-05-18T19:03:30.292Z" }, + { url = "https://files.pythonhosted.org/packages/fb/d9/9ee86173aae4576c35a2f50ae930d2ccb4c4c236f6cb9353267aa1d626b7/jiter-0.10.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:919d139cdfa8ae8945112398511cb7fca58a77382617d279556b344867a37e61", size = 491083, upload-time = "2025-05-18T19:03:31.654Z" }, + { url = "https://files.pythonhosted.org/packages/d9/2c/f955de55e74771493ac9e188b0f731524c6a995dffdcb8c255b89c6fb74b/jiter-0.10.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:13ddbc6ae311175a3b03bd8994881bc4635c923754932918e18da841632349db", size = 388821, upload-time = "2025-05-18T19:03:33.184Z" }, + { url = "https://files.pythonhosted.org/packages/81/5a/0e73541b6edd3f4aada586c24e50626c7815c561a7ba337d6a7eb0a915b4/jiter-0.10.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4c440ea003ad10927a30521a9062ce10b5479592e8a70da27f21eeb457b4a9c5", size = 352174, upload-time = "2025-05-18T19:03:34.965Z" }, + { url = "https://files.pythonhosted.org/packages/1c/c0/61eeec33b8c75b31cae42be14d44f9e6fe3ac15a4e58010256ac3abf3638/jiter-0.10.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:dc347c87944983481e138dea467c0551080c86b9d21de6ea9306efb12ca8f606", size = 391869, upload-time = "2025-05-18T19:03:36.436Z" }, + { url = "https://files.pythonhosted.org/packages/41/22/5beb5ee4ad4ef7d86f5ea5b4509f680a20706c4a7659e74344777efb7739/jiter-0.10.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:13252b58c1f4d8c5b63ab103c03d909e8e1e7842d302473f482915d95fefd605", size = 523741, upload-time = "2025-05-18T19:03:38.168Z" }, + { url = "https://files.pythonhosted.org/packages/ea/10/768e8818538e5817c637b0df52e54366ec4cebc3346108a4457ea7a98f32/jiter-0.10.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:7d1bbf3c465de4a24ab12fb7766a0003f6f9bce48b8b6a886158c4d569452dc5", size = 514527, upload-time = "2025-05-18T19:03:39.577Z" }, + { url = "https://files.pythonhosted.org/packages/73/6d/29b7c2dc76ce93cbedabfd842fc9096d01a0550c52692dfc33d3cc889815/jiter-0.10.0-cp311-cp311-win32.whl", hash = "sha256:db16e4848b7e826edca4ccdd5b145939758dadf0dc06e7007ad0e9cfb5928ae7", size = 210765, upload-time = "2025-05-18T19:03:41.271Z" }, + { url = "https://files.pythonhosted.org/packages/c2/c9/d394706deb4c660137caf13e33d05a031d734eb99c051142e039d8ceb794/jiter-0.10.0-cp311-cp311-win_amd64.whl", hash = "sha256:9c9c1d5f10e18909e993f9641f12fe1c77b3e9b533ee94ffa970acc14ded3812", size = 209234, upload-time = "2025-05-18T19:03:42.918Z" }, + { url = "https://files.pythonhosted.org/packages/6d/b5/348b3313c58f5fbfb2194eb4d07e46a35748ba6e5b3b3046143f3040bafa/jiter-0.10.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:1e274728e4a5345a6dde2d343c8da018b9d4bd4350f5a472fa91f66fda44911b", size = 312262, upload-time = "2025-05-18T19:03:44.637Z" }, + { url = "https://files.pythonhosted.org/packages/9c/4a/6a2397096162b21645162825f058d1709a02965606e537e3304b02742e9b/jiter-0.10.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7202ae396446c988cb2a5feb33a543ab2165b786ac97f53b59aafb803fef0744", size = 320124, upload-time = "2025-05-18T19:03:46.341Z" }, + { url = "https://files.pythonhosted.org/packages/2a/85/1ce02cade7516b726dd88f59a4ee46914bf79d1676d1228ef2002ed2f1c9/jiter-0.10.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:23ba7722d6748b6920ed02a8f1726fb4b33e0fd2f3f621816a8b486c66410ab2", size = 345330, upload-time = "2025-05-18T19:03:47.596Z" }, + { url = "https://files.pythonhosted.org/packages/75/d0/bb6b4f209a77190ce10ea8d7e50bf3725fc16d3372d0a9f11985a2b23eff/jiter-0.10.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:371eab43c0a288537d30e1f0b193bc4eca90439fc08a022dd83e5e07500ed026", size = 369670, upload-time = "2025-05-18T19:03:49.334Z" }, + { url = "https://files.pythonhosted.org/packages/a0/f5/a61787da9b8847a601e6827fbc42ecb12be2c925ced3252c8ffcb56afcaf/jiter-0.10.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6c675736059020365cebc845a820214765162728b51ab1e03a1b7b3abb70f74c", size = 489057, upload-time = "2025-05-18T19:03:50.66Z" }, + { url = "https://files.pythonhosted.org/packages/12/e4/6f906272810a7b21406c760a53aadbe52e99ee070fc5c0cb191e316de30b/jiter-0.10.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0c5867d40ab716e4684858e4887489685968a47e3ba222e44cde6e4a2154f959", size = 389372, upload-time = "2025-05-18T19:03:51.98Z" }, + { url = "https://files.pythonhosted.org/packages/e2/ba/77013b0b8ba904bf3762f11e0129b8928bff7f978a81838dfcc958ad5728/jiter-0.10.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:395bb9a26111b60141757d874d27fdea01b17e8fac958b91c20128ba8f4acc8a", size = 352038, upload-time = "2025-05-18T19:03:53.703Z" }, + { url = "https://files.pythonhosted.org/packages/67/27/c62568e3ccb03368dbcc44a1ef3a423cb86778a4389e995125d3d1aaa0a4/jiter-0.10.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6842184aed5cdb07e0c7e20e5bdcfafe33515ee1741a6835353bb45fe5d1bd95", size = 391538, upload-time = "2025-05-18T19:03:55.046Z" }, + { url = "https://files.pythonhosted.org/packages/c0/72/0d6b7e31fc17a8fdce76164884edef0698ba556b8eb0af9546ae1a06b91d/jiter-0.10.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:62755d1bcea9876770d4df713d82606c8c1a3dca88ff39046b85a048566d56ea", size = 523557, upload-time = "2025-05-18T19:03:56.386Z" }, + { url = "https://files.pythonhosted.org/packages/2f/09/bc1661fbbcbeb6244bd2904ff3a06f340aa77a2b94e5a7373fd165960ea3/jiter-0.10.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:533efbce2cacec78d5ba73a41756beff8431dfa1694b6346ce7af3a12c42202b", size = 514202, upload-time = "2025-05-18T19:03:57.675Z" }, + { url = "https://files.pythonhosted.org/packages/1b/84/5a5d5400e9d4d54b8004c9673bbe4403928a00d28529ff35b19e9d176b19/jiter-0.10.0-cp312-cp312-win32.whl", hash = "sha256:8be921f0cadd245e981b964dfbcd6fd4bc4e254cdc069490416dd7a2632ecc01", size = 211781, upload-time = "2025-05-18T19:03:59.025Z" }, + { url = "https://files.pythonhosted.org/packages/9b/52/7ec47455e26f2d6e5f2ea4951a0652c06e5b995c291f723973ae9e724a65/jiter-0.10.0-cp312-cp312-win_amd64.whl", hash = "sha256:a7c7d785ae9dda68c2678532a5a1581347e9c15362ae9f6e68f3fdbfb64f2e49", size = 206176, upload-time = "2025-05-18T19:04:00.305Z" }, + { url = "https://files.pythonhosted.org/packages/2e/b0/279597e7a270e8d22623fea6c5d4eeac328e7d95c236ed51a2b884c54f70/jiter-0.10.0-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:e0588107ec8e11b6f5ef0e0d656fb2803ac6cf94a96b2b9fc675c0e3ab5e8644", size = 311617, upload-time = "2025-05-18T19:04:02.078Z" }, + { url = "https://files.pythonhosted.org/packages/91/e3/0916334936f356d605f54cc164af4060e3e7094364add445a3bc79335d46/jiter-0.10.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:cafc4628b616dc32530c20ee53d71589816cf385dd9449633e910d596b1f5c8a", size = 318947, upload-time = "2025-05-18T19:04:03.347Z" }, + { url = "https://files.pythonhosted.org/packages/6a/8e/fd94e8c02d0e94539b7d669a7ebbd2776e51f329bb2c84d4385e8063a2ad/jiter-0.10.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:520ef6d981172693786a49ff5b09eda72a42e539f14788124a07530f785c3ad6", size = 344618, upload-time = "2025-05-18T19:04:04.709Z" }, + { url = "https://files.pythonhosted.org/packages/6f/b0/f9f0a2ec42c6e9c2e61c327824687f1e2415b767e1089c1d9135f43816bd/jiter-0.10.0-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:554dedfd05937f8fc45d17ebdf298fe7e0c77458232bcb73d9fbbf4c6455f5b3", size = 368829, upload-time = "2025-05-18T19:04:06.912Z" }, + { url = "https://files.pythonhosted.org/packages/e8/57/5bbcd5331910595ad53b9fd0c610392ac68692176f05ae48d6ce5c852967/jiter-0.10.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5bc299da7789deacf95f64052d97f75c16d4fc8c4c214a22bf8d859a4288a1c2", size = 491034, upload-time = "2025-05-18T19:04:08.222Z" }, + { url = "https://files.pythonhosted.org/packages/9b/be/c393df00e6e6e9e623a73551774449f2f23b6ec6a502a3297aeeece2c65a/jiter-0.10.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5161e201172de298a8a1baad95eb85db4fb90e902353b1f6a41d64ea64644e25", size = 388529, upload-time = "2025-05-18T19:04:09.566Z" }, + { url = "https://files.pythonhosted.org/packages/42/3e/df2235c54d365434c7f150b986a6e35f41ebdc2f95acea3036d99613025d/jiter-0.10.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2e2227db6ba93cb3e2bf67c87e594adde0609f146344e8207e8730364db27041", size = 350671, upload-time = "2025-05-18T19:04:10.98Z" }, + { url = "https://files.pythonhosted.org/packages/c6/77/71b0b24cbcc28f55ab4dbfe029f9a5b73aeadaba677843fc6dc9ed2b1d0a/jiter-0.10.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:15acb267ea5e2c64515574b06a8bf393fbfee6a50eb1673614aa45f4613c0cca", size = 390864, upload-time = "2025-05-18T19:04:12.722Z" }, + { url = "https://files.pythonhosted.org/packages/6a/d3/ef774b6969b9b6178e1d1e7a89a3bd37d241f3d3ec5f8deb37bbd203714a/jiter-0.10.0-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:901b92f2e2947dc6dfcb52fd624453862e16665ea909a08398dde19c0731b7f4", size = 522989, upload-time = "2025-05-18T19:04:14.261Z" }, + { url = "https://files.pythonhosted.org/packages/0c/41/9becdb1d8dd5d854142f45a9d71949ed7e87a8e312b0bede2de849388cb9/jiter-0.10.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:d0cb9a125d5a3ec971a094a845eadde2db0de85b33c9f13eb94a0c63d463879e", size = 513495, upload-time = "2025-05-18T19:04:15.603Z" }, + { url = "https://files.pythonhosted.org/packages/9c/36/3468e5a18238bdedae7c4d19461265b5e9b8e288d3f86cd89d00cbb48686/jiter-0.10.0-cp313-cp313-win32.whl", hash = "sha256:48a403277ad1ee208fb930bdf91745e4d2d6e47253eedc96e2559d1e6527006d", size = 211289, upload-time = "2025-05-18T19:04:17.541Z" }, + { url = "https://files.pythonhosted.org/packages/7e/07/1c96b623128bcb913706e294adb5f768fb7baf8db5e1338ce7b4ee8c78ef/jiter-0.10.0-cp313-cp313-win_amd64.whl", hash = "sha256:75f9eb72ecb640619c29bf714e78c9c46c9c4eaafd644bf78577ede459f330d4", size = 205074, upload-time = "2025-05-18T19:04:19.21Z" }, + { url = "https://files.pythonhosted.org/packages/54/46/caa2c1342655f57d8f0f2519774c6d67132205909c65e9aa8255e1d7b4f4/jiter-0.10.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:28ed2a4c05a1f32ef0e1d24c2611330219fed727dae01789f4a335617634b1ca", size = 318225, upload-time = "2025-05-18T19:04:20.583Z" }, + { url = "https://files.pythonhosted.org/packages/43/84/c7d44c75767e18946219ba2d703a5a32ab37b0bc21886a97bc6062e4da42/jiter-0.10.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:14a4c418b1ec86a195f1ca69da8b23e8926c752b685af665ce30777233dfe070", size = 350235, upload-time = "2025-05-18T19:04:22.363Z" }, + { url = "https://files.pythonhosted.org/packages/01/16/f5a0135ccd968b480daad0e6ab34b0c7c5ba3bc447e5088152696140dcb3/jiter-0.10.0-cp313-cp313t-win_amd64.whl", hash = "sha256:d7bfed2fe1fe0e4dda6ef682cee888ba444b21e7a6553e03252e4feb6cf0adca", size = 207278, upload-time = "2025-05-18T19:04:23.627Z" }, + { url = "https://files.pythonhosted.org/packages/1c/9b/1d646da42c3de6c2188fdaa15bce8ecb22b635904fc68be025e21249ba44/jiter-0.10.0-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:5e9251a5e83fab8d87799d3e1a46cb4b7f2919b895c6f4483629ed2446f66522", size = 310866, upload-time = "2025-05-18T19:04:24.891Z" }, + { url = "https://files.pythonhosted.org/packages/ad/0e/26538b158e8a7c7987e94e7aeb2999e2e82b1f9d2e1f6e9874ddf71ebda0/jiter-0.10.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:023aa0204126fe5b87ccbcd75c8a0d0261b9abdbbf46d55e7ae9f8e22424eeb8", size = 318772, upload-time = "2025-05-18T19:04:26.161Z" }, + { url = "https://files.pythonhosted.org/packages/7b/fb/d302893151caa1c2636d6574d213e4b34e31fd077af6050a9c5cbb42f6fb/jiter-0.10.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3c189c4f1779c05f75fc17c0c1267594ed918996a231593a21a5ca5438445216", size = 344534, upload-time = "2025-05-18T19:04:27.495Z" }, + { url = "https://files.pythonhosted.org/packages/01/d8/5780b64a149d74e347c5128d82176eb1e3241b1391ac07935693466d6219/jiter-0.10.0-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:15720084d90d1098ca0229352607cd68256c76991f6b374af96f36920eae13c4", size = 369087, upload-time = "2025-05-18T19:04:28.896Z" }, + { url = "https://files.pythonhosted.org/packages/e8/5b/f235a1437445160e777544f3ade57544daf96ba7e96c1a5b24a6f7ac7004/jiter-0.10.0-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e4f2fb68e5f1cfee30e2b2a09549a00683e0fde4c6a2ab88c94072fc33cb7426", size = 490694, upload-time = "2025-05-18T19:04:30.183Z" }, + { url = "https://files.pythonhosted.org/packages/85/a9/9c3d4617caa2ff89cf61b41e83820c27ebb3f7b5fae8a72901e8cd6ff9be/jiter-0.10.0-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ce541693355fc6da424c08b7edf39a2895f58d6ea17d92cc2b168d20907dee12", size = 388992, upload-time = "2025-05-18T19:04:32.028Z" }, + { url = "https://files.pythonhosted.org/packages/68/b1/344fd14049ba5c94526540af7eb661871f9c54d5f5601ff41a959b9a0bbd/jiter-0.10.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:31c50c40272e189d50006ad5c73883caabb73d4e9748a688b216e85a9a9ca3b9", size = 351723, upload-time = "2025-05-18T19:04:33.467Z" }, + { url = "https://files.pythonhosted.org/packages/41/89/4c0e345041186f82a31aee7b9d4219a910df672b9fef26f129f0cda07a29/jiter-0.10.0-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:fa3402a2ff9815960e0372a47b75c76979d74402448509ccd49a275fa983ef8a", size = 392215, upload-time = "2025-05-18T19:04:34.827Z" }, + { url = "https://files.pythonhosted.org/packages/55/58/ee607863e18d3f895feb802154a2177d7e823a7103f000df182e0f718b38/jiter-0.10.0-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:1956f934dca32d7bb647ea21d06d93ca40868b505c228556d3373cbd255ce853", size = 522762, upload-time = "2025-05-18T19:04:36.19Z" }, + { url = "https://files.pythonhosted.org/packages/15/d0/9123fb41825490d16929e73c212de9a42913d68324a8ce3c8476cae7ac9d/jiter-0.10.0-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:fcedb049bdfc555e261d6f65a6abe1d5ad68825b7202ccb9692636c70fcced86", size = 513427, upload-time = "2025-05-18T19:04:37.544Z" }, + { url = "https://files.pythonhosted.org/packages/d8/b3/2bd02071c5a2430d0b70403a34411fc519c2f227da7b03da9ba6a956f931/jiter-0.10.0-cp314-cp314-win32.whl", hash = "sha256:ac509f7eccca54b2a29daeb516fb95b6f0bd0d0d8084efaf8ed5dfc7b9f0b357", size = 210127, upload-time = "2025-05-18T19:04:38.837Z" }, + { url = "https://files.pythonhosted.org/packages/03/0c/5fe86614ea050c3ecd728ab4035534387cd41e7c1855ef6c031f1ca93e3f/jiter-0.10.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:5ed975b83a2b8639356151cef5c0d597c68376fc4922b45d0eb384ac058cfa00", size = 318527, upload-time = "2025-05-18T19:04:40.612Z" }, + { url = "https://files.pythonhosted.org/packages/b3/4a/4175a563579e884192ba6e81725fc0448b042024419be8d83aa8a80a3f44/jiter-0.10.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3aa96f2abba33dc77f79b4cf791840230375f9534e5fac927ccceb58c5e604a5", size = 354213, upload-time = "2025-05-18T19:04:41.894Z" }, + { url = "https://files.pythonhosted.org/packages/98/fd/aced428e2bd3c6c1132f67c5a708f9e7fd161d0ca8f8c5862b17b93cdf0a/jiter-0.10.0-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:bd6292a43c0fc09ce7c154ec0fa646a536b877d1e8f2f96c19707f65355b5a4d", size = 317665, upload-time = "2025-05-18T19:04:43.417Z" }, + { url = "https://files.pythonhosted.org/packages/b6/2e/47d42f15d53ed382aef8212a737101ae2720e3697a954f9b95af06d34e89/jiter-0.10.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:39de429dcaeb6808d75ffe9effefe96a4903c6a4b376b2f6d08d77c1aaee2f18", size = 312152, upload-time = "2025-05-18T19:04:44.797Z" }, + { url = "https://files.pythonhosted.org/packages/7b/02/aae834228ef4834fc18718724017995ace8da5f70aa1ec225b9bc2b2d7aa/jiter-0.10.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:52ce124f13a7a616fad3bb723f2bfb537d78239d1f7f219566dc52b6f2a9e48d", size = 346708, upload-time = "2025-05-18T19:04:46.127Z" }, + { url = "https://files.pythonhosted.org/packages/35/d4/6ff39dee2d0a9abd69d8a3832ce48a3aa644eed75e8515b5ff86c526ca9a/jiter-0.10.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:166f3606f11920f9a1746b2eea84fa2c0a5d50fd313c38bdea4edc072000b0af", size = 371360, upload-time = "2025-05-18T19:04:47.448Z" }, + { url = "https://files.pythonhosted.org/packages/a9/67/c749d962b4eb62445867ae4e64a543cbb5d63cc7d78ada274ac515500a7f/jiter-0.10.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:28dcecbb4ba402916034fc14eba7709f250c4d24b0c43fc94d187ee0580af181", size = 492105, upload-time = "2025-05-18T19:04:48.792Z" }, + { url = "https://files.pythonhosted.org/packages/f6/d3/8fe1b1bae5161f27b1891c256668f598fa4c30c0a7dacd668046a6215fca/jiter-0.10.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:86c5aa6910f9bebcc7bc4f8bc461aff68504388b43bfe5e5c0bd21efa33b52f4", size = 389577, upload-time = "2025-05-18T19:04:50.13Z" }, + { url = "https://files.pythonhosted.org/packages/ef/28/ecb19d789b4777898a4252bfaac35e3f8caf16c93becd58dcbaac0dc24ad/jiter-0.10.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ceeb52d242b315d7f1f74b441b6a167f78cea801ad7c11c36da77ff2d42e8a28", size = 353849, upload-time = "2025-05-18T19:04:51.443Z" }, + { url = "https://files.pythonhosted.org/packages/77/69/261f798f84790da6482ebd8c87ec976192b8c846e79444d0a2e0d33ebed8/jiter-0.10.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ff76d8887c8c8ee1e772274fcf8cc1071c2c58590d13e33bd12d02dc9a560397", size = 392029, upload-time = "2025-05-18T19:04:52.792Z" }, + { url = "https://files.pythonhosted.org/packages/cb/08/b8d15140d4d91f16faa2f5d416c1a71ab1bbe2b66c57197b692d04c0335f/jiter-0.10.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:a9be4d0fa2b79f7222a88aa488bd89e2ae0a0a5b189462a12def6ece2faa45f1", size = 524386, upload-time = "2025-05-18T19:04:54.203Z" }, + { url = "https://files.pythonhosted.org/packages/9b/1d/23c41765cc95c0e23ac492a88450d34bf0fd87a37218d1b97000bffe0f53/jiter-0.10.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9ab7fd8738094139b6c1ab1822d6f2000ebe41515c537235fd45dabe13ec9324", size = 515234, upload-time = "2025-05-18T19:04:55.838Z" }, + { url = "https://files.pythonhosted.org/packages/9f/14/381d8b151132e79790579819c3775be32820569f23806769658535fe467f/jiter-0.10.0-cp39-cp39-win32.whl", hash = "sha256:5f51e048540dd27f204ff4a87f5d79294ea0aa3aa552aca34934588cf27023cf", size = 211436, upload-time = "2025-05-18T19:04:57.183Z" }, + { url = "https://files.pythonhosted.org/packages/59/66/f23ae51dea8ee8ce429027b60008ca895d0fa0704f0c7fe5f09014a6cffb/jiter-0.10.0-cp39-cp39-win_amd64.whl", hash = "sha256:1b28302349dc65703a9e4ead16f163b1c339efffbe1049c30a44b001a2a4fff9", size = 208777, upload-time = "2025-05-18T19:04:58.454Z" }, ] [[package]] name = "jsonschema" -version = "4.23.0" +version = "4.25.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "attrs" }, @@ -897,21 +1141,21 @@ dependencies = [ { name = "referencing" }, { name = "rpds-py" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/38/2e/03362ee4034a4c917f697890ccd4aec0800ccf9ded7f511971c75451deec/jsonschema-4.23.0.tar.gz", hash = "sha256:d71497fef26351a33265337fa77ffeb82423f3ea21283cd9467bb03999266bc4", size = 325778, upload-time = "2024-07-08T18:40:05.546Z" } +sdist = { url = "https://files.pythonhosted.org/packages/d5/00/a297a868e9d0784450faa7365c2172a7d6110c763e30ba861867c32ae6a9/jsonschema-4.25.0.tar.gz", hash = "sha256:e63acf5c11762c0e6672ffb61482bdf57f0876684d8d249c0fe2d730d48bc55f", size = 356830, upload-time = "2025-07-18T15:39:45.11Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/69/4a/4f9dbeb84e8850557c02365a0eee0649abe5eb1d84af92a25731c6c0f922/jsonschema-4.23.0-py3-none-any.whl", hash = "sha256:fbadb6f8b144a8f8cf9f0b89ba94501d143e50411a1278633f56a7acf7fd5566", size = 88462, upload-time = "2024-07-08T18:40:00.165Z" }, + { url = "https://files.pythonhosted.org/packages/fe/54/c86cd8e011fe98803d7e382fd67c0df5ceab8d2b7ad8c5a81524f791551c/jsonschema-4.25.0-py3-none-any.whl", hash = "sha256:24c2e8da302de79c8b9382fee3e76b355e44d2a4364bb207159ce10b517bd716", size = 89184, upload-time = "2025-07-18T15:39:42.956Z" }, ] [[package]] name = "jsonschema-specifications" -version = "2024.10.1" +version = "2025.4.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "referencing" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/10/db/58f950c996c793472e336ff3655b13fbcf1e3b359dcf52dcf3ed3b52c352/jsonschema_specifications-2024.10.1.tar.gz", hash = "sha256:0f38b83639958ce1152d02a7f062902c41c8fd20d558b0c34344292d417ae272", size = 15561, upload-time = "2024-10-08T12:29:32.068Z" } +sdist = { url = "https://files.pythonhosted.org/packages/bf/ce/46fbd9c8119cfc3581ee5643ea49464d168028cfb5caff5fc0596d0cf914/jsonschema_specifications-2025.4.1.tar.gz", hash = "sha256:630159c9f4dbea161a6a2205c3011cc4f18ff381b189fff48bb39b9bf26ae608", size = 15513, upload-time = "2025-04-23T12:34:07.418Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/d1/0f/8910b19ac0670a0f80ce1008e5e751c4a57e14d2c4c13a482aa6079fa9d6/jsonschema_specifications-2024.10.1-py3-none-any.whl", hash = "sha256:a09a0680616357d9a0ecf05c12ad234479f549239d0f5b55f3deea67475da9bf", size = 18459, upload-time = "2024-10-08T12:29:30.439Z" }, + { url = "https://files.pythonhosted.org/packages/01/0e/b27cdbaccf30b890c40ed1da9fd4a3593a5cf94dae54fb34f8a4b74fcd3f/jsonschema_specifications-2025.4.1-py3-none-any.whl", hash = "sha256:4653bffbd6584f7de83a67e0d620ef16900b390ddc7939d56684d6c81e33f1af", size = 18437, upload-time = "2025-04-23T12:34:05.422Z" }, ] [[package]] @@ -928,11 +1172,12 @@ wheels = [ [[package]] name = "litellm" -version = "1.67.4.post1" +version = "1.75.5.post1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "aiohttp" }, - { name = "click" }, + { name = "click", version = "8.1.8", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" }, + { name = "click", version = "8.2.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10'" }, { name = "httpx" }, { name = "importlib-metadata" }, { name = "jinja2" }, @@ -943,26 +1188,32 @@ dependencies = [ { name = "tiktoken" }, { name = "tokenizers" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/4d/89/bacf75633dd43d6c5536380fb652c4af25046c29f5c6e5fdb4e8fe5af505/litellm-1.67.4.post1.tar.gz", hash = "sha256:057f2505f82d8c3f83d705c375b0d1931de998b13e239a6b06e16ee351fda648", size = 7243930, upload-time = "2025-04-28T03:16:40.119Z" } +sdist = { url = "https://files.pythonhosted.org/packages/10/97/6091a020895102a20f1da204ebe68c1293123555476b38e749f95ba5981c/litellm-1.75.5.post1.tar.gz", hash = "sha256:e40a0e4b25032755dc5df7f02742abe9e3b8836236363f605f3bdd363cb5a0d0", size = 10127846, upload-time = "2025-08-10T16:30:23.788Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/8f/76/780f68a3b26227136a5147c76860aacedcae9bf1b7afc1c991ec9cad11bc/litellm-1.75.5.post1-py3-none-any.whl", hash = "sha256:1c72809a9c8f6e132ad06eb7e628f674c775b0ce6bfb58cbd37e8b585d929cb7", size = 8895997, upload-time = "2025-08-10T16:30:21.325Z" }, +] [[package]] name = "markdown" -version = "3.8" +version = "3.8.2" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "importlib-metadata", marker = "python_full_version < '3.10'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/2f/15/222b423b0b88689c266d9eac4e61396fe2cc53464459d6a37618ac863b24/markdown-3.8.tar.gz", hash = "sha256:7df81e63f0df5c4b24b7d156eb81e4690595239b7d70937d0409f1b0de319c6f", size = 360906, upload-time = "2025-04-11T14:42:50.928Z" } +sdist = { url = "https://files.pythonhosted.org/packages/d7/c2/4ab49206c17f75cb08d6311171f2d65798988db4360c4d1485bd0eedd67c/markdown-3.8.2.tar.gz", hash = "sha256:247b9a70dd12e27f67431ce62523e675b866d254f900c4fe75ce3dda62237c45", size = 362071, upload-time = "2025-06-19T17:12:44.483Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/51/3f/afe76f8e2246ffbc867440cbcf90525264df0e658f8a5ca1f872b3f6192a/markdown-3.8-py3-none-any.whl", hash = "sha256:794a929b79c5af141ef5ab0f2f642d0f7b1872981250230e72682346f7cc90dc", size = 106210, upload-time = "2025-04-11T14:42:49.178Z" }, + { url = "https://files.pythonhosted.org/packages/96/2b/34cc11786bc00d0f04d0f5fdc3a2b1ae0b6239eef72d3d345805f9ad92a1/markdown-3.8.2-py3-none-any.whl", hash = "sha256:5c83764dbd4e00bdd94d85a19b8d55ccca20fe35b2e678a1422b380324dd5f24", size = 106827, upload-time = "2025-06-19T17:12:42.994Z" }, ] [[package]] name = "markdown-it-py" version = "3.0.0" source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.10'", +] dependencies = [ - { name = "mdurl" }, + { name = "mdurl", marker = "python_full_version < '3.10'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/38/71/3b932df36c1a044d397a1f92d1cf91ee0a503d91e470cbd670aa66b07ed0/markdown-it-py-3.0.0.tar.gz", hash = "sha256:e3f60a94fa066dc52ec76661e37c851cb232d92f9886b15cb560aaada2df8feb", size = 74596, upload-time = "2023-06-03T06:41:14.443Z" } wheels = [ @@ -971,10 +1222,34 @@ wheels = [ [package.optional-dependencies] linkify = [ - { name = "linkify-it-py" }, + { name = "linkify-it-py", marker = "python_full_version < '3.10'" }, +] +plugins = [ + { name = "mdit-py-plugins", version = "0.4.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" }, +] + +[[package]] +name = "markdown-it-py" +version = "4.0.0" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.11'", + "python_full_version == '3.10.*'", +] +dependencies = [ + { name = "mdurl", marker = "python_full_version >= '3.10'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/5b/f5/4ec618ed16cc4f8fb3b701563655a69816155e79e24a17b651541804721d/markdown_it_py-4.0.0.tar.gz", hash = "sha256:cb0a2b4aa34f932c007117b194e945bd74e0ec24133ceb5bac59009cda1cb9f3", size = 73070, upload-time = "2025-08-11T12:57:52.854Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/94/54/e7d793b573f298e1c9013b8c4dade17d481164aa517d1d7148619c2cedbf/markdown_it_py-4.0.0-py3-none-any.whl", hash = "sha256:87327c59b172c5011896038353a81343b6754500a08cd7a4973bb48c6d578147", size = 87321, upload-time = "2025-08-11T12:57:51.923Z" }, +] + +[package.optional-dependencies] +linkify = [ + { name = "linkify-it-py", marker = "python_full_version >= '3.10'" }, ] plugins = [ - { name = "mdit-py-plugins" }, + { name = "mdit-py-plugins", version = "0.5.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10'" }, ] [[package]] @@ -1047,36 +1322,57 @@ wheels = [ [[package]] name = "mcp" -version = "1.9.4" +version = "1.12.4" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "anyio", marker = "python_full_version >= '3.10'" }, { name = "httpx", marker = "python_full_version >= '3.10'" }, { name = "httpx-sse", marker = "python_full_version >= '3.10'" }, + { name = "jsonschema", marker = "python_full_version >= '3.10'" }, { name = "pydantic", marker = "python_full_version >= '3.10'" }, { name = "pydantic-settings", marker = "python_full_version >= '3.10'" }, { name = "python-multipart", marker = "python_full_version >= '3.10'" }, + { name = "pywin32", marker = "python_full_version >= '3.10' and sys_platform == 'win32'" }, { name = "sse-starlette", marker = "python_full_version >= '3.10'" }, { name = "starlette", marker = "python_full_version >= '3.10'" }, { name = "uvicorn", marker = "python_full_version >= '3.10' and sys_platform != 'emscripten'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/06/f2/dc2450e566eeccf92d89a00c3e813234ad58e2ba1e31d11467a09ac4f3b9/mcp-1.9.4.tar.gz", hash = "sha256:cfb0bcd1a9535b42edaef89947b9e18a8feb49362e1cc059d6e7fc636f2cb09f", size = 333294, upload-time = "2025-06-12T08:20:30.158Z" } +sdist = { url = "https://files.pythonhosted.org/packages/31/88/f6cb7e7c260cd4b4ce375f2b1614b33ce401f63af0f49f7141a2e9bf0a45/mcp-1.12.4.tar.gz", hash = "sha256:0765585e9a3a5916a3c3ab8659330e493adc7bd8b2ca6120c2d7a0c43e034ca5", size = 431148, upload-time = "2025-08-07T20:31:18.082Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/97/fc/80e655c955137393c443842ffcc4feccab5b12fa7cb8de9ced90f90e6998/mcp-1.9.4-py3-none-any.whl", hash = "sha256:7fcf36b62936adb8e63f89346bccca1268eeca9bf6dfb562ee10b1dfbda9dac0", size = 130232, upload-time = "2025-06-12T08:20:28.551Z" }, + { url = "https://files.pythonhosted.org/packages/ad/68/316cbc54b7163fa22571dcf42c9cc46562aae0a021b974e0a8141e897200/mcp-1.12.4-py3-none-any.whl", hash = "sha256:7aa884648969fab8e78b89399d59a683202972e12e6bc9a1c88ce7eda7743789", size = 160145, upload-time = "2025-08-07T20:31:15.69Z" }, ] [[package]] name = "mdit-py-plugins" version = "0.4.2" source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.10'", +] dependencies = [ - { name = "markdown-it-py" }, + { name = "markdown-it-py", version = "3.0.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/19/03/a2ecab526543b152300717cf232bb4bb8605b6edb946c845016fa9c9c9fd/mdit_py_plugins-0.4.2.tar.gz", hash = "sha256:5f2cd1fdb606ddf152d37ec30e46101a60512bc0e5fa1a7002c36647b09e26b5", size = 43542, upload-time = "2024-09-09T20:27:49.564Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/a7/f7/7782a043553ee469c1ff49cfa1cdace2d6bf99a1f333cf38676b3ddf30da/mdit_py_plugins-0.4.2-py3-none-any.whl", hash = "sha256:0c673c3f889399a33b95e88d2f0d111b4447bdfea7f237dab2d488f459835636", size = 55316, upload-time = "2024-09-09T20:27:48.397Z" }, ] +[[package]] +name = "mdit-py-plugins" +version = "0.5.0" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.11'", + "python_full_version == '3.10.*'", +] +dependencies = [ + { name = "markdown-it-py", version = "4.0.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b2/fd/a756d36c0bfba5f6e39a1cdbdbfdd448dc02692467d83816dff4592a1ebc/mdit_py_plugins-0.5.0.tar.gz", hash = "sha256:f4918cb50119f50446560513a8e311d574ff6aaed72606ddae6d35716fe809c6", size = 44655, upload-time = "2025-08-11T07:25:49.083Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fb/86/dd6e5db36df29e76c7a7699123569a4a18c1623ce68d826ed96c62643cae/mdit_py_plugins-0.5.0-py3-none-any.whl", hash = "sha256:07a08422fc1936a5d26d146759e9155ea466e842f5ab2f7d2266dd084c8dab1f", size = 57205, upload-time = "2025-08-11T07:25:47.597Z" }, +] + [[package]] name = "mdurl" version = "0.1.2" @@ -1100,7 +1396,8 @@ name = "mkdocs" version = "1.6.1" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "click" }, + { name = "click", version = "8.1.8", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" }, + { name = "click", version = "8.2.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10'" }, { name = "colorama", marker = "sys_platform == 'win32'" }, { name = "ghp-import" }, { name = "importlib-metadata", marker = "python_full_version < '3.10'" }, @@ -1122,16 +1419,16 @@ wheels = [ [[package]] name = "mkdocs-autorefs" -version = "1.4.1" +version = "1.4.2" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "markdown" }, { name = "markupsafe" }, { name = "mkdocs" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/c2/44/140469d87379c02f1e1870315f3143718036a983dd0416650827b8883192/mkdocs_autorefs-1.4.1.tar.gz", hash = "sha256:4b5b6235a4becb2b10425c2fa191737e415b37aa3418919db33e5d774c9db079", size = 4131355, upload-time = "2025-03-08T13:35:21.232Z" } +sdist = { url = "https://files.pythonhosted.org/packages/47/0c/c9826f35b99c67fa3a7cddfa094c1a6c43fafde558c309c6e4403e5b37dc/mkdocs_autorefs-1.4.2.tar.gz", hash = "sha256:e2ebe1abd2b67d597ed19378c0fff84d73d1dbce411fce7a7cc6f161888b6749", size = 54961, upload-time = "2025-05-20T13:09:09.886Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/f8/29/1125f7b11db63e8e32bcfa0752a4eea30abff3ebd0796f808e14571ddaa2/mkdocs_autorefs-1.4.1-py3-none-any.whl", hash = "sha256:9793c5ac06a6ebbe52ec0f8439256e66187badf4b5334b5fde0b128ec134df4f", size = 5782047, upload-time = "2025-03-08T13:35:18.889Z" }, + { url = "https://files.pythonhosted.org/packages/87/dc/fc063b78f4b769d1956319351704e23ebeba1e9e1d6a41b4b602325fd7e4/mkdocs_autorefs-1.4.2-py3-none-any.whl", hash = "sha256:83d6d777b66ec3c372a1aad4ae0cf77c243ba5bcda5bf0c6b8a2c5e7a3d89f13", size = 24969, upload-time = "2025-05-20T13:09:08.237Z" }, ] [[package]] @@ -1151,7 +1448,7 @@ wheels = [ [[package]] name = "mkdocs-material" -version = "9.6.11" +version = "9.6.16" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "babel" }, @@ -1166,9 +1463,9 @@ dependencies = [ { name = "pymdown-extensions" }, { name = "requests" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/5b/7e/c65e330e99daa5813e7594e57a09219ad041ed631604a72588ec7c11b34b/mkdocs_material-9.6.11.tar.gz", hash = "sha256:0b7f4a0145c5074cdd692e4362d232fb25ef5b23328d0ec1ab287af77cc0deff", size = 3951595, upload-time = "2025-04-01T07:04:42.095Z" } +sdist = { url = "https://files.pythonhosted.org/packages/dd/84/aec27a468c5e8c27689c71b516fb5a0d10b8fca45b9ad2dd9d6e43bc4296/mkdocs_material-9.6.16.tar.gz", hash = "sha256:d07011df4a5c02ee0877496d9f1bfc986cfb93d964799b032dd99fe34c0e9d19", size = 4028828, upload-time = "2025-07-26T15:53:47.542Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/19/91/79a15a772151aca0d505f901f6bbd4b85ee1fe54100256a6702056bab121/mkdocs_material-9.6.11-py3-none-any.whl", hash = "sha256:47f21ef9cbf4f0ebdce78a2ceecaa5d413581a55141e4464902224ebbc0b1263", size = 8703720, upload-time = "2025-04-01T07:04:39.073Z" }, + { url = "https://files.pythonhosted.org/packages/65/f4/90ad67125b4dd66e7884e4dbdfab82e3679eb92b751116f8bb25ccfe2f0c/mkdocs_material-9.6.16-py3-none-any.whl", hash = "sha256:8d1a1282b892fe1fdf77bfeb08c485ba3909dd743c9ba69a19a40f637c6ec18c", size = 9223743, upload-time = "2025-07-26T15:53:44.236Z" }, ] [[package]] @@ -1194,7 +1491,7 @@ wheels = [ [[package]] name = "mkdocstrings" -version = "0.29.1" +version = "0.30.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "importlib-metadata", marker = "python_full_version < '3.10'" }, @@ -1205,9 +1502,9 @@ dependencies = [ { name = "mkdocs-autorefs" }, { name = "pymdown-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/41/e8/d22922664a627a0d3d7ff4a6ca95800f5dde54f411982591b4621a76225d/mkdocstrings-0.29.1.tar.gz", hash = "sha256:8722f8f8c5cd75da56671e0a0c1bbed1df9946c0cef74794d6141b34011abd42", size = 1212686, upload-time = "2025-03-31T08:33:11.997Z" } +sdist = { url = "https://files.pythonhosted.org/packages/e2/0a/7e4776217d4802009c8238c75c5345e23014a4706a8414a62c0498858183/mkdocstrings-0.30.0.tar.gz", hash = "sha256:5d8019b9c31ddacd780b6784ffcdd6f21c408f34c0bd1103b5351d609d5b4444", size = 106597, upload-time = "2025-07-22T23:48:45.998Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/98/14/22533a578bf8b187e05d67e2c1721ce10e3f526610eebaf7a149d557ea7a/mkdocstrings-0.29.1-py3-none-any.whl", hash = "sha256:37a9736134934eea89cbd055a513d40a020d87dfcae9e3052c2a6b8cd4af09b6", size = 1631075, upload-time = "2025-03-31T08:33:09.661Z" }, + { url = "https://files.pythonhosted.org/packages/de/b4/3c5eac68f31e124a55d255d318c7445840fa1be55e013f507556d6481913/mkdocstrings-0.30.0-py3-none-any.whl", hash = "sha256:ae9e4a0d8c1789697ac776f2e034e2ddd71054ae1cf2c2bb1433ccfd07c226f2", size = 36579, upload-time = "2025-07-22T23:48:44.152Z" }, ] [package.optional-dependencies] @@ -1217,7 +1514,7 @@ python = [ [[package]] name = "mkdocstrings-python" -version = "1.16.10" +version = "1.16.12" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "griffe" }, @@ -1225,243 +1522,343 @@ dependencies = [ { name = "mkdocstrings" }, { name = "typing-extensions", marker = "python_full_version < '3.11'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/44/c8/600c4201b6b9e72bab16802316d0c90ce04089f8e6bb5e064cd2a5abba7e/mkdocstrings_python-1.16.10.tar.gz", hash = "sha256:f9eedfd98effb612ab4d0ed6dd2b73aff6eba5215e0a65cea6d877717f75502e", size = 205771, upload-time = "2025-04-03T14:24:48.12Z" } +sdist = { url = "https://files.pythonhosted.org/packages/bf/ed/b886f8c714fd7cccc39b79646b627dbea84cd95c46be43459ef46852caf0/mkdocstrings_python-1.16.12.tar.gz", hash = "sha256:9b9eaa066e0024342d433e332a41095c4e429937024945fea511afe58f63175d", size = 206065, upload-time = "2025-06-03T12:52:49.276Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/53/37/19549c5e0179785308cc988a68e16aa7550e4e270ec8a9878334e86070c6/mkdocstrings_python-1.16.10-py3-none-any.whl", hash = "sha256:63bb9f01f8848a644bdb6289e86dc38ceddeaa63ecc2e291e3b2ca52702a6643", size = 124112, upload-time = "2025-04-03T14:24:46.561Z" }, + { url = "https://files.pythonhosted.org/packages/3b/dd/a24ee3de56954bfafb6ede7cd63c2413bb842cc48eb45e41c43a05a33074/mkdocstrings_python-1.16.12-py3-none-any.whl", hash = "sha256:22ded3a63b3d823d57457a70ff9860d5a4de9e8b1e482876fc9baabaf6f5f374", size = 124287, upload-time = "2025-06-03T12:52:47.819Z" }, ] [[package]] name = "multidict" -version = "6.4.3" +version = "6.6.4" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "typing-extensions", marker = "python_full_version < '3.11'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/da/2c/e367dfb4c6538614a0c9453e510d75d66099edf1c4e69da1b5ce691a1931/multidict-6.4.3.tar.gz", hash = "sha256:3ada0b058c9f213c5f95ba301f922d402ac234f1111a7d8fd70f1b99f3c281ec", size = 89372, upload-time = "2025-04-10T22:20:17.956Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/83/44/45e798d4cd1b5dfe41ddf36266c7aca6d954e3c7a8b0d599ad555ce2b4f8/multidict-6.4.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:32a998bd8a64ca48616eac5a8c1cc4fa38fb244a3facf2eeb14abe186e0f6cc5", size = 65822, upload-time = "2025-04-10T22:17:32.83Z" }, - { url = "https://files.pythonhosted.org/packages/10/fb/9ea024f928503f8c758f8463759d21958bf27b1f7a1103df73e5022e6a7c/multidict-6.4.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:a54ec568f1fc7f3c313c2f3b16e5db346bf3660e1309746e7fccbbfded856188", size = 38706, upload-time = "2025-04-10T22:17:35.028Z" }, - { url = "https://files.pythonhosted.org/packages/6d/eb/7013316febca37414c0e1469fccadcb1a0e4315488f8f57ca5d29b384863/multidict-6.4.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a7be07e5df178430621c716a63151165684d3e9958f2bbfcb644246162007ab7", size = 37979, upload-time = "2025-04-10T22:17:36.626Z" }, - { url = "https://files.pythonhosted.org/packages/64/28/5a7bf4e7422613ea80f9ebc529d3845b20a422cfa94d4355504ac98047ee/multidict-6.4.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b128dbf1c939674a50dd0b28f12c244d90e5015e751a4f339a96c54f7275e291", size = 220233, upload-time = "2025-04-10T22:17:37.807Z" }, - { url = "https://files.pythonhosted.org/packages/52/05/b4c58850f71befde6a16548968b48331a155a80627750b150bb5962e4dea/multidict-6.4.3-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:b9cb19dfd83d35b6ff24a4022376ea6e45a2beba8ef3f0836b8a4b288b6ad685", size = 217762, upload-time = "2025-04-10T22:17:39.493Z" }, - { url = "https://files.pythonhosted.org/packages/99/a3/393e23bba1e9a00f95b3957acd8f5e3ee3446e78c550f593be25f9de0483/multidict-6.4.3-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3cf62f8e447ea2c1395afa289b332e49e13d07435369b6f4e41f887db65b40bf", size = 230699, upload-time = "2025-04-10T22:17:41.207Z" }, - { url = "https://files.pythonhosted.org/packages/9c/a7/52c63069eb1a079f824257bb8045d93e692fa2eb34d08323d1fdbdfc398a/multidict-6.4.3-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:909f7d43ff8f13d1adccb6a397094adc369d4da794407f8dd592c51cf0eae4b1", size = 226801, upload-time = "2025-04-10T22:17:42.62Z" }, - { url = "https://files.pythonhosted.org/packages/2c/e9/40d2b73e7d6574d91074d83477a990e3701affbe8b596010d4f5e6c7a6fa/multidict-6.4.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0bb8f8302fbc7122033df959e25777b0b7659b1fd6bcb9cb6bed76b5de67afef", size = 219833, upload-time = "2025-04-10T22:17:44.046Z" }, - { url = "https://files.pythonhosted.org/packages/e4/6a/0572b22fe63c632254f55a1c1cb7d29f644002b1d8731d6103a290edc754/multidict-6.4.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:224b79471b4f21169ea25ebc37ed6f058040c578e50ade532e2066562597b8a9", size = 212920, upload-time = "2025-04-10T22:17:45.48Z" }, - { url = "https://files.pythonhosted.org/packages/33/fe/c63735db9dece0053868b2d808bcc2592a83ce1830bc98243852a2b34d42/multidict-6.4.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:a7bd27f7ab3204f16967a6f899b3e8e9eb3362c0ab91f2ee659e0345445e0078", size = 225263, upload-time = "2025-04-10T22:17:47.203Z" }, - { url = "https://files.pythonhosted.org/packages/47/c2/2db296d64d41525110c27ed38fadd5eb571c6b936233e75a5ea61b14e337/multidict-6.4.3-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:99592bd3162e9c664671fd14e578a33bfdba487ea64bcb41d281286d3c870ad7", size = 214249, upload-time = "2025-04-10T22:17:48.95Z" }, - { url = "https://files.pythonhosted.org/packages/7e/74/8bc26e54c79f9a0f111350b1b28a9cacaaee53ecafccd53c90e59754d55a/multidict-6.4.3-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:a62d78a1c9072949018cdb05d3c533924ef8ac9bcb06cbf96f6d14772c5cd451", size = 221650, upload-time = "2025-04-10T22:17:50.265Z" }, - { url = "https://files.pythonhosted.org/packages/af/d7/2ce87606e3799d9a08a941f4c170930a9895886ea8bd0eca75c44baeebe3/multidict-6.4.3-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:3ccdde001578347e877ca4f629450973c510e88e8865d5aefbcb89b852ccc666", size = 231235, upload-time = "2025-04-10T22:17:51.579Z" }, - { url = "https://files.pythonhosted.org/packages/07/e1/d191a7ad3b90c613fc4b130d07a41c380e249767586148709b54d006ca17/multidict-6.4.3-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:eccb67b0e78aa2e38a04c5ecc13bab325a43e5159a181a9d1a6723db913cbb3c", size = 226056, upload-time = "2025-04-10T22:17:53.092Z" }, - { url = "https://files.pythonhosted.org/packages/24/05/a57490cf6a8d5854f4af2d17dfc54924f37fbb683986e133b76710a36079/multidict-6.4.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:8b6fcf6054fc4114a27aa865f8840ef3d675f9316e81868e0ad5866184a6cba5", size = 220014, upload-time = "2025-04-10T22:17:54.729Z" }, - { url = "https://files.pythonhosted.org/packages/5c/b1/be04fa9f08c684e9e27cca85b4ab94c10f017ec07c4c631af9c8c10bb275/multidict-6.4.3-cp310-cp310-win32.whl", hash = "sha256:f92c7f62d59373cd93bc9969d2da9b4b21f78283b1379ba012f7ee8127b3152e", size = 35042, upload-time = "2025-04-10T22:17:56.615Z" }, - { url = "https://files.pythonhosted.org/packages/d9/ca/8888f99892513001fa900eef11bafbf38ff3485109510487de009da85748/multidict-6.4.3-cp310-cp310-win_amd64.whl", hash = "sha256:b57e28dbc031d13916b946719f213c494a517b442d7b48b29443e79610acd887", size = 38506, upload-time = "2025-04-10T22:17:58.119Z" }, - { url = "https://files.pythonhosted.org/packages/16/e0/53cf7f27eda48fffa53cfd4502329ed29e00efb9e4ce41362cbf8aa54310/multidict-6.4.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:f6f19170197cc29baccd33ccc5b5d6a331058796485857cf34f7635aa25fb0cd", size = 65259, upload-time = "2025-04-10T22:17:59.632Z" }, - { url = "https://files.pythonhosted.org/packages/44/79/1dcd93ce7070cf01c2ee29f781c42b33c64fce20033808f1cc9ec8413d6e/multidict-6.4.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f2882bf27037eb687e49591690e5d491e677272964f9ec7bc2abbe09108bdfb8", size = 38451, upload-time = "2025-04-10T22:18:01.202Z" }, - { url = "https://files.pythonhosted.org/packages/f4/35/2292cf29ab5f0d0b3613fad1b75692148959d3834d806be1885ceb49a8ff/multidict-6.4.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:fbf226ac85f7d6b6b9ba77db4ec0704fde88463dc17717aec78ec3c8546c70ad", size = 37706, upload-time = "2025-04-10T22:18:02.276Z" }, - { url = "https://files.pythonhosted.org/packages/f6/d1/6b157110b2b187b5a608b37714acb15ee89ec773e3800315b0107ea648cd/multidict-6.4.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2e329114f82ad4b9dd291bef614ea8971ec119ecd0f54795109976de75c9a852", size = 226669, upload-time = "2025-04-10T22:18:03.436Z" }, - { url = "https://files.pythonhosted.org/packages/40/7f/61a476450651f177c5570e04bd55947f693077ba7804fe9717ee9ae8de04/multidict-6.4.3-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:1f4e0334d7a555c63f5c8952c57ab6f1c7b4f8c7f3442df689fc9f03df315c08", size = 223182, upload-time = "2025-04-10T22:18:04.922Z" }, - { url = "https://files.pythonhosted.org/packages/51/7b/eaf7502ac4824cdd8edcf5723e2e99f390c879866aec7b0c420267b53749/multidict-6.4.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:740915eb776617b57142ce0bb13b7596933496e2f798d3d15a20614adf30d229", size = 235025, upload-time = "2025-04-10T22:18:06.274Z" }, - { url = "https://files.pythonhosted.org/packages/3b/f6/facdbbd73c96b67a93652774edd5778ab1167854fa08ea35ad004b1b70ad/multidict-6.4.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:255dac25134d2b141c944b59a0d2f7211ca12a6d4779f7586a98b4b03ea80508", size = 231481, upload-time = "2025-04-10T22:18:07.742Z" }, - { url = "https://files.pythonhosted.org/packages/70/57/c008e861b3052405eebf921fd56a748322d8c44dcfcab164fffbccbdcdc4/multidict-6.4.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d4e8535bd4d741039b5aad4285ecd9b902ef9e224711f0b6afda6e38d7ac02c7", size = 223492, upload-time = "2025-04-10T22:18:09.095Z" }, - { url = "https://files.pythonhosted.org/packages/30/4d/7d8440d3a12a6ae5d6b202d6e7f2ac6ab026e04e99aaf1b73f18e6bc34bc/multidict-6.4.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:30c433a33be000dd968f5750722eaa0991037be0be4a9d453eba121774985bc8", size = 217279, upload-time = "2025-04-10T22:18:10.474Z" }, - { url = "https://files.pythonhosted.org/packages/7f/e7/bca0df4dd057597b94138d2d8af04eb3c27396a425b1b0a52e082f9be621/multidict-6.4.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:4eb33b0bdc50acd538f45041f5f19945a1f32b909b76d7b117c0c25d8063df56", size = 228733, upload-time = "2025-04-10T22:18:11.793Z" }, - { url = "https://files.pythonhosted.org/packages/88/f5/383827c3f1c38d7c92dbad00a8a041760228573b1c542fbf245c37bbca8a/multidict-6.4.3-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:75482f43465edefd8a5d72724887ccdcd0c83778ded8f0cb1e0594bf71736cc0", size = 218089, upload-time = "2025-04-10T22:18:13.153Z" }, - { url = "https://files.pythonhosted.org/packages/36/8a/a5174e8a7d8b94b4c8f9c1e2cf5d07451f41368ffe94d05fc957215b8e72/multidict-6.4.3-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:ce5b3082e86aee80b3925ab4928198450d8e5b6466e11501fe03ad2191c6d777", size = 225257, upload-time = "2025-04-10T22:18:14.654Z" }, - { url = "https://files.pythonhosted.org/packages/8c/76/1d4b7218f0fd00b8e5c90b88df2e45f8af127f652f4e41add947fa54c1c4/multidict-6.4.3-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:e413152e3212c4d39f82cf83c6f91be44bec9ddea950ce17af87fbf4e32ca6b2", size = 234728, upload-time = "2025-04-10T22:18:16.236Z" }, - { url = "https://files.pythonhosted.org/packages/64/44/18372a4f6273fc7ca25630d7bf9ae288cde64f29593a078bff450c7170b6/multidict-6.4.3-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:8aac2eeff69b71f229a405c0a4b61b54bade8e10163bc7b44fcd257949620618", size = 230087, upload-time = "2025-04-10T22:18:17.979Z" }, - { url = "https://files.pythonhosted.org/packages/0f/ae/28728c314a698d8a6d9491fcacc897077348ec28dd85884d09e64df8a855/multidict-6.4.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:ab583ac203af1d09034be41458feeab7863c0635c650a16f15771e1386abf2d7", size = 223137, upload-time = "2025-04-10T22:18:19.362Z" }, - { url = "https://files.pythonhosted.org/packages/22/50/785bb2b3fe16051bc91c70a06a919f26312da45c34db97fc87441d61e343/multidict-6.4.3-cp311-cp311-win32.whl", hash = "sha256:1b2019317726f41e81154df636a897de1bfe9228c3724a433894e44cd2512378", size = 34959, upload-time = "2025-04-10T22:18:20.728Z" }, - { url = "https://files.pythonhosted.org/packages/2f/63/2a22e099ae2f4d92897618c00c73a09a08a2a9aa14b12736965bf8d59fd3/multidict-6.4.3-cp311-cp311-win_amd64.whl", hash = "sha256:43173924fa93c7486402217fab99b60baf78d33806af299c56133a3755f69589", size = 38541, upload-time = "2025-04-10T22:18:22.001Z" }, - { url = "https://files.pythonhosted.org/packages/fc/bb/3abdaf8fe40e9226ce8a2ba5ecf332461f7beec478a455d6587159f1bf92/multidict-6.4.3-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:1f1c2f58f08b36f8475f3ec6f5aeb95270921d418bf18f90dffd6be5c7b0e676", size = 64019, upload-time = "2025-04-10T22:18:23.174Z" }, - { url = "https://files.pythonhosted.org/packages/7e/b5/1b2e8de8217d2e89db156625aa0fe4a6faad98972bfe07a7b8c10ef5dd6b/multidict-6.4.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:26ae9ad364fc61b936fb7bf4c9d8bd53f3a5b4417142cd0be5c509d6f767e2f1", size = 37925, upload-time = "2025-04-10T22:18:24.834Z" }, - { url = "https://files.pythonhosted.org/packages/b4/e2/3ca91c112644a395c8eae017144c907d173ea910c913ff8b62549dcf0bbf/multidict-6.4.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:659318c6c8a85f6ecfc06b4e57529e5a78dfdd697260cc81f683492ad7e9435a", size = 37008, upload-time = "2025-04-10T22:18:26.069Z" }, - { url = "https://files.pythonhosted.org/packages/60/23/79bc78146c7ac8d1ac766b2770ca2e07c2816058b8a3d5da6caed8148637/multidict-6.4.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e1eb72c741fd24d5a28242ce72bb61bc91f8451877131fa3fe930edb195f7054", size = 224374, upload-time = "2025-04-10T22:18:27.714Z" }, - { url = "https://files.pythonhosted.org/packages/86/35/77950ed9ebd09136003a85c1926ba42001ca5be14feb49710e4334ee199b/multidict-6.4.3-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:3cd06d88cb7398252284ee75c8db8e680aa0d321451132d0dba12bc995f0adcc", size = 230869, upload-time = "2025-04-10T22:18:29.162Z" }, - { url = "https://files.pythonhosted.org/packages/49/97/2a33c6e7d90bc116c636c14b2abab93d6521c0c052d24bfcc231cbf7f0e7/multidict-6.4.3-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4543d8dc6470a82fde92b035a92529317191ce993533c3c0c68f56811164ed07", size = 231949, upload-time = "2025-04-10T22:18:30.679Z" }, - { url = "https://files.pythonhosted.org/packages/56/ce/e9b5d9fcf854f61d6686ada7ff64893a7a5523b2a07da6f1265eaaea5151/multidict-6.4.3-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:30a3ebdc068c27e9d6081fca0e2c33fdf132ecea703a72ea216b81a66860adde", size = 231032, upload-time = "2025-04-10T22:18:32.146Z" }, - { url = "https://files.pythonhosted.org/packages/f0/ac/7ced59dcdfeddd03e601edb05adff0c66d81ed4a5160c443e44f2379eef0/multidict-6.4.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b038f10e23f277153f86f95c777ba1958bcd5993194fda26a1d06fae98b2f00c", size = 223517, upload-time = "2025-04-10T22:18:33.538Z" }, - { url = "https://files.pythonhosted.org/packages/db/e6/325ed9055ae4e085315193a1b58bdb4d7fc38ffcc1f4975cfca97d015e17/multidict-6.4.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c605a2b2dc14282b580454b9b5d14ebe0668381a3a26d0ac39daa0ca115eb2ae", size = 216291, upload-time = "2025-04-10T22:18:34.962Z" }, - { url = "https://files.pythonhosted.org/packages/fa/84/eeee6d477dd9dcb7691c3bb9d08df56017f5dd15c730bcc9383dcf201cf4/multidict-6.4.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8bd2b875f4ca2bb527fe23e318ddd509b7df163407b0fb717df229041c6df5d3", size = 228982, upload-time = "2025-04-10T22:18:36.443Z" }, - { url = "https://files.pythonhosted.org/packages/82/94/4d1f3e74e7acf8b0c85db350e012dcc61701cd6668bc2440bb1ecb423c90/multidict-6.4.3-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:c2e98c840c9c8e65c0e04b40c6c5066c8632678cd50c8721fdbcd2e09f21a507", size = 226823, upload-time = "2025-04-10T22:18:37.924Z" }, - { url = "https://files.pythonhosted.org/packages/09/f0/1e54b95bda7cd01080e5732f9abb7b76ab5cc795b66605877caeb2197476/multidict-6.4.3-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:66eb80dd0ab36dbd559635e62fba3083a48a252633164857a1d1684f14326427", size = 222714, upload-time = "2025-04-10T22:18:39.807Z" }, - { url = "https://files.pythonhosted.org/packages/e7/a2/f6cbca875195bd65a3e53b37ab46486f3cc125bdeab20eefe5042afa31fb/multidict-6.4.3-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:c23831bdee0a2a3cf21be057b5e5326292f60472fb6c6f86392bbf0de70ba731", size = 233739, upload-time = "2025-04-10T22:18:41.341Z" }, - { url = "https://files.pythonhosted.org/packages/79/68/9891f4d2b8569554723ddd6154375295f789dc65809826c6fb96a06314fd/multidict-6.4.3-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:1535cec6443bfd80d028052e9d17ba6ff8a5a3534c51d285ba56c18af97e9713", size = 230809, upload-time = "2025-04-10T22:18:42.817Z" }, - { url = "https://files.pythonhosted.org/packages/e6/72/a7be29ba1e87e4fc5ceb44dabc7940b8005fd2436a332a23547709315f70/multidict-6.4.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:3b73e7227681f85d19dec46e5b881827cd354aabe46049e1a61d2f9aaa4e285a", size = 226934, upload-time = "2025-04-10T22:18:44.311Z" }, - { url = "https://files.pythonhosted.org/packages/12/c1/259386a9ad6840ff7afc686da96808b503d152ac4feb3a96c651dc4f5abf/multidict-6.4.3-cp312-cp312-win32.whl", hash = "sha256:8eac0c49df91b88bf91f818e0a24c1c46f3622978e2c27035bfdca98e0e18124", size = 35242, upload-time = "2025-04-10T22:18:46.193Z" }, - { url = "https://files.pythonhosted.org/packages/06/24/c8fdff4f924d37225dc0c56a28b1dca10728fc2233065fafeb27b4b125be/multidict-6.4.3-cp312-cp312-win_amd64.whl", hash = "sha256:11990b5c757d956cd1db7cb140be50a63216af32cd6506329c2c59d732d802db", size = 38635, upload-time = "2025-04-10T22:18:47.498Z" }, - { url = "https://files.pythonhosted.org/packages/6c/4b/86fd786d03915c6f49998cf10cd5fe6b6ac9e9a071cb40885d2e080fb90d/multidict-6.4.3-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:7a76534263d03ae0cfa721fea40fd2b5b9d17a6f85e98025931d41dc49504474", size = 63831, upload-time = "2025-04-10T22:18:48.748Z" }, - { url = "https://files.pythonhosted.org/packages/45/05/9b51fdf7aef2563340a93be0a663acba2c428c4daeaf3960d92d53a4a930/multidict-6.4.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:805031c2f599eee62ac579843555ed1ce389ae00c7e9f74c2a1b45e0564a88dd", size = 37888, upload-time = "2025-04-10T22:18:50.021Z" }, - { url = "https://files.pythonhosted.org/packages/0b/43/53fc25394386c911822419b522181227ca450cf57fea76e6188772a1bd91/multidict-6.4.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:c56c179839d5dcf51d565132185409d1d5dd8e614ba501eb79023a6cab25576b", size = 36852, upload-time = "2025-04-10T22:18:51.246Z" }, - { url = "https://files.pythonhosted.org/packages/8a/68/7b99c751e822467c94a235b810a2fd4047d4ecb91caef6b5c60116991c4b/multidict-6.4.3-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9c64f4ddb3886dd8ab71b68a7431ad4aa01a8fa5be5b11543b29674f29ca0ba3", size = 223644, upload-time = "2025-04-10T22:18:52.965Z" }, - { url = "https://files.pythonhosted.org/packages/80/1b/d458d791e4dd0f7e92596667784fbf99e5c8ba040affe1ca04f06b93ae92/multidict-6.4.3-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:3002a856367c0b41cad6784f5b8d3ab008eda194ed7864aaa58f65312e2abcac", size = 230446, upload-time = "2025-04-10T22:18:54.509Z" }, - { url = "https://files.pythonhosted.org/packages/e2/46/9793378d988905491a7806d8987862dc5a0bae8a622dd896c4008c7b226b/multidict-6.4.3-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3d75e621e7d887d539d6e1d789f0c64271c250276c333480a9e1de089611f790", size = 231070, upload-time = "2025-04-10T22:18:56.019Z" }, - { url = "https://files.pythonhosted.org/packages/a7/b8/b127d3e1f8dd2a5bf286b47b24567ae6363017292dc6dec44656e6246498/multidict-6.4.3-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:995015cf4a3c0d72cbf453b10a999b92c5629eaf3a0c3e1efb4b5c1f602253bb", size = 229956, upload-time = "2025-04-10T22:18:59.146Z" }, - { url = "https://files.pythonhosted.org/packages/0c/93/f70a4c35b103fcfe1443059a2bb7f66e5c35f2aea7804105ff214f566009/multidict-6.4.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a2b0fabae7939d09d7d16a711468c385272fa1b9b7fb0d37e51143585d8e72e0", size = 222599, upload-time = "2025-04-10T22:19:00.657Z" }, - { url = "https://files.pythonhosted.org/packages/63/8c/e28e0eb2fe34921d6aa32bfc4ac75b09570b4d6818cc95d25499fe08dc1d/multidict-6.4.3-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:61ed4d82f8a1e67eb9eb04f8587970d78fe7cddb4e4d6230b77eda23d27938f9", size = 216136, upload-time = "2025-04-10T22:19:02.244Z" }, - { url = "https://files.pythonhosted.org/packages/72/f5/fbc81f866585b05f89f99d108be5d6ad170e3b6c4d0723d1a2f6ba5fa918/multidict-6.4.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:062428944a8dc69df9fdc5d5fc6279421e5f9c75a9ee3f586f274ba7b05ab3c8", size = 228139, upload-time = "2025-04-10T22:19:04.151Z" }, - { url = "https://files.pythonhosted.org/packages/bb/ba/7d196bad6b85af2307d81f6979c36ed9665f49626f66d883d6c64d156f78/multidict-6.4.3-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:b90e27b4674e6c405ad6c64e515a505c6d113b832df52fdacb6b1ffd1fa9a1d1", size = 226251, upload-time = "2025-04-10T22:19:06.117Z" }, - { url = "https://files.pythonhosted.org/packages/cc/e2/fae46a370dce79d08b672422a33df721ec8b80105e0ea8d87215ff6b090d/multidict-6.4.3-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:7d50d4abf6729921e9613d98344b74241572b751c6b37feed75fb0c37bd5a817", size = 221868, upload-time = "2025-04-10T22:19:07.981Z" }, - { url = "https://files.pythonhosted.org/packages/26/20/bbc9a3dec19d5492f54a167f08546656e7aef75d181d3d82541463450e88/multidict-6.4.3-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:43fe10524fb0a0514be3954be53258e61d87341008ce4914f8e8b92bee6f875d", size = 233106, upload-time = "2025-04-10T22:19:09.5Z" }, - { url = "https://files.pythonhosted.org/packages/ee/8d/f30ae8f5ff7a2461177f4d8eb0d8f69f27fb6cfe276b54ec4fd5a282d918/multidict-6.4.3-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:236966ca6c472ea4e2d3f02f6673ebfd36ba3f23159c323f5a496869bc8e47c9", size = 230163, upload-time = "2025-04-10T22:19:11Z" }, - { url = "https://files.pythonhosted.org/packages/15/e9/2833f3c218d3c2179f3093f766940ded6b81a49d2e2f9c46ab240d23dfec/multidict-6.4.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:422a5ec315018e606473ba1f5431e064cf8b2a7468019233dcf8082fabad64c8", size = 225906, upload-time = "2025-04-10T22:19:12.875Z" }, - { url = "https://files.pythonhosted.org/packages/f1/31/6edab296ac369fd286b845fa5dd4c409e63bc4655ed8c9510fcb477e9ae9/multidict-6.4.3-cp313-cp313-win32.whl", hash = "sha256:f901a5aace8e8c25d78960dcc24c870c8d356660d3b49b93a78bf38eb682aac3", size = 35238, upload-time = "2025-04-10T22:19:14.41Z" }, - { url = "https://files.pythonhosted.org/packages/23/57/2c0167a1bffa30d9a1383c3dab99d8caae985defc8636934b5668830d2ef/multidict-6.4.3-cp313-cp313-win_amd64.whl", hash = "sha256:1c152c49e42277bc9a2f7b78bd5fa10b13e88d1b0328221e7aef89d5c60a99a5", size = 38799, upload-time = "2025-04-10T22:19:15.869Z" }, - { url = "https://files.pythonhosted.org/packages/c9/13/2ead63b9ab0d2b3080819268acb297bd66e238070aa8d42af12b08cbee1c/multidict-6.4.3-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:be8751869e28b9c0d368d94f5afcb4234db66fe8496144547b4b6d6a0645cfc6", size = 68642, upload-time = "2025-04-10T22:19:17.527Z" }, - { url = "https://files.pythonhosted.org/packages/85/45/f1a751e1eede30c23951e2ae274ce8fad738e8a3d5714be73e0a41b27b16/multidict-6.4.3-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:0d4b31f8a68dccbcd2c0ea04f0e014f1defc6b78f0eb8b35f2265e8716a6df0c", size = 40028, upload-time = "2025-04-10T22:19:19.465Z" }, - { url = "https://files.pythonhosted.org/packages/a7/29/fcc53e886a2cc5595cc4560df333cb9630257bda65003a7eb4e4e0d8f9c1/multidict-6.4.3-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:032efeab3049e37eef2ff91271884303becc9e54d740b492a93b7e7266e23756", size = 39424, upload-time = "2025-04-10T22:19:20.762Z" }, - { url = "https://files.pythonhosted.org/packages/f6/f0/056c81119d8b88703971f937b371795cab1407cd3c751482de5bfe1a04a9/multidict-6.4.3-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9e78006af1a7c8a8007e4f56629d7252668344442f66982368ac06522445e375", size = 226178, upload-time = "2025-04-10T22:19:22.17Z" }, - { url = "https://files.pythonhosted.org/packages/a3/79/3b7e5fea0aa80583d3a69c9d98b7913dfd4fbc341fb10bb2fb48d35a9c21/multidict-6.4.3-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:daeac9dd30cda8703c417e4fddccd7c4dc0c73421a0b54a7da2713be125846be", size = 222617, upload-time = "2025-04-10T22:19:23.773Z" }, - { url = "https://files.pythonhosted.org/packages/06/db/3ed012b163e376fc461e1d6a67de69b408339bc31dc83d39ae9ec3bf9578/multidict-6.4.3-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1f6f90700881438953eae443a9c6f8a509808bc3b185246992c4233ccee37fea", size = 227919, upload-time = "2025-04-10T22:19:25.35Z" }, - { url = "https://files.pythonhosted.org/packages/b1/db/0433c104bca380989bc04d3b841fc83e95ce0c89f680e9ea4251118b52b6/multidict-6.4.3-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f84627997008390dd15762128dcf73c3365f4ec0106739cde6c20a07ed198ec8", size = 226097, upload-time = "2025-04-10T22:19:27.183Z" }, - { url = "https://files.pythonhosted.org/packages/c2/95/910db2618175724dd254b7ae635b6cd8d2947a8b76b0376de7b96d814dab/multidict-6.4.3-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3307b48cd156153b117c0ea54890a3bdbf858a5b296ddd40dc3852e5f16e9b02", size = 220706, upload-time = "2025-04-10T22:19:28.882Z" }, - { url = "https://files.pythonhosted.org/packages/d1/af/aa176c6f5f1d901aac957d5258d5e22897fe13948d1e69063ae3d5d0ca01/multidict-6.4.3-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ead46b0fa1dcf5af503a46e9f1c2e80b5d95c6011526352fa5f42ea201526124", size = 211728, upload-time = "2025-04-10T22:19:30.481Z" }, - { url = "https://files.pythonhosted.org/packages/e7/42/d51cc5fc1527c3717d7f85137d6c79bb7a93cd214c26f1fc57523774dbb5/multidict-6.4.3-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:1748cb2743bedc339d63eb1bca314061568793acd603a6e37b09a326334c9f44", size = 226276, upload-time = "2025-04-10T22:19:32.454Z" }, - { url = "https://files.pythonhosted.org/packages/28/6b/d836dea45e0b8432343ba4acf9a8ecaa245da4c0960fb7ab45088a5e568a/multidict-6.4.3-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:acc9fa606f76fc111b4569348cc23a771cb52c61516dcc6bcef46d612edb483b", size = 212069, upload-time = "2025-04-10T22:19:34.17Z" }, - { url = "https://files.pythonhosted.org/packages/55/34/0ee1a7adb3560e18ee9289c6e5f7db54edc312b13e5c8263e88ea373d12c/multidict-6.4.3-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:31469d5832b5885adeb70982e531ce86f8c992334edd2f2254a10fa3182ac504", size = 217858, upload-time = "2025-04-10T22:19:35.879Z" }, - { url = "https://files.pythonhosted.org/packages/04/08/586d652c2f5acefe0cf4e658eedb4d71d4ba6dfd4f189bd81b400fc1bc6b/multidict-6.4.3-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:ba46b51b6e51b4ef7bfb84b82f5db0dc5e300fb222a8a13b8cd4111898a869cf", size = 226988, upload-time = "2025-04-10T22:19:37.434Z" }, - { url = "https://files.pythonhosted.org/packages/82/e3/cc59c7e2bc49d7f906fb4ffb6d9c3a3cf21b9f2dd9c96d05bef89c2b1fd1/multidict-6.4.3-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:389cfefb599edf3fcfd5f64c0410da686f90f5f5e2c4d84e14f6797a5a337af4", size = 220435, upload-time = "2025-04-10T22:19:39.005Z" }, - { url = "https://files.pythonhosted.org/packages/e0/32/5c3a556118aca9981d883f38c4b1bfae646f3627157f70f4068e5a648955/multidict-6.4.3-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:64bc2bbc5fba7b9db5c2c8d750824f41c6994e3882e6d73c903c2afa78d091e4", size = 221494, upload-time = "2025-04-10T22:19:41.447Z" }, - { url = "https://files.pythonhosted.org/packages/b9/3b/1599631f59024b75c4d6e3069f4502409970a336647502aaf6b62fb7ac98/multidict-6.4.3-cp313-cp313t-win32.whl", hash = "sha256:0ecdc12ea44bab2807d6b4a7e5eef25109ab1c82a8240d86d3c1fc9f3b72efd5", size = 41775, upload-time = "2025-04-10T22:19:43.707Z" }, - { url = "https://files.pythonhosted.org/packages/e8/4e/09301668d675d02ca8e8e1a3e6be046619e30403f5ada2ed5b080ae28d02/multidict-6.4.3-cp313-cp313t-win_amd64.whl", hash = "sha256:7146a8742ea71b5d7d955bffcef58a9e6e04efba704b52a460134fefd10a8208", size = 45946, upload-time = "2025-04-10T22:19:45.071Z" }, - { url = "https://files.pythonhosted.org/packages/62/41/609ef2253da5d1686a85456b8315dec648a45a1d547074db225e94b3dd61/multidict-6.4.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:5427a2679e95a642b7f8b0f761e660c845c8e6fe3141cddd6b62005bd133fc21", size = 65724, upload-time = "2025-04-10T22:19:46.917Z" }, - { url = "https://files.pythonhosted.org/packages/b5/4e/3a2daf9ccbdb503df7b91cbee240fccc96dd3287397b05ed59673b196cde/multidict-6.4.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:24a8caa26521b9ad09732972927d7b45b66453e6ebd91a3c6a46d811eeb7349b", size = 38659, upload-time = "2025-04-10T22:19:48.306Z" }, - { url = "https://files.pythonhosted.org/packages/04/f8/3a7ec724c51ad9c1534ebb0a60020e24c12b1fe4c60a4fdd0c97a3383cf4/multidict-6.4.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:6b5a272bc7c36a2cd1b56ddc6bff02e9ce499f9f14ee4a45c45434ef083f2459", size = 37927, upload-time = "2025-04-10T22:19:49.733Z" }, - { url = "https://files.pythonhosted.org/packages/7f/c5/76c9a8cd657b3a44daf08f14faebb558b00fa22698f58ee7fa3876ade2e4/multidict-6.4.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:edf74dc5e212b8c75165b435c43eb0d5e81b6b300a938a4eb82827119115e840", size = 217990, upload-time = "2025-04-10T22:19:51.577Z" }, - { url = "https://files.pythonhosted.org/packages/ac/b9/6ccb5bfc3747546e096f34c8b2ee91ccab0a92fefe7a9addc4ef9055ab4d/multidict-6.4.3-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:9f35de41aec4b323c71f54b0ca461ebf694fb48bec62f65221f52e0017955b39", size = 213431, upload-time = "2025-04-10T22:19:53.37Z" }, - { url = "https://files.pythonhosted.org/packages/0b/e9/95af61c79ffabb4a4331fe0736280ef30b324b67772fd018faf408d73f7d/multidict-6.4.3-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ae93e0ff43b6f6892999af64097b18561691ffd835e21a8348a441e256592e1f", size = 228087, upload-time = "2025-04-10T22:19:55.008Z" }, - { url = "https://files.pythonhosted.org/packages/04/d2/bd7454b40e4d0f21771b2aa077c0e3f4dfb965f209ffce21112743cdadaa/multidict-6.4.3-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5e3929269e9d7eff905d6971d8b8c85e7dbc72c18fb99c8eae6fe0a152f2e343", size = 224061, upload-time = "2025-04-10T22:19:56.643Z" }, - { url = "https://files.pythonhosted.org/packages/7a/f9/b50679179dd909ba28ce49dca551b40a8349aaed64beececd8ab64589b65/multidict-6.4.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fb6214fe1750adc2a1b801a199d64b5a67671bf76ebf24c730b157846d0e90d2", size = 216133, upload-time = "2025-04-10T22:19:58.33Z" }, - { url = "https://files.pythonhosted.org/packages/8f/47/9b77c483a5183ed734d1272cbe685d7313922806d686c63748997374afc1/multidict-6.4.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6d79cf5c0c6284e90f72123f4a3e4add52d6c6ebb4a9054e88df15b8d08444c6", size = 209868, upload-time = "2025-04-10T22:20:00.529Z" }, - { url = "https://files.pythonhosted.org/packages/6e/b1/c621ed6098e81404098236a08f7be9274e364cdb0fed12de837030235d19/multidict-6.4.3-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:2427370f4a255262928cd14533a70d9738dfacadb7563bc3b7f704cc2360fc4e", size = 221723, upload-time = "2025-04-10T22:20:02.696Z" }, - { url = "https://files.pythonhosted.org/packages/3a/9f/77f41726c1a3e5651e37c67aea5736645484834efd06795b2f8d38318890/multidict-6.4.3-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:fbd8d737867912b6c5f99f56782b8cb81f978a97b4437a1c476de90a3e41c9a1", size = 211008, upload-time = "2025-04-10T22:20:04.418Z" }, - { url = "https://files.pythonhosted.org/packages/00/66/eec0484c1de91439ce4e054f754f0ecb1c9d1a5fa09a1c12952fb3717ce9/multidict-6.4.3-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:0ee1bf613c448997f73fc4efb4ecebebb1c02268028dd4f11f011f02300cf1e8", size = 216800, upload-time = "2025-04-10T22:20:06.088Z" }, - { url = "https://files.pythonhosted.org/packages/95/58/a8f07841c6db4bdd8d1ae50cc8910cc63b5078b6dae3b196ec654d888060/multidict-6.4.3-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:578568c4ba5f2b8abd956baf8b23790dbfdc953e87d5b110bce343b4a54fc9e7", size = 227661, upload-time = "2025-04-10T22:20:07.807Z" }, - { url = "https://files.pythonhosted.org/packages/2a/a5/c50b9430fe79d4b04efda204f22450a23cb4ae895734940541141a858089/multidict-6.4.3-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:a059ad6b80de5b84b9fa02a39400319e62edd39d210b4e4f8c4f1243bdac4752", size = 221821, upload-time = "2025-04-10T22:20:09.517Z" }, - { url = "https://files.pythonhosted.org/packages/99/4c/2b69c52c4b1357d197c38a913fcf45b4200af79adfcdf96d88cb02d18f5b/multidict-6.4.3-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:dd53893675b729a965088aaadd6a1f326a72b83742b056c1065bdd2e2a42b4df", size = 216332, upload-time = "2025-04-10T22:20:11.237Z" }, - { url = "https://files.pythonhosted.org/packages/1b/39/63d9bd977aed6a053955b30aad38bbfe1f0f8d7462f80760b498387c91ee/multidict-6.4.3-cp39-cp39-win32.whl", hash = "sha256:abcfed2c4c139f25c2355e180bcc077a7cae91eefbb8b3927bb3f836c9586f1f", size = 35087, upload-time = "2025-04-10T22:20:12.971Z" }, - { url = "https://files.pythonhosted.org/packages/8f/d4/c6b8936fa9ff5e77fbba9ba431bc380ad0f8e6442a05c7fb6bfe35fdff60/multidict-6.4.3-cp39-cp39-win_amd64.whl", hash = "sha256:b1b389ae17296dd739015d5ddb222ee99fd66adeae910de21ac950e00979d897", size = 38680, upload-time = "2025-04-10T22:20:14.974Z" }, - { url = "https://files.pythonhosted.org/packages/96/10/7d526c8974f017f1e7ca584c71ee62a638e9334d8d33f27d7cdfc9ae79e4/multidict-6.4.3-py3-none-any.whl", hash = "sha256:59fe01ee8e2a1e8ceb3f6dbb216b09c8d9f4ef1c22c4fc825d045a147fa2ebc9", size = 10400, upload-time = "2025-04-10T22:20:16.445Z" }, +sdist = { url = "https://files.pythonhosted.org/packages/69/7f/0652e6ed47ab288e3756ea9c0df8b14950781184d4bd7883f4d87dd41245/multidict-6.6.4.tar.gz", hash = "sha256:d2d4e4787672911b48350df02ed3fa3fffdc2f2e8ca06dd6afdf34189b76a9dd", size = 101843, upload-time = "2025-08-11T12:08:48.217Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/eb/6b/86f353088c1358e76fd30b0146947fddecee812703b604ee901e85cd2a80/multidict-6.6.4-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:b8aa6f0bd8125ddd04a6593437bad6a7e70f300ff4180a531654aa2ab3f6d58f", size = 77054, upload-time = "2025-08-11T12:06:02.99Z" }, + { url = "https://files.pythonhosted.org/packages/19/5d/c01dc3d3788bb877bd7f5753ea6eb23c1beeca8044902a8f5bfb54430f63/multidict-6.6.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:b9e5853bbd7264baca42ffc53391b490d65fe62849bf2c690fa3f6273dbcd0cb", size = 44914, upload-time = "2025-08-11T12:06:05.264Z" }, + { url = "https://files.pythonhosted.org/packages/46/44/964dae19ea42f7d3e166474d8205f14bb811020e28bc423d46123ddda763/multidict-6.6.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0af5f9dee472371e36d6ae38bde009bd8ce65ac7335f55dcc240379d7bed1495", size = 44601, upload-time = "2025-08-11T12:06:06.627Z" }, + { url = "https://files.pythonhosted.org/packages/31/20/0616348a1dfb36cb2ab33fc9521de1f27235a397bf3f59338e583afadd17/multidict-6.6.4-cp310-cp310-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:d24f351e4d759f5054b641c81e8291e5d122af0fca5c72454ff77f7cbe492de8", size = 224821, upload-time = "2025-08-11T12:06:08.06Z" }, + { url = "https://files.pythonhosted.org/packages/14/26/5d8923c69c110ff51861af05bd27ca6783011b96725d59ccae6d9daeb627/multidict-6.6.4-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:db6a3810eec08280a172a6cd541ff4a5f6a97b161d93ec94e6c4018917deb6b7", size = 242608, upload-time = "2025-08-11T12:06:09.697Z" }, + { url = "https://files.pythonhosted.org/packages/5c/cc/e2ad3ba9459aa34fa65cf1f82a5c4a820a2ce615aacfb5143b8817f76504/multidict-6.6.4-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:a1b20a9d56b2d81e2ff52ecc0670d583eaabaa55f402e8d16dd062373dbbe796", size = 222324, upload-time = "2025-08-11T12:06:10.905Z" }, + { url = "https://files.pythonhosted.org/packages/19/db/4ed0f65701afbc2cb0c140d2d02928bb0fe38dd044af76e58ad7c54fd21f/multidict-6.6.4-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:8c9854df0eaa610a23494c32a6f44a3a550fb398b6b51a56e8c6b9b3689578db", size = 253234, upload-time = "2025-08-11T12:06:12.658Z" }, + { url = "https://files.pythonhosted.org/packages/94/c1/5160c9813269e39ae14b73debb907bfaaa1beee1762da8c4fb95df4764ed/multidict-6.6.4-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:4bb7627fd7a968f41905a4d6343b0d63244a0623f006e9ed989fa2b78f4438a0", size = 251613, upload-time = "2025-08-11T12:06:13.97Z" }, + { url = "https://files.pythonhosted.org/packages/05/a9/48d1bd111fc2f8fb98b2ed7f9a115c55a9355358432a19f53c0b74d8425d/multidict-6.6.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:caebafea30ed049c57c673d0b36238b1748683be2593965614d7b0e99125c877", size = 241649, upload-time = "2025-08-11T12:06:15.204Z" }, + { url = "https://files.pythonhosted.org/packages/85/2a/f7d743df0019408768af8a70d2037546a2be7b81fbb65f040d76caafd4c5/multidict-6.6.4-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:ad887a8250eb47d3ab083d2f98db7f48098d13d42eb7a3b67d8a5c795f224ace", size = 239238, upload-time = "2025-08-11T12:06:16.467Z" }, + { url = "https://files.pythonhosted.org/packages/cb/b8/4f4bb13323c2d647323f7919201493cf48ebe7ded971717bfb0f1a79b6bf/multidict-6.6.4-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:ed8358ae7d94ffb7c397cecb62cbac9578a83ecefc1eba27b9090ee910e2efb6", size = 233517, upload-time = "2025-08-11T12:06:18.107Z" }, + { url = "https://files.pythonhosted.org/packages/33/29/4293c26029ebfbba4f574febd2ed01b6f619cfa0d2e344217d53eef34192/multidict-6.6.4-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:ecab51ad2462197a4c000b6d5701fc8585b80eecb90583635d7e327b7b6923eb", size = 243122, upload-time = "2025-08-11T12:06:19.361Z" }, + { url = "https://files.pythonhosted.org/packages/20/60/a1c53628168aa22447bfde3a8730096ac28086704a0d8c590f3b63388d0c/multidict-6.6.4-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:c5c97aa666cf70e667dfa5af945424ba1329af5dd988a437efeb3a09430389fb", size = 248992, upload-time = "2025-08-11T12:06:20.661Z" }, + { url = "https://files.pythonhosted.org/packages/a3/3b/55443a0c372f33cae5d9ec37a6a973802884fa0ab3586659b197cf8cc5e9/multidict-6.6.4-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:9a950b7cf54099c1209f455ac5970b1ea81410f2af60ed9eb3c3f14f0bfcf987", size = 243708, upload-time = "2025-08-11T12:06:21.891Z" }, + { url = "https://files.pythonhosted.org/packages/7c/60/a18c6900086769312560b2626b18e8cca22d9e85b1186ba77f4755b11266/multidict-6.6.4-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:163c7ea522ea9365a8a57832dea7618e6cbdc3cd75f8c627663587459a4e328f", size = 237498, upload-time = "2025-08-11T12:06:23.206Z" }, + { url = "https://files.pythonhosted.org/packages/11/3d/8bdd8bcaff2951ce2affccca107a404925a2beafedd5aef0b5e4a71120a6/multidict-6.6.4-cp310-cp310-win32.whl", hash = "sha256:17d2cbbfa6ff20821396b25890f155f40c986f9cfbce5667759696d83504954f", size = 41415, upload-time = "2025-08-11T12:06:24.77Z" }, + { url = "https://files.pythonhosted.org/packages/c0/53/cab1ad80356a4cd1b685a254b680167059b433b573e53872fab245e9fc95/multidict-6.6.4-cp310-cp310-win_amd64.whl", hash = "sha256:ce9a40fbe52e57e7edf20113a4eaddfacac0561a0879734e636aa6d4bb5e3fb0", size = 46046, upload-time = "2025-08-11T12:06:25.893Z" }, + { url = "https://files.pythonhosted.org/packages/cf/9a/874212b6f5c1c2d870d0a7adc5bb4cfe9b0624fa15cdf5cf757c0f5087ae/multidict-6.6.4-cp310-cp310-win_arm64.whl", hash = "sha256:01d0959807a451fe9fdd4da3e139cb5b77f7328baf2140feeaf233e1d777b729", size = 43147, upload-time = "2025-08-11T12:06:27.534Z" }, + { url = "https://files.pythonhosted.org/packages/6b/7f/90a7f01e2d005d6653c689039977f6856718c75c5579445effb7e60923d1/multidict-6.6.4-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:c7a0e9b561e6460484318a7612e725df1145d46b0ef57c6b9866441bf6e27e0c", size = 76472, upload-time = "2025-08-11T12:06:29.006Z" }, + { url = "https://files.pythonhosted.org/packages/54/a3/bed07bc9e2bb302ce752f1dabc69e884cd6a676da44fb0e501b246031fdd/multidict-6.6.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6bf2f10f70acc7a2446965ffbc726e5fc0b272c97a90b485857e5c70022213eb", size = 44634, upload-time = "2025-08-11T12:06:30.374Z" }, + { url = "https://files.pythonhosted.org/packages/a7/4b/ceeb4f8f33cf81277da464307afeaf164fb0297947642585884f5cad4f28/multidict-6.6.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:66247d72ed62d5dd29752ffc1d3b88f135c6a8de8b5f63b7c14e973ef5bda19e", size = 44282, upload-time = "2025-08-11T12:06:31.958Z" }, + { url = "https://files.pythonhosted.org/packages/03/35/436a5da8702b06866189b69f655ffdb8f70796252a8772a77815f1812679/multidict-6.6.4-cp311-cp311-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:105245cc6b76f51e408451a844a54e6823bbd5a490ebfe5bdfc79798511ceded", size = 229696, upload-time = "2025-08-11T12:06:33.087Z" }, + { url = "https://files.pythonhosted.org/packages/b6/0e/915160be8fecf1fca35f790c08fb74ca684d752fcba62c11daaf3d92c216/multidict-6.6.4-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:cbbc54e58b34c3bae389ef00046be0961f30fef7cb0dd9c7756aee376a4f7683", size = 246665, upload-time = "2025-08-11T12:06:34.448Z" }, + { url = "https://files.pythonhosted.org/packages/08/ee/2f464330acd83f77dcc346f0b1a0eaae10230291450887f96b204b8ac4d3/multidict-6.6.4-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:56c6b3652f945c9bc3ac6c8178cd93132b8d82dd581fcbc3a00676c51302bc1a", size = 225485, upload-time = "2025-08-11T12:06:35.672Z" }, + { url = "https://files.pythonhosted.org/packages/71/cc/9a117f828b4d7fbaec6adeed2204f211e9caf0a012692a1ee32169f846ae/multidict-6.6.4-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:b95494daf857602eccf4c18ca33337dd2be705bccdb6dddbfc9d513e6addb9d9", size = 257318, upload-time = "2025-08-11T12:06:36.98Z" }, + { url = "https://files.pythonhosted.org/packages/25/77/62752d3dbd70e27fdd68e86626c1ae6bccfebe2bb1f84ae226363e112f5a/multidict-6.6.4-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:e5b1413361cef15340ab9dc61523e653d25723e82d488ef7d60a12878227ed50", size = 254689, upload-time = "2025-08-11T12:06:38.233Z" }, + { url = "https://files.pythonhosted.org/packages/00/6e/fac58b1072a6fc59af5e7acb245e8754d3e1f97f4f808a6559951f72a0d4/multidict-6.6.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e167bf899c3d724f9662ef00b4f7fef87a19c22b2fead198a6f68b263618df52", size = 246709, upload-time = "2025-08-11T12:06:39.517Z" }, + { url = "https://files.pythonhosted.org/packages/01/ef/4698d6842ef5e797c6db7744b0081e36fb5de3d00002cc4c58071097fac3/multidict-6.6.4-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:aaea28ba20a9026dfa77f4b80369e51cb767c61e33a2d4043399c67bd95fb7c6", size = 243185, upload-time = "2025-08-11T12:06:40.796Z" }, + { url = "https://files.pythonhosted.org/packages/aa/c9/d82e95ae1d6e4ef396934e9b0e942dfc428775f9554acf04393cce66b157/multidict-6.6.4-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:8c91cdb30809a96d9ecf442ec9bc45e8cfaa0f7f8bdf534e082c2443a196727e", size = 237838, upload-time = "2025-08-11T12:06:42.595Z" }, + { url = "https://files.pythonhosted.org/packages/57/cf/f94af5c36baaa75d44fab9f02e2a6bcfa0cd90acb44d4976a80960759dbc/multidict-6.6.4-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:1a0ccbfe93ca114c5d65a2471d52d8829e56d467c97b0e341cf5ee45410033b3", size = 246368, upload-time = "2025-08-11T12:06:44.304Z" }, + { url = "https://files.pythonhosted.org/packages/4a/fe/29f23460c3d995f6a4b678cb2e9730e7277231b981f0b234702f0177818a/multidict-6.6.4-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:55624b3f321d84c403cb7d8e6e982f41ae233d85f85db54ba6286f7295dc8a9c", size = 253339, upload-time = "2025-08-11T12:06:45.597Z" }, + { url = "https://files.pythonhosted.org/packages/29/b6/fd59449204426187b82bf8a75f629310f68c6adc9559dc922d5abe34797b/multidict-6.6.4-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:4a1fb393a2c9d202cb766c76208bd7945bc194eba8ac920ce98c6e458f0b524b", size = 246933, upload-time = "2025-08-11T12:06:46.841Z" }, + { url = "https://files.pythonhosted.org/packages/19/52/d5d6b344f176a5ac3606f7a61fb44dc746e04550e1a13834dff722b8d7d6/multidict-6.6.4-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:43868297a5759a845fa3a483fb4392973a95fb1de891605a3728130c52b8f40f", size = 242225, upload-time = "2025-08-11T12:06:48.588Z" }, + { url = "https://files.pythonhosted.org/packages/ec/d3/5b2281ed89ff4d5318d82478a2a2450fcdfc3300da48ff15c1778280ad26/multidict-6.6.4-cp311-cp311-win32.whl", hash = "sha256:ed3b94c5e362a8a84d69642dbeac615452e8af9b8eb825b7bc9f31a53a1051e2", size = 41306, upload-time = "2025-08-11T12:06:49.95Z" }, + { url = "https://files.pythonhosted.org/packages/74/7d/36b045c23a1ab98507aefd44fd8b264ee1dd5e5010543c6fccf82141ccef/multidict-6.6.4-cp311-cp311-win_amd64.whl", hash = "sha256:d8c112f7a90d8ca5d20213aa41eac690bb50a76da153e3afb3886418e61cb22e", size = 46029, upload-time = "2025-08-11T12:06:51.082Z" }, + { url = "https://files.pythonhosted.org/packages/0f/5e/553d67d24432c5cd52b49047f2d248821843743ee6d29a704594f656d182/multidict-6.6.4-cp311-cp311-win_arm64.whl", hash = "sha256:3bb0eae408fa1996d87247ca0d6a57b7fc1dcf83e8a5c47ab82c558c250d4adf", size = 43017, upload-time = "2025-08-11T12:06:52.243Z" }, + { url = "https://files.pythonhosted.org/packages/05/f6/512ffd8fd8b37fb2680e5ac35d788f1d71bbaf37789d21a820bdc441e565/multidict-6.6.4-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:0ffb87be160942d56d7b87b0fdf098e81ed565add09eaa1294268c7f3caac4c8", size = 76516, upload-time = "2025-08-11T12:06:53.393Z" }, + { url = "https://files.pythonhosted.org/packages/99/58/45c3e75deb8855c36bd66cc1658007589662ba584dbf423d01df478dd1c5/multidict-6.6.4-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d191de6cbab2aff5de6c5723101705fd044b3e4c7cfd587a1929b5028b9714b3", size = 45394, upload-time = "2025-08-11T12:06:54.555Z" }, + { url = "https://files.pythonhosted.org/packages/fd/ca/e8c4472a93a26e4507c0b8e1f0762c0d8a32de1328ef72fd704ef9cc5447/multidict-6.6.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:38a0956dd92d918ad5feff3db8fcb4a5eb7dba114da917e1a88475619781b57b", size = 43591, upload-time = "2025-08-11T12:06:55.672Z" }, + { url = "https://files.pythonhosted.org/packages/05/51/edf414f4df058574a7265034d04c935aa84a89e79ce90fcf4df211f47b16/multidict-6.6.4-cp312-cp312-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:6865f6d3b7900ae020b495d599fcf3765653bc927951c1abb959017f81ae8287", size = 237215, upload-time = "2025-08-11T12:06:57.213Z" }, + { url = "https://files.pythonhosted.org/packages/c8/45/8b3d6dbad8cf3252553cc41abea09ad527b33ce47a5e199072620b296902/multidict-6.6.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0a2088c126b6f72db6c9212ad827d0ba088c01d951cee25e758c450da732c138", size = 258299, upload-time = "2025-08-11T12:06:58.946Z" }, + { url = "https://files.pythonhosted.org/packages/3c/e8/8ca2e9a9f5a435fc6db40438a55730a4bf4956b554e487fa1b9ae920f825/multidict-6.6.4-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:0f37bed7319b848097085d7d48116f545985db988e2256b2e6f00563a3416ee6", size = 242357, upload-time = "2025-08-11T12:07:00.301Z" }, + { url = "https://files.pythonhosted.org/packages/0f/84/80c77c99df05a75c28490b2af8f7cba2a12621186e0a8b0865d8e745c104/multidict-6.6.4-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:01368e3c94032ba6ca0b78e7ccb099643466cf24f8dc8eefcfdc0571d56e58f9", size = 268369, upload-time = "2025-08-11T12:07:01.638Z" }, + { url = "https://files.pythonhosted.org/packages/0d/e9/920bfa46c27b05fb3e1ad85121fd49f441492dca2449c5bcfe42e4565d8a/multidict-6.6.4-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:8fe323540c255db0bffee79ad7f048c909f2ab0edb87a597e1c17da6a54e493c", size = 269341, upload-time = "2025-08-11T12:07:02.943Z" }, + { url = "https://files.pythonhosted.org/packages/af/65/753a2d8b05daf496f4a9c367fe844e90a1b2cac78e2be2c844200d10cc4c/multidict-6.6.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b8eb3025f17b0a4c3cd08cda49acf312a19ad6e8a4edd9dbd591e6506d999402", size = 256100, upload-time = "2025-08-11T12:07:04.564Z" }, + { url = "https://files.pythonhosted.org/packages/09/54/655be13ae324212bf0bc15d665a4e34844f34c206f78801be42f7a0a8aaa/multidict-6.6.4-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:bbc14f0365534d35a06970d6a83478b249752e922d662dc24d489af1aa0d1be7", size = 253584, upload-time = "2025-08-11T12:07:05.914Z" }, + { url = "https://files.pythonhosted.org/packages/5c/74/ab2039ecc05264b5cec73eb018ce417af3ebb384ae9c0e9ed42cb33f8151/multidict-6.6.4-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:75aa52fba2d96bf972e85451b99d8e19cc37ce26fd016f6d4aa60da9ab2b005f", size = 251018, upload-time = "2025-08-11T12:07:08.301Z" }, + { url = "https://files.pythonhosted.org/packages/af/0a/ccbb244ac848e56c6427f2392741c06302bbfba49c0042f1eb3c5b606497/multidict-6.6.4-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:4fefd4a815e362d4f011919d97d7b4a1e566f1dde83dc4ad8cfb5b41de1df68d", size = 251477, upload-time = "2025-08-11T12:07:10.248Z" }, + { url = "https://files.pythonhosted.org/packages/0e/b0/0ed49bba775b135937f52fe13922bc64a7eaf0a3ead84a36e8e4e446e096/multidict-6.6.4-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:db9801fe021f59a5b375ab778973127ca0ac52429a26e2fd86aa9508f4d26eb7", size = 263575, upload-time = "2025-08-11T12:07:11.928Z" }, + { url = "https://files.pythonhosted.org/packages/3e/d9/7fb85a85e14de2e44dfb6a24f03c41e2af8697a6df83daddb0e9b7569f73/multidict-6.6.4-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:a650629970fa21ac1fb06ba25dabfc5b8a2054fcbf6ae97c758aa956b8dba802", size = 259649, upload-time = "2025-08-11T12:07:13.244Z" }, + { url = "https://files.pythonhosted.org/packages/03/9e/b3a459bcf9b6e74fa461a5222a10ff9b544cb1cd52fd482fb1b75ecda2a2/multidict-6.6.4-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:452ff5da78d4720d7516a3a2abd804957532dd69296cb77319c193e3ffb87e24", size = 251505, upload-time = "2025-08-11T12:07:14.57Z" }, + { url = "https://files.pythonhosted.org/packages/86/a2/8022f78f041dfe6d71e364001a5cf987c30edfc83c8a5fb7a3f0974cff39/multidict-6.6.4-cp312-cp312-win32.whl", hash = "sha256:8c2fcb12136530ed19572bbba61b407f655e3953ba669b96a35036a11a485793", size = 41888, upload-time = "2025-08-11T12:07:15.904Z" }, + { url = "https://files.pythonhosted.org/packages/c7/eb/d88b1780d43a56db2cba24289fa744a9d216c1a8546a0dc3956563fd53ea/multidict-6.6.4-cp312-cp312-win_amd64.whl", hash = "sha256:047d9425860a8c9544fed1b9584f0c8bcd31bcde9568b047c5e567a1025ecd6e", size = 46072, upload-time = "2025-08-11T12:07:17.045Z" }, + { url = "https://files.pythonhosted.org/packages/9f/16/b929320bf5750e2d9d4931835a4c638a19d2494a5b519caaaa7492ebe105/multidict-6.6.4-cp312-cp312-win_arm64.whl", hash = "sha256:14754eb72feaa1e8ae528468f24250dd997b8e2188c3d2f593f9eba259e4b364", size = 43222, upload-time = "2025-08-11T12:07:18.328Z" }, + { url = "https://files.pythonhosted.org/packages/3a/5d/e1db626f64f60008320aab00fbe4f23fc3300d75892a3381275b3d284580/multidict-6.6.4-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:f46a6e8597f9bd71b31cc708195d42b634c8527fecbcf93febf1052cacc1f16e", size = 75848, upload-time = "2025-08-11T12:07:19.912Z" }, + { url = "https://files.pythonhosted.org/packages/4c/aa/8b6f548d839b6c13887253af4e29c939af22a18591bfb5d0ee6f1931dae8/multidict-6.6.4-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:22e38b2bc176c5eb9c0a0e379f9d188ae4cd8b28c0f53b52bce7ab0a9e534657", size = 45060, upload-time = "2025-08-11T12:07:21.163Z" }, + { url = "https://files.pythonhosted.org/packages/eb/c6/f5e97e5d99a729bc2aa58eb3ebfa9f1e56a9b517cc38c60537c81834a73f/multidict-6.6.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5df8afd26f162da59e218ac0eefaa01b01b2e6cd606cffa46608f699539246da", size = 43269, upload-time = "2025-08-11T12:07:22.392Z" }, + { url = "https://files.pythonhosted.org/packages/dc/31/d54eb0c62516776f36fe67f84a732f97e0b0e12f98d5685bebcc6d396910/multidict-6.6.4-cp313-cp313-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:49517449b58d043023720aa58e62b2f74ce9b28f740a0b5d33971149553d72aa", size = 237158, upload-time = "2025-08-11T12:07:23.636Z" }, + { url = "https://files.pythonhosted.org/packages/c4/1c/8a10c1c25b23156e63b12165a929d8eb49a6ed769fdbefb06e6f07c1e50d/multidict-6.6.4-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ae9408439537c5afdca05edd128a63f56a62680f4b3c234301055d7a2000220f", size = 257076, upload-time = "2025-08-11T12:07:25.049Z" }, + { url = "https://files.pythonhosted.org/packages/ad/86/90e20b5771d6805a119e483fd3d1e8393e745a11511aebca41f0da38c3e2/multidict-6.6.4-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:87a32d20759dc52a9e850fe1061b6e41ab28e2998d44168a8a341b99ded1dba0", size = 240694, upload-time = "2025-08-11T12:07:26.458Z" }, + { url = "https://files.pythonhosted.org/packages/e7/49/484d3e6b535bc0555b52a0a26ba86e4d8d03fd5587d4936dc59ba7583221/multidict-6.6.4-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:52e3c8d43cdfff587ceedce9deb25e6ae77daba560b626e97a56ddcad3756879", size = 266350, upload-time = "2025-08-11T12:07:27.94Z" }, + { url = "https://files.pythonhosted.org/packages/bf/b4/aa4c5c379b11895083d50021e229e90c408d7d875471cb3abf721e4670d6/multidict-6.6.4-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:ad8850921d3a8d8ff6fbef790e773cecfc260bbfa0566998980d3fa8f520bc4a", size = 267250, upload-time = "2025-08-11T12:07:29.303Z" }, + { url = "https://files.pythonhosted.org/packages/80/e5/5e22c5bf96a64bdd43518b1834c6d95a4922cc2066b7d8e467dae9b6cee6/multidict-6.6.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:497a2954adc25c08daff36f795077f63ad33e13f19bfff7736e72c785391534f", size = 254900, upload-time = "2025-08-11T12:07:30.764Z" }, + { url = "https://files.pythonhosted.org/packages/17/38/58b27fed927c07035abc02befacab42491e7388ca105e087e6e0215ead64/multidict-6.6.4-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:024ce601f92d780ca1617ad4be5ac15b501cc2414970ffa2bb2bbc2bd5a68fa5", size = 252355, upload-time = "2025-08-11T12:07:32.205Z" }, + { url = "https://files.pythonhosted.org/packages/d0/a1/dad75d23a90c29c02b5d6f3d7c10ab36c3197613be5d07ec49c7791e186c/multidict-6.6.4-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:a693fc5ed9bdd1c9e898013e0da4dcc640de7963a371c0bd458e50e046bf6438", size = 250061, upload-time = "2025-08-11T12:07:33.623Z" }, + { url = "https://files.pythonhosted.org/packages/b8/1a/ac2216b61c7f116edab6dc3378cca6c70dc019c9a457ff0d754067c58b20/multidict-6.6.4-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:190766dac95aab54cae5b152a56520fd99298f32a1266d66d27fdd1b5ac00f4e", size = 249675, upload-time = "2025-08-11T12:07:34.958Z" }, + { url = "https://files.pythonhosted.org/packages/d4/79/1916af833b800d13883e452e8e0977c065c4ee3ab7a26941fbfdebc11895/multidict-6.6.4-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:34d8f2a5ffdceab9dcd97c7a016deb2308531d5f0fced2bb0c9e1df45b3363d7", size = 261247, upload-time = "2025-08-11T12:07:36.588Z" }, + { url = "https://files.pythonhosted.org/packages/c5/65/d1f84fe08ac44a5fc7391cbc20a7cedc433ea616b266284413fd86062f8c/multidict-6.6.4-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:59e8d40ab1f5a8597abcef00d04845155a5693b5da00d2c93dbe88f2050f2812", size = 257960, upload-time = "2025-08-11T12:07:39.735Z" }, + { url = "https://files.pythonhosted.org/packages/13/b5/29ec78057d377b195ac2c5248c773703a6b602e132a763e20ec0457e7440/multidict-6.6.4-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:467fe64138cfac771f0e949b938c2e1ada2b5af22f39692aa9258715e9ea613a", size = 250078, upload-time = "2025-08-11T12:07:41.525Z" }, + { url = "https://files.pythonhosted.org/packages/c4/0e/7e79d38f70a872cae32e29b0d77024bef7834b0afb406ddae6558d9e2414/multidict-6.6.4-cp313-cp313-win32.whl", hash = "sha256:14616a30fe6d0a48d0a48d1a633ab3b8bec4cf293aac65f32ed116f620adfd69", size = 41708, upload-time = "2025-08-11T12:07:43.405Z" }, + { url = "https://files.pythonhosted.org/packages/9d/34/746696dffff742e97cd6a23da953e55d0ea51fa601fa2ff387b3edcfaa2c/multidict-6.6.4-cp313-cp313-win_amd64.whl", hash = "sha256:40cd05eaeb39e2bc8939451f033e57feaa2ac99e07dbca8afe2be450a4a3b6cf", size = 45912, upload-time = "2025-08-11T12:07:45.082Z" }, + { url = "https://files.pythonhosted.org/packages/c7/87/3bac136181e271e29170d8d71929cdeddeb77f3e8b6a0c08da3a8e9da114/multidict-6.6.4-cp313-cp313-win_arm64.whl", hash = "sha256:f6eb37d511bfae9e13e82cb4d1af36b91150466f24d9b2b8a9785816deb16605", size = 43076, upload-time = "2025-08-11T12:07:46.746Z" }, + { url = "https://files.pythonhosted.org/packages/64/94/0a8e63e36c049b571c9ae41ee301ada29c3fee9643d9c2548d7d558a1d99/multidict-6.6.4-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:6c84378acd4f37d1b507dfa0d459b449e2321b3ba5f2338f9b085cf7a7ba95eb", size = 82812, upload-time = "2025-08-11T12:07:48.402Z" }, + { url = "https://files.pythonhosted.org/packages/25/1a/be8e369dfcd260d2070a67e65dd3990dd635cbd735b98da31e00ea84cd4e/multidict-6.6.4-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:0e0558693063c75f3d952abf645c78f3c5dfdd825a41d8c4d8156fc0b0da6e7e", size = 48313, upload-time = "2025-08-11T12:07:49.679Z" }, + { url = "https://files.pythonhosted.org/packages/26/5a/dd4ade298674b2f9a7b06a32c94ffbc0497354df8285f27317c66433ce3b/multidict-6.6.4-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:3f8e2384cb83ebd23fd07e9eada8ba64afc4c759cd94817433ab8c81ee4b403f", size = 46777, upload-time = "2025-08-11T12:07:51.318Z" }, + { url = "https://files.pythonhosted.org/packages/89/db/98aa28bc7e071bfba611ac2ae803c24e96dd3a452b4118c587d3d872c64c/multidict-6.6.4-cp313-cp313t-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:f996b87b420995a9174b2a7c1a8daf7db4750be6848b03eb5e639674f7963773", size = 229321, upload-time = "2025-08-11T12:07:52.965Z" }, + { url = "https://files.pythonhosted.org/packages/c7/bc/01ddda2a73dd9d167bd85d0e8ef4293836a8f82b786c63fb1a429bc3e678/multidict-6.6.4-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:cc356250cffd6e78416cf5b40dc6a74f1edf3be8e834cf8862d9ed5265cf9b0e", size = 249954, upload-time = "2025-08-11T12:07:54.423Z" }, + { url = "https://files.pythonhosted.org/packages/06/78/6b7c0f020f9aa0acf66d0ab4eb9f08375bac9a50ff5e3edb1c4ccd59eafc/multidict-6.6.4-cp313-cp313t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:dadf95aa862714ea468a49ad1e09fe00fcc9ec67d122f6596a8d40caf6cec7d0", size = 228612, upload-time = "2025-08-11T12:07:55.914Z" }, + { url = "https://files.pythonhosted.org/packages/00/44/3faa416f89b2d5d76e9d447296a81521e1c832ad6e40b92f990697b43192/multidict-6.6.4-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:7dd57515bebffd8ebd714d101d4c434063322e4fe24042e90ced41f18b6d3395", size = 257528, upload-time = "2025-08-11T12:07:57.371Z" }, + { url = "https://files.pythonhosted.org/packages/05/5f/77c03b89af0fcb16f018f668207768191fb9dcfb5e3361a5e706a11db2c9/multidict-6.6.4-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:967af5f238ebc2eb1da4e77af5492219fbd9b4b812347da39a7b5f5c72c0fa45", size = 256329, upload-time = "2025-08-11T12:07:58.844Z" }, + { url = "https://files.pythonhosted.org/packages/cf/e9/ed750a2a9afb4f8dc6f13dc5b67b514832101b95714f1211cd42e0aafc26/multidict-6.6.4-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2a4c6875c37aae9794308ec43e3530e4aa0d36579ce38d89979bbf89582002bb", size = 247928, upload-time = "2025-08-11T12:08:01.037Z" }, + { url = "https://files.pythonhosted.org/packages/1f/b5/e0571bc13cda277db7e6e8a532791d4403dacc9850006cb66d2556e649c0/multidict-6.6.4-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:7f683a551e92bdb7fac545b9c6f9fa2aebdeefa61d607510b3533286fcab67f5", size = 245228, upload-time = "2025-08-11T12:08:02.96Z" }, + { url = "https://files.pythonhosted.org/packages/f3/a3/69a84b0eccb9824491f06368f5b86e72e4af54c3067c37c39099b6687109/multidict-6.6.4-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:3ba5aaf600edaf2a868a391779f7a85d93bed147854925f34edd24cc70a3e141", size = 235869, upload-time = "2025-08-11T12:08:04.746Z" }, + { url = "https://files.pythonhosted.org/packages/a9/9d/28802e8f9121a6a0804fa009debf4e753d0a59969ea9f70be5f5fdfcb18f/multidict-6.6.4-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:580b643b7fd2c295d83cad90d78419081f53fd532d1f1eb67ceb7060f61cff0d", size = 243446, upload-time = "2025-08-11T12:08:06.332Z" }, + { url = "https://files.pythonhosted.org/packages/38/ea/6c98add069b4878c1d66428a5f5149ddb6d32b1f9836a826ac764b9940be/multidict-6.6.4-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:37b7187197da6af3ee0b044dbc9625afd0c885f2800815b228a0e70f9a7f473d", size = 252299, upload-time = "2025-08-11T12:08:07.931Z" }, + { url = "https://files.pythonhosted.org/packages/3a/09/8fe02d204473e14c0af3affd50af9078839dfca1742f025cca765435d6b4/multidict-6.6.4-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:e1b93790ed0bc26feb72e2f08299691ceb6da5e9e14a0d13cc74f1869af327a0", size = 246926, upload-time = "2025-08-11T12:08:09.467Z" }, + { url = "https://files.pythonhosted.org/packages/37/3d/7b1e10d774a6df5175ecd3c92bff069e77bed9ec2a927fdd4ff5fe182f67/multidict-6.6.4-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:a506a77ddee1efcca81ecbeae27ade3e09cdf21a8ae854d766c2bb4f14053f92", size = 243383, upload-time = "2025-08-11T12:08:10.981Z" }, + { url = "https://files.pythonhosted.org/packages/50/b0/a6fae46071b645ae98786ab738447de1ef53742eaad949f27e960864bb49/multidict-6.6.4-cp313-cp313t-win32.whl", hash = "sha256:f93b2b2279883d1d0a9e1bd01f312d6fc315c5e4c1f09e112e4736e2f650bc4e", size = 47775, upload-time = "2025-08-11T12:08:12.439Z" }, + { url = "https://files.pythonhosted.org/packages/b2/0a/2436550b1520091af0600dff547913cb2d66fbac27a8c33bc1b1bccd8d98/multidict-6.6.4-cp313-cp313t-win_amd64.whl", hash = "sha256:6d46a180acdf6e87cc41dc15d8f5c2986e1e8739dc25dbb7dac826731ef381a4", size = 53100, upload-time = "2025-08-11T12:08:13.823Z" }, + { url = "https://files.pythonhosted.org/packages/97/ea/43ac51faff934086db9c072a94d327d71b7d8b40cd5dcb47311330929ef0/multidict-6.6.4-cp313-cp313t-win_arm64.whl", hash = "sha256:756989334015e3335d087a27331659820d53ba432befdef6a718398b0a8493ad", size = 45501, upload-time = "2025-08-11T12:08:15.173Z" }, + { url = "https://files.pythonhosted.org/packages/d4/d3/f04c5db316caee9b5b2cbba66270b358c922a959855995bedde87134287c/multidict-6.6.4-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:af7618b591bae552b40dbb6f93f5518328a949dac626ee75927bba1ecdeea9f4", size = 76977, upload-time = "2025-08-11T12:08:16.667Z" }, + { url = "https://files.pythonhosted.org/packages/70/39/a6200417d883e510728ab3caec02d3b66ff09e1c85e0aab2ba311abfdf06/multidict-6.6.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b6819f83aef06f560cb15482d619d0e623ce9bf155115150a85ab11b8342a665", size = 44878, upload-time = "2025-08-11T12:08:18.157Z" }, + { url = "https://files.pythonhosted.org/packages/6f/7e/815be31ed35571b137d65232816f61513fcd97b2717d6a9d7800b5a0c6e0/multidict-6.6.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4d09384e75788861e046330308e7af54dd306aaf20eb760eb1d0de26b2bea2cb", size = 44546, upload-time = "2025-08-11T12:08:19.694Z" }, + { url = "https://files.pythonhosted.org/packages/e2/f1/21b5bff6a8c3e2aff56956c241941ace6b8820e1abe6b12d3c52868a773d/multidict-6.6.4-cp39-cp39-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:a59c63061f1a07b861c004e53869eb1211ffd1a4acbca330e3322efa6dd02978", size = 223020, upload-time = "2025-08-11T12:08:21.554Z" }, + { url = "https://files.pythonhosted.org/packages/15/59/37083f1dd3439979a0ffeb1906818d978d88b4cc7f4600a9f89b1cb6713c/multidict-6.6.4-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:350f6b0fe1ced61e778037fdc7613f4051c8baf64b1ee19371b42a3acdb016a0", size = 240528, upload-time = "2025-08-11T12:08:23.45Z" }, + { url = "https://files.pythonhosted.org/packages/d1/f0/f054d123c87784307a27324c829eb55bcfd2e261eb785fcabbd832c8dc4a/multidict-6.6.4-cp39-cp39-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:0c5cbac6b55ad69cb6aa17ee9343dfbba903118fd530348c330211dc7aa756d1", size = 219540, upload-time = "2025-08-11T12:08:24.965Z" }, + { url = "https://files.pythonhosted.org/packages/e8/26/8f78ce17b7118149c17f238f28fba2a850b660b860f9b024a34d0191030f/multidict-6.6.4-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:630f70c32b8066ddfd920350bc236225814ad94dfa493fe1910ee17fe4365cbb", size = 251182, upload-time = "2025-08-11T12:08:26.511Z" }, + { url = "https://files.pythonhosted.org/packages/00/c3/a21466322d69f6594fe22d9379200f99194d21c12a5bbf8c2a39a46b83b6/multidict-6.6.4-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f8d4916a81697faec6cb724a273bd5457e4c6c43d82b29f9dc02c5542fd21fc9", size = 249371, upload-time = "2025-08-11T12:08:28.075Z" }, + { url = "https://files.pythonhosted.org/packages/c2/8e/2e673124eb05cf8dc82e9265eccde01a36bcbd3193e27799b8377123c976/multidict-6.6.4-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8e42332cf8276bb7645d310cdecca93a16920256a5b01bebf747365f86a1675b", size = 239235, upload-time = "2025-08-11T12:08:29.937Z" }, + { url = "https://files.pythonhosted.org/packages/2b/2d/bdd9f05e7c89e30a4b0e4faf0681a30748f8d1310f68cfdc0e3571e75bd5/multidict-6.6.4-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:f3be27440f7644ab9a13a6fc86f09cdd90b347c3c5e30c6d6d860de822d7cb53", size = 237410, upload-time = "2025-08-11T12:08:31.872Z" }, + { url = "https://files.pythonhosted.org/packages/46/4c/3237b83f8ca9a2673bb08fc340c15da005a80f5cc49748b587c8ae83823b/multidict-6.6.4-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:21f216669109e02ef3e2415ede07f4f8987f00de8cdfa0cc0b3440d42534f9f0", size = 232979, upload-time = "2025-08-11T12:08:33.399Z" }, + { url = "https://files.pythonhosted.org/packages/55/a6/a765decff625ae9bc581aed303cd1837955177dafc558859a69f56f56ba8/multidict-6.6.4-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:d9890d68c45d1aeac5178ded1d1cccf3bc8d7accf1f976f79bf63099fb16e4bd", size = 240979, upload-time = "2025-08-11T12:08:35.02Z" }, + { url = "https://files.pythonhosted.org/packages/6b/2d/9c75975cb0c66ea33cae1443bb265b2b3cd689bffcbc68872565f401da23/multidict-6.6.4-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:edfdcae97cdc5d1a89477c436b61f472c4d40971774ac4729c613b4b133163cb", size = 246849, upload-time = "2025-08-11T12:08:37.038Z" }, + { url = "https://files.pythonhosted.org/packages/3e/71/d21ac0843c1d8751fb5dcf8a1f436625d39d4577bc27829799d09b419af7/multidict-6.6.4-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:0b2e886624be5773e69cf32bcb8534aecdeb38943520b240fed3d5596a430f2f", size = 241798, upload-time = "2025-08-11T12:08:38.669Z" }, + { url = "https://files.pythonhosted.org/packages/94/3d/1d8911e53092837bd11b1c99d71de3e2a9a26f8911f864554677663242aa/multidict-6.6.4-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:be5bf4b3224948032a845d12ab0f69f208293742df96dc14c4ff9b09e508fc17", size = 235315, upload-time = "2025-08-11T12:08:40.266Z" }, + { url = "https://files.pythonhosted.org/packages/86/c5/4b758df96376f73e936b1942c6c2dfc17e37ed9d5ff3b01a811496966ca0/multidict-6.6.4-cp39-cp39-win32.whl", hash = "sha256:10a68a9191f284fe9d501fef4efe93226e74df92ce7a24e301371293bd4918ae", size = 41434, upload-time = "2025-08-11T12:08:41.965Z" }, + { url = "https://files.pythonhosted.org/packages/58/16/f1dfa2a0f25f2717a5e9e5fe8fd30613f7fe95e3530cec8d11f5de0b709c/multidict-6.6.4-cp39-cp39-win_amd64.whl", hash = "sha256:ee25f82f53262f9ac93bd7e58e47ea1bdcc3393cef815847e397cba17e284210", size = 46186, upload-time = "2025-08-11T12:08:43.367Z" }, + { url = "https://files.pythonhosted.org/packages/88/7d/a0568bac65438c494cb6950b29f394d875a796a237536ac724879cf710c9/multidict-6.6.4-cp39-cp39-win_arm64.whl", hash = "sha256:f9867e55590e0855bcec60d4f9a092b69476db64573c9fe17e92b0c50614c16a", size = 43115, upload-time = "2025-08-11T12:08:45.126Z" }, + { url = "https://files.pythonhosted.org/packages/fd/69/b547032297c7e63ba2af494edba695d781af8a0c6e89e4d06cf848b21d80/multidict-6.6.4-py3-none-any.whl", hash = "sha256:27d8f8e125c07cb954e54d75d04905a9bba8a439c1d84aca94949d4d03d8601c", size = 12313, upload-time = "2025-08-11T12:08:46.891Z" }, ] [[package]] name = "mypy" -version = "1.15.0" +version = "1.17.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "mypy-extensions" }, + { name = "pathspec" }, { name = "tomli", marker = "python_full_version < '3.11'" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/ce/43/d5e49a86afa64bd3839ea0d5b9c7103487007d728e1293f52525d6d5486a/mypy-1.15.0.tar.gz", hash = "sha256:404534629d51d3efea5c800ee7c42b72a6554d6c400e6a79eafe15d11341fd43", size = 3239717, upload-time = "2025-02-05T03:50:34.655Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/68/f8/65a7ce8d0e09b6329ad0c8d40330d100ea343bd4dd04c4f8ae26462d0a17/mypy-1.15.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:979e4e1a006511dacf628e36fadfecbcc0160a8af6ca7dad2f5025529e082c13", size = 10738433, upload-time = "2025-02-05T03:49:29.145Z" }, - { url = "https://files.pythonhosted.org/packages/b4/95/9c0ecb8eacfe048583706249439ff52105b3f552ea9c4024166c03224270/mypy-1.15.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c4bb0e1bd29f7d34efcccd71cf733580191e9a264a2202b0239da95984c5b559", size = 9861472, upload-time = "2025-02-05T03:49:16.986Z" }, - { url = "https://files.pythonhosted.org/packages/84/09/9ec95e982e282e20c0d5407bc65031dfd0f0f8ecc66b69538296e06fcbee/mypy-1.15.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:be68172e9fd9ad8fb876c6389f16d1c1b5f100ffa779f77b1fb2176fcc9ab95b", size = 11611424, upload-time = "2025-02-05T03:49:46.908Z" }, - { url = "https://files.pythonhosted.org/packages/78/13/f7d14e55865036a1e6a0a69580c240f43bc1f37407fe9235c0d4ef25ffb0/mypy-1.15.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c7be1e46525adfa0d97681432ee9fcd61a3964c2446795714699a998d193f1a3", size = 12365450, upload-time = "2025-02-05T03:50:05.89Z" }, - { url = "https://files.pythonhosted.org/packages/48/e1/301a73852d40c241e915ac6d7bcd7fedd47d519246db2d7b86b9d7e7a0cb/mypy-1.15.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:2e2c2e6d3593f6451b18588848e66260ff62ccca522dd231cd4dd59b0160668b", size = 12551765, upload-time = "2025-02-05T03:49:33.56Z" }, - { url = "https://files.pythonhosted.org/packages/77/ba/c37bc323ae5fe7f3f15a28e06ab012cd0b7552886118943e90b15af31195/mypy-1.15.0-cp310-cp310-win_amd64.whl", hash = "sha256:6983aae8b2f653e098edb77f893f7b6aca69f6cffb19b2cc7443f23cce5f4828", size = 9274701, upload-time = "2025-02-05T03:49:38.981Z" }, - { url = "https://files.pythonhosted.org/packages/03/bc/f6339726c627bd7ca1ce0fa56c9ae2d0144604a319e0e339bdadafbbb599/mypy-1.15.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2922d42e16d6de288022e5ca321cd0618b238cfc5570e0263e5ba0a77dbef56f", size = 10662338, upload-time = "2025-02-05T03:50:17.287Z" }, - { url = "https://files.pythonhosted.org/packages/e2/90/8dcf506ca1a09b0d17555cc00cd69aee402c203911410136cd716559efe7/mypy-1.15.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2ee2d57e01a7c35de00f4634ba1bbf015185b219e4dc5909e281016df43f5ee5", size = 9787540, upload-time = "2025-02-05T03:49:51.21Z" }, - { url = "https://files.pythonhosted.org/packages/05/05/a10f9479681e5da09ef2f9426f650d7b550d4bafbef683b69aad1ba87457/mypy-1.15.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:973500e0774b85d9689715feeffcc980193086551110fd678ebe1f4342fb7c5e", size = 11538051, upload-time = "2025-02-05T03:50:20.885Z" }, - { url = "https://files.pythonhosted.org/packages/e9/9a/1f7d18b30edd57441a6411fcbc0c6869448d1a4bacbaee60656ac0fc29c8/mypy-1.15.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5a95fb17c13e29d2d5195869262f8125dfdb5c134dc8d9a9d0aecf7525b10c2c", size = 12286751, upload-time = "2025-02-05T03:49:42.408Z" }, - { url = "https://files.pythonhosted.org/packages/72/af/19ff499b6f1dafcaf56f9881f7a965ac2f474f69f6f618b5175b044299f5/mypy-1.15.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:1905f494bfd7d85a23a88c5d97840888a7bd516545fc5aaedff0267e0bb54e2f", size = 12421783, upload-time = "2025-02-05T03:49:07.707Z" }, - { url = "https://files.pythonhosted.org/packages/96/39/11b57431a1f686c1aed54bf794870efe0f6aeca11aca281a0bd87a5ad42c/mypy-1.15.0-cp311-cp311-win_amd64.whl", hash = "sha256:c9817fa23833ff189db061e6d2eff49b2f3b6ed9856b4a0a73046e41932d744f", size = 9265618, upload-time = "2025-02-05T03:49:54.581Z" }, - { url = "https://files.pythonhosted.org/packages/98/3a/03c74331c5eb8bd025734e04c9840532226775c47a2c39b56a0c8d4f128d/mypy-1.15.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:aea39e0583d05124836ea645f412e88a5c7d0fd77a6d694b60d9b6b2d9f184fd", size = 10793981, upload-time = "2025-02-05T03:50:28.25Z" }, - { url = "https://files.pythonhosted.org/packages/f0/1a/41759b18f2cfd568848a37c89030aeb03534411eef981df621d8fad08a1d/mypy-1.15.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2f2147ab812b75e5b5499b01ade1f4a81489a147c01585cda36019102538615f", size = 9749175, upload-time = "2025-02-05T03:50:13.411Z" }, - { url = "https://files.pythonhosted.org/packages/12/7e/873481abf1ef112c582db832740f4c11b2bfa510e829d6da29b0ab8c3f9c/mypy-1.15.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ce436f4c6d218a070048ed6a44c0bbb10cd2cc5e272b29e7845f6a2f57ee4464", size = 11455675, upload-time = "2025-02-05T03:50:31.421Z" }, - { url = "https://files.pythonhosted.org/packages/b3/d0/92ae4cde706923a2d3f2d6c39629134063ff64b9dedca9c1388363da072d/mypy-1.15.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8023ff13985661b50a5928fc7a5ca15f3d1affb41e5f0a9952cb68ef090b31ee", size = 12410020, upload-time = "2025-02-05T03:48:48.705Z" }, - { url = "https://files.pythonhosted.org/packages/46/8b/df49974b337cce35f828ba6fda228152d6db45fed4c86ba56ffe442434fd/mypy-1.15.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1124a18bc11a6a62887e3e137f37f53fbae476dc36c185d549d4f837a2a6a14e", size = 12498582, upload-time = "2025-02-05T03:49:03.628Z" }, - { url = "https://files.pythonhosted.org/packages/13/50/da5203fcf6c53044a0b699939f31075c45ae8a4cadf538a9069b165c1050/mypy-1.15.0-cp312-cp312-win_amd64.whl", hash = "sha256:171a9ca9a40cd1843abeca0e405bc1940cd9b305eaeea2dda769ba096932bb22", size = 9366614, upload-time = "2025-02-05T03:50:00.313Z" }, - { url = "https://files.pythonhosted.org/packages/6a/9b/fd2e05d6ffff24d912f150b87db9e364fa8282045c875654ce7e32fffa66/mypy-1.15.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:93faf3fdb04768d44bf28693293f3904bbb555d076b781ad2530214ee53e3445", size = 10788592, upload-time = "2025-02-05T03:48:55.789Z" }, - { url = "https://files.pythonhosted.org/packages/74/37/b246d711c28a03ead1fd906bbc7106659aed7c089d55fe40dd58db812628/mypy-1.15.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:811aeccadfb730024c5d3e326b2fbe9249bb7413553f15499a4050f7c30e801d", size = 9753611, upload-time = "2025-02-05T03:48:44.581Z" }, - { url = "https://files.pythonhosted.org/packages/a6/ac/395808a92e10cfdac8003c3de9a2ab6dc7cde6c0d2a4df3df1b815ffd067/mypy-1.15.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:98b7b9b9aedb65fe628c62a6dc57f6d5088ef2dfca37903a7d9ee374d03acca5", size = 11438443, upload-time = "2025-02-05T03:49:25.514Z" }, - { url = "https://files.pythonhosted.org/packages/d2/8b/801aa06445d2de3895f59e476f38f3f8d610ef5d6908245f07d002676cbf/mypy-1.15.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c43a7682e24b4f576d93072216bf56eeff70d9140241f9edec0c104d0c515036", size = 12402541, upload-time = "2025-02-05T03:49:57.623Z" }, - { url = "https://files.pythonhosted.org/packages/c7/67/5a4268782eb77344cc613a4cf23540928e41f018a9a1ec4c6882baf20ab8/mypy-1.15.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:baefc32840a9f00babd83251560e0ae1573e2f9d1b067719479bfb0e987c6357", size = 12494348, upload-time = "2025-02-05T03:48:52.361Z" }, - { url = "https://files.pythonhosted.org/packages/83/3e/57bb447f7bbbfaabf1712d96f9df142624a386d98fb026a761532526057e/mypy-1.15.0-cp313-cp313-win_amd64.whl", hash = "sha256:b9378e2c00146c44793c98b8d5a61039a048e31f429fb0eb546d93f4b000bedf", size = 9373648, upload-time = "2025-02-05T03:49:11.395Z" }, - { url = "https://files.pythonhosted.org/packages/5a/fa/79cf41a55b682794abe71372151dbbf856e3008f6767057229e6649d294a/mypy-1.15.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:e601a7fa172c2131bff456bb3ee08a88360760d0d2f8cbd7a75a65497e2df078", size = 10737129, upload-time = "2025-02-05T03:50:24.509Z" }, - { url = "https://files.pythonhosted.org/packages/d3/33/dd8feb2597d648de29e3da0a8bf4e1afbda472964d2a4a0052203a6f3594/mypy-1.15.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:712e962a6357634fef20412699a3655c610110e01cdaa6180acec7fc9f8513ba", size = 9856335, upload-time = "2025-02-05T03:49:36.398Z" }, - { url = "https://files.pythonhosted.org/packages/e4/b5/74508959c1b06b96674b364ffeb7ae5802646b32929b7701fc6b18447592/mypy-1.15.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f95579473af29ab73a10bada2f9722856792a36ec5af5399b653aa28360290a5", size = 11611935, upload-time = "2025-02-05T03:49:14.154Z" }, - { url = "https://files.pythonhosted.org/packages/6c/53/da61b9d9973efcd6507183fdad96606996191657fe79701b2c818714d573/mypy-1.15.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8f8722560a14cde92fdb1e31597760dc35f9f5524cce17836c0d22841830fd5b", size = 12365827, upload-time = "2025-02-05T03:48:59.458Z" }, - { url = "https://files.pythonhosted.org/packages/c1/72/965bd9ee89540c79a25778cc080c7e6ef40aa1eeac4d52cec7eae6eb5228/mypy-1.15.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:1fbb8da62dc352133d7d7ca90ed2fb0e9d42bb1a32724c287d3c76c58cbaa9c2", size = 12541924, upload-time = "2025-02-05T03:50:03.12Z" }, - { url = "https://files.pythonhosted.org/packages/46/d0/f41645c2eb263e6c77ada7d76f894c580c9ddb20d77f0c24d34273a4dab2/mypy-1.15.0-cp39-cp39-win_amd64.whl", hash = "sha256:d10d994b41fb3497719bbf866f227b3489048ea4bbbb5015357db306249f7980", size = 9271176, upload-time = "2025-02-05T03:50:10.86Z" }, - { url = "https://files.pythonhosted.org/packages/09/4e/a7d65c7322c510de2c409ff3828b03354a7c43f5a8ed458a7a131b41c7b9/mypy-1.15.0-py3-none-any.whl", hash = "sha256:5469affef548bd1895d86d3bf10ce2b44e33d86923c29e4d675b3e323437ea3e", size = 2221777, upload-time = "2025-02-05T03:50:08.348Z" }, +sdist = { url = "https://files.pythonhosted.org/packages/8e/22/ea637422dedf0bf36f3ef238eab4e455e2a0dcc3082b5cc067615347ab8e/mypy-1.17.1.tar.gz", hash = "sha256:25e01ec741ab5bb3eec8ba9cdb0f769230368a22c959c4937360efb89b7e9f01", size = 3352570, upload-time = "2025-07-31T07:54:19.204Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/77/a9/3d7aa83955617cdf02f94e50aab5c830d205cfa4320cf124ff64acce3a8e/mypy-1.17.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:3fbe6d5555bf608c47203baa3e72dbc6ec9965b3d7c318aa9a4ca76f465bd972", size = 11003299, upload-time = "2025-07-31T07:54:06.425Z" }, + { url = "https://files.pythonhosted.org/packages/83/e8/72e62ff837dd5caaac2b4a5c07ce769c8e808a00a65e5d8f94ea9c6f20ab/mypy-1.17.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:80ef5c058b7bce08c83cac668158cb7edea692e458d21098c7d3bce35a5d43e7", size = 10125451, upload-time = "2025-07-31T07:53:52.974Z" }, + { url = "https://files.pythonhosted.org/packages/7d/10/f3f3543f6448db11881776f26a0ed079865926b0c841818ee22de2c6bbab/mypy-1.17.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c4a580f8a70c69e4a75587bd925d298434057fe2a428faaf927ffe6e4b9a98df", size = 11916211, upload-time = "2025-07-31T07:53:18.879Z" }, + { url = "https://files.pythonhosted.org/packages/06/bf/63e83ed551282d67bb3f7fea2cd5561b08d2bb6eb287c096539feb5ddbc5/mypy-1.17.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:dd86bb649299f09d987a2eebb4d52d10603224500792e1bee18303bbcc1ce390", size = 12652687, upload-time = "2025-07-31T07:53:30.544Z" }, + { url = "https://files.pythonhosted.org/packages/69/66/68f2eeef11facf597143e85b694a161868b3b006a5fbad50e09ea117ef24/mypy-1.17.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:a76906f26bd8d51ea9504966a9c25419f2e668f012e0bdf3da4ea1526c534d94", size = 12896322, upload-time = "2025-07-31T07:53:50.74Z" }, + { url = "https://files.pythonhosted.org/packages/a3/87/8e3e9c2c8bd0d7e071a89c71be28ad088aaecbadf0454f46a540bda7bca6/mypy-1.17.1-cp310-cp310-win_amd64.whl", hash = "sha256:e79311f2d904ccb59787477b7bd5d26f3347789c06fcd7656fa500875290264b", size = 9507962, upload-time = "2025-07-31T07:53:08.431Z" }, + { url = "https://files.pythonhosted.org/packages/46/cf/eadc80c4e0a70db1c08921dcc220357ba8ab2faecb4392e3cebeb10edbfa/mypy-1.17.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ad37544be07c5d7fba814eb370e006df58fed8ad1ef33ed1649cb1889ba6ff58", size = 10921009, upload-time = "2025-07-31T07:53:23.037Z" }, + { url = "https://files.pythonhosted.org/packages/5d/c1/c869d8c067829ad30d9bdae051046561552516cfb3a14f7f0347b7d973ee/mypy-1.17.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:064e2ff508e5464b4bd807a7c1625bc5047c5022b85c70f030680e18f37273a5", size = 10047482, upload-time = "2025-07-31T07:53:26.151Z" }, + { url = "https://files.pythonhosted.org/packages/98/b9/803672bab3fe03cee2e14786ca056efda4bb511ea02dadcedde6176d06d0/mypy-1.17.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:70401bbabd2fa1aa7c43bb358f54037baf0586f41e83b0ae67dd0534fc64edfd", size = 11832883, upload-time = "2025-07-31T07:53:47.948Z" }, + { url = "https://files.pythonhosted.org/packages/88/fb/fcdac695beca66800918c18697b48833a9a6701de288452b6715a98cfee1/mypy-1.17.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e92bdc656b7757c438660f775f872a669b8ff374edc4d18277d86b63edba6b8b", size = 12566215, upload-time = "2025-07-31T07:54:04.031Z" }, + { url = "https://files.pythonhosted.org/packages/7f/37/a932da3d3dace99ee8eb2043b6ab03b6768c36eb29a02f98f46c18c0da0e/mypy-1.17.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:c1fdf4abb29ed1cb091cf432979e162c208a5ac676ce35010373ff29247bcad5", size = 12751956, upload-time = "2025-07-31T07:53:36.263Z" }, + { url = "https://files.pythonhosted.org/packages/8c/cf/6438a429e0f2f5cab8bc83e53dbebfa666476f40ee322e13cac5e64b79e7/mypy-1.17.1-cp311-cp311-win_amd64.whl", hash = "sha256:ff2933428516ab63f961644bc49bc4cbe42bbffb2cd3b71cc7277c07d16b1a8b", size = 9507307, upload-time = "2025-07-31T07:53:59.734Z" }, + { url = "https://files.pythonhosted.org/packages/17/a2/7034d0d61af8098ec47902108553122baa0f438df8a713be860f7407c9e6/mypy-1.17.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:69e83ea6553a3ba79c08c6e15dbd9bfa912ec1e493bf75489ef93beb65209aeb", size = 11086295, upload-time = "2025-07-31T07:53:28.124Z" }, + { url = "https://files.pythonhosted.org/packages/14/1f/19e7e44b594d4b12f6ba8064dbe136505cec813549ca3e5191e40b1d3cc2/mypy-1.17.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1b16708a66d38abb1e6b5702f5c2c87e133289da36f6a1d15f6a5221085c6403", size = 10112355, upload-time = "2025-07-31T07:53:21.121Z" }, + { url = "https://files.pythonhosted.org/packages/5b/69/baa33927e29e6b4c55d798a9d44db5d394072eef2bdc18c3e2048c9ed1e9/mypy-1.17.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:89e972c0035e9e05823907ad5398c5a73b9f47a002b22359b177d40bdaee7056", size = 11875285, upload-time = "2025-07-31T07:53:55.293Z" }, + { url = "https://files.pythonhosted.org/packages/90/13/f3a89c76b0a41e19490b01e7069713a30949d9a6c147289ee1521bcea245/mypy-1.17.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:03b6d0ed2b188e35ee6d5c36b5580cffd6da23319991c49ab5556c023ccf1341", size = 12737895, upload-time = "2025-07-31T07:53:43.623Z" }, + { url = "https://files.pythonhosted.org/packages/23/a1/c4ee79ac484241301564072e6476c5a5be2590bc2e7bfd28220033d2ef8f/mypy-1.17.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c837b896b37cd103570d776bda106eabb8737aa6dd4f248451aecf53030cdbeb", size = 12931025, upload-time = "2025-07-31T07:54:17.125Z" }, + { url = "https://files.pythonhosted.org/packages/89/b8/7409477be7919a0608900e6320b155c72caab4fef46427c5cc75f85edadd/mypy-1.17.1-cp312-cp312-win_amd64.whl", hash = "sha256:665afab0963a4b39dff7c1fa563cc8b11ecff7910206db4b2e64dd1ba25aed19", size = 9584664, upload-time = "2025-07-31T07:54:12.842Z" }, + { url = "https://files.pythonhosted.org/packages/5b/82/aec2fc9b9b149f372850291827537a508d6c4d3664b1750a324b91f71355/mypy-1.17.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:93378d3203a5c0800c6b6d850ad2f19f7a3cdf1a3701d3416dbf128805c6a6a7", size = 11075338, upload-time = "2025-07-31T07:53:38.873Z" }, + { url = "https://files.pythonhosted.org/packages/07/ac/ee93fbde9d2242657128af8c86f5d917cd2887584cf948a8e3663d0cd737/mypy-1.17.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:15d54056f7fe7a826d897789f53dd6377ec2ea8ba6f776dc83c2902b899fee81", size = 10113066, upload-time = "2025-07-31T07:54:14.707Z" }, + { url = "https://files.pythonhosted.org/packages/5a/68/946a1e0be93f17f7caa56c45844ec691ca153ee8b62f21eddda336a2d203/mypy-1.17.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:209a58fed9987eccc20f2ca94afe7257a8f46eb5df1fb69958650973230f91e6", size = 11875473, upload-time = "2025-07-31T07:53:14.504Z" }, + { url = "https://files.pythonhosted.org/packages/9f/0f/478b4dce1cb4f43cf0f0d00fba3030b21ca04a01b74d1cd272a528cf446f/mypy-1.17.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:099b9a5da47de9e2cb5165e581f158e854d9e19d2e96b6698c0d64de911dd849", size = 12744296, upload-time = "2025-07-31T07:53:03.896Z" }, + { url = "https://files.pythonhosted.org/packages/ca/70/afa5850176379d1b303f992a828de95fc14487429a7139a4e0bdd17a8279/mypy-1.17.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:fa6ffadfbe6994d724c5a1bb6123a7d27dd68fc9c059561cd33b664a79578e14", size = 12914657, upload-time = "2025-07-31T07:54:08.576Z" }, + { url = "https://files.pythonhosted.org/packages/53/f9/4a83e1c856a3d9c8f6edaa4749a4864ee98486e9b9dbfbc93842891029c2/mypy-1.17.1-cp313-cp313-win_amd64.whl", hash = "sha256:9a2b7d9180aed171f033c9f2fc6c204c1245cf60b0cb61cf2e7acc24eea78e0a", size = 9593320, upload-time = "2025-07-31T07:53:01.341Z" }, + { url = "https://files.pythonhosted.org/packages/38/56/79c2fac86da57c7d8c48622a05873eaab40b905096c33597462713f5af90/mypy-1.17.1-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:15a83369400454c41ed3a118e0cc58bd8123921a602f385cb6d6ea5df050c733", size = 11040037, upload-time = "2025-07-31T07:54:10.942Z" }, + { url = "https://files.pythonhosted.org/packages/4d/c3/adabe6ff53638e3cad19e3547268482408323b1e68bf082c9119000cd049/mypy-1.17.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:55b918670f692fc9fba55c3298d8a3beae295c5cded0a55dccdc5bbead814acd", size = 10131550, upload-time = "2025-07-31T07:53:41.307Z" }, + { url = "https://files.pythonhosted.org/packages/b8/c5/2e234c22c3bdeb23a7817af57a58865a39753bde52c74e2c661ee0cfc640/mypy-1.17.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:62761474061feef6f720149d7ba876122007ddc64adff5ba6f374fda35a018a0", size = 11872963, upload-time = "2025-07-31T07:53:16.878Z" }, + { url = "https://files.pythonhosted.org/packages/ab/26/c13c130f35ca8caa5f2ceab68a247775648fdcd6c9a18f158825f2bc2410/mypy-1.17.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c49562d3d908fd49ed0938e5423daed8d407774a479b595b143a3d7f87cdae6a", size = 12710189, upload-time = "2025-07-31T07:54:01.962Z" }, + { url = "https://files.pythonhosted.org/packages/82/df/c7d79d09f6de8383fe800521d066d877e54d30b4fb94281c262be2df84ef/mypy-1.17.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:397fba5d7616a5bc60b45c7ed204717eaddc38f826e3645402c426057ead9a91", size = 12900322, upload-time = "2025-07-31T07:53:10.551Z" }, + { url = "https://files.pythonhosted.org/packages/b8/98/3d5a48978b4f708c55ae832619addc66d677f6dc59f3ebad71bae8285ca6/mypy-1.17.1-cp314-cp314-win_amd64.whl", hash = "sha256:9d6b20b97d373f41617bd0708fd46aa656059af57f2ef72aa8c7d6a2b73b74ed", size = 9751879, upload-time = "2025-07-31T07:52:56.683Z" }, + { url = "https://files.pythonhosted.org/packages/29/cb/673e3d34e5d8de60b3a61f44f80150a738bff568cd6b7efb55742a605e98/mypy-1.17.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5d1092694f166a7e56c805caaf794e0585cabdbf1df36911c414e4e9abb62ae9", size = 10992466, upload-time = "2025-07-31T07:53:57.574Z" }, + { url = "https://files.pythonhosted.org/packages/0c/d0/fe1895836eea3a33ab801561987a10569df92f2d3d4715abf2cfeaa29cb2/mypy-1.17.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:79d44f9bfb004941ebb0abe8eff6504223a9c1ac51ef967d1263c6572bbebc99", size = 10117638, upload-time = "2025-07-31T07:53:34.256Z" }, + { url = "https://files.pythonhosted.org/packages/97/f3/514aa5532303aafb95b9ca400a31054a2bd9489de166558c2baaeea9c522/mypy-1.17.1-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b01586eed696ec905e61bd2568f48740f7ac4a45b3a468e6423a03d3788a51a8", size = 11915673, upload-time = "2025-07-31T07:52:59.361Z" }, + { url = "https://files.pythonhosted.org/packages/ab/c3/c0805f0edec96fe8e2c048b03769a6291523d509be8ee7f56ae922fa3882/mypy-1.17.1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:43808d9476c36b927fbcd0b0255ce75efe1b68a080154a38ae68a7e62de8f0f8", size = 12649022, upload-time = "2025-07-31T07:53:45.92Z" }, + { url = "https://files.pythonhosted.org/packages/45/3e/d646b5a298ada21a8512fa7e5531f664535a495efa672601702398cea2b4/mypy-1.17.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:feb8cc32d319edd5859da2cc084493b3e2ce5e49a946377663cc90f6c15fb259", size = 12895536, upload-time = "2025-07-31T07:53:06.17Z" }, + { url = "https://files.pythonhosted.org/packages/14/55/e13d0dcd276975927d1f4e9e2ec4fd409e199f01bdc671717e673cc63a22/mypy-1.17.1-cp39-cp39-win_amd64.whl", hash = "sha256:d7598cf74c3e16539d4e2f0b8d8c318e00041553d83d4861f87c7a72e95ac24d", size = 9512564, upload-time = "2025-07-31T07:53:12.346Z" }, + { url = "https://files.pythonhosted.org/packages/1d/f3/8fcd2af0f5b806f6cf463efaffd3c9548a28f84220493ecd38d127b6b66d/mypy-1.17.1-py3-none-any.whl", hash = "sha256:a9f52c0351c21fe24c21d8c0eb1f62967b262d6729393397b6f443c3b773c3b9", size = 2283411, upload-time = "2025-07-31T07:53:24.664Z" }, ] [[package]] name = "mypy-extensions" -version = "1.0.0" +version = "1.1.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/98/a4/1ab47638b92648243faf97a5aeb6ea83059cc3624972ab6b8d2316078d3f/mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782", size = 4433, upload-time = "2023-02-04T12:11:27.157Z" } +sdist = { url = "https://files.pythonhosted.org/packages/a2/6e/371856a3fb9d31ca8dac321cda606860fa4548858c0cc45d9d1d4ca2628b/mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558", size = 6343, upload-time = "2025-04-22T14:54:24.164Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/2a/e2/5d3f6ada4297caebe1a2add3b126fe800c96f56dbe5d1988a2cbe0b267aa/mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d", size = 4695, upload-time = "2023-02-04T12:11:25.002Z" }, + { url = "https://files.pythonhosted.org/packages/79/7b/2c79738432f5c924bef5071f933bcc9efd0473bac3b4aa584a6f7c1c8df8/mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505", size = 4963, upload-time = "2025-04-22T14:54:22.983Z" }, ] [[package]] name = "numpy" -version = "2.2.4" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/e1/78/31103410a57bc2c2b93a3597340a8119588571f6a4539067546cb9a0bfac/numpy-2.2.4.tar.gz", hash = "sha256:9ba03692a45d3eef66559efe1d1096c4b9b75c0986b5dff5530c378fb8331d4f", size = 20270701, upload-time = "2025-03-16T18:27:00.648Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/04/89/a79e86e5c1433926ed7d60cb267fb64aa578b6101ab645800fd43b4801de/numpy-2.2.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:8146f3550d627252269ac42ae660281d673eb6f8b32f113538e0cc2a9aed42b9", size = 21250661, upload-time = "2025-03-16T18:02:13.017Z" }, - { url = "https://files.pythonhosted.org/packages/79/c2/f50921beb8afd60ed9589ad880332cfefdb805422210d327fb48f12b7a81/numpy-2.2.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e642d86b8f956098b564a45e6f6ce68a22c2c97a04f5acd3f221f57b8cb850ae", size = 14389926, upload-time = "2025-03-16T18:02:39.022Z" }, - { url = "https://files.pythonhosted.org/packages/c7/b9/2c4e96130b0b0f97b0ef4a06d6dae3b39d058b21a5e2fa2decd7fd6b1c8f/numpy-2.2.4-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:a84eda42bd12edc36eb5b53bbcc9b406820d3353f1994b6cfe453a33ff101775", size = 5428329, upload-time = "2025-03-16T18:02:50.032Z" }, - { url = "https://files.pythonhosted.org/packages/7f/a5/3d7094aa898f4fc5c84cdfb26beeae780352d43f5d8bdec966c4393d644c/numpy-2.2.4-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:4ba5054787e89c59c593a4169830ab362ac2bee8a969249dc56e5d7d20ff8df9", size = 6963559, upload-time = "2025-03-16T18:03:02.523Z" }, - { url = "https://files.pythonhosted.org/packages/4c/22/fb1be710a14434c09080dd4a0acc08939f612ec02efcb04b9e210474782d/numpy-2.2.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7716e4a9b7af82c06a2543c53ca476fa0b57e4d760481273e09da04b74ee6ee2", size = 14368066, upload-time = "2025-03-16T18:03:27.146Z" }, - { url = "https://files.pythonhosted.org/packages/c2/07/2e5cc71193e3ef3a219ffcf6ca4858e46ea2be09c026ddd480d596b32867/numpy-2.2.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:adf8c1d66f432ce577d0197dceaac2ac00c0759f573f28516246351c58a85020", size = 16417040, upload-time = "2025-03-16T18:03:55.999Z" }, - { url = "https://files.pythonhosted.org/packages/1a/97/3b1537776ad9a6d1a41813818343745e8dd928a2916d4c9edcd9a8af1dac/numpy-2.2.4-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:218f061d2faa73621fa23d6359442b0fc658d5b9a70801373625d958259eaca3", size = 15879862, upload-time = "2025-03-16T18:04:23.56Z" }, - { url = "https://files.pythonhosted.org/packages/b0/b7/4472f603dd45ef36ff3d8e84e84fe02d9467c78f92cc121633dce6da307b/numpy-2.2.4-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:df2f57871a96bbc1b69733cd4c51dc33bea66146b8c63cacbfed73eec0883017", size = 18206032, upload-time = "2025-03-16T18:04:53.694Z" }, - { url = "https://files.pythonhosted.org/packages/0d/bd/6a092963fb82e6c5aa0d0440635827bbb2910da229545473bbb58c537ed3/numpy-2.2.4-cp310-cp310-win32.whl", hash = "sha256:a0258ad1f44f138b791327961caedffbf9612bfa504ab9597157806faa95194a", size = 6608517, upload-time = "2025-03-16T18:05:06.647Z" }, - { url = "https://files.pythonhosted.org/packages/01/e3/cb04627bc2a1638948bc13e818df26495aa18e20d5be1ed95ab2b10b6847/numpy-2.2.4-cp310-cp310-win_amd64.whl", hash = "sha256:0d54974f9cf14acf49c60f0f7f4084b6579d24d439453d5fc5805d46a165b542", size = 12943498, upload-time = "2025-03-16T18:05:28.591Z" }, - { url = "https://files.pythonhosted.org/packages/16/fb/09e778ee3a8ea0d4dc8329cca0a9c9e65fed847d08e37eba74cb7ed4b252/numpy-2.2.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:e9e0a277bb2eb5d8a7407e14688b85fd8ad628ee4e0c7930415687b6564207a4", size = 21254989, upload-time = "2025-03-16T18:06:04.092Z" }, - { url = "https://files.pythonhosted.org/packages/a2/0a/1212befdbecab5d80eca3cde47d304cad986ad4eec7d85a42e0b6d2cc2ef/numpy-2.2.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:9eeea959168ea555e556b8188da5fa7831e21d91ce031e95ce23747b7609f8a4", size = 14425910, upload-time = "2025-03-16T18:06:29.062Z" }, - { url = "https://files.pythonhosted.org/packages/2b/3e/e7247c1d4f15086bb106c8d43c925b0b2ea20270224f5186fa48d4fb5cbd/numpy-2.2.4-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:bd3ad3b0a40e713fc68f99ecfd07124195333f1e689387c180813f0e94309d6f", size = 5426490, upload-time = "2025-03-16T18:06:39.901Z" }, - { url = "https://files.pythonhosted.org/packages/5d/fa/aa7cd6be51419b894c5787a8a93c3302a1ed4f82d35beb0613ec15bdd0e2/numpy-2.2.4-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:cf28633d64294969c019c6df4ff37f5698e8326db68cc2b66576a51fad634880", size = 6967754, upload-time = "2025-03-16T18:06:52.658Z" }, - { url = "https://files.pythonhosted.org/packages/d5/ee/96457c943265de9fadeb3d2ffdbab003f7fba13d971084a9876affcda095/numpy-2.2.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2fa8fa7697ad1646b5c93de1719965844e004fcad23c91228aca1cf0800044a1", size = 14373079, upload-time = "2025-03-16T18:07:16.297Z" }, - { url = "https://files.pythonhosted.org/packages/c5/5c/ceefca458559f0ccc7a982319f37ed07b0d7b526964ae6cc61f8ad1b6119/numpy-2.2.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f4162988a360a29af158aeb4a2f4f09ffed6a969c9776f8f3bdee9b06a8ab7e5", size = 16428819, upload-time = "2025-03-16T18:07:44.188Z" }, - { url = "https://files.pythonhosted.org/packages/22/31/9b2ac8eee99e001eb6add9fa27514ef5e9faf176169057a12860af52704c/numpy-2.2.4-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:892c10d6a73e0f14935c31229e03325a7b3093fafd6ce0af704be7f894d95687", size = 15881470, upload-time = "2025-03-16T18:08:11.545Z" }, - { url = "https://files.pythonhosted.org/packages/f0/dc/8569b5f25ff30484b555ad8a3f537e0225d091abec386c9420cf5f7a2976/numpy-2.2.4-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:db1f1c22173ac1c58db249ae48aa7ead29f534b9a948bc56828337aa84a32ed6", size = 18218144, upload-time = "2025-03-16T18:08:42.042Z" }, - { url = "https://files.pythonhosted.org/packages/5e/05/463c023a39bdeb9bb43a99e7dee2c664cb68d5bb87d14f92482b9f6011cc/numpy-2.2.4-cp311-cp311-win32.whl", hash = "sha256:ea2bb7e2ae9e37d96835b3576a4fa4b3a97592fbea8ef7c3587078b0068b8f09", size = 6606368, upload-time = "2025-03-16T18:08:55.074Z" }, - { url = "https://files.pythonhosted.org/packages/8b/72/10c1d2d82101c468a28adc35de6c77b308f288cfd0b88e1070f15b98e00c/numpy-2.2.4-cp311-cp311-win_amd64.whl", hash = "sha256:f7de08cbe5551911886d1ab60de58448c6df0f67d9feb7d1fb21e9875ef95e91", size = 12947526, upload-time = "2025-03-16T18:09:16.844Z" }, - { url = "https://files.pythonhosted.org/packages/a2/30/182db21d4f2a95904cec1a6f779479ea1ac07c0647f064dea454ec650c42/numpy-2.2.4-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:a7b9084668aa0f64e64bd00d27ba5146ef1c3a8835f3bd912e7a9e01326804c4", size = 20947156, upload-time = "2025-03-16T18:09:51.975Z" }, - { url = "https://files.pythonhosted.org/packages/24/6d/9483566acfbda6c62c6bc74b6e981c777229d2af93c8eb2469b26ac1b7bc/numpy-2.2.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:dbe512c511956b893d2dacd007d955a3f03d555ae05cfa3ff1c1ff6df8851854", size = 14133092, upload-time = "2025-03-16T18:10:16.329Z" }, - { url = "https://files.pythonhosted.org/packages/27/f6/dba8a258acbf9d2bed2525cdcbb9493ef9bae5199d7a9cb92ee7e9b2aea6/numpy-2.2.4-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:bb649f8b207ab07caebba230d851b579a3c8711a851d29efe15008e31bb4de24", size = 5163515, upload-time = "2025-03-16T18:10:26.19Z" }, - { url = "https://files.pythonhosted.org/packages/62/30/82116199d1c249446723c68f2c9da40d7f062551036f50b8c4caa42ae252/numpy-2.2.4-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:f34dc300df798742b3d06515aa2a0aee20941c13579d7a2f2e10af01ae4901ee", size = 6696558, upload-time = "2025-03-16T18:10:38.996Z" }, - { url = "https://files.pythonhosted.org/packages/0e/b2/54122b3c6df5df3e87582b2e9430f1bdb63af4023c739ba300164c9ae503/numpy-2.2.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c3f7ac96b16955634e223b579a3e5798df59007ca43e8d451a0e6a50f6bfdfba", size = 14084742, upload-time = "2025-03-16T18:11:02.76Z" }, - { url = "https://files.pythonhosted.org/packages/02/e2/e2cbb8d634151aab9528ef7b8bab52ee4ab10e076509285602c2a3a686e0/numpy-2.2.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4f92084defa704deadd4e0a5ab1dc52d8ac9e8a8ef617f3fbb853e79b0ea3592", size = 16134051, upload-time = "2025-03-16T18:11:32.767Z" }, - { url = "https://files.pythonhosted.org/packages/8e/21/efd47800e4affc993e8be50c1b768de038363dd88865920439ef7b422c60/numpy-2.2.4-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:7a4e84a6283b36632e2a5b56e121961f6542ab886bc9e12f8f9818b3c266bfbb", size = 15578972, upload-time = "2025-03-16T18:11:59.877Z" }, - { url = "https://files.pythonhosted.org/packages/04/1e/f8bb88f6157045dd5d9b27ccf433d016981032690969aa5c19e332b138c0/numpy-2.2.4-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:11c43995255eb4127115956495f43e9343736edb7fcdb0d973defd9de14cd84f", size = 17898106, upload-time = "2025-03-16T18:12:31.487Z" }, - { url = "https://files.pythonhosted.org/packages/2b/93/df59a5a3897c1f036ae8ff845e45f4081bb06943039ae28a3c1c7c780f22/numpy-2.2.4-cp312-cp312-win32.whl", hash = "sha256:65ef3468b53269eb5fdb3a5c09508c032b793da03251d5f8722b1194f1790c00", size = 6311190, upload-time = "2025-03-16T18:12:44.46Z" }, - { url = "https://files.pythonhosted.org/packages/46/69/8c4f928741c2a8efa255fdc7e9097527c6dc4e4df147e3cadc5d9357ce85/numpy-2.2.4-cp312-cp312-win_amd64.whl", hash = "sha256:2aad3c17ed2ff455b8eaafe06bcdae0062a1db77cb99f4b9cbb5f4ecb13c5146", size = 12644305, upload-time = "2025-03-16T18:13:06.864Z" }, - { url = "https://files.pythonhosted.org/packages/2a/d0/bd5ad792e78017f5decfb2ecc947422a3669a34f775679a76317af671ffc/numpy-2.2.4-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:1cf4e5c6a278d620dee9ddeb487dc6a860f9b199eadeecc567f777daace1e9e7", size = 20933623, upload-time = "2025-03-16T18:13:43.231Z" }, - { url = "https://files.pythonhosted.org/packages/c3/bc/2b3545766337b95409868f8e62053135bdc7fa2ce630aba983a2aa60b559/numpy-2.2.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:1974afec0b479e50438fc3648974268f972e2d908ddb6d7fb634598cdb8260a0", size = 14148681, upload-time = "2025-03-16T18:14:08.031Z" }, - { url = "https://files.pythonhosted.org/packages/6a/70/67b24d68a56551d43a6ec9fe8c5f91b526d4c1a46a6387b956bf2d64744e/numpy-2.2.4-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:79bd5f0a02aa16808fcbc79a9a376a147cc1045f7dfe44c6e7d53fa8b8a79392", size = 5148759, upload-time = "2025-03-16T18:14:18.613Z" }, - { url = "https://files.pythonhosted.org/packages/1c/8b/e2fc8a75fcb7be12d90b31477c9356c0cbb44abce7ffb36be39a0017afad/numpy-2.2.4-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:3387dd7232804b341165cedcb90694565a6015433ee076c6754775e85d86f1fc", size = 6683092, upload-time = "2025-03-16T18:14:31.386Z" }, - { url = "https://files.pythonhosted.org/packages/13/73/41b7b27f169ecf368b52533edb72e56a133f9e86256e809e169362553b49/numpy-2.2.4-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6f527d8fdb0286fd2fd97a2a96c6be17ba4232da346931d967a0630050dfd298", size = 14081422, upload-time = "2025-03-16T18:14:54.83Z" }, - { url = "https://files.pythonhosted.org/packages/4b/04/e208ff3ae3ddfbafc05910f89546382f15a3f10186b1f56bd99f159689c2/numpy-2.2.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bce43e386c16898b91e162e5baaad90c4b06f9dcbe36282490032cec98dc8ae7", size = 16132202, upload-time = "2025-03-16T18:15:22.035Z" }, - { url = "https://files.pythonhosted.org/packages/fe/bc/2218160574d862d5e55f803d88ddcad88beff94791f9c5f86d67bd8fbf1c/numpy-2.2.4-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:31504f970f563d99f71a3512d0c01a645b692b12a63630d6aafa0939e52361e6", size = 15573131, upload-time = "2025-03-16T18:15:48.546Z" }, - { url = "https://files.pythonhosted.org/packages/a5/78/97c775bc4f05abc8a8426436b7cb1be806a02a2994b195945600855e3a25/numpy-2.2.4-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:81413336ef121a6ba746892fad881a83351ee3e1e4011f52e97fba79233611fd", size = 17894270, upload-time = "2025-03-16T18:16:20.274Z" }, - { url = "https://files.pythonhosted.org/packages/b9/eb/38c06217a5f6de27dcb41524ca95a44e395e6a1decdc0c99fec0832ce6ae/numpy-2.2.4-cp313-cp313-win32.whl", hash = "sha256:f486038e44caa08dbd97275a9a35a283a8f1d2f0ee60ac260a1790e76660833c", size = 6308141, upload-time = "2025-03-16T18:20:15.297Z" }, - { url = "https://files.pythonhosted.org/packages/52/17/d0dd10ab6d125c6d11ffb6dfa3423c3571befab8358d4f85cd4471964fcd/numpy-2.2.4-cp313-cp313-win_amd64.whl", hash = "sha256:207a2b8441cc8b6a2a78c9ddc64d00d20c303d79fba08c577752f080c4007ee3", size = 12636885, upload-time = "2025-03-16T18:20:36.982Z" }, - { url = "https://files.pythonhosted.org/packages/fa/e2/793288ede17a0fdc921172916efb40f3cbc2aa97e76c5c84aba6dc7e8747/numpy-2.2.4-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:8120575cb4882318c791f839a4fd66161a6fa46f3f0a5e613071aae35b5dd8f8", size = 20961829, upload-time = "2025-03-16T18:16:56.191Z" }, - { url = "https://files.pythonhosted.org/packages/3a/75/bb4573f6c462afd1ea5cbedcc362fe3e9bdbcc57aefd37c681be1155fbaa/numpy-2.2.4-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:a761ba0fa886a7bb33c6c8f6f20213735cb19642c580a931c625ee377ee8bd39", size = 14161419, upload-time = "2025-03-16T18:17:22.811Z" }, - { url = "https://files.pythonhosted.org/packages/03/68/07b4cd01090ca46c7a336958b413cdbe75002286295f2addea767b7f16c9/numpy-2.2.4-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:ac0280f1ba4a4bfff363a99a6aceed4f8e123f8a9b234c89140f5e894e452ecd", size = 5196414, upload-time = "2025-03-16T18:17:34.066Z" }, - { url = "https://files.pythonhosted.org/packages/a5/fd/d4a29478d622fedff5c4b4b4cedfc37a00691079623c0575978d2446db9e/numpy-2.2.4-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:879cf3a9a2b53a4672a168c21375166171bc3932b7e21f622201811c43cdd3b0", size = 6709379, upload-time = "2025-03-16T18:17:47.466Z" }, - { url = "https://files.pythonhosted.org/packages/41/78/96dddb75bb9be730b87c72f30ffdd62611aba234e4e460576a068c98eff6/numpy-2.2.4-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f05d4198c1bacc9124018109c5fba2f3201dbe7ab6e92ff100494f236209c960", size = 14051725, upload-time = "2025-03-16T18:18:11.904Z" }, - { url = "https://files.pythonhosted.org/packages/00/06/5306b8199bffac2a29d9119c11f457f6c7d41115a335b78d3f86fad4dbe8/numpy-2.2.4-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e2f085ce2e813a50dfd0e01fbfc0c12bbe5d2063d99f8b29da30e544fb6483b8", size = 16101638, upload-time = "2025-03-16T18:18:40.749Z" }, - { url = "https://files.pythonhosted.org/packages/fa/03/74c5b631ee1ded596945c12027649e6344614144369fd3ec1aaced782882/numpy-2.2.4-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:92bda934a791c01d6d9d8e038363c50918ef7c40601552a58ac84c9613a665bc", size = 15571717, upload-time = "2025-03-16T18:19:04.512Z" }, - { url = "https://files.pythonhosted.org/packages/cb/dc/4fc7c0283abe0981e3b89f9b332a134e237dd476b0c018e1e21083310c31/numpy-2.2.4-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:ee4d528022f4c5ff67332469e10efe06a267e32f4067dc76bb7e2cddf3cd25ff", size = 17879998, upload-time = "2025-03-16T18:19:32.52Z" }, - { url = "https://files.pythonhosted.org/packages/e5/2b/878576190c5cfa29ed896b518cc516aecc7c98a919e20706c12480465f43/numpy-2.2.4-cp313-cp313t-win32.whl", hash = "sha256:05c076d531e9998e7e694c36e8b349969c56eadd2cdcd07242958489d79a7286", size = 6366896, upload-time = "2025-03-16T18:19:43.55Z" }, - { url = "https://files.pythonhosted.org/packages/3e/05/eb7eec66b95cf697f08c754ef26c3549d03ebd682819f794cb039574a0a6/numpy-2.2.4-cp313-cp313t-win_amd64.whl", hash = "sha256:188dcbca89834cc2e14eb2f106c96d6d46f200fe0200310fc29089657379c58d", size = 12739119, upload-time = "2025-03-16T18:20:03.94Z" }, - { url = "https://files.pythonhosted.org/packages/b2/5c/f09c33a511aff41a098e6ef3498465d95f6360621034a3d95f47edbc9119/numpy-2.2.4-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:7051ee569db5fbac144335e0f3b9c2337e0c8d5c9fee015f259a5bd70772b7e8", size = 21081956, upload-time = "2025-03-16T18:21:12.955Z" }, - { url = "https://files.pythonhosted.org/packages/ba/30/74c48b3b6494c4b820b7fa1781d441e94d87a08daa5b35d222f06ba41a6f/numpy-2.2.4-pp310-pypy310_pp73-macosx_14_0_x86_64.whl", hash = "sha256:ab2939cd5bec30a7430cbdb2287b63151b77cf9624de0532d629c9a1c59b1d5c", size = 6827143, upload-time = "2025-03-16T18:21:26.748Z" }, - { url = "https://files.pythonhosted.org/packages/54/f5/ab0d2f48b490535c7a80e05da4a98902b632369efc04f0e47bb31ca97d8f/numpy-2.2.4-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d0f35b19894a9e08639fd60a1ec1978cb7f5f7f1eace62f38dd36be8aecdef4d", size = 16233350, upload-time = "2025-03-16T18:21:53.902Z" }, - { url = "https://files.pythonhosted.org/packages/3b/3a/2f6d8c1f8e45d496bca6baaec93208035faeb40d5735c25afac092ec9a12/numpy-2.2.4-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:b4adfbbc64014976d2f91084915ca4e626fbf2057fb81af209c1a6d776d23e3d", size = 12857565, upload-time = "2025-03-16T18:22:17.631Z" }, +version = "2.2.6" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version == '3.10.*'", +] +sdist = { url = "https://files.pythonhosted.org/packages/76/21/7d2a95e4bba9dc13d043ee156a356c0a8f0c6309dff6b21b4d71a073b8a8/numpy-2.2.6.tar.gz", hash = "sha256:e29554e2bef54a90aa5cc07da6ce955accb83f21ab5de01a62c8478897b264fd", size = 20276440, upload-time = "2025-05-17T22:38:04.611Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/9a/3e/ed6db5be21ce87955c0cbd3009f2803f59fa08df21b5df06862e2d8e2bdd/numpy-2.2.6-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:b412caa66f72040e6d268491a59f2c43bf03eb6c96dd8f0307829feb7fa2b6fb", size = 21165245, upload-time = "2025-05-17T21:27:58.555Z" }, + { url = "https://files.pythonhosted.org/packages/22/c2/4b9221495b2a132cc9d2eb862e21d42a009f5a60e45fc44b00118c174bff/numpy-2.2.6-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8e41fd67c52b86603a91c1a505ebaef50b3314de0213461c7a6e99c9a3beff90", size = 14360048, upload-time = "2025-05-17T21:28:21.406Z" }, + { url = "https://files.pythonhosted.org/packages/fd/77/dc2fcfc66943c6410e2bf598062f5959372735ffda175b39906d54f02349/numpy-2.2.6-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:37e990a01ae6ec7fe7fa1c26c55ecb672dd98b19c3d0e1d1f326fa13cb38d163", size = 5340542, upload-time = "2025-05-17T21:28:30.931Z" }, + { url = "https://files.pythonhosted.org/packages/7a/4f/1cb5fdc353a5f5cc7feb692db9b8ec2c3d6405453f982435efc52561df58/numpy-2.2.6-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:5a6429d4be8ca66d889b7cf70f536a397dc45ba6faeb5f8c5427935d9592e9cf", size = 6878301, upload-time = "2025-05-17T21:28:41.613Z" }, + { url = "https://files.pythonhosted.org/packages/eb/17/96a3acd228cec142fcb8723bd3cc39c2a474f7dcf0a5d16731980bcafa95/numpy-2.2.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:efd28d4e9cd7d7a8d39074a4d44c63eda73401580c5c76acda2ce969e0a38e83", size = 14297320, upload-time = "2025-05-17T21:29:02.78Z" }, + { url = "https://files.pythonhosted.org/packages/b4/63/3de6a34ad7ad6646ac7d2f55ebc6ad439dbbf9c4370017c50cf403fb19b5/numpy-2.2.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fc7b73d02efb0e18c000e9ad8b83480dfcd5dfd11065997ed4c6747470ae8915", size = 16801050, upload-time = "2025-05-17T21:29:27.675Z" }, + { url = "https://files.pythonhosted.org/packages/07/b6/89d837eddef52b3d0cec5c6ba0456c1bf1b9ef6a6672fc2b7873c3ec4e2e/numpy-2.2.6-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:74d4531beb257d2c3f4b261bfb0fc09e0f9ebb8842d82a7b4209415896adc680", size = 15807034, upload-time = "2025-05-17T21:29:51.102Z" }, + { url = "https://files.pythonhosted.org/packages/01/c8/dc6ae86e3c61cfec1f178e5c9f7858584049b6093f843bca541f94120920/numpy-2.2.6-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:8fc377d995680230e83241d8a96def29f204b5782f371c532579b4f20607a289", size = 18614185, upload-time = "2025-05-17T21:30:18.703Z" }, + { url = "https://files.pythonhosted.org/packages/5b/c5/0064b1b7e7c89137b471ccec1fd2282fceaae0ab3a9550f2568782d80357/numpy-2.2.6-cp310-cp310-win32.whl", hash = "sha256:b093dd74e50a8cba3e873868d9e93a85b78e0daf2e98c6797566ad8044e8363d", size = 6527149, upload-time = "2025-05-17T21:30:29.788Z" }, + { url = "https://files.pythonhosted.org/packages/a3/dd/4b822569d6b96c39d1215dbae0582fd99954dcbcf0c1a13c61783feaca3f/numpy-2.2.6-cp310-cp310-win_amd64.whl", hash = "sha256:f0fd6321b839904e15c46e0d257fdd101dd7f530fe03fd6359c1ea63738703f3", size = 12904620, upload-time = "2025-05-17T21:30:48.994Z" }, + { url = "https://files.pythonhosted.org/packages/da/a8/4f83e2aa666a9fbf56d6118faaaf5f1974d456b1823fda0a176eff722839/numpy-2.2.6-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f9f1adb22318e121c5c69a09142811a201ef17ab257a1e66ca3025065b7f53ae", size = 21176963, upload-time = "2025-05-17T21:31:19.36Z" }, + { url = "https://files.pythonhosted.org/packages/b3/2b/64e1affc7972decb74c9e29e5649fac940514910960ba25cd9af4488b66c/numpy-2.2.6-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c820a93b0255bc360f53eca31a0e676fd1101f673dda8da93454a12e23fc5f7a", size = 14406743, upload-time = "2025-05-17T21:31:41.087Z" }, + { url = "https://files.pythonhosted.org/packages/4a/9f/0121e375000b5e50ffdd8b25bf78d8e1a5aa4cca3f185d41265198c7b834/numpy-2.2.6-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:3d70692235e759f260c3d837193090014aebdf026dfd167834bcba43e30c2a42", size = 5352616, upload-time = "2025-05-17T21:31:50.072Z" }, + { url = "https://files.pythonhosted.org/packages/31/0d/b48c405c91693635fbe2dcd7bc84a33a602add5f63286e024d3b6741411c/numpy-2.2.6-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:481b49095335f8eed42e39e8041327c05b0f6f4780488f61286ed3c01368d491", size = 6889579, upload-time = "2025-05-17T21:32:01.712Z" }, + { url = "https://files.pythonhosted.org/packages/52/b8/7f0554d49b565d0171eab6e99001846882000883998e7b7d9f0d98b1f934/numpy-2.2.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b64d8d4d17135e00c8e346e0a738deb17e754230d7e0810ac5012750bbd85a5a", size = 14312005, upload-time = "2025-05-17T21:32:23.332Z" }, + { url = "https://files.pythonhosted.org/packages/b3/dd/2238b898e51bd6d389b7389ffb20d7f4c10066d80351187ec8e303a5a475/numpy-2.2.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba10f8411898fc418a521833e014a77d3ca01c15b0c6cdcce6a0d2897e6dbbdf", size = 16821570, upload-time = "2025-05-17T21:32:47.991Z" }, + { url = "https://files.pythonhosted.org/packages/83/6c/44d0325722cf644f191042bf47eedad61c1e6df2432ed65cbe28509d404e/numpy-2.2.6-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:bd48227a919f1bafbdda0583705e547892342c26fb127219d60a5c36882609d1", size = 15818548, upload-time = "2025-05-17T21:33:11.728Z" }, + { url = "https://files.pythonhosted.org/packages/ae/9d/81e8216030ce66be25279098789b665d49ff19eef08bfa8cb96d4957f422/numpy-2.2.6-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:9551a499bf125c1d4f9e250377c1ee2eddd02e01eac6644c080162c0c51778ab", size = 18620521, upload-time = "2025-05-17T21:33:39.139Z" }, + { url = "https://files.pythonhosted.org/packages/6a/fd/e19617b9530b031db51b0926eed5345ce8ddc669bb3bc0044b23e275ebe8/numpy-2.2.6-cp311-cp311-win32.whl", hash = "sha256:0678000bb9ac1475cd454c6b8c799206af8107e310843532b04d49649c717a47", size = 6525866, upload-time = "2025-05-17T21:33:50.273Z" }, + { url = "https://files.pythonhosted.org/packages/31/0a/f354fb7176b81747d870f7991dc763e157a934c717b67b58456bc63da3df/numpy-2.2.6-cp311-cp311-win_amd64.whl", hash = "sha256:e8213002e427c69c45a52bbd94163084025f533a55a59d6f9c5b820774ef3303", size = 12907455, upload-time = "2025-05-17T21:34:09.135Z" }, + { url = "https://files.pythonhosted.org/packages/82/5d/c00588b6cf18e1da539b45d3598d3557084990dcc4331960c15ee776ee41/numpy-2.2.6-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:41c5a21f4a04fa86436124d388f6ed60a9343a6f767fced1a8a71c3fbca038ff", size = 20875348, upload-time = "2025-05-17T21:34:39.648Z" }, + { url = "https://files.pythonhosted.org/packages/66/ee/560deadcdde6c2f90200450d5938f63a34b37e27ebff162810f716f6a230/numpy-2.2.6-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:de749064336d37e340f640b05f24e9e3dd678c57318c7289d222a8a2f543e90c", size = 14119362, upload-time = "2025-05-17T21:35:01.241Z" }, + { url = "https://files.pythonhosted.org/packages/3c/65/4baa99f1c53b30adf0acd9a5519078871ddde8d2339dc5a7fde80d9d87da/numpy-2.2.6-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:894b3a42502226a1cac872f840030665f33326fc3dac8e57c607905773cdcde3", size = 5084103, upload-time = "2025-05-17T21:35:10.622Z" }, + { url = "https://files.pythonhosted.org/packages/cc/89/e5a34c071a0570cc40c9a54eb472d113eea6d002e9ae12bb3a8407fb912e/numpy-2.2.6-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:71594f7c51a18e728451bb50cc60a3ce4e6538822731b2933209a1f3614e9282", size = 6625382, upload-time = "2025-05-17T21:35:21.414Z" }, + { url = "https://files.pythonhosted.org/packages/f8/35/8c80729f1ff76b3921d5c9487c7ac3de9b2a103b1cd05e905b3090513510/numpy-2.2.6-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f2618db89be1b4e05f7a1a847a9c1c0abd63e63a1607d892dd54668dd92faf87", size = 14018462, upload-time = "2025-05-17T21:35:42.174Z" }, + { url = "https://files.pythonhosted.org/packages/8c/3d/1e1db36cfd41f895d266b103df00ca5b3cbe965184df824dec5c08c6b803/numpy-2.2.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fd83c01228a688733f1ded5201c678f0c53ecc1006ffbc404db9f7a899ac6249", size = 16527618, upload-time = "2025-05-17T21:36:06.711Z" }, + { url = "https://files.pythonhosted.org/packages/61/c6/03ed30992602c85aa3cd95b9070a514f8b3c33e31124694438d88809ae36/numpy-2.2.6-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:37c0ca431f82cd5fa716eca9506aefcabc247fb27ba69c5062a6d3ade8cf8f49", size = 15505511, upload-time = "2025-05-17T21:36:29.965Z" }, + { url = "https://files.pythonhosted.org/packages/b7/25/5761d832a81df431e260719ec45de696414266613c9ee268394dd5ad8236/numpy-2.2.6-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fe27749d33bb772c80dcd84ae7e8df2adc920ae8297400dabec45f0dedb3f6de", size = 18313783, upload-time = "2025-05-17T21:36:56.883Z" }, + { url = "https://files.pythonhosted.org/packages/57/0a/72d5a3527c5ebffcd47bde9162c39fae1f90138c961e5296491ce778e682/numpy-2.2.6-cp312-cp312-win32.whl", hash = "sha256:4eeaae00d789f66c7a25ac5f34b71a7035bb474e679f410e5e1a94deb24cf2d4", size = 6246506, upload-time = "2025-05-17T21:37:07.368Z" }, + { url = "https://files.pythonhosted.org/packages/36/fa/8c9210162ca1b88529ab76b41ba02d433fd54fecaf6feb70ef9f124683f1/numpy-2.2.6-cp312-cp312-win_amd64.whl", hash = "sha256:c1f9540be57940698ed329904db803cf7a402f3fc200bfe599334c9bd84a40b2", size = 12614190, upload-time = "2025-05-17T21:37:26.213Z" }, + { url = "https://files.pythonhosted.org/packages/f9/5c/6657823f4f594f72b5471f1db1ab12e26e890bb2e41897522d134d2a3e81/numpy-2.2.6-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:0811bb762109d9708cca4d0b13c4f67146e3c3b7cf8d34018c722adb2d957c84", size = 20867828, upload-time = "2025-05-17T21:37:56.699Z" }, + { url = "https://files.pythonhosted.org/packages/dc/9e/14520dc3dadf3c803473bd07e9b2bd1b69bc583cb2497b47000fed2fa92f/numpy-2.2.6-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:287cc3162b6f01463ccd86be154f284d0893d2b3ed7292439ea97eafa8170e0b", size = 14143006, upload-time = "2025-05-17T21:38:18.291Z" }, + { url = "https://files.pythonhosted.org/packages/4f/06/7e96c57d90bebdce9918412087fc22ca9851cceaf5567a45c1f404480e9e/numpy-2.2.6-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:f1372f041402e37e5e633e586f62aa53de2eac8d98cbfb822806ce4bbefcb74d", size = 5076765, upload-time = "2025-05-17T21:38:27.319Z" }, + { url = "https://files.pythonhosted.org/packages/73/ed/63d920c23b4289fdac96ddbdd6132e9427790977d5457cd132f18e76eae0/numpy-2.2.6-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:55a4d33fa519660d69614a9fad433be87e5252f4b03850642f88993f7b2ca566", size = 6617736, upload-time = "2025-05-17T21:38:38.141Z" }, + { url = "https://files.pythonhosted.org/packages/85/c5/e19c8f99d83fd377ec8c7e0cf627a8049746da54afc24ef0a0cb73d5dfb5/numpy-2.2.6-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f92729c95468a2f4f15e9bb94c432a9229d0d50de67304399627a943201baa2f", size = 14010719, upload-time = "2025-05-17T21:38:58.433Z" }, + { url = "https://files.pythonhosted.org/packages/19/49/4df9123aafa7b539317bf6d342cb6d227e49f7a35b99c287a6109b13dd93/numpy-2.2.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1bc23a79bfabc5d056d106f9befb8d50c31ced2fbc70eedb8155aec74a45798f", size = 16526072, upload-time = "2025-05-17T21:39:22.638Z" }, + { url = "https://files.pythonhosted.org/packages/b2/6c/04b5f47f4f32f7c2b0e7260442a8cbcf8168b0e1a41ff1495da42f42a14f/numpy-2.2.6-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:e3143e4451880bed956e706a3220b4e5cf6172ef05fcc397f6f36a550b1dd868", size = 15503213, upload-time = "2025-05-17T21:39:45.865Z" }, + { url = "https://files.pythonhosted.org/packages/17/0a/5cd92e352c1307640d5b6fec1b2ffb06cd0dabe7d7b8227f97933d378422/numpy-2.2.6-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:b4f13750ce79751586ae2eb824ba7e1e8dba64784086c98cdbbcc6a42112ce0d", size = 18316632, upload-time = "2025-05-17T21:40:13.331Z" }, + { url = "https://files.pythonhosted.org/packages/f0/3b/5cba2b1d88760ef86596ad0f3d484b1cbff7c115ae2429678465057c5155/numpy-2.2.6-cp313-cp313-win32.whl", hash = "sha256:5beb72339d9d4fa36522fc63802f469b13cdbe4fdab4a288f0c441b74272ebfd", size = 6244532, upload-time = "2025-05-17T21:43:46.099Z" }, + { url = "https://files.pythonhosted.org/packages/cb/3b/d58c12eafcb298d4e6d0d40216866ab15f59e55d148a5658bb3132311fcf/numpy-2.2.6-cp313-cp313-win_amd64.whl", hash = "sha256:b0544343a702fa80c95ad5d3d608ea3599dd54d4632df855e4c8d24eb6ecfa1c", size = 12610885, upload-time = "2025-05-17T21:44:05.145Z" }, + { url = "https://files.pythonhosted.org/packages/6b/9e/4bf918b818e516322db999ac25d00c75788ddfd2d2ade4fa66f1f38097e1/numpy-2.2.6-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:0bca768cd85ae743b2affdc762d617eddf3bcf8724435498a1e80132d04879e6", size = 20963467, upload-time = "2025-05-17T21:40:44Z" }, + { url = "https://files.pythonhosted.org/packages/61/66/d2de6b291507517ff2e438e13ff7b1e2cdbdb7cb40b3ed475377aece69f9/numpy-2.2.6-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:fc0c5673685c508a142ca65209b4e79ed6740a4ed6b2267dbba90f34b0b3cfda", size = 14225144, upload-time = "2025-05-17T21:41:05.695Z" }, + { url = "https://files.pythonhosted.org/packages/e4/25/480387655407ead912e28ba3a820bc69af9adf13bcbe40b299d454ec011f/numpy-2.2.6-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:5bd4fc3ac8926b3819797a7c0e2631eb889b4118a9898c84f585a54d475b7e40", size = 5200217, upload-time = "2025-05-17T21:41:15.903Z" }, + { url = "https://files.pythonhosted.org/packages/aa/4a/6e313b5108f53dcbf3aca0c0f3e9c92f4c10ce57a0a721851f9785872895/numpy-2.2.6-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:fee4236c876c4e8369388054d02d0e9bb84821feb1a64dd59e137e6511a551f8", size = 6712014, upload-time = "2025-05-17T21:41:27.321Z" }, + { url = "https://files.pythonhosted.org/packages/b7/30/172c2d5c4be71fdf476e9de553443cf8e25feddbe185e0bd88b096915bcc/numpy-2.2.6-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e1dda9c7e08dc141e0247a5b8f49cf05984955246a327d4c48bda16821947b2f", size = 14077935, upload-time = "2025-05-17T21:41:49.738Z" }, + { url = "https://files.pythonhosted.org/packages/12/fb/9e743f8d4e4d3c710902cf87af3512082ae3d43b945d5d16563f26ec251d/numpy-2.2.6-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f447e6acb680fd307f40d3da4852208af94afdfab89cf850986c3ca00562f4fa", size = 16600122, upload-time = "2025-05-17T21:42:14.046Z" }, + { url = "https://files.pythonhosted.org/packages/12/75/ee20da0e58d3a66f204f38916757e01e33a9737d0b22373b3eb5a27358f9/numpy-2.2.6-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:389d771b1623ec92636b0786bc4ae56abafad4a4c513d36a55dce14bd9ce8571", size = 15586143, upload-time = "2025-05-17T21:42:37.464Z" }, + { url = "https://files.pythonhosted.org/packages/76/95/bef5b37f29fc5e739947e9ce5179ad402875633308504a52d188302319c8/numpy-2.2.6-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:8e9ace4a37db23421249ed236fdcdd457d671e25146786dfc96835cd951aa7c1", size = 18385260, upload-time = "2025-05-17T21:43:05.189Z" }, + { url = "https://files.pythonhosted.org/packages/09/04/f2f83279d287407cf36a7a8053a5abe7be3622a4363337338f2585e4afda/numpy-2.2.6-cp313-cp313t-win32.whl", hash = "sha256:038613e9fb8c72b0a41f025a7e4c3f0b7a1b5d768ece4796b674c8f3fe13efff", size = 6377225, upload-time = "2025-05-17T21:43:16.254Z" }, + { url = "https://files.pythonhosted.org/packages/67/0e/35082d13c09c02c011cf21570543d202ad929d961c02a147493cb0c2bdf5/numpy-2.2.6-cp313-cp313t-win_amd64.whl", hash = "sha256:6031dd6dfecc0cf9f668681a37648373bddd6421fff6c66ec1624eed0180ee06", size = 12771374, upload-time = "2025-05-17T21:43:35.479Z" }, + { url = "https://files.pythonhosted.org/packages/9e/3b/d94a75f4dbf1ef5d321523ecac21ef23a3cd2ac8b78ae2aac40873590229/numpy-2.2.6-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:0b605b275d7bd0c640cad4e5d30fa701a8d59302e127e5f79138ad62762c3e3d", size = 21040391, upload-time = "2025-05-17T21:44:35.948Z" }, + { url = "https://files.pythonhosted.org/packages/17/f4/09b2fa1b58f0fb4f7c7963a1649c64c4d315752240377ed74d9cd878f7b5/numpy-2.2.6-pp310-pypy310_pp73-macosx_14_0_x86_64.whl", hash = "sha256:7befc596a7dc9da8a337f79802ee8adb30a552a94f792b9c9d18c840055907db", size = 6786754, upload-time = "2025-05-17T21:44:47.446Z" }, + { url = "https://files.pythonhosted.org/packages/af/30/feba75f143bdc868a1cc3f44ccfa6c4b9ec522b36458e738cd00f67b573f/numpy-2.2.6-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ce47521a4754c8f4593837384bd3424880629f718d87c5d44f8ed763edd63543", size = 16643476, upload-time = "2025-05-17T21:45:11.871Z" }, + { url = "https://files.pythonhosted.org/packages/37/48/ac2a9584402fb6c0cd5b5d1a91dcf176b15760130dd386bbafdbfe3640bf/numpy-2.2.6-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:d042d24c90c41b54fd506da306759e06e568864df8ec17ccc17e9e884634fd00", size = 12812666, upload-time = "2025-05-17T21:45:31.426Z" }, +] + +[[package]] +name = "numpy" +version = "2.3.2" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.11'", +] +sdist = { url = "https://files.pythonhosted.org/packages/37/7d/3fec4199c5ffb892bed55cff901e4f39a58c81df9c44c280499e92cad264/numpy-2.3.2.tar.gz", hash = "sha256:e0486a11ec30cdecb53f184d496d1c6a20786c81e55e41640270130056f8ee48", size = 20489306, upload-time = "2025-07-24T21:32:07.553Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/96/26/1320083986108998bd487e2931eed2aeedf914b6e8905431487543ec911d/numpy-2.3.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:852ae5bed3478b92f093e30f785c98e0cb62fa0a939ed057c31716e18a7a22b9", size = 21259016, upload-time = "2025-07-24T20:24:35.214Z" }, + { url = "https://files.pythonhosted.org/packages/c4/2b/792b341463fa93fc7e55abbdbe87dac316c5b8cb5e94fb7a59fb6fa0cda5/numpy-2.3.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:7a0e27186e781a69959d0230dd9909b5e26024f8da10683bd6344baea1885168", size = 14451158, upload-time = "2025-07-24T20:24:58.397Z" }, + { url = "https://files.pythonhosted.org/packages/b7/13/e792d7209261afb0c9f4759ffef6135b35c77c6349a151f488f531d13595/numpy-2.3.2-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:f0a1a8476ad77a228e41619af2fa9505cf69df928e9aaa165746584ea17fed2b", size = 5379817, upload-time = "2025-07-24T20:25:07.746Z" }, + { url = "https://files.pythonhosted.org/packages/49/ce/055274fcba4107c022b2113a213c7287346563f48d62e8d2a5176ad93217/numpy-2.3.2-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:cbc95b3813920145032412f7e33d12080f11dc776262df1712e1638207dde9e8", size = 6913606, upload-time = "2025-07-24T20:25:18.84Z" }, + { url = "https://files.pythonhosted.org/packages/17/f2/e4d72e6bc5ff01e2ab613dc198d560714971900c03674b41947e38606502/numpy-2.3.2-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f75018be4980a7324edc5930fe39aa391d5734531b1926968605416ff58c332d", size = 14589652, upload-time = "2025-07-24T20:25:40.356Z" }, + { url = "https://files.pythonhosted.org/packages/c8/b0/fbeee3000a51ebf7222016e2939b5c5ecf8000a19555d04a18f1e02521b8/numpy-2.3.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:20b8200721840f5621b7bd03f8dcd78de33ec522fc40dc2641aa09537df010c3", size = 16938816, upload-time = "2025-07-24T20:26:05.721Z" }, + { url = "https://files.pythonhosted.org/packages/a9/ec/2f6c45c3484cc159621ea8fc000ac5a86f1575f090cac78ac27193ce82cd/numpy-2.3.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1f91e5c028504660d606340a084db4b216567ded1056ea2b4be4f9d10b67197f", size = 16370512, upload-time = "2025-07-24T20:26:30.545Z" }, + { url = "https://files.pythonhosted.org/packages/b5/01/dd67cf511850bd7aefd6347aaae0956ed415abea741ae107834aae7d6d4e/numpy-2.3.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:fb1752a3bb9a3ad2d6b090b88a9a0ae1cd6f004ef95f75825e2f382c183b2097", size = 18884947, upload-time = "2025-07-24T20:26:58.24Z" }, + { url = "https://files.pythonhosted.org/packages/a7/17/2cf60fd3e6a61d006778735edf67a222787a8c1a7842aed43ef96d777446/numpy-2.3.2-cp311-cp311-win32.whl", hash = "sha256:4ae6863868aaee2f57503c7a5052b3a2807cf7a3914475e637a0ecd366ced220", size = 6599494, upload-time = "2025-07-24T20:27:09.786Z" }, + { url = "https://files.pythonhosted.org/packages/d5/03/0eade211c504bda872a594f045f98ddcc6caef2b7c63610946845e304d3f/numpy-2.3.2-cp311-cp311-win_amd64.whl", hash = "sha256:240259d6564f1c65424bcd10f435145a7644a65a6811cfc3201c4a429ba79170", size = 13087889, upload-time = "2025-07-24T20:27:29.558Z" }, + { url = "https://files.pythonhosted.org/packages/13/32/2c7979d39dafb2a25087e12310fc7f3b9d3c7d960df4f4bc97955ae0ce1d/numpy-2.3.2-cp311-cp311-win_arm64.whl", hash = "sha256:4209f874d45f921bde2cff1ffcd8a3695f545ad2ffbef6d3d3c6768162efab89", size = 10459560, upload-time = "2025-07-24T20:27:46.803Z" }, + { url = "https://files.pythonhosted.org/packages/00/6d/745dd1c1c5c284d17725e5c802ca4d45cfc6803519d777f087b71c9f4069/numpy-2.3.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:bc3186bea41fae9d8e90c2b4fb5f0a1f5a690682da79b92574d63f56b529080b", size = 20956420, upload-time = "2025-07-24T20:28:18.002Z" }, + { url = "https://files.pythonhosted.org/packages/bc/96/e7b533ea5740641dd62b07a790af5d9d8fec36000b8e2d0472bd7574105f/numpy-2.3.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2f4f0215edb189048a3c03bd5b19345bdfa7b45a7a6f72ae5945d2a28272727f", size = 14184660, upload-time = "2025-07-24T20:28:39.522Z" }, + { url = "https://files.pythonhosted.org/packages/2b/53/102c6122db45a62aa20d1b18c9986f67e6b97e0d6fbc1ae13e3e4c84430c/numpy-2.3.2-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:8b1224a734cd509f70816455c3cffe13a4f599b1bf7130f913ba0e2c0b2006c0", size = 5113382, upload-time = "2025-07-24T20:28:48.544Z" }, + { url = "https://files.pythonhosted.org/packages/2b/21/376257efcbf63e624250717e82b4fae93d60178f09eb03ed766dbb48ec9c/numpy-2.3.2-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:3dcf02866b977a38ba3ec10215220609ab9667378a9e2150615673f3ffd6c73b", size = 6647258, upload-time = "2025-07-24T20:28:59.104Z" }, + { url = "https://files.pythonhosted.org/packages/91/ba/f4ebf257f08affa464fe6036e13f2bf9d4642a40228781dc1235da81be9f/numpy-2.3.2-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:572d5512df5470f50ada8d1972c5f1082d9a0b7aa5944db8084077570cf98370", size = 14281409, upload-time = "2025-07-24T20:40:30.298Z" }, + { url = "https://files.pythonhosted.org/packages/59/ef/f96536f1df42c668cbacb727a8c6da7afc9c05ece6d558927fb1722693e1/numpy-2.3.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8145dd6d10df13c559d1e4314df29695613575183fa2e2d11fac4c208c8a1f73", size = 16641317, upload-time = "2025-07-24T20:40:56.625Z" }, + { url = "https://files.pythonhosted.org/packages/f6/a7/af813a7b4f9a42f498dde8a4c6fcbff8100eed00182cc91dbaf095645f38/numpy-2.3.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:103ea7063fa624af04a791c39f97070bf93b96d7af7eb23530cd087dc8dbe9dc", size = 16056262, upload-time = "2025-07-24T20:41:20.797Z" }, + { url = "https://files.pythonhosted.org/packages/8b/5d/41c4ef8404caaa7f05ed1cfb06afe16a25895260eacbd29b4d84dff2920b/numpy-2.3.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fc927d7f289d14f5e037be917539620603294454130b6de200091e23d27dc9be", size = 18579342, upload-time = "2025-07-24T20:41:50.753Z" }, + { url = "https://files.pythonhosted.org/packages/a1/4f/9950e44c5a11636f4a3af6e825ec23003475cc9a466edb7a759ed3ea63bd/numpy-2.3.2-cp312-cp312-win32.whl", hash = "sha256:d95f59afe7f808c103be692175008bab926b59309ade3e6d25009e9a171f7036", size = 6320610, upload-time = "2025-07-24T20:42:01.551Z" }, + { url = "https://files.pythonhosted.org/packages/7c/2f/244643a5ce54a94f0a9a2ab578189c061e4a87c002e037b0829dd77293b6/numpy-2.3.2-cp312-cp312-win_amd64.whl", hash = "sha256:9e196ade2400c0c737d93465327d1ae7c06c7cb8a1756121ebf54b06ca183c7f", size = 12786292, upload-time = "2025-07-24T20:42:20.738Z" }, + { url = "https://files.pythonhosted.org/packages/54/cd/7b5f49d5d78db7badab22d8323c1b6ae458fbf86c4fdfa194ab3cd4eb39b/numpy-2.3.2-cp312-cp312-win_arm64.whl", hash = "sha256:ee807923782faaf60d0d7331f5e86da7d5e3079e28b291973c545476c2b00d07", size = 10194071, upload-time = "2025-07-24T20:42:36.657Z" }, + { url = "https://files.pythonhosted.org/packages/1c/c0/c6bb172c916b00700ed3bf71cb56175fd1f7dbecebf8353545d0b5519f6c/numpy-2.3.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:c8d9727f5316a256425892b043736d63e89ed15bbfe6556c5ff4d9d4448ff3b3", size = 20949074, upload-time = "2025-07-24T20:43:07.813Z" }, + { url = "https://files.pythonhosted.org/packages/20/4e/c116466d22acaf4573e58421c956c6076dc526e24a6be0903219775d862e/numpy-2.3.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:efc81393f25f14d11c9d161e46e6ee348637c0a1e8a54bf9dedc472a3fae993b", size = 14177311, upload-time = "2025-07-24T20:43:29.335Z" }, + { url = "https://files.pythonhosted.org/packages/78/45/d4698c182895af189c463fc91d70805d455a227261d950e4e0f1310c2550/numpy-2.3.2-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:dd937f088a2df683cbb79dda9a772b62a3e5a8a7e76690612c2737f38c6ef1b6", size = 5106022, upload-time = "2025-07-24T20:43:37.999Z" }, + { url = "https://files.pythonhosted.org/packages/9f/76/3e6880fef4420179309dba72a8c11f6166c431cf6dee54c577af8906f914/numpy-2.3.2-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:11e58218c0c46c80509186e460d79fbdc9ca1eb8d8aee39d8f2dc768eb781089", size = 6640135, upload-time = "2025-07-24T20:43:49.28Z" }, + { url = "https://files.pythonhosted.org/packages/34/fa/87ff7f25b3c4ce9085a62554460b7db686fef1e0207e8977795c7b7d7ba1/numpy-2.3.2-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5ad4ebcb683a1f99f4f392cc522ee20a18b2bb12a2c1c42c3d48d5a1adc9d3d2", size = 14278147, upload-time = "2025-07-24T20:44:10.328Z" }, + { url = "https://files.pythonhosted.org/packages/1d/0f/571b2c7a3833ae419fe69ff7b479a78d313581785203cc70a8db90121b9a/numpy-2.3.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:938065908d1d869c7d75d8ec45f735a034771c6ea07088867f713d1cd3bbbe4f", size = 16635989, upload-time = "2025-07-24T20:44:34.88Z" }, + { url = "https://files.pythonhosted.org/packages/24/5a/84ae8dca9c9a4c592fe11340b36a86ffa9fd3e40513198daf8a97839345c/numpy-2.3.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:66459dccc65d8ec98cc7df61307b64bf9e08101f9598755d42d8ae65d9a7a6ee", size = 16053052, upload-time = "2025-07-24T20:44:58.872Z" }, + { url = "https://files.pythonhosted.org/packages/57/7c/e5725d99a9133b9813fcf148d3f858df98511686e853169dbaf63aec6097/numpy-2.3.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a7af9ed2aa9ec5950daf05bb11abc4076a108bd3c7db9aa7251d5f107079b6a6", size = 18577955, upload-time = "2025-07-24T20:45:26.714Z" }, + { url = "https://files.pythonhosted.org/packages/ae/11/7c546fcf42145f29b71e4d6f429e96d8d68e5a7ba1830b2e68d7418f0bbd/numpy-2.3.2-cp313-cp313-win32.whl", hash = "sha256:906a30249315f9c8e17b085cc5f87d3f369b35fedd0051d4a84686967bdbbd0b", size = 6311843, upload-time = "2025-07-24T20:49:24.444Z" }, + { url = "https://files.pythonhosted.org/packages/aa/6f/a428fd1cb7ed39b4280d057720fed5121b0d7754fd2a9768640160f5517b/numpy-2.3.2-cp313-cp313-win_amd64.whl", hash = "sha256:c63d95dc9d67b676e9108fe0d2182987ccb0f11933c1e8959f42fa0da8d4fa56", size = 12782876, upload-time = "2025-07-24T20:49:43.227Z" }, + { url = "https://files.pythonhosted.org/packages/65/85/4ea455c9040a12595fb6c43f2c217257c7b52dd0ba332c6a6c1d28b289fe/numpy-2.3.2-cp313-cp313-win_arm64.whl", hash = "sha256:b05a89f2fb84d21235f93de47129dd4f11c16f64c87c33f5e284e6a3a54e43f2", size = 10192786, upload-time = "2025-07-24T20:49:59.443Z" }, + { url = "https://files.pythonhosted.org/packages/80/23/8278f40282d10c3f258ec3ff1b103d4994bcad78b0cba9208317f6bb73da/numpy-2.3.2-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:4e6ecfeddfa83b02318f4d84acf15fbdbf9ded18e46989a15a8b6995dfbf85ab", size = 21047395, upload-time = "2025-07-24T20:45:58.821Z" }, + { url = "https://files.pythonhosted.org/packages/1f/2d/624f2ce4a5df52628b4ccd16a4f9437b37c35f4f8a50d00e962aae6efd7a/numpy-2.3.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:508b0eada3eded10a3b55725b40806a4b855961040180028f52580c4729916a2", size = 14300374, upload-time = "2025-07-24T20:46:20.207Z" }, + { url = "https://files.pythonhosted.org/packages/f6/62/ff1e512cdbb829b80a6bd08318a58698867bca0ca2499d101b4af063ee97/numpy-2.3.2-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:754d6755d9a7588bdc6ac47dc4ee97867271b17cee39cb87aef079574366db0a", size = 5228864, upload-time = "2025-07-24T20:46:30.58Z" }, + { url = "https://files.pythonhosted.org/packages/7d/8e/74bc18078fff03192d4032cfa99d5a5ca937807136d6f5790ce07ca53515/numpy-2.3.2-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:a9f66e7d2b2d7712410d3bc5684149040ef5f19856f20277cd17ea83e5006286", size = 6737533, upload-time = "2025-07-24T20:46:46.111Z" }, + { url = "https://files.pythonhosted.org/packages/19/ea/0731efe2c9073ccca5698ef6a8c3667c4cf4eea53fcdcd0b50140aba03bc/numpy-2.3.2-cp313-cp313t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:de6ea4e5a65d5a90c7d286ddff2b87f3f4ad61faa3db8dabe936b34c2275b6f8", size = 14352007, upload-time = "2025-07-24T20:47:07.1Z" }, + { url = "https://files.pythonhosted.org/packages/cf/90/36be0865f16dfed20f4bc7f75235b963d5939707d4b591f086777412ff7b/numpy-2.3.2-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a3ef07ec8cbc8fc9e369c8dcd52019510c12da4de81367d8b20bc692aa07573a", size = 16701914, upload-time = "2025-07-24T20:47:32.459Z" }, + { url = "https://files.pythonhosted.org/packages/94/30/06cd055e24cb6c38e5989a9e747042b4e723535758e6153f11afea88c01b/numpy-2.3.2-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:27c9f90e7481275c7800dc9c24b7cc40ace3fdb970ae4d21eaff983a32f70c91", size = 16132708, upload-time = "2025-07-24T20:47:58.129Z" }, + { url = "https://files.pythonhosted.org/packages/9a/14/ecede608ea73e58267fd7cb78f42341b3b37ba576e778a1a06baffbe585c/numpy-2.3.2-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:07b62978075b67eee4065b166d000d457c82a1efe726cce608b9db9dd66a73a5", size = 18651678, upload-time = "2025-07-24T20:48:25.402Z" }, + { url = "https://files.pythonhosted.org/packages/40/f3/2fe6066b8d07c3685509bc24d56386534c008b462a488b7f503ba82b8923/numpy-2.3.2-cp313-cp313t-win32.whl", hash = "sha256:c771cfac34a4f2c0de8e8c97312d07d64fd8f8ed45bc9f5726a7e947270152b5", size = 6441832, upload-time = "2025-07-24T20:48:37.181Z" }, + { url = "https://files.pythonhosted.org/packages/0b/ba/0937d66d05204d8f28630c9c60bc3eda68824abde4cf756c4d6aad03b0c6/numpy-2.3.2-cp313-cp313t-win_amd64.whl", hash = "sha256:72dbebb2dcc8305c431b2836bcc66af967df91be793d63a24e3d9b741374c450", size = 12927049, upload-time = "2025-07-24T20:48:56.24Z" }, + { url = "https://files.pythonhosted.org/packages/e9/ed/13542dd59c104d5e654dfa2ac282c199ba64846a74c2c4bcdbc3a0f75df1/numpy-2.3.2-cp313-cp313t-win_arm64.whl", hash = "sha256:72c6df2267e926a6d5286b0a6d556ebe49eae261062059317837fda12ddf0c1a", size = 10262935, upload-time = "2025-07-24T20:49:13.136Z" }, + { url = "https://files.pythonhosted.org/packages/c9/7c/7659048aaf498f7611b783e000c7268fcc4dcf0ce21cd10aad7b2e8f9591/numpy-2.3.2-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:448a66d052d0cf14ce9865d159bfc403282c9bc7bb2a31b03cc18b651eca8b1a", size = 20950906, upload-time = "2025-07-24T20:50:30.346Z" }, + { url = "https://files.pythonhosted.org/packages/80/db/984bea9d4ddf7112a04cfdfb22b1050af5757864cfffe8e09e44b7f11a10/numpy-2.3.2-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:546aaf78e81b4081b2eba1d105c3b34064783027a06b3ab20b6eba21fb64132b", size = 14185607, upload-time = "2025-07-24T20:50:51.923Z" }, + { url = "https://files.pythonhosted.org/packages/e4/76/b3d6f414f4eca568f469ac112a3b510938d892bc5a6c190cb883af080b77/numpy-2.3.2-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:87c930d52f45df092f7578889711a0768094debf73cfcde105e2d66954358125", size = 5114110, upload-time = "2025-07-24T20:51:01.041Z" }, + { url = "https://files.pythonhosted.org/packages/9e/d2/6f5e6826abd6bca52392ed88fe44a4b52aacb60567ac3bc86c67834c3a56/numpy-2.3.2-cp314-cp314-macosx_14_0_x86_64.whl", hash = "sha256:8dc082ea901a62edb8f59713c6a7e28a85daddcb67454c839de57656478f5b19", size = 6642050, upload-time = "2025-07-24T20:51:11.64Z" }, + { url = "https://files.pythonhosted.org/packages/c4/43/f12b2ade99199e39c73ad182f103f9d9791f48d885c600c8e05927865baf/numpy-2.3.2-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:af58de8745f7fa9ca1c0c7c943616c6fe28e75d0c81f5c295810e3c83b5be92f", size = 14296292, upload-time = "2025-07-24T20:51:33.488Z" }, + { url = "https://files.pythonhosted.org/packages/5d/f9/77c07d94bf110a916b17210fac38680ed8734c236bfed9982fd8524a7b47/numpy-2.3.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fed5527c4cf10f16c6d0b6bee1f89958bccb0ad2522c8cadc2efd318bcd545f5", size = 16638913, upload-time = "2025-07-24T20:51:58.517Z" }, + { url = "https://files.pythonhosted.org/packages/9b/d1/9d9f2c8ea399cc05cfff8a7437453bd4e7d894373a93cdc46361bbb49a7d/numpy-2.3.2-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:095737ed986e00393ec18ec0b21b47c22889ae4b0cd2d5e88342e08b01141f58", size = 16071180, upload-time = "2025-07-24T20:52:22.827Z" }, + { url = "https://files.pythonhosted.org/packages/4c/41/82e2c68aff2a0c9bf315e47d61951099fed65d8cb2c8d9dc388cb87e947e/numpy-2.3.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:b5e40e80299607f597e1a8a247ff8d71d79c5b52baa11cc1cce30aa92d2da6e0", size = 18576809, upload-time = "2025-07-24T20:52:51.015Z" }, + { url = "https://files.pythonhosted.org/packages/14/14/4b4fd3efb0837ed252d0f583c5c35a75121038a8c4e065f2c259be06d2d8/numpy-2.3.2-cp314-cp314-win32.whl", hash = "sha256:7d6e390423cc1f76e1b8108c9b6889d20a7a1f59d9a60cac4a050fa734d6c1e2", size = 6366410, upload-time = "2025-07-24T20:56:44.949Z" }, + { url = "https://files.pythonhosted.org/packages/11/9e/b4c24a6b8467b61aced5c8dc7dcfce23621baa2e17f661edb2444a418040/numpy-2.3.2-cp314-cp314-win_amd64.whl", hash = "sha256:b9d0878b21e3918d76d2209c924ebb272340da1fb51abc00f986c258cd5e957b", size = 12918821, upload-time = "2025-07-24T20:57:06.479Z" }, + { url = "https://files.pythonhosted.org/packages/0e/0f/0dc44007c70b1007c1cef86b06986a3812dd7106d8f946c09cfa75782556/numpy-2.3.2-cp314-cp314-win_arm64.whl", hash = "sha256:2738534837c6a1d0c39340a190177d7d66fdf432894f469728da901f8f6dc910", size = 10477303, upload-time = "2025-07-24T20:57:22.879Z" }, + { url = "https://files.pythonhosted.org/packages/8b/3e/075752b79140b78ddfc9c0a1634d234cfdbc6f9bbbfa6b7504e445ad7d19/numpy-2.3.2-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:4d002ecf7c9b53240be3bb69d80f86ddbd34078bae04d87be81c1f58466f264e", size = 21047524, upload-time = "2025-07-24T20:53:22.086Z" }, + { url = "https://files.pythonhosted.org/packages/fe/6d/60e8247564a72426570d0e0ea1151b95ce5bd2f1597bb878a18d32aec855/numpy-2.3.2-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:293b2192c6bcce487dbc6326de5853787f870aeb6c43f8f9c6496db5b1781e45", size = 14300519, upload-time = "2025-07-24T20:53:44.053Z" }, + { url = "https://files.pythonhosted.org/packages/4d/73/d8326c442cd428d47a067070c3ac6cc3b651a6e53613a1668342a12d4479/numpy-2.3.2-cp314-cp314t-macosx_14_0_arm64.whl", hash = "sha256:0a4f2021a6da53a0d580d6ef5db29947025ae8b35b3250141805ea9a32bbe86b", size = 5228972, upload-time = "2025-07-24T20:53:53.81Z" }, + { url = "https://files.pythonhosted.org/packages/34/2e/e71b2d6dad075271e7079db776196829019b90ce3ece5c69639e4f6fdc44/numpy-2.3.2-cp314-cp314t-macosx_14_0_x86_64.whl", hash = "sha256:9c144440db4bf3bb6372d2c3e49834cc0ff7bb4c24975ab33e01199e645416f2", size = 6737439, upload-time = "2025-07-24T20:54:04.742Z" }, + { url = "https://files.pythonhosted.org/packages/15/b0/d004bcd56c2c5e0500ffc65385eb6d569ffd3363cb5e593ae742749b2daa/numpy-2.3.2-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f92d6c2a8535dc4fe4419562294ff957f83a16ebdec66df0805e473ffaad8bd0", size = 14352479, upload-time = "2025-07-24T20:54:25.819Z" }, + { url = "https://files.pythonhosted.org/packages/11/e3/285142fcff8721e0c99b51686426165059874c150ea9ab898e12a492e291/numpy-2.3.2-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:cefc2219baa48e468e3db7e706305fcd0c095534a192a08f31e98d83a7d45fb0", size = 16702805, upload-time = "2025-07-24T20:54:50.814Z" }, + { url = "https://files.pythonhosted.org/packages/33/c3/33b56b0e47e604af2c7cd065edca892d180f5899599b76830652875249a3/numpy-2.3.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:76c3e9501ceb50b2ff3824c3589d5d1ab4ac857b0ee3f8f49629d0de55ecf7c2", size = 16133830, upload-time = "2025-07-24T20:55:17.306Z" }, + { url = "https://files.pythonhosted.org/packages/6e/ae/7b1476a1f4d6a48bc669b8deb09939c56dd2a439db1ab03017844374fb67/numpy-2.3.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:122bf5ed9a0221b3419672493878ba4967121514b1d7d4656a7580cd11dddcbf", size = 18652665, upload-time = "2025-07-24T20:55:46.665Z" }, + { url = "https://files.pythonhosted.org/packages/14/ba/5b5c9978c4bb161034148ade2de9db44ec316fab89ce8c400db0e0c81f86/numpy-2.3.2-cp314-cp314t-win32.whl", hash = "sha256:6f1ae3dcb840edccc45af496f312528c15b1f79ac318169d094e85e4bb35fdf1", size = 6514777, upload-time = "2025-07-24T20:55:57.66Z" }, + { url = "https://files.pythonhosted.org/packages/eb/46/3dbaf0ae7c17cdc46b9f662c56da2054887b8d9e737c1476f335c83d33db/numpy-2.3.2-cp314-cp314t-win_amd64.whl", hash = "sha256:087ffc25890d89a43536f75c5fe8770922008758e8eeeef61733957041ed2f9b", size = 13111856, upload-time = "2025-07-24T20:56:17.318Z" }, + { url = "https://files.pythonhosted.org/packages/c1/9e/1652778bce745a67b5fe05adde60ed362d38eb17d919a540e813d30f6874/numpy-2.3.2-cp314-cp314t-win_arm64.whl", hash = "sha256:092aeb3449833ea9c0bf0089d70c29ae480685dd2377ec9cdbbb620257f84631", size = 10544226, upload-time = "2025-07-24T20:56:34.509Z" }, + { url = "https://files.pythonhosted.org/packages/cf/ea/50ebc91d28b275b23b7128ef25c3d08152bc4068f42742867e07a870a42a/numpy-2.3.2-pp311-pypy311_pp73-macosx_10_15_x86_64.whl", hash = "sha256:14a91ebac98813a49bc6aa1a0dfc09513dcec1d97eaf31ca21a87221a1cdcb15", size = 21130338, upload-time = "2025-07-24T20:57:54.37Z" }, + { url = "https://files.pythonhosted.org/packages/9f/57/cdd5eac00dd5f137277355c318a955c0d8fb8aa486020c22afd305f8b88f/numpy-2.3.2-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:71669b5daae692189540cffc4c439468d35a3f84f0c88b078ecd94337f6cb0ec", size = 14375776, upload-time = "2025-07-24T20:58:16.303Z" }, + { url = "https://files.pythonhosted.org/packages/83/85/27280c7f34fcd305c2209c0cdca4d70775e4859a9eaa92f850087f8dea50/numpy-2.3.2-pp311-pypy311_pp73-macosx_14_0_arm64.whl", hash = "sha256:69779198d9caee6e547adb933941ed7520f896fd9656834c300bdf4dd8642712", size = 5304882, upload-time = "2025-07-24T20:58:26.199Z" }, + { url = "https://files.pythonhosted.org/packages/48/b4/6500b24d278e15dd796f43824e69939d00981d37d9779e32499e823aa0aa/numpy-2.3.2-pp311-pypy311_pp73-macosx_14_0_x86_64.whl", hash = "sha256:2c3271cc4097beb5a60f010bcc1cc204b300bb3eafb4399376418a83a1c6373c", size = 6818405, upload-time = "2025-07-24T20:58:37.341Z" }, + { url = "https://files.pythonhosted.org/packages/9b/c9/142c1e03f199d202da8e980c2496213509291b6024fd2735ad28ae7065c7/numpy-2.3.2-pp311-pypy311_pp73-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8446acd11fe3dc1830568c941d44449fd5cb83068e5c70bd5a470d323d448296", size = 14419651, upload-time = "2025-07-24T20:58:59.048Z" }, + { url = "https://files.pythonhosted.org/packages/8b/95/8023e87cbea31a750a6c00ff9427d65ebc5fef104a136bfa69f76266d614/numpy-2.3.2-pp311-pypy311_pp73-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:aa098a5ab53fa407fded5870865c6275a5cd4101cfdef8d6fafc48286a96e981", size = 16760166, upload-time = "2025-07-24T21:28:56.38Z" }, + { url = "https://files.pythonhosted.org/packages/78/e3/6690b3f85a05506733c7e90b577e4762517404ea78bab2ca3a5cb1aeb78d/numpy-2.3.2-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:6936aff90dda378c09bea075af0d9c675fe3a977a9d2402f95a87f440f59f619", size = 12977811, upload-time = "2025-07-24T21:29:18.234Z" }, ] [[package]] name = "openai" -version = "1.93.1" +version = "2.2.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "anyio" }, @@ -1473,14 +1870,14 @@ dependencies = [ { name = "tqdm" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/5e/a8/e4427729da048cb33bda15e70f09f7520bdf3577bafc546b135ecb36af7d/openai-1.93.1.tar.gz", hash = "sha256:11eb8932965d0f79ecc4cb38a60a0c4cef4bcd5fcf08b99fc9a399fa5f1e50ab", size = 487124, upload-time = "2025-07-07T16:40:38.389Z" } +sdist = { url = "https://files.pythonhosted.org/packages/b8/b1/8201e321a7d64a25c6f5a560320272d8be70547add40311fceb916518632/openai-2.2.0.tar.gz", hash = "sha256:bc49d077a8bf0e370eec4d038bc05e232c20855a19df0b58e5b3e5a8da7d33e0", size = 588512, upload-time = "2025-10-06T18:08:13.665Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/64/4f/875e5af1fb4e5ed4ea9e4a88f482d9ca2e48932105605b6c516e9a14de25/openai-1.93.1-py3-none-any.whl", hash = "sha256:a2c2946c4f21346d4902311a7440381fd8a33466ee7ca688133d1cad29a9357c", size = 755081, upload-time = "2025-07-07T16:40:36.585Z" }, + { url = "https://files.pythonhosted.org/packages/cb/92/6aeef1836e66dfec7f7f160a4f06d7041be7f6ccfc47a2f0f5738b332245/openai-2.2.0-py3-none-any.whl", hash = "sha256:d222e63436e33f3134a3d7ce490dc2d2f146fa98036eb65cc225df3ce163916f", size = 998972, upload-time = "2025-10-06T18:08:11.775Z" }, ] [[package]] name = "openai-agents" -version = "0.2.0" +version = "0.4.2" source = { editable = "." } dependencies = [ { name = "griffe" }, @@ -1493,24 +1890,38 @@ dependencies = [ ] [package.optional-dependencies] +encrypt = [ + { name = "cryptography" }, +] litellm = [ { name = "litellm" }, ] realtime = [ { name = "websockets" }, ] +redis = [ + { name = "redis" }, +] +sqlalchemy = [ + { name = "asyncpg" }, + { name = "sqlalchemy" }, +] viz = [ { name = "graphviz" }, ] voice = [ - { name = "numpy", marker = "python_full_version >= '3.10'" }, + { name = "numpy", version = "2.2.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version == '3.10.*'" }, + { name = "numpy", version = "2.3.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, { name = "websockets" }, ] [package.dev-dependencies] dev = [ + { name = "aiosqlite" }, { name = "coverage" }, + { name = "cryptography" }, { name = "eval-type-backport" }, + { name = "fakeredis" }, { name = "fastapi" }, { name = "graphviz" }, { name = "inline-snapshot" }, @@ -1534,25 +1945,32 @@ dev = [ [package.metadata] requires-dist = [ + { name = "asyncpg", marker = "extra == 'sqlalchemy'", specifier = ">=0.29.0" }, + { name = "cryptography", marker = "extra == 'encrypt'", specifier = ">=45.0,<46" }, { name = "graphviz", marker = "extra == 'viz'", specifier = ">=0.17" }, { name = "griffe", specifier = ">=1.5.6,<2" }, { name = "litellm", marker = "extra == 'litellm'", specifier = ">=1.67.4.post1,<2" }, - { name = "mcp", marker = "python_full_version >= '3.10'", specifier = ">=1.9.4,<2" }, + { name = "mcp", marker = "python_full_version >= '3.10'", specifier = ">=1.11.0,<2" }, { name = "numpy", marker = "python_full_version >= '3.10' and extra == 'voice'", specifier = ">=2.2.0,<3" }, - { name = "openai", specifier = ">=1.93.1,<2" }, + { name = "openai", specifier = ">=2.2,<3" }, { name = "pydantic", specifier = ">=2.10,<3" }, + { name = "redis", marker = "extra == 'redis'", specifier = ">=6.4.0" }, { name = "requests", specifier = ">=2.0,<3" }, + { name = "sqlalchemy", marker = "extra == 'sqlalchemy'", specifier = ">=2.0" }, { name = "types-requests", specifier = ">=2.0,<3" }, { name = "typing-extensions", specifier = ">=4.12.2,<5" }, { name = "websockets", marker = "extra == 'realtime'", specifier = ">=15.0,<16" }, { name = "websockets", marker = "extra == 'voice'", specifier = ">=15.0,<16" }, ] -provides-extras = ["voice", "viz", "litellm", "realtime"] +provides-extras = ["voice", "viz", "litellm", "realtime", "sqlalchemy", "encrypt", "redis"] [package.metadata.requires-dev] dev = [ + { name = "aiosqlite", specifier = ">=0.21.0" }, { name = "coverage", specifier = ">=7.6.12" }, + { name = "cryptography", specifier = ">=45.0,<46" }, { name = "eval-type-backport", specifier = ">=0.2.2" }, + { name = "fakeredis", specifier = ">=2.31.3" }, { name = "fastapi", specifier = ">=0.110.0,<1" }, { name = "graphviz" }, { name = "inline-snapshot", specifier = ">=0.20.7" }, @@ -1577,11 +1995,11 @@ dev = [ [[package]] name = "packaging" -version = "24.2" +version = "25.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d0/63/68dbb6eb2de9cb10ee4c9c14a0148804425e13c4fb20d61cce69f53106da/packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f", size = 163950, upload-time = "2024-11-08T09:47:47.202Z" } +sdist = { url = "https://files.pythonhosted.org/packages/a1/d4/1fc4078c65507b51b96ca8f8c3ba19e6a61c8253c72794544580a7b6c24d/packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f", size = 165727, upload-time = "2025-04-19T11:48:59.673Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", size = 65451, upload-time = "2024-11-08T09:47:44.722Z" }, + { url = "https://files.pythonhosted.org/packages/20/12/38679034af332785aac8774540895e234f4d07f7545804097de4b666afd8/packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484", size = 66469, upload-time = "2025-04-19T11:48:57.875Z" }, ] [[package]] @@ -1604,11 +2022,11 @@ wheels = [ [[package]] name = "platformdirs" -version = "4.3.7" +version = "4.3.8" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/b6/2d/7d512a3913d60623e7eb945c6d1b4f0bddf1d0b7ada5225274c87e5b53d1/platformdirs-4.3.7.tar.gz", hash = "sha256:eb437d586b6a0986388f0d6f74aa0cde27b48d0e3d66843640bfb6bdcdb6e351", size = 21291, upload-time = "2025-03-19T20:36:10.989Z" } +sdist = { url = "https://files.pythonhosted.org/packages/fe/8b/3c73abc9c759ecd3f1f7ceff6685840859e8070c4d947c93fae71f6a0bf2/platformdirs-4.3.8.tar.gz", hash = "sha256:3d512d96e16bcb959a814c9f348431070822a6496326a4be0911c40b5a74c2bc", size = 21362, upload-time = "2025-05-07T22:47:42.121Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/6d/45/59578566b3275b8fd9157885918fcd0c4d74162928a5310926887b856a51/platformdirs-4.3.7-py3-none-any.whl", hash = "sha256:a03875334331946f13c549dbd8f4bac7a13a50a895a0eb1e8c6a8ace80d40a94", size = 18499, upload-time = "2025-03-19T20:36:09.038Z" }, + { url = "https://files.pythonhosted.org/packages/fe/39/979e8e21520d4e47a0bbe349e2713c0aac6f3d853d0e5b34d76206c439aa/platformdirs-4.3.8-py3-none-any.whl", hash = "sha256:ff7059bb7eb1179e2685604f4aaf157cfd9535242bd23742eadc3c13542139b4", size = 18567, upload-time = "2025-05-07T22:47:40.376Z" }, ] [[package]] @@ -1631,116 +2049,116 @@ wheels = [ [[package]] name = "pluggy" -version = "1.5.0" +version = "1.6.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/96/2d/02d4312c973c6050a18b314a5ad0b3210edb65a906f868e31c111dede4a6/pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", size = 67955, upload-time = "2024-04-20T21:34:42.531Z" } +sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669", size = 20556, upload-time = "2024-04-20T21:34:40.434Z" }, + { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" }, ] [[package]] name = "propcache" -version = "0.3.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/07/c8/fdc6686a986feae3541ea23dcaa661bd93972d3940460646c6bb96e21c40/propcache-0.3.1.tar.gz", hash = "sha256:40d980c33765359098837527e18eddefc9a24cea5b45e078a7f3bb5b032c6ecf", size = 43651, upload-time = "2025-03-26T03:06:12.05Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/20/56/e27c136101addf877c8291dbda1b3b86ae848f3837ce758510a0d806c92f/propcache-0.3.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:f27785888d2fdd918bc36de8b8739f2d6c791399552333721b58193f68ea3e98", size = 80224, upload-time = "2025-03-26T03:03:35.81Z" }, - { url = "https://files.pythonhosted.org/packages/63/bd/88e98836544c4f04db97eefd23b037c2002fa173dd2772301c61cd3085f9/propcache-0.3.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d4e89cde74154c7b5957f87a355bb9c8ec929c167b59c83d90654ea36aeb6180", size = 46491, upload-time = "2025-03-26T03:03:38.107Z" }, - { url = "https://files.pythonhosted.org/packages/15/43/0b8eb2a55753c4a574fc0899885da504b521068d3b08ca56774cad0bea2b/propcache-0.3.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:730178f476ef03d3d4d255f0c9fa186cb1d13fd33ffe89d39f2cda4da90ceb71", size = 45927, upload-time = "2025-03-26T03:03:39.394Z" }, - { url = "https://files.pythonhosted.org/packages/ad/6c/d01f9dfbbdc613305e0a831016844987a1fb4861dd221cd4c69b1216b43f/propcache-0.3.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:967a8eec513dbe08330f10137eacb427b2ca52118769e82ebcfcab0fba92a649", size = 206135, upload-time = "2025-03-26T03:03:40.757Z" }, - { url = "https://files.pythonhosted.org/packages/9a/8a/e6e1c77394088f4cfdace4a91a7328e398ebed745d59c2f6764135c5342d/propcache-0.3.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5b9145c35cc87313b5fd480144f8078716007656093d23059e8993d3a8fa730f", size = 220517, upload-time = "2025-03-26T03:03:42.657Z" }, - { url = "https://files.pythonhosted.org/packages/19/3b/6c44fa59d6418f4239d5db8b1ece757351e85d6f3ca126dfe37d427020c8/propcache-0.3.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9e64e948ab41411958670f1093c0a57acfdc3bee5cf5b935671bbd5313bcf229", size = 218952, upload-time = "2025-03-26T03:03:44.549Z" }, - { url = "https://files.pythonhosted.org/packages/7c/e4/4aeb95a1cd085e0558ab0de95abfc5187329616193a1012a6c4c930e9f7a/propcache-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:319fa8765bfd6a265e5fa661547556da381e53274bc05094fc9ea50da51bfd46", size = 206593, upload-time = "2025-03-26T03:03:46.114Z" }, - { url = "https://files.pythonhosted.org/packages/da/6a/29fa75de1cbbb302f1e1d684009b969976ca603ee162282ae702287b6621/propcache-0.3.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c66d8ccbc902ad548312b96ed8d5d266d0d2c6d006fd0f66323e9d8f2dd49be7", size = 196745, upload-time = "2025-03-26T03:03:48.02Z" }, - { url = "https://files.pythonhosted.org/packages/19/7e/2237dad1dbffdd2162de470599fa1a1d55df493b16b71e5d25a0ac1c1543/propcache-0.3.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:2d219b0dbabe75e15e581fc1ae796109b07c8ba7d25b9ae8d650da582bed01b0", size = 203369, upload-time = "2025-03-26T03:03:49.63Z" }, - { url = "https://files.pythonhosted.org/packages/a4/bc/a82c5878eb3afb5c88da86e2cf06e1fe78b7875b26198dbb70fe50a010dc/propcache-0.3.1-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:cd6a55f65241c551eb53f8cf4d2f4af33512c39da5d9777694e9d9c60872f519", size = 198723, upload-time = "2025-03-26T03:03:51.091Z" }, - { url = "https://files.pythonhosted.org/packages/17/76/9632254479c55516f51644ddbf747a45f813031af5adcb8db91c0b824375/propcache-0.3.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:9979643ffc69b799d50d3a7b72b5164a2e97e117009d7af6dfdd2ab906cb72cd", size = 200751, upload-time = "2025-03-26T03:03:52.631Z" }, - { url = "https://files.pythonhosted.org/packages/3e/c3/a90b773cf639bd01d12a9e20c95be0ae978a5a8abe6d2d343900ae76cd71/propcache-0.3.1-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:4cf9e93a81979f1424f1a3d155213dc928f1069d697e4353edb8a5eba67c6259", size = 210730, upload-time = "2025-03-26T03:03:54.498Z" }, - { url = "https://files.pythonhosted.org/packages/ed/ec/ad5a952cdb9d65c351f88db7c46957edd3d65ffeee72a2f18bd6341433e0/propcache-0.3.1-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:2fce1df66915909ff6c824bbb5eb403d2d15f98f1518e583074671a30fe0c21e", size = 213499, upload-time = "2025-03-26T03:03:56.054Z" }, - { url = "https://files.pythonhosted.org/packages/83/c0/ea5133dda43e298cd2010ec05c2821b391e10980e64ee72c0a76cdbb813a/propcache-0.3.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:4d0dfdd9a2ebc77b869a0b04423591ea8823f791293b527dc1bb896c1d6f1136", size = 207132, upload-time = "2025-03-26T03:03:57.398Z" }, - { url = "https://files.pythonhosted.org/packages/79/dd/71aae9dec59333064cfdd7eb31a63fa09f64181b979802a67a90b2abfcba/propcache-0.3.1-cp310-cp310-win32.whl", hash = "sha256:1f6cc0ad7b4560e5637eb2c994e97b4fa41ba8226069c9277eb5ea7101845b42", size = 40952, upload-time = "2025-03-26T03:03:59.146Z" }, - { url = "https://files.pythonhosted.org/packages/31/0a/49ff7e5056c17dfba62cbdcbb90a29daffd199c52f8e65e5cb09d5f53a57/propcache-0.3.1-cp310-cp310-win_amd64.whl", hash = "sha256:47ef24aa6511e388e9894ec16f0fbf3313a53ee68402bc428744a367ec55b833", size = 45163, upload-time = "2025-03-26T03:04:00.672Z" }, - { url = "https://files.pythonhosted.org/packages/90/0f/5a5319ee83bd651f75311fcb0c492c21322a7fc8f788e4eef23f44243427/propcache-0.3.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:7f30241577d2fef2602113b70ef7231bf4c69a97e04693bde08ddab913ba0ce5", size = 80243, upload-time = "2025-03-26T03:04:01.912Z" }, - { url = "https://files.pythonhosted.org/packages/ce/84/3db5537e0879942783e2256616ff15d870a11d7ac26541336fe1b673c818/propcache-0.3.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:43593c6772aa12abc3af7784bff4a41ffa921608dd38b77cf1dfd7f5c4e71371", size = 46503, upload-time = "2025-03-26T03:04:03.704Z" }, - { url = "https://files.pythonhosted.org/packages/e2/c8/b649ed972433c3f0d827d7f0cf9ea47162f4ef8f4fe98c5f3641a0bc63ff/propcache-0.3.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a75801768bbe65499495660b777e018cbe90c7980f07f8aa57d6be79ea6f71da", size = 45934, upload-time = "2025-03-26T03:04:05.257Z" }, - { url = "https://files.pythonhosted.org/packages/59/f9/4c0a5cf6974c2c43b1a6810c40d889769cc8f84cea676cbe1e62766a45f8/propcache-0.3.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f6f1324db48f001c2ca26a25fa25af60711e09b9aaf4b28488602776f4f9a744", size = 233633, upload-time = "2025-03-26T03:04:07.044Z" }, - { url = "https://files.pythonhosted.org/packages/e7/64/66f2f4d1b4f0007c6e9078bd95b609b633d3957fe6dd23eac33ebde4b584/propcache-0.3.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5cdb0f3e1eb6dfc9965d19734d8f9c481b294b5274337a8cb5cb01b462dcb7e0", size = 241124, upload-time = "2025-03-26T03:04:08.676Z" }, - { url = "https://files.pythonhosted.org/packages/aa/bf/7b8c9fd097d511638fa9b6af3d986adbdf567598a567b46338c925144c1b/propcache-0.3.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1eb34d90aac9bfbced9a58b266f8946cb5935869ff01b164573a7634d39fbcb5", size = 240283, upload-time = "2025-03-26T03:04:10.172Z" }, - { url = "https://files.pythonhosted.org/packages/fa/c9/e85aeeeaae83358e2a1ef32d6ff50a483a5d5248bc38510d030a6f4e2816/propcache-0.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f35c7070eeec2cdaac6fd3fe245226ed2a6292d3ee8c938e5bb645b434c5f256", size = 232498, upload-time = "2025-03-26T03:04:11.616Z" }, - { url = "https://files.pythonhosted.org/packages/8e/66/acb88e1f30ef5536d785c283af2e62931cb934a56a3ecf39105887aa8905/propcache-0.3.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b23c11c2c9e6d4e7300c92e022046ad09b91fd00e36e83c44483df4afa990073", size = 221486, upload-time = "2025-03-26T03:04:13.102Z" }, - { url = "https://files.pythonhosted.org/packages/f5/f9/233ddb05ffdcaee4448508ee1d70aa7deff21bb41469ccdfcc339f871427/propcache-0.3.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:3e19ea4ea0bf46179f8a3652ac1426e6dcbaf577ce4b4f65be581e237340420d", size = 222675, upload-time = "2025-03-26T03:04:14.658Z" }, - { url = "https://files.pythonhosted.org/packages/98/b8/eb977e28138f9e22a5a789daf608d36e05ed93093ef12a12441030da800a/propcache-0.3.1-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:bd39c92e4c8f6cbf5f08257d6360123af72af9f4da75a690bef50da77362d25f", size = 215727, upload-time = "2025-03-26T03:04:16.207Z" }, - { url = "https://files.pythonhosted.org/packages/89/2d/5f52d9c579f67b8ee1edd9ec073c91b23cc5b7ff7951a1e449e04ed8fdf3/propcache-0.3.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:b0313e8b923b3814d1c4a524c93dfecea5f39fa95601f6a9b1ac96cd66f89ea0", size = 217878, upload-time = "2025-03-26T03:04:18.11Z" }, - { url = "https://files.pythonhosted.org/packages/7a/fd/5283e5ed8a82b00c7a989b99bb6ea173db1ad750bf0bf8dff08d3f4a4e28/propcache-0.3.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:e861ad82892408487be144906a368ddbe2dc6297074ade2d892341b35c59844a", size = 230558, upload-time = "2025-03-26T03:04:19.562Z" }, - { url = "https://files.pythonhosted.org/packages/90/38/ab17d75938ef7ac87332c588857422ae126b1c76253f0f5b1242032923ca/propcache-0.3.1-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:61014615c1274df8da5991a1e5da85a3ccb00c2d4701ac6f3383afd3ca47ab0a", size = 233754, upload-time = "2025-03-26T03:04:21.065Z" }, - { url = "https://files.pythonhosted.org/packages/06/5d/3b921b9c60659ae464137508d3b4c2b3f52f592ceb1964aa2533b32fcf0b/propcache-0.3.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:71ebe3fe42656a2328ab08933d420df5f3ab121772eef78f2dc63624157f0ed9", size = 226088, upload-time = "2025-03-26T03:04:22.718Z" }, - { url = "https://files.pythonhosted.org/packages/54/6e/30a11f4417d9266b5a464ac5a8c5164ddc9dd153dfa77bf57918165eb4ae/propcache-0.3.1-cp311-cp311-win32.whl", hash = "sha256:58aa11f4ca8b60113d4b8e32d37e7e78bd8af4d1a5b5cb4979ed856a45e62005", size = 40859, upload-time = "2025-03-26T03:04:24.039Z" }, - { url = "https://files.pythonhosted.org/packages/1d/3a/8a68dd867da9ca2ee9dfd361093e9cb08cb0f37e5ddb2276f1b5177d7731/propcache-0.3.1-cp311-cp311-win_amd64.whl", hash = "sha256:9532ea0b26a401264b1365146c440a6d78269ed41f83f23818d4b79497aeabe7", size = 45153, upload-time = "2025-03-26T03:04:25.211Z" }, - { url = "https://files.pythonhosted.org/packages/41/aa/ca78d9be314d1e15ff517b992bebbed3bdfef5b8919e85bf4940e57b6137/propcache-0.3.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:f78eb8422acc93d7b69964012ad7048764bb45a54ba7a39bb9e146c72ea29723", size = 80430, upload-time = "2025-03-26T03:04:26.436Z" }, - { url = "https://files.pythonhosted.org/packages/1a/d8/f0c17c44d1cda0ad1979af2e593ea290defdde9eaeb89b08abbe02a5e8e1/propcache-0.3.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:89498dd49c2f9a026ee057965cdf8192e5ae070ce7d7a7bd4b66a8e257d0c976", size = 46637, upload-time = "2025-03-26T03:04:27.932Z" }, - { url = "https://files.pythonhosted.org/packages/ae/bd/c1e37265910752e6e5e8a4c1605d0129e5b7933c3dc3cf1b9b48ed83b364/propcache-0.3.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:09400e98545c998d57d10035ff623266927cb784d13dd2b31fd33b8a5316b85b", size = 46123, upload-time = "2025-03-26T03:04:30.659Z" }, - { url = "https://files.pythonhosted.org/packages/d4/b0/911eda0865f90c0c7e9f0415d40a5bf681204da5fd7ca089361a64c16b28/propcache-0.3.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aa8efd8c5adc5a2c9d3b952815ff8f7710cefdcaf5f2c36d26aff51aeca2f12f", size = 243031, upload-time = "2025-03-26T03:04:31.977Z" }, - { url = "https://files.pythonhosted.org/packages/0a/06/0da53397c76a74271621807265b6eb61fb011451b1ddebf43213df763669/propcache-0.3.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c2fe5c910f6007e716a06d269608d307b4f36e7babee5f36533722660e8c4a70", size = 249100, upload-time = "2025-03-26T03:04:33.45Z" }, - { url = "https://files.pythonhosted.org/packages/f1/eb/13090e05bf6b963fc1653cdc922133ced467cb4b8dab53158db5a37aa21e/propcache-0.3.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a0ab8cf8cdd2194f8ff979a43ab43049b1df0b37aa64ab7eca04ac14429baeb7", size = 250170, upload-time = "2025-03-26T03:04:35.542Z" }, - { url = "https://files.pythonhosted.org/packages/3b/4c/f72c9e1022b3b043ec7dc475a0f405d4c3e10b9b1d378a7330fecf0652da/propcache-0.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:563f9d8c03ad645597b8d010ef4e9eab359faeb11a0a2ac9f7b4bc8c28ebef25", size = 245000, upload-time = "2025-03-26T03:04:37.501Z" }, - { url = "https://files.pythonhosted.org/packages/e8/fd/970ca0e22acc829f1adf5de3724085e778c1ad8a75bec010049502cb3a86/propcache-0.3.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fb6e0faf8cb6b4beea5d6ed7b5a578254c6d7df54c36ccd3d8b3eb00d6770277", size = 230262, upload-time = "2025-03-26T03:04:39.532Z" }, - { url = "https://files.pythonhosted.org/packages/c4/42/817289120c6b9194a44f6c3e6b2c3277c5b70bbad39e7df648f177cc3634/propcache-0.3.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:1c5c7ab7f2bb3f573d1cb921993006ba2d39e8621019dffb1c5bc94cdbae81e8", size = 236772, upload-time = "2025-03-26T03:04:41.109Z" }, - { url = "https://files.pythonhosted.org/packages/7c/9c/3b3942b302badd589ad6b672da3ca7b660a6c2f505cafd058133ddc73918/propcache-0.3.1-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:050b571b2e96ec942898f8eb46ea4bfbb19bd5502424747e83badc2d4a99a44e", size = 231133, upload-time = "2025-03-26T03:04:42.544Z" }, - { url = "https://files.pythonhosted.org/packages/98/a1/75f6355f9ad039108ff000dfc2e19962c8dea0430da9a1428e7975cf24b2/propcache-0.3.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:e1c4d24b804b3a87e9350f79e2371a705a188d292fd310e663483af6ee6718ee", size = 230741, upload-time = "2025-03-26T03:04:44.06Z" }, - { url = "https://files.pythonhosted.org/packages/67/0c/3e82563af77d1f8731132166da69fdfd95e71210e31f18edce08a1eb11ea/propcache-0.3.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:e4fe2a6d5ce975c117a6bb1e8ccda772d1e7029c1cca1acd209f91d30fa72815", size = 244047, upload-time = "2025-03-26T03:04:45.983Z" }, - { url = "https://files.pythonhosted.org/packages/f7/50/9fb7cca01532a08c4d5186d7bb2da6c4c587825c0ae134b89b47c7d62628/propcache-0.3.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:feccd282de1f6322f56f6845bf1207a537227812f0a9bf5571df52bb418d79d5", size = 246467, upload-time = "2025-03-26T03:04:47.699Z" }, - { url = "https://files.pythonhosted.org/packages/a9/02/ccbcf3e1c604c16cc525309161d57412c23cf2351523aedbb280eb7c9094/propcache-0.3.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:ec314cde7314d2dd0510c6787326bbffcbdc317ecee6b7401ce218b3099075a7", size = 241022, upload-time = "2025-03-26T03:04:49.195Z" }, - { url = "https://files.pythonhosted.org/packages/db/19/e777227545e09ca1e77a6e21274ae9ec45de0f589f0ce3eca2a41f366220/propcache-0.3.1-cp312-cp312-win32.whl", hash = "sha256:7d2d5a0028d920738372630870e7d9644ce437142197f8c827194fca404bf03b", size = 40647, upload-time = "2025-03-26T03:04:50.595Z" }, - { url = "https://files.pythonhosted.org/packages/24/bb/3b1b01da5dd04c77a204c84e538ff11f624e31431cfde7201d9110b092b1/propcache-0.3.1-cp312-cp312-win_amd64.whl", hash = "sha256:88c423efef9d7a59dae0614eaed718449c09a5ac79a5f224a8b9664d603f04a3", size = 44784, upload-time = "2025-03-26T03:04:51.791Z" }, - { url = "https://files.pythonhosted.org/packages/58/60/f645cc8b570f99be3cf46714170c2de4b4c9d6b827b912811eff1eb8a412/propcache-0.3.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:f1528ec4374617a7a753f90f20e2f551121bb558fcb35926f99e3c42367164b8", size = 77865, upload-time = "2025-03-26T03:04:53.406Z" }, - { url = "https://files.pythonhosted.org/packages/6f/d4/c1adbf3901537582e65cf90fd9c26fde1298fde5a2c593f987112c0d0798/propcache-0.3.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:dc1915ec523b3b494933b5424980831b636fe483d7d543f7afb7b3bf00f0c10f", size = 45452, upload-time = "2025-03-26T03:04:54.624Z" }, - { url = "https://files.pythonhosted.org/packages/d1/b5/fe752b2e63f49f727c6c1c224175d21b7d1727ce1d4873ef1c24c9216830/propcache-0.3.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:a110205022d077da24e60b3df8bcee73971be9575dec5573dd17ae5d81751111", size = 44800, upload-time = "2025-03-26T03:04:55.844Z" }, - { url = "https://files.pythonhosted.org/packages/62/37/fc357e345bc1971e21f76597028b059c3d795c5ca7690d7a8d9a03c9708a/propcache-0.3.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d249609e547c04d190e820d0d4c8ca03ed4582bcf8e4e160a6969ddfb57b62e5", size = 225804, upload-time = "2025-03-26T03:04:57.158Z" }, - { url = "https://files.pythonhosted.org/packages/0d/f1/16e12c33e3dbe7f8b737809bad05719cff1dccb8df4dafbcff5575002c0e/propcache-0.3.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5ced33d827625d0a589e831126ccb4f5c29dfdf6766cac441d23995a65825dcb", size = 230650, upload-time = "2025-03-26T03:04:58.61Z" }, - { url = "https://files.pythonhosted.org/packages/3e/a2/018b9f2ed876bf5091e60153f727e8f9073d97573f790ff7cdf6bc1d1fb8/propcache-0.3.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4114c4ada8f3181af20808bedb250da6bae56660e4b8dfd9cd95d4549c0962f7", size = 234235, upload-time = "2025-03-26T03:05:00.599Z" }, - { url = "https://files.pythonhosted.org/packages/45/5f/3faee66fc930dfb5da509e34c6ac7128870631c0e3582987fad161fcb4b1/propcache-0.3.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:975af16f406ce48f1333ec5e912fe11064605d5c5b3f6746969077cc3adeb120", size = 228249, upload-time = "2025-03-26T03:05:02.11Z" }, - { url = "https://files.pythonhosted.org/packages/62/1e/a0d5ebda5da7ff34d2f5259a3e171a94be83c41eb1e7cd21a2105a84a02e/propcache-0.3.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a34aa3a1abc50740be6ac0ab9d594e274f59960d3ad253cd318af76b996dd654", size = 214964, upload-time = "2025-03-26T03:05:03.599Z" }, - { url = "https://files.pythonhosted.org/packages/db/a0/d72da3f61ceab126e9be1f3bc7844b4e98c6e61c985097474668e7e52152/propcache-0.3.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:9cec3239c85ed15bfaded997773fdad9fb5662b0a7cbc854a43f291eb183179e", size = 222501, upload-time = "2025-03-26T03:05:05.107Z" }, - { url = "https://files.pythonhosted.org/packages/18/6d/a008e07ad7b905011253adbbd97e5b5375c33f0b961355ca0a30377504ac/propcache-0.3.1-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:05543250deac8e61084234d5fc54f8ebd254e8f2b39a16b1dce48904f45b744b", size = 217917, upload-time = "2025-03-26T03:05:06.59Z" }, - { url = "https://files.pythonhosted.org/packages/98/37/02c9343ffe59e590e0e56dc5c97d0da2b8b19fa747ebacf158310f97a79a/propcache-0.3.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:5cb5918253912e088edbf023788de539219718d3b10aef334476b62d2b53de53", size = 217089, upload-time = "2025-03-26T03:05:08.1Z" }, - { url = "https://files.pythonhosted.org/packages/53/1b/d3406629a2c8a5666d4674c50f757a77be119b113eedd47b0375afdf1b42/propcache-0.3.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:f3bbecd2f34d0e6d3c543fdb3b15d6b60dd69970c2b4c822379e5ec8f6f621d5", size = 228102, upload-time = "2025-03-26T03:05:09.982Z" }, - { url = "https://files.pythonhosted.org/packages/cd/a7/3664756cf50ce739e5f3abd48febc0be1a713b1f389a502ca819791a6b69/propcache-0.3.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:aca63103895c7d960a5b9b044a83f544b233c95e0dcff114389d64d762017af7", size = 230122, upload-time = "2025-03-26T03:05:11.408Z" }, - { url = "https://files.pythonhosted.org/packages/35/36/0bbabaacdcc26dac4f8139625e930f4311864251276033a52fd52ff2a274/propcache-0.3.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:5a0a9898fdb99bf11786265468571e628ba60af80dc3f6eb89a3545540c6b0ef", size = 226818, upload-time = "2025-03-26T03:05:12.909Z" }, - { url = "https://files.pythonhosted.org/packages/cc/27/4e0ef21084b53bd35d4dae1634b6d0bad35e9c58ed4f032511acca9d4d26/propcache-0.3.1-cp313-cp313-win32.whl", hash = "sha256:3a02a28095b5e63128bcae98eb59025924f121f048a62393db682f049bf4ac24", size = 40112, upload-time = "2025-03-26T03:05:14.289Z" }, - { url = "https://files.pythonhosted.org/packages/a6/2c/a54614d61895ba6dd7ac8f107e2b2a0347259ab29cbf2ecc7b94fa38c4dc/propcache-0.3.1-cp313-cp313-win_amd64.whl", hash = "sha256:813fbb8b6aea2fc9659815e585e548fe706d6f663fa73dff59a1677d4595a037", size = 44034, upload-time = "2025-03-26T03:05:15.616Z" }, - { url = "https://files.pythonhosted.org/packages/5a/a8/0a4fd2f664fc6acc66438370905124ce62e84e2e860f2557015ee4a61c7e/propcache-0.3.1-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:a444192f20f5ce8a5e52761a031b90f5ea6288b1eef42ad4c7e64fef33540b8f", size = 82613, upload-time = "2025-03-26T03:05:16.913Z" }, - { url = "https://files.pythonhosted.org/packages/4d/e5/5ef30eb2cd81576256d7b6caaa0ce33cd1d2c2c92c8903cccb1af1a4ff2f/propcache-0.3.1-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:0fbe94666e62ebe36cd652f5fc012abfbc2342de99b523f8267a678e4dfdee3c", size = 47763, upload-time = "2025-03-26T03:05:18.607Z" }, - { url = "https://files.pythonhosted.org/packages/87/9a/87091ceb048efeba4d28e903c0b15bcc84b7c0bf27dc0261e62335d9b7b8/propcache-0.3.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:f011f104db880f4e2166bcdcf7f58250f7a465bc6b068dc84c824a3d4a5c94dc", size = 47175, upload-time = "2025-03-26T03:05:19.85Z" }, - { url = "https://files.pythonhosted.org/packages/3e/2f/854e653c96ad1161f96194c6678a41bbb38c7947d17768e8811a77635a08/propcache-0.3.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3e584b6d388aeb0001d6d5c2bd86b26304adde6d9bb9bfa9c4889805021b96de", size = 292265, upload-time = "2025-03-26T03:05:21.654Z" }, - { url = "https://files.pythonhosted.org/packages/40/8d/090955e13ed06bc3496ba4a9fb26c62e209ac41973cb0d6222de20c6868f/propcache-0.3.1-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8a17583515a04358b034e241f952f1715243482fc2c2945fd99a1b03a0bd77d6", size = 294412, upload-time = "2025-03-26T03:05:23.147Z" }, - { url = "https://files.pythonhosted.org/packages/39/e6/d51601342e53cc7582449e6a3c14a0479fab2f0750c1f4d22302e34219c6/propcache-0.3.1-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5aed8d8308215089c0734a2af4f2e95eeb360660184ad3912686c181e500b2e7", size = 294290, upload-time = "2025-03-26T03:05:24.577Z" }, - { url = "https://files.pythonhosted.org/packages/3b/4d/be5f1a90abc1881884aa5878989a1acdafd379a91d9c7e5e12cef37ec0d7/propcache-0.3.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6d8e309ff9a0503ef70dc9a0ebd3e69cf7b3894c9ae2ae81fc10943c37762458", size = 282926, upload-time = "2025-03-26T03:05:26.459Z" }, - { url = "https://files.pythonhosted.org/packages/57/2b/8f61b998c7ea93a2b7eca79e53f3e903db1787fca9373af9e2cf8dc22f9d/propcache-0.3.1-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b655032b202028a582d27aeedc2e813299f82cb232f969f87a4fde491a233f11", size = 267808, upload-time = "2025-03-26T03:05:28.188Z" }, - { url = "https://files.pythonhosted.org/packages/11/1c/311326c3dfce59c58a6098388ba984b0e5fb0381ef2279ec458ef99bd547/propcache-0.3.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:9f64d91b751df77931336b5ff7bafbe8845c5770b06630e27acd5dbb71e1931c", size = 290916, upload-time = "2025-03-26T03:05:29.757Z" }, - { url = "https://files.pythonhosted.org/packages/4b/74/91939924b0385e54dc48eb2e4edd1e4903ffd053cf1916ebc5347ac227f7/propcache-0.3.1-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:19a06db789a4bd896ee91ebc50d059e23b3639c25d58eb35be3ca1cbe967c3bf", size = 262661, upload-time = "2025-03-26T03:05:31.472Z" }, - { url = "https://files.pythonhosted.org/packages/c2/d7/e6079af45136ad325c5337f5dd9ef97ab5dc349e0ff362fe5c5db95e2454/propcache-0.3.1-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:bef100c88d8692864651b5f98e871fb090bd65c8a41a1cb0ff2322db39c96c27", size = 264384, upload-time = "2025-03-26T03:05:32.984Z" }, - { url = "https://files.pythonhosted.org/packages/b7/d5/ba91702207ac61ae6f1c2da81c5d0d6bf6ce89e08a2b4d44e411c0bbe867/propcache-0.3.1-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:87380fb1f3089d2a0b8b00f006ed12bd41bd858fabfa7330c954c70f50ed8757", size = 291420, upload-time = "2025-03-26T03:05:34.496Z" }, - { url = "https://files.pythonhosted.org/packages/58/70/2117780ed7edcd7ba6b8134cb7802aada90b894a9810ec56b7bb6018bee7/propcache-0.3.1-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:e474fc718e73ba5ec5180358aa07f6aded0ff5f2abe700e3115c37d75c947e18", size = 290880, upload-time = "2025-03-26T03:05:36.256Z" }, - { url = "https://files.pythonhosted.org/packages/4a/1f/ecd9ce27710021ae623631c0146719280a929d895a095f6d85efb6a0be2e/propcache-0.3.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:17d1c688a443355234f3c031349da69444be052613483f3e4158eef751abcd8a", size = 287407, upload-time = "2025-03-26T03:05:37.799Z" }, - { url = "https://files.pythonhosted.org/packages/3e/66/2e90547d6b60180fb29e23dc87bd8c116517d4255240ec6d3f7dc23d1926/propcache-0.3.1-cp313-cp313t-win32.whl", hash = "sha256:359e81a949a7619802eb601d66d37072b79b79c2505e6d3fd8b945538411400d", size = 42573, upload-time = "2025-03-26T03:05:39.193Z" }, - { url = "https://files.pythonhosted.org/packages/cb/8f/50ad8599399d1861b4d2b6b45271f0ef6af1b09b0a2386a46dbaf19c9535/propcache-0.3.1-cp313-cp313t-win_amd64.whl", hash = "sha256:e7fb9a84c9abbf2b2683fa3e7b0d7da4d8ecf139a1c635732a8bda29c5214b0e", size = 46757, upload-time = "2025-03-26T03:05:40.811Z" }, - { url = "https://files.pythonhosted.org/packages/aa/e1/4a782cdc7ebc42dfb44224dabf93b481395a0b6cbc9f0149785edbbab19c/propcache-0.3.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:ed5f6d2edbf349bd8d630e81f474d33d6ae5d07760c44d33cd808e2f5c8f4ae6", size = 81368, upload-time = "2025-03-26T03:05:42.15Z" }, - { url = "https://files.pythonhosted.org/packages/18/c6/9a39b2646a71321815d8d616e890851af9fb327af7d1b9fdce7d2d8377ca/propcache-0.3.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:668ddddc9f3075af019f784456267eb504cb77c2c4bd46cc8402d723b4d200bf", size = 47037, upload-time = "2025-03-26T03:05:44.279Z" }, - { url = "https://files.pythonhosted.org/packages/f3/e2/88ad1c4c42861dd09b45924e468c42a1beb2c5267cb960b7a9f6af67dd04/propcache-0.3.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:0c86e7ceea56376216eba345aa1fc6a8a6b27ac236181f840d1d7e6a1ea9ba5c", size = 46462, upload-time = "2025-03-26T03:05:45.569Z" }, - { url = "https://files.pythonhosted.org/packages/ae/7e/3e3b36854e96be2e881bc6e87293d59c74dd734dd038dd4981474be44e26/propcache-0.3.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:83be47aa4e35b87c106fc0c84c0fc069d3f9b9b06d3c494cd404ec6747544894", size = 209214, upload-time = "2025-03-26T03:05:47.366Z" }, - { url = "https://files.pythonhosted.org/packages/11/1a/ac0f757cc0babdc8217056fca85150066cf43bf11db9651e6b7d8e0646d6/propcache-0.3.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:27c6ac6aa9fc7bc662f594ef380707494cb42c22786a558d95fcdedb9aa5d035", size = 224702, upload-time = "2025-03-26T03:05:48.946Z" }, - { url = "https://files.pythonhosted.org/packages/92/0a/0cf77d0e984b7058019ffa5385b3efd6962cbd5340a8f278ae103032863a/propcache-0.3.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:64a956dff37080b352c1c40b2966b09defb014347043e740d420ca1eb7c9b908", size = 223085, upload-time = "2025-03-26T03:05:50.472Z" }, - { url = "https://files.pythonhosted.org/packages/05/fc/cb52a0caf803caff9b95b0a99e7c9c87f15b7e34ba0feebfd2572b49013d/propcache-0.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:82de5da8c8893056603ac2d6a89eb8b4df49abf1a7c19d536984c8dd63f481d5", size = 209613, upload-time = "2025-03-26T03:05:52.36Z" }, - { url = "https://files.pythonhosted.org/packages/e5/fc/b1d1fdffbe1e0278ab535f8d21fc6b030889417714a545755bdd5ebe9bb0/propcache-0.3.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0c3c3a203c375b08fd06a20da3cf7aac293b834b6f4f4db71190e8422750cca5", size = 199931, upload-time = "2025-03-26T03:05:54.302Z" }, - { url = "https://files.pythonhosted.org/packages/23/a9/2a2f8d93d8f526c35dd8dbbc4a1ac22a106712cd821e15e2a6530aea8931/propcache-0.3.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:b303b194c2e6f171cfddf8b8ba30baefccf03d36a4d9cab7fd0bb68ba476a3d7", size = 208937, upload-time = "2025-03-26T03:05:56.38Z" }, - { url = "https://files.pythonhosted.org/packages/ef/71/5247a264b95e8d4ba86757cf9ad6a523d764bd4579a2d80007a2d4d2b0ad/propcache-0.3.1-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:916cd229b0150129d645ec51614d38129ee74c03293a9f3f17537be0029a9641", size = 202577, upload-time = "2025-03-26T03:05:58.325Z" }, - { url = "https://files.pythonhosted.org/packages/6f/4e/c8ec771731f1b1e7d07bd8875f1d13c1564b5d60f7483624d021eaef5687/propcache-0.3.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:a461959ead5b38e2581998700b26346b78cd98540b5524796c175722f18b0294", size = 204669, upload-time = "2025-03-26T03:05:59.849Z" }, - { url = "https://files.pythonhosted.org/packages/c5/b8/bdfcb1170a7b8504226064d7c0b4deb61acbcc6bb2e754ee25fb36c1b72a/propcache-0.3.1-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:069e7212890b0bcf9b2be0a03afb0c2d5161d91e1bf51569a64f629acc7defbf", size = 214334, upload-time = "2025-03-26T03:06:01.905Z" }, - { url = "https://files.pythonhosted.org/packages/72/c6/fdb9e8ba161a4e12c75a7415cb99314cad195d3b8ae9d770783cec54001e/propcache-0.3.1-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:ef2e4e91fb3945769e14ce82ed53007195e616a63aa43b40fb7ebaaf907c8d4c", size = 218052, upload-time = "2025-03-26T03:06:03.586Z" }, - { url = "https://files.pythonhosted.org/packages/67/3f/0dd87220f61598b61b590a8b3562142ae475a9c0f694ee32bf97e4e41d44/propcache-0.3.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:8638f99dca15b9dff328fb6273e09f03d1c50d9b6512f3b65a4154588a7595fe", size = 210852, upload-time = "2025-03-26T03:06:05.045Z" }, - { url = "https://files.pythonhosted.org/packages/7b/4e/e332164372af66992c07b470448beb7e36ce7dba6a06c6c2b6131f112e74/propcache-0.3.1-cp39-cp39-win32.whl", hash = "sha256:6f173bbfe976105aaa890b712d1759de339d8a7cef2fc0a1714cc1a1e1c47f64", size = 41481, upload-time = "2025-03-26T03:06:07.507Z" }, - { url = "https://files.pythonhosted.org/packages/61/73/d64abb7bb5d18880ecfac152247c0f1a5807256ea21e4737ce3019afffeb/propcache-0.3.1-cp39-cp39-win_amd64.whl", hash = "sha256:603f1fe4144420374f1a69b907494c3acbc867a581c2d49d4175b0de7cc64566", size = 45720, upload-time = "2025-03-26T03:06:09.139Z" }, - { url = "https://files.pythonhosted.org/packages/b8/d3/c3cb8f1d6ae3b37f83e1de806713a9b3642c5895f0215a62e1a4bd6e5e34/propcache-0.3.1-py3-none-any.whl", hash = "sha256:9a8ecf38de50a7f518c21568c80f985e776397b902f1ce0b01f799aba1608b40", size = 12376, upload-time = "2025-03-26T03:06:10.5Z" }, +version = "0.3.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a6/16/43264e4a779dd8588c21a70f0709665ee8f611211bdd2c87d952cfa7c776/propcache-0.3.2.tar.gz", hash = "sha256:20d7d62e4e7ef05f221e0db2856b979540686342e7dd9973b815599c7057e168", size = 44139, upload-time = "2025-06-09T22:56:06.081Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ab/14/510deed325e262afeb8b360043c5d7c960da7d3ecd6d6f9496c9c56dc7f4/propcache-0.3.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:22d9962a358aedbb7a2e36187ff273adeaab9743373a272976d2e348d08c7770", size = 73178, upload-time = "2025-06-09T22:53:40.126Z" }, + { url = "https://files.pythonhosted.org/packages/cd/4e/ad52a7925ff01c1325653a730c7ec3175a23f948f08626a534133427dcff/propcache-0.3.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0d0fda578d1dc3f77b6b5a5dce3b9ad69a8250a891760a548df850a5e8da87f3", size = 43133, upload-time = "2025-06-09T22:53:41.965Z" }, + { url = "https://files.pythonhosted.org/packages/63/7c/e9399ba5da7780871db4eac178e9c2e204c23dd3e7d32df202092a1ed400/propcache-0.3.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:3def3da3ac3ce41562d85db655d18ebac740cb3fa4367f11a52b3da9d03a5cc3", size = 43039, upload-time = "2025-06-09T22:53:43.268Z" }, + { url = "https://files.pythonhosted.org/packages/22/e1/58da211eb8fdc6fc854002387d38f415a6ca5f5c67c1315b204a5d3e9d7a/propcache-0.3.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9bec58347a5a6cebf239daba9bda37dffec5b8d2ce004d9fe4edef3d2815137e", size = 201903, upload-time = "2025-06-09T22:53:44.872Z" }, + { url = "https://files.pythonhosted.org/packages/c4/0a/550ea0f52aac455cb90111c8bab995208443e46d925e51e2f6ebdf869525/propcache-0.3.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:55ffda449a507e9fbd4aca1a7d9aa6753b07d6166140e5a18d2ac9bc49eac220", size = 213362, upload-time = "2025-06-09T22:53:46.707Z" }, + { url = "https://files.pythonhosted.org/packages/5a/af/9893b7d878deda9bb69fcf54600b247fba7317761b7db11fede6e0f28bd0/propcache-0.3.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:64a67fb39229a8a8491dd42f864e5e263155e729c2e7ff723d6e25f596b1e8cb", size = 210525, upload-time = "2025-06-09T22:53:48.547Z" }, + { url = "https://files.pythonhosted.org/packages/7c/bb/38fd08b278ca85cde36d848091ad2b45954bc5f15cce494bb300b9285831/propcache-0.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9da1cf97b92b51253d5b68cf5a2b9e0dafca095e36b7f2da335e27dc6172a614", size = 198283, upload-time = "2025-06-09T22:53:50.067Z" }, + { url = "https://files.pythonhosted.org/packages/78/8c/9fe55bd01d362bafb413dfe508c48753111a1e269737fa143ba85693592c/propcache-0.3.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5f559e127134b07425134b4065be45b166183fdcb433cb6c24c8e4149056ad50", size = 191872, upload-time = "2025-06-09T22:53:51.438Z" }, + { url = "https://files.pythonhosted.org/packages/54/14/4701c33852937a22584e08abb531d654c8bcf7948a8f87ad0a4822394147/propcache-0.3.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:aff2e4e06435d61f11a428360a932138d0ec288b0a31dd9bd78d200bd4a2b339", size = 199452, upload-time = "2025-06-09T22:53:53.229Z" }, + { url = "https://files.pythonhosted.org/packages/16/44/447f2253d859602095356007657ee535e0093215ea0b3d1d6a41d16e5201/propcache-0.3.2-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:4927842833830942a5d0a56e6f4839bc484785b8e1ce8d287359794818633ba0", size = 191567, upload-time = "2025-06-09T22:53:54.541Z" }, + { url = "https://files.pythonhosted.org/packages/f2/b3/e4756258749bb2d3b46defcff606a2f47410bab82be5824a67e84015b267/propcache-0.3.2-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:6107ddd08b02654a30fb8ad7a132021759d750a82578b94cd55ee2772b6ebea2", size = 193015, upload-time = "2025-06-09T22:53:56.44Z" }, + { url = "https://files.pythonhosted.org/packages/1e/df/e6d3c7574233164b6330b9fd697beeac402afd367280e6dc377bb99b43d9/propcache-0.3.2-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:70bd8b9cd6b519e12859c99f3fc9a93f375ebd22a50296c3a295028bea73b9e7", size = 204660, upload-time = "2025-06-09T22:53:57.839Z" }, + { url = "https://files.pythonhosted.org/packages/b2/53/e4d31dd5170b4a0e2e6b730f2385a96410633b4833dc25fe5dffd1f73294/propcache-0.3.2-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:2183111651d710d3097338dd1893fcf09c9f54e27ff1a8795495a16a469cc90b", size = 206105, upload-time = "2025-06-09T22:53:59.638Z" }, + { url = "https://files.pythonhosted.org/packages/7f/fe/74d54cf9fbe2a20ff786e5f7afcfde446588f0cf15fb2daacfbc267b866c/propcache-0.3.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:fb075ad271405dcad8e2a7ffc9a750a3bf70e533bd86e89f0603e607b93aa64c", size = 196980, upload-time = "2025-06-09T22:54:01.071Z" }, + { url = "https://files.pythonhosted.org/packages/22/ec/c469c9d59dada8a7679625e0440b544fe72e99311a4679c279562051f6fc/propcache-0.3.2-cp310-cp310-win32.whl", hash = "sha256:404d70768080d3d3bdb41d0771037da19d8340d50b08e104ca0e7f9ce55fce70", size = 37679, upload-time = "2025-06-09T22:54:03.003Z" }, + { url = "https://files.pythonhosted.org/packages/38/35/07a471371ac89d418f8d0b699c75ea6dca2041fbda360823de21f6a9ce0a/propcache-0.3.2-cp310-cp310-win_amd64.whl", hash = "sha256:7435d766f978b4ede777002e6b3b6641dd229cd1da8d3d3106a45770365f9ad9", size = 41459, upload-time = "2025-06-09T22:54:04.134Z" }, + { url = "https://files.pythonhosted.org/packages/80/8d/e8b436717ab9c2cfc23b116d2c297305aa4cd8339172a456d61ebf5669b8/propcache-0.3.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:0b8d2f607bd8f80ddc04088bc2a037fdd17884a6fcadc47a96e334d72f3717be", size = 74207, upload-time = "2025-06-09T22:54:05.399Z" }, + { url = "https://files.pythonhosted.org/packages/d6/29/1e34000e9766d112171764b9fa3226fa0153ab565d0c242c70e9945318a7/propcache-0.3.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:06766d8f34733416e2e34f46fea488ad5d60726bb9481d3cddf89a6fa2d9603f", size = 43648, upload-time = "2025-06-09T22:54:08.023Z" }, + { url = "https://files.pythonhosted.org/packages/46/92/1ad5af0df781e76988897da39b5f086c2bf0f028b7f9bd1f409bb05b6874/propcache-0.3.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a2dc1f4a1df4fecf4e6f68013575ff4af84ef6f478fe5344317a65d38a8e6dc9", size = 43496, upload-time = "2025-06-09T22:54:09.228Z" }, + { url = "https://files.pythonhosted.org/packages/b3/ce/e96392460f9fb68461fabab3e095cb00c8ddf901205be4eae5ce246e5b7e/propcache-0.3.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:be29c4f4810c5789cf10ddf6af80b041c724e629fa51e308a7a0fb19ed1ef7bf", size = 217288, upload-time = "2025-06-09T22:54:10.466Z" }, + { url = "https://files.pythonhosted.org/packages/c5/2a/866726ea345299f7ceefc861a5e782b045545ae6940851930a6adaf1fca6/propcache-0.3.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:59d61f6970ecbd8ff2e9360304d5c8876a6abd4530cb752c06586849ac8a9dc9", size = 227456, upload-time = "2025-06-09T22:54:11.828Z" }, + { url = "https://files.pythonhosted.org/packages/de/03/07d992ccb6d930398689187e1b3c718339a1c06b8b145a8d9650e4726166/propcache-0.3.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:62180e0b8dbb6b004baec00a7983e4cc52f5ada9cd11f48c3528d8cfa7b96a66", size = 225429, upload-time = "2025-06-09T22:54:13.823Z" }, + { url = "https://files.pythonhosted.org/packages/5d/e6/116ba39448753b1330f48ab8ba927dcd6cf0baea8a0ccbc512dfb49ba670/propcache-0.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c144ca294a204c470f18cf4c9d78887810d04a3e2fbb30eea903575a779159df", size = 213472, upload-time = "2025-06-09T22:54:15.232Z" }, + { url = "https://files.pythonhosted.org/packages/a6/85/f01f5d97e54e428885a5497ccf7f54404cbb4f906688a1690cd51bf597dc/propcache-0.3.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c5c2a784234c28854878d68978265617aa6dc0780e53d44b4d67f3651a17a9a2", size = 204480, upload-time = "2025-06-09T22:54:17.104Z" }, + { url = "https://files.pythonhosted.org/packages/e3/79/7bf5ab9033b8b8194cc3f7cf1aaa0e9c3256320726f64a3e1f113a812dce/propcache-0.3.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:5745bc7acdafa978ca1642891b82c19238eadc78ba2aaa293c6863b304e552d7", size = 214530, upload-time = "2025-06-09T22:54:18.512Z" }, + { url = "https://files.pythonhosted.org/packages/31/0b/bd3e0c00509b609317df4a18e6b05a450ef2d9a963e1d8bc9c9415d86f30/propcache-0.3.2-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:c0075bf773d66fa8c9d41f66cc132ecc75e5bb9dd7cce3cfd14adc5ca184cb95", size = 205230, upload-time = "2025-06-09T22:54:19.947Z" }, + { url = "https://files.pythonhosted.org/packages/7a/23/fae0ff9b54b0de4e819bbe559508da132d5683c32d84d0dc2ccce3563ed4/propcache-0.3.2-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:5f57aa0847730daceff0497f417c9de353c575d8da3579162cc74ac294c5369e", size = 206754, upload-time = "2025-06-09T22:54:21.716Z" }, + { url = "https://files.pythonhosted.org/packages/b7/7f/ad6a3c22630aaa5f618b4dc3c3598974a72abb4c18e45a50b3cdd091eb2f/propcache-0.3.2-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:eef914c014bf72d18efb55619447e0aecd5fb7c2e3fa7441e2e5d6099bddff7e", size = 218430, upload-time = "2025-06-09T22:54:23.17Z" }, + { url = "https://files.pythonhosted.org/packages/5b/2c/ba4f1c0e8a4b4c75910742f0d333759d441f65a1c7f34683b4a74c0ee015/propcache-0.3.2-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:2a4092e8549031e82facf3decdbc0883755d5bbcc62d3aea9d9e185549936dcf", size = 223884, upload-time = "2025-06-09T22:54:25.539Z" }, + { url = "https://files.pythonhosted.org/packages/88/e4/ebe30fc399e98572019eee82ad0caf512401661985cbd3da5e3140ffa1b0/propcache-0.3.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:85871b050f174bc0bfb437efbdb68aaf860611953ed12418e4361bc9c392749e", size = 211480, upload-time = "2025-06-09T22:54:26.892Z" }, + { url = "https://files.pythonhosted.org/packages/96/0a/7d5260b914e01d1d0906f7f38af101f8d8ed0dc47426219eeaf05e8ea7c2/propcache-0.3.2-cp311-cp311-win32.whl", hash = "sha256:36c8d9b673ec57900c3554264e630d45980fd302458e4ac801802a7fd2ef7897", size = 37757, upload-time = "2025-06-09T22:54:28.241Z" }, + { url = "https://files.pythonhosted.org/packages/e1/2d/89fe4489a884bc0da0c3278c552bd4ffe06a1ace559db5ef02ef24ab446b/propcache-0.3.2-cp311-cp311-win_amd64.whl", hash = "sha256:e53af8cb6a781b02d2ea079b5b853ba9430fcbe18a8e3ce647d5982a3ff69f39", size = 41500, upload-time = "2025-06-09T22:54:29.4Z" }, + { url = "https://files.pythonhosted.org/packages/a8/42/9ca01b0a6f48e81615dca4765a8f1dd2c057e0540f6116a27dc5ee01dfb6/propcache-0.3.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:8de106b6c84506b31c27168582cd3cb3000a6412c16df14a8628e5871ff83c10", size = 73674, upload-time = "2025-06-09T22:54:30.551Z" }, + { url = "https://files.pythonhosted.org/packages/af/6e/21293133beb550f9c901bbece755d582bfaf2176bee4774000bd4dd41884/propcache-0.3.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:28710b0d3975117239c76600ea351934ac7b5ff56e60953474342608dbbb6154", size = 43570, upload-time = "2025-06-09T22:54:32.296Z" }, + { url = "https://files.pythonhosted.org/packages/0c/c8/0393a0a3a2b8760eb3bde3c147f62b20044f0ddac81e9d6ed7318ec0d852/propcache-0.3.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ce26862344bdf836650ed2487c3d724b00fbfec4233a1013f597b78c1cb73615", size = 43094, upload-time = "2025-06-09T22:54:33.929Z" }, + { url = "https://files.pythonhosted.org/packages/37/2c/489afe311a690399d04a3e03b069225670c1d489eb7b044a566511c1c498/propcache-0.3.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bca54bd347a253af2cf4544bbec232ab982f4868de0dd684246b67a51bc6b1db", size = 226958, upload-time = "2025-06-09T22:54:35.186Z" }, + { url = "https://files.pythonhosted.org/packages/9d/ca/63b520d2f3d418c968bf596839ae26cf7f87bead026b6192d4da6a08c467/propcache-0.3.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:55780d5e9a2ddc59711d727226bb1ba83a22dd32f64ee15594b9392b1f544eb1", size = 234894, upload-time = "2025-06-09T22:54:36.708Z" }, + { url = "https://files.pythonhosted.org/packages/11/60/1d0ed6fff455a028d678df30cc28dcee7af77fa2b0e6962ce1df95c9a2a9/propcache-0.3.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:035e631be25d6975ed87ab23153db6a73426a48db688070d925aa27e996fe93c", size = 233672, upload-time = "2025-06-09T22:54:38.062Z" }, + { url = "https://files.pythonhosted.org/packages/37/7c/54fd5301ef38505ab235d98827207176a5c9b2aa61939b10a460ca53e123/propcache-0.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ee6f22b6eaa39297c751d0e80c0d3a454f112f5c6481214fcf4c092074cecd67", size = 224395, upload-time = "2025-06-09T22:54:39.634Z" }, + { url = "https://files.pythonhosted.org/packages/ee/1a/89a40e0846f5de05fdc6779883bf46ba980e6df4d2ff8fb02643de126592/propcache-0.3.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7ca3aee1aa955438c4dba34fc20a9f390e4c79967257d830f137bd5a8a32ed3b", size = 212510, upload-time = "2025-06-09T22:54:41.565Z" }, + { url = "https://files.pythonhosted.org/packages/5e/33/ca98368586c9566a6b8d5ef66e30484f8da84c0aac3f2d9aec6d31a11bd5/propcache-0.3.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:7a4f30862869fa2b68380d677cc1c5fcf1e0f2b9ea0cf665812895c75d0ca3b8", size = 222949, upload-time = "2025-06-09T22:54:43.038Z" }, + { url = "https://files.pythonhosted.org/packages/ba/11/ace870d0aafe443b33b2f0b7efdb872b7c3abd505bfb4890716ad7865e9d/propcache-0.3.2-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:b77ec3c257d7816d9f3700013639db7491a434644c906a2578a11daf13176251", size = 217258, upload-time = "2025-06-09T22:54:44.376Z" }, + { url = "https://files.pythonhosted.org/packages/5b/d2/86fd6f7adffcfc74b42c10a6b7db721d1d9ca1055c45d39a1a8f2a740a21/propcache-0.3.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:cab90ac9d3f14b2d5050928483d3d3b8fb6b4018893fc75710e6aa361ecb2474", size = 213036, upload-time = "2025-06-09T22:54:46.243Z" }, + { url = "https://files.pythonhosted.org/packages/07/94/2d7d1e328f45ff34a0a284cf5a2847013701e24c2a53117e7c280a4316b3/propcache-0.3.2-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:0b504d29f3c47cf6b9e936c1852246c83d450e8e063d50562115a6be6d3a2535", size = 227684, upload-time = "2025-06-09T22:54:47.63Z" }, + { url = "https://files.pythonhosted.org/packages/b7/05/37ae63a0087677e90b1d14710e532ff104d44bc1efa3b3970fff99b891dc/propcache-0.3.2-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:ce2ac2675a6aa41ddb2a0c9cbff53780a617ac3d43e620f8fd77ba1c84dcfc06", size = 234562, upload-time = "2025-06-09T22:54:48.982Z" }, + { url = "https://files.pythonhosted.org/packages/a4/7c/3f539fcae630408d0bd8bf3208b9a647ccad10976eda62402a80adf8fc34/propcache-0.3.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:62b4239611205294cc433845b914131b2a1f03500ff3c1ed093ed216b82621e1", size = 222142, upload-time = "2025-06-09T22:54:50.424Z" }, + { url = "https://files.pythonhosted.org/packages/7c/d2/34b9eac8c35f79f8a962546b3e97e9d4b990c420ee66ac8255d5d9611648/propcache-0.3.2-cp312-cp312-win32.whl", hash = "sha256:df4a81b9b53449ebc90cc4deefb052c1dd934ba85012aa912c7ea7b7e38b60c1", size = 37711, upload-time = "2025-06-09T22:54:52.072Z" }, + { url = "https://files.pythonhosted.org/packages/19/61/d582be5d226cf79071681d1b46b848d6cb03d7b70af7063e33a2787eaa03/propcache-0.3.2-cp312-cp312-win_amd64.whl", hash = "sha256:7046e79b989d7fe457bb755844019e10f693752d169076138abf17f31380800c", size = 41479, upload-time = "2025-06-09T22:54:53.234Z" }, + { url = "https://files.pythonhosted.org/packages/dc/d1/8c747fafa558c603c4ca19d8e20b288aa0c7cda74e9402f50f31eb65267e/propcache-0.3.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ca592ed634a73ca002967458187109265e980422116c0a107cf93d81f95af945", size = 71286, upload-time = "2025-06-09T22:54:54.369Z" }, + { url = "https://files.pythonhosted.org/packages/61/99/d606cb7986b60d89c36de8a85d58764323b3a5ff07770a99d8e993b3fa73/propcache-0.3.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:9ecb0aad4020e275652ba3975740f241bd12a61f1a784df044cf7477a02bc252", size = 42425, upload-time = "2025-06-09T22:54:55.642Z" }, + { url = "https://files.pythonhosted.org/packages/8c/96/ef98f91bbb42b79e9bb82bdd348b255eb9d65f14dbbe3b1594644c4073f7/propcache-0.3.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:7f08f1cc28bd2eade7a8a3d2954ccc673bb02062e3e7da09bc75d843386b342f", size = 41846, upload-time = "2025-06-09T22:54:57.246Z" }, + { url = "https://files.pythonhosted.org/packages/5b/ad/3f0f9a705fb630d175146cd7b1d2bf5555c9beaed54e94132b21aac098a6/propcache-0.3.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d1a342c834734edb4be5ecb1e9fb48cb64b1e2320fccbd8c54bf8da8f2a84c33", size = 208871, upload-time = "2025-06-09T22:54:58.975Z" }, + { url = "https://files.pythonhosted.org/packages/3a/38/2085cda93d2c8b6ec3e92af2c89489a36a5886b712a34ab25de9fbca7992/propcache-0.3.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8a544caaae1ac73f1fecfae70ded3e93728831affebd017d53449e3ac052ac1e", size = 215720, upload-time = "2025-06-09T22:55:00.471Z" }, + { url = "https://files.pythonhosted.org/packages/61/c1/d72ea2dc83ac7f2c8e182786ab0fc2c7bd123a1ff9b7975bee671866fe5f/propcache-0.3.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:310d11aa44635298397db47a3ebce7db99a4cc4b9bbdfcf6c98a60c8d5261cf1", size = 215203, upload-time = "2025-06-09T22:55:01.834Z" }, + { url = "https://files.pythonhosted.org/packages/af/81/b324c44ae60c56ef12007105f1460d5c304b0626ab0cc6b07c8f2a9aa0b8/propcache-0.3.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4c1396592321ac83157ac03a2023aa6cc4a3cc3cfdecb71090054c09e5a7cce3", size = 206365, upload-time = "2025-06-09T22:55:03.199Z" }, + { url = "https://files.pythonhosted.org/packages/09/73/88549128bb89e66d2aff242488f62869014ae092db63ccea53c1cc75a81d/propcache-0.3.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8cabf5b5902272565e78197edb682017d21cf3b550ba0460ee473753f28d23c1", size = 196016, upload-time = "2025-06-09T22:55:04.518Z" }, + { url = "https://files.pythonhosted.org/packages/b9/3f/3bdd14e737d145114a5eb83cb172903afba7242f67c5877f9909a20d948d/propcache-0.3.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:0a2f2235ac46a7aa25bdeb03a9e7060f6ecbd213b1f9101c43b3090ffb971ef6", size = 205596, upload-time = "2025-06-09T22:55:05.942Z" }, + { url = "https://files.pythonhosted.org/packages/0f/ca/2f4aa819c357d3107c3763d7ef42c03980f9ed5c48c82e01e25945d437c1/propcache-0.3.2-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:92b69e12e34869a6970fd2f3da91669899994b47c98f5d430b781c26f1d9f387", size = 200977, upload-time = "2025-06-09T22:55:07.792Z" }, + { url = "https://files.pythonhosted.org/packages/cd/4a/e65276c7477533c59085251ae88505caf6831c0e85ff8b2e31ebcbb949b1/propcache-0.3.2-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:54e02207c79968ebbdffc169591009f4474dde3b4679e16634d34c9363ff56b4", size = 197220, upload-time = "2025-06-09T22:55:09.173Z" }, + { url = "https://files.pythonhosted.org/packages/7c/54/fc7152e517cf5578278b242396ce4d4b36795423988ef39bb8cd5bf274c8/propcache-0.3.2-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:4adfb44cb588001f68c5466579d3f1157ca07f7504fc91ec87862e2b8e556b88", size = 210642, upload-time = "2025-06-09T22:55:10.62Z" }, + { url = "https://files.pythonhosted.org/packages/b9/80/abeb4a896d2767bf5f1ea7b92eb7be6a5330645bd7fb844049c0e4045d9d/propcache-0.3.2-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:fd3e6019dc1261cd0291ee8919dd91fbab7b169bb76aeef6c716833a3f65d206", size = 212789, upload-time = "2025-06-09T22:55:12.029Z" }, + { url = "https://files.pythonhosted.org/packages/b3/db/ea12a49aa7b2b6d68a5da8293dcf50068d48d088100ac016ad92a6a780e6/propcache-0.3.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4c181cad81158d71c41a2bce88edce078458e2dd5ffee7eddd6b05da85079f43", size = 205880, upload-time = "2025-06-09T22:55:13.45Z" }, + { url = "https://files.pythonhosted.org/packages/d1/e5/9076a0bbbfb65d1198007059c65639dfd56266cf8e477a9707e4b1999ff4/propcache-0.3.2-cp313-cp313-win32.whl", hash = "sha256:8a08154613f2249519e549de2330cf8e2071c2887309a7b07fb56098f5170a02", size = 37220, upload-time = "2025-06-09T22:55:15.284Z" }, + { url = "https://files.pythonhosted.org/packages/d3/f5/b369e026b09a26cd77aa88d8fffd69141d2ae00a2abaaf5380d2603f4b7f/propcache-0.3.2-cp313-cp313-win_amd64.whl", hash = "sha256:e41671f1594fc4ab0a6dec1351864713cb3a279910ae8b58f884a88a0a632c05", size = 40678, upload-time = "2025-06-09T22:55:16.445Z" }, + { url = "https://files.pythonhosted.org/packages/a4/3a/6ece377b55544941a08d03581c7bc400a3c8cd3c2865900a68d5de79e21f/propcache-0.3.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:9a3cf035bbaf035f109987d9d55dc90e4b0e36e04bbbb95af3055ef17194057b", size = 76560, upload-time = "2025-06-09T22:55:17.598Z" }, + { url = "https://files.pythonhosted.org/packages/0c/da/64a2bb16418740fa634b0e9c3d29edff1db07f56d3546ca2d86ddf0305e1/propcache-0.3.2-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:156c03d07dc1323d8dacaa221fbe028c5c70d16709cdd63502778e6c3ccca1b0", size = 44676, upload-time = "2025-06-09T22:55:18.922Z" }, + { url = "https://files.pythonhosted.org/packages/36/7b/f025e06ea51cb72c52fb87e9b395cced02786610b60a3ed51da8af017170/propcache-0.3.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:74413c0ba02ba86f55cf60d18daab219f7e531620c15f1e23d95563f505efe7e", size = 44701, upload-time = "2025-06-09T22:55:20.106Z" }, + { url = "https://files.pythonhosted.org/packages/a4/00/faa1b1b7c3b74fc277f8642f32a4c72ba1d7b2de36d7cdfb676db7f4303e/propcache-0.3.2-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f066b437bb3fa39c58ff97ab2ca351db465157d68ed0440abecb21715eb24b28", size = 276934, upload-time = "2025-06-09T22:55:21.5Z" }, + { url = "https://files.pythonhosted.org/packages/74/ab/935beb6f1756e0476a4d5938ff44bf0d13a055fed880caf93859b4f1baf4/propcache-0.3.2-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f1304b085c83067914721e7e9d9917d41ad87696bf70f0bc7dee450e9c71ad0a", size = 278316, upload-time = "2025-06-09T22:55:22.918Z" }, + { url = "https://files.pythonhosted.org/packages/f8/9d/994a5c1ce4389610838d1caec74bdf0e98b306c70314d46dbe4fcf21a3e2/propcache-0.3.2-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ab50cef01b372763a13333b4e54021bdcb291fc9a8e2ccb9c2df98be51bcde6c", size = 282619, upload-time = "2025-06-09T22:55:24.651Z" }, + { url = "https://files.pythonhosted.org/packages/2b/00/a10afce3d1ed0287cef2e09506d3be9822513f2c1e96457ee369adb9a6cd/propcache-0.3.2-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fad3b2a085ec259ad2c2842666b2a0a49dea8463579c606426128925af1ed725", size = 265896, upload-time = "2025-06-09T22:55:26.049Z" }, + { url = "https://files.pythonhosted.org/packages/2e/a8/2aa6716ffa566ca57c749edb909ad27884680887d68517e4be41b02299f3/propcache-0.3.2-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:261fa020c1c14deafd54c76b014956e2f86991af198c51139faf41c4d5e83892", size = 252111, upload-time = "2025-06-09T22:55:27.381Z" }, + { url = "https://files.pythonhosted.org/packages/36/4f/345ca9183b85ac29c8694b0941f7484bf419c7f0fea2d1e386b4f7893eed/propcache-0.3.2-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:46d7f8aa79c927e5f987ee3a80205c987717d3659f035c85cf0c3680526bdb44", size = 268334, upload-time = "2025-06-09T22:55:28.747Z" }, + { url = "https://files.pythonhosted.org/packages/3e/ca/fcd54f78b59e3f97b3b9715501e3147f5340167733d27db423aa321e7148/propcache-0.3.2-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:6d8f3f0eebf73e3c0ff0e7853f68be638b4043c65a70517bb575eff54edd8dbe", size = 255026, upload-time = "2025-06-09T22:55:30.184Z" }, + { url = "https://files.pythonhosted.org/packages/8b/95/8e6a6bbbd78ac89c30c225210a5c687790e532ba4088afb8c0445b77ef37/propcache-0.3.2-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:03c89c1b14a5452cf15403e291c0ccd7751d5b9736ecb2c5bab977ad6c5bcd81", size = 250724, upload-time = "2025-06-09T22:55:31.646Z" }, + { url = "https://files.pythonhosted.org/packages/ee/b0/0dd03616142baba28e8b2d14ce5df6631b4673850a3d4f9c0f9dd714a404/propcache-0.3.2-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:0cc17efde71e12bbaad086d679ce575268d70bc123a5a71ea7ad76f70ba30bba", size = 268868, upload-time = "2025-06-09T22:55:33.209Z" }, + { url = "https://files.pythonhosted.org/packages/c5/98/2c12407a7e4fbacd94ddd32f3b1e3d5231e77c30ef7162b12a60e2dd5ce3/propcache-0.3.2-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:acdf05d00696bc0447e278bb53cb04ca72354e562cf88ea6f9107df8e7fd9770", size = 271322, upload-time = "2025-06-09T22:55:35.065Z" }, + { url = "https://files.pythonhosted.org/packages/35/91/9cb56efbb428b006bb85db28591e40b7736847b8331d43fe335acf95f6c8/propcache-0.3.2-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:4445542398bd0b5d32df908031cb1b30d43ac848e20470a878b770ec2dcc6330", size = 265778, upload-time = "2025-06-09T22:55:36.45Z" }, + { url = "https://files.pythonhosted.org/packages/9a/4c/b0fe775a2bdd01e176b14b574be679d84fc83958335790f7c9a686c1f468/propcache-0.3.2-cp313-cp313t-win32.whl", hash = "sha256:f86e5d7cd03afb3a1db8e9f9f6eff15794e79e791350ac48a8c924e6f439f394", size = 41175, upload-time = "2025-06-09T22:55:38.436Z" }, + { url = "https://files.pythonhosted.org/packages/a4/ff/47f08595e3d9b5e149c150f88d9714574f1a7cbd89fe2817158a952674bf/propcache-0.3.2-cp313-cp313t-win_amd64.whl", hash = "sha256:9704bedf6e7cbe3c65eca4379a9b53ee6a83749f047808cbb5044d40d7d72198", size = 44857, upload-time = "2025-06-09T22:55:39.687Z" }, + { url = "https://files.pythonhosted.org/packages/6c/39/8ea9bcfaaff16fd0b0fc901ee522e24c9ec44b4ca0229cfffb8066a06959/propcache-0.3.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:a7fad897f14d92086d6b03fdd2eb844777b0c4d7ec5e3bac0fbae2ab0602bbe5", size = 74678, upload-time = "2025-06-09T22:55:41.227Z" }, + { url = "https://files.pythonhosted.org/packages/d3/85/cab84c86966e1d354cf90cdc4ba52f32f99a5bca92a1529d666d957d7686/propcache-0.3.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1f43837d4ca000243fd7fd6301947d7cb93360d03cd08369969450cc6b2ce3b4", size = 43829, upload-time = "2025-06-09T22:55:42.417Z" }, + { url = "https://files.pythonhosted.org/packages/23/f7/9cb719749152d8b26d63801b3220ce2d3931312b2744d2b3a088b0ee9947/propcache-0.3.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:261df2e9474a5949c46e962065d88eb9b96ce0f2bd30e9d3136bcde84befd8f2", size = 43729, upload-time = "2025-06-09T22:55:43.651Z" }, + { url = "https://files.pythonhosted.org/packages/a2/a2/0b2b5a210ff311260002a315f6f9531b65a36064dfb804655432b2f7d3e3/propcache-0.3.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e514326b79e51f0a177daab1052bc164d9d9e54133797a3a58d24c9c87a3fe6d", size = 204483, upload-time = "2025-06-09T22:55:45.327Z" }, + { url = "https://files.pythonhosted.org/packages/3f/e0/7aff5de0c535f783b0c8be5bdb750c305c1961d69fbb136939926e155d98/propcache-0.3.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d4a996adb6904f85894570301939afeee65f072b4fd265ed7e569e8d9058e4ec", size = 217425, upload-time = "2025-06-09T22:55:46.729Z" }, + { url = "https://files.pythonhosted.org/packages/92/1d/65fa889eb3b2a7d6e4ed3c2b568a9cb8817547a1450b572de7bf24872800/propcache-0.3.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:76cace5d6b2a54e55b137669b30f31aa15977eeed390c7cbfb1dafa8dfe9a701", size = 214723, upload-time = "2025-06-09T22:55:48.342Z" }, + { url = "https://files.pythonhosted.org/packages/9a/e2/eecf6989870988dfd731de408a6fa366e853d361a06c2133b5878ce821ad/propcache-0.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:31248e44b81d59d6addbb182c4720f90b44e1efdc19f58112a3c3a1615fb47ef", size = 200166, upload-time = "2025-06-09T22:55:49.775Z" }, + { url = "https://files.pythonhosted.org/packages/12/06/c32be4950967f18f77489268488c7cdc78cbfc65a8ba8101b15e526b83dc/propcache-0.3.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:abb7fa19dbf88d3857363e0493b999b8011eea856b846305d8c0512dfdf8fbb1", size = 194004, upload-time = "2025-06-09T22:55:51.335Z" }, + { url = "https://files.pythonhosted.org/packages/46/6c/17b521a6b3b7cbe277a4064ff0aa9129dd8c89f425a5a9b6b4dd51cc3ff4/propcache-0.3.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:d81ac3ae39d38588ad0549e321e6f773a4e7cc68e7751524a22885d5bbadf886", size = 203075, upload-time = "2025-06-09T22:55:52.681Z" }, + { url = "https://files.pythonhosted.org/packages/62/cb/3bdba2b736b3e45bc0e40f4370f745b3e711d439ffbffe3ae416393eece9/propcache-0.3.2-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:cc2782eb0f7a16462285b6f8394bbbd0e1ee5f928034e941ffc444012224171b", size = 195407, upload-time = "2025-06-09T22:55:54.048Z" }, + { url = "https://files.pythonhosted.org/packages/29/bd/760c5c6a60a4a2c55a421bc34a25ba3919d49dee411ddb9d1493bb51d46e/propcache-0.3.2-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:db429c19a6c7e8a1c320e6a13c99799450f411b02251fb1b75e6217cf4a14fcb", size = 196045, upload-time = "2025-06-09T22:55:55.485Z" }, + { url = "https://files.pythonhosted.org/packages/76/58/ced2757a46f55b8c84358d6ab8de4faf57cba831c51e823654da7144b13a/propcache-0.3.2-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:21d8759141a9e00a681d35a1f160892a36fb6caa715ba0b832f7747da48fb6ea", size = 208432, upload-time = "2025-06-09T22:55:56.884Z" }, + { url = "https://files.pythonhosted.org/packages/bb/ec/d98ea8d5a4d8fe0e372033f5254eddf3254344c0c5dc6c49ab84349e4733/propcache-0.3.2-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:2ca6d378f09adb13837614ad2754fa8afaee330254f404299611bce41a8438cb", size = 210100, upload-time = "2025-06-09T22:55:58.498Z" }, + { url = "https://files.pythonhosted.org/packages/56/84/b6d8a7ecf3f62d7dd09d9d10bbf89fad6837970ef868b35b5ffa0d24d9de/propcache-0.3.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:34a624af06c048946709f4278b4176470073deda88d91342665d95f7c6270fbe", size = 200712, upload-time = "2025-06-09T22:55:59.906Z" }, + { url = "https://files.pythonhosted.org/packages/bf/32/889f4903ddfe4a9dc61da71ee58b763758cf2d608fe1decede06e6467f8d/propcache-0.3.2-cp39-cp39-win32.whl", hash = "sha256:4ba3fef1c30f306b1c274ce0b8baaa2c3cdd91f645c48f06394068f37d3837a1", size = 38187, upload-time = "2025-06-09T22:56:01.212Z" }, + { url = "https://files.pythonhosted.org/packages/67/74/d666795fb9ba1dc139d30de64f3b6fd1ff9c9d3d96ccfdb992cd715ce5d2/propcache-0.3.2-cp39-cp39-win_amd64.whl", hash = "sha256:7a2368eed65fc69a7a7a40b27f22e85e7627b74216f0846b04ba5c116e191ec9", size = 42025, upload-time = "2025-06-09T22:56:02.875Z" }, + { url = "https://files.pythonhosted.org/packages/cc/35/cc0aaecf278bb4575b8555f2b137de5ab821595ddae9da9d3cd1da4072c7/propcache-0.3.2-py3-none-any.whl", hash = "sha256:98f1ec44fb675f5052cccc8e609c46ed23a35a1cfd18545ad4e29002d858a43f", size = 12663, upload-time = "2025-06-09T22:56:04.484Z" }, ] [[package]] @@ -1754,7 +2172,7 @@ wheels = [ [[package]] name = "pydantic" -version = "2.11.3" +version = "2.11.7" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "annotated-types" }, @@ -1762,131 +2180,132 @@ dependencies = [ { name = "typing-extensions" }, { name = "typing-inspection" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/10/2e/ca897f093ee6c5f3b0bee123ee4465c50e75431c3d5b6a3b44a47134e891/pydantic-2.11.3.tar.gz", hash = "sha256:7471657138c16adad9322fe3070c0116dd6c3ad8d649300e3cbdfe91f4db4ec3", size = 785513, upload-time = "2025-04-08T13:27:06.399Z" } +sdist = { url = "https://files.pythonhosted.org/packages/00/dd/4325abf92c39ba8623b5af936ddb36ffcfe0beae70405d456ab1fb2f5b8c/pydantic-2.11.7.tar.gz", hash = "sha256:d989c3c6cb79469287b1569f7447a17848c998458d49ebe294e975b9baf0f0db", size = 788350, upload-time = "2025-06-14T08:33:17.137Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/b0/1d/407b29780a289868ed696d1616f4aad49d6388e5a77f567dcd2629dcd7b8/pydantic-2.11.3-py3-none-any.whl", hash = "sha256:a082753436a07f9ba1289c6ffa01cd93db3548776088aa917cc43b63f68fa60f", size = 443591, upload-time = "2025-04-08T13:27:03.789Z" }, + { url = "https://files.pythonhosted.org/packages/6a/c0/ec2b1c8712ca690e5d61979dee872603e92b8a32f94cc1b72d53beab008a/pydantic-2.11.7-py3-none-any.whl", hash = "sha256:dde5df002701f6de26248661f6835bbe296a47bf73990135c7d07ce741b9623b", size = 444782, upload-time = "2025-06-14T08:33:14.905Z" }, ] [[package]] name = "pydantic-core" -version = "2.33.1" +version = "2.33.2" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/17/19/ed6a078a5287aea7922de6841ef4c06157931622c89c2a47940837b5eecd/pydantic_core-2.33.1.tar.gz", hash = "sha256:bcc9c6fdb0ced789245b02b7d6603e17d1563064ddcfc36f046b61c0c05dd9df", size = 434395, upload-time = "2025-04-02T09:49:41.8Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/38/ea/5f572806ab4d4223d11551af814d243b0e3e02cc6913def4d1fe4a5ca41c/pydantic_core-2.33.1-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:3077cfdb6125cc8dab61b155fdd714663e401f0e6883f9632118ec12cf42df26", size = 2044021, upload-time = "2025-04-02T09:46:45.065Z" }, - { url = "https://files.pythonhosted.org/packages/8c/d1/f86cc96d2aa80e3881140d16d12ef2b491223f90b28b9a911346c04ac359/pydantic_core-2.33.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8ffab8b2908d152e74862d276cf5017c81a2f3719f14e8e3e8d6b83fda863927", size = 1861742, upload-time = "2025-04-02T09:46:46.684Z" }, - { url = "https://files.pythonhosted.org/packages/37/08/fbd2cd1e9fc735a0df0142fac41c114ad9602d1c004aea340169ae90973b/pydantic_core-2.33.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5183e4f6a2d468787243ebcd70cf4098c247e60d73fb7d68d5bc1e1beaa0c4db", size = 1910414, upload-time = "2025-04-02T09:46:48.263Z" }, - { url = "https://files.pythonhosted.org/packages/7f/73/3ac217751decbf8d6cb9443cec9b9eb0130eeada6ae56403e11b486e277e/pydantic_core-2.33.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:398a38d323f37714023be1e0285765f0a27243a8b1506b7b7de87b647b517e48", size = 1996848, upload-time = "2025-04-02T09:46:49.441Z" }, - { url = "https://files.pythonhosted.org/packages/9a/f5/5c26b265cdcff2661e2520d2d1e9db72d117ea00eb41e00a76efe68cb009/pydantic_core-2.33.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:87d3776f0001b43acebfa86f8c64019c043b55cc5a6a2e313d728b5c95b46969", size = 2141055, upload-time = "2025-04-02T09:46:50.602Z" }, - { url = "https://files.pythonhosted.org/packages/5d/14/a9c3cee817ef2f8347c5ce0713e91867a0dceceefcb2973942855c917379/pydantic_core-2.33.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c566dd9c5f63d22226409553531f89de0cac55397f2ab8d97d6f06cfce6d947e", size = 2753806, upload-time = "2025-04-02T09:46:52.116Z" }, - { url = "https://files.pythonhosted.org/packages/f2/68/866ce83a51dd37e7c604ce0050ff6ad26de65a7799df89f4db87dd93d1d6/pydantic_core-2.33.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a0d5f3acc81452c56895e90643a625302bd6be351e7010664151cc55b7b97f89", size = 2007777, upload-time = "2025-04-02T09:46:53.675Z" }, - { url = "https://files.pythonhosted.org/packages/b6/a8/36771f4404bb3e49bd6d4344da4dede0bf89cc1e01f3b723c47248a3761c/pydantic_core-2.33.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d3a07fadec2a13274a8d861d3d37c61e97a816beae717efccaa4b36dfcaadcde", size = 2122803, upload-time = "2025-04-02T09:46:55.789Z" }, - { url = "https://files.pythonhosted.org/packages/18/9c/730a09b2694aa89360d20756369822d98dc2f31b717c21df33b64ffd1f50/pydantic_core-2.33.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:f99aeda58dce827f76963ee87a0ebe75e648c72ff9ba1174a253f6744f518f65", size = 2086755, upload-time = "2025-04-02T09:46:56.956Z" }, - { url = "https://files.pythonhosted.org/packages/54/8e/2dccd89602b5ec31d1c58138d02340ecb2ebb8c2cac3cc66b65ce3edb6ce/pydantic_core-2.33.1-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:902dbc832141aa0ec374f4310f1e4e7febeebc3256f00dc359a9ac3f264a45dc", size = 2257358, upload-time = "2025-04-02T09:46:58.445Z" }, - { url = "https://files.pythonhosted.org/packages/d1/9c/126e4ac1bfad8a95a9837acdd0963695d69264179ba4ede8b8c40d741702/pydantic_core-2.33.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:fe44d56aa0b00d66640aa84a3cbe80b7a3ccdc6f0b1ca71090696a6d4777c091", size = 2257916, upload-time = "2025-04-02T09:46:59.726Z" }, - { url = "https://files.pythonhosted.org/packages/7d/ba/91eea2047e681a6853c81c20aeca9dcdaa5402ccb7404a2097c2adf9d038/pydantic_core-2.33.1-cp310-cp310-win32.whl", hash = "sha256:ed3eb16d51257c763539bde21e011092f127a2202692afaeaccb50db55a31383", size = 1923823, upload-time = "2025-04-02T09:47:01.278Z" }, - { url = "https://files.pythonhosted.org/packages/94/c0/fcdf739bf60d836a38811476f6ecd50374880b01e3014318b6e809ddfd52/pydantic_core-2.33.1-cp310-cp310-win_amd64.whl", hash = "sha256:694ad99a7f6718c1a498dc170ca430687a39894a60327f548e02a9c7ee4b6504", size = 1952494, upload-time = "2025-04-02T09:47:02.976Z" }, - { url = "https://files.pythonhosted.org/packages/d6/7f/c6298830cb780c46b4f46bb24298d01019ffa4d21769f39b908cd14bbd50/pydantic_core-2.33.1-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:6e966fc3caaf9f1d96b349b0341c70c8d6573bf1bac7261f7b0ba88f96c56c24", size = 2044224, upload-time = "2025-04-02T09:47:04.199Z" }, - { url = "https://files.pythonhosted.org/packages/a8/65/6ab3a536776cad5343f625245bd38165d6663256ad43f3a200e5936afd6c/pydantic_core-2.33.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:bfd0adeee563d59c598ceabddf2c92eec77abcb3f4a391b19aa7366170bd9e30", size = 1858845, upload-time = "2025-04-02T09:47:05.686Z" }, - { url = "https://files.pythonhosted.org/packages/e9/15/9a22fd26ba5ee8c669d4b8c9c244238e940cd5d818649603ca81d1c69861/pydantic_core-2.33.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:91815221101ad3c6b507804178a7bb5cb7b2ead9ecd600041669c8d805ebd595", size = 1910029, upload-time = "2025-04-02T09:47:07.042Z" }, - { url = "https://files.pythonhosted.org/packages/d5/33/8cb1a62818974045086f55f604044bf35b9342900318f9a2a029a1bec460/pydantic_core-2.33.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9fea9c1869bb4742d174a57b4700c6dadea951df8b06de40c2fedb4f02931c2e", size = 1997784, upload-time = "2025-04-02T09:47:08.63Z" }, - { url = "https://files.pythonhosted.org/packages/c0/ca/49958e4df7715c71773e1ea5be1c74544923d10319173264e6db122543f9/pydantic_core-2.33.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1d20eb4861329bb2484c021b9d9a977566ab16d84000a57e28061151c62b349a", size = 2141075, upload-time = "2025-04-02T09:47:10.267Z" }, - { url = "https://files.pythonhosted.org/packages/7b/a6/0b3a167a9773c79ba834b959b4e18c3ae9216b8319bd8422792abc8a41b1/pydantic_core-2.33.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0fb935c5591573ae3201640579f30128ccc10739b45663f93c06796854405505", size = 2745849, upload-time = "2025-04-02T09:47:11.724Z" }, - { url = "https://files.pythonhosted.org/packages/0b/60/516484135173aa9e5861d7a0663dce82e4746d2e7f803627d8c25dfa5578/pydantic_core-2.33.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c964fd24e6166420d18fb53996d8c9fd6eac9bf5ae3ec3d03015be4414ce497f", size = 2005794, upload-time = "2025-04-02T09:47:13.099Z" }, - { url = "https://files.pythonhosted.org/packages/86/70/05b1eb77459ad47de00cf78ee003016da0cedf8b9170260488d7c21e9181/pydantic_core-2.33.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:681d65e9011f7392db5aa002b7423cc442d6a673c635668c227c6c8d0e5a4f77", size = 2123237, upload-time = "2025-04-02T09:47:14.355Z" }, - { url = "https://files.pythonhosted.org/packages/c7/57/12667a1409c04ae7dc95d3b43158948eb0368e9c790be8b095cb60611459/pydantic_core-2.33.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e100c52f7355a48413e2999bfb4e139d2977a904495441b374f3d4fb4a170961", size = 2086351, upload-time = "2025-04-02T09:47:15.676Z" }, - { url = "https://files.pythonhosted.org/packages/57/61/cc6d1d1c1664b58fdd6ecc64c84366c34ec9b606aeb66cafab6f4088974c/pydantic_core-2.33.1-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:048831bd363490be79acdd3232f74a0e9951b11b2b4cc058aeb72b22fdc3abe1", size = 2258914, upload-time = "2025-04-02T09:47:17Z" }, - { url = "https://files.pythonhosted.org/packages/d1/0a/edb137176a1f5419b2ddee8bde6a0a548cfa3c74f657f63e56232df8de88/pydantic_core-2.33.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:bdc84017d28459c00db6f918a7272a5190bec3090058334e43a76afb279eac7c", size = 2257385, upload-time = "2025-04-02T09:47:18.631Z" }, - { url = "https://files.pythonhosted.org/packages/26/3c/48ca982d50e4b0e1d9954919c887bdc1c2b462801bf408613ccc641b3daa/pydantic_core-2.33.1-cp311-cp311-win32.whl", hash = "sha256:32cd11c5914d1179df70406427097c7dcde19fddf1418c787540f4b730289896", size = 1923765, upload-time = "2025-04-02T09:47:20.34Z" }, - { url = "https://files.pythonhosted.org/packages/33/cd/7ab70b99e5e21559f5de38a0928ea84e6f23fdef2b0d16a6feaf942b003c/pydantic_core-2.33.1-cp311-cp311-win_amd64.whl", hash = "sha256:2ea62419ba8c397e7da28a9170a16219d310d2cf4970dbc65c32faf20d828c83", size = 1950688, upload-time = "2025-04-02T09:47:22.029Z" }, - { url = "https://files.pythonhosted.org/packages/4b/ae/db1fc237b82e2cacd379f63e3335748ab88b5adde98bf7544a1b1bd10a84/pydantic_core-2.33.1-cp311-cp311-win_arm64.whl", hash = "sha256:fc903512177361e868bc1f5b80ac8c8a6e05fcdd574a5fb5ffeac5a9982b9e89", size = 1908185, upload-time = "2025-04-02T09:47:23.385Z" }, - { url = "https://files.pythonhosted.org/packages/c8/ce/3cb22b07c29938f97ff5f5bb27521f95e2ebec399b882392deb68d6c440e/pydantic_core-2.33.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:1293d7febb995e9d3ec3ea09caf1a26214eec45b0f29f6074abb004723fc1de8", size = 2026640, upload-time = "2025-04-02T09:47:25.394Z" }, - { url = "https://files.pythonhosted.org/packages/19/78/f381d643b12378fee782a72126ec5d793081ef03791c28a0fd542a5bee64/pydantic_core-2.33.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:99b56acd433386c8f20be5c4000786d1e7ca0523c8eefc995d14d79c7a081498", size = 1852649, upload-time = "2025-04-02T09:47:27.417Z" }, - { url = "https://files.pythonhosted.org/packages/9d/2b/98a37b80b15aac9eb2c6cfc6dbd35e5058a352891c5cce3a8472d77665a6/pydantic_core-2.33.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:35a5ec3fa8c2fe6c53e1b2ccc2454398f95d5393ab398478f53e1afbbeb4d939", size = 1892472, upload-time = "2025-04-02T09:47:29.006Z" }, - { url = "https://files.pythonhosted.org/packages/4e/d4/3c59514e0f55a161004792b9ff3039da52448f43f5834f905abef9db6e4a/pydantic_core-2.33.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b172f7b9d2f3abc0efd12e3386f7e48b576ef309544ac3a63e5e9cdd2e24585d", size = 1977509, upload-time = "2025-04-02T09:47:33.464Z" }, - { url = "https://files.pythonhosted.org/packages/a9/b6/c2c7946ef70576f79a25db59a576bce088bdc5952d1b93c9789b091df716/pydantic_core-2.33.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9097b9f17f91eea659b9ec58148c0747ec354a42f7389b9d50701610d86f812e", size = 2128702, upload-time = "2025-04-02T09:47:34.812Z" }, - { url = "https://files.pythonhosted.org/packages/88/fe/65a880f81e3f2a974312b61f82a03d85528f89a010ce21ad92f109d94deb/pydantic_core-2.33.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cc77ec5b7e2118b152b0d886c7514a4653bcb58c6b1d760134a9fab915f777b3", size = 2679428, upload-time = "2025-04-02T09:47:37.315Z" }, - { url = "https://files.pythonhosted.org/packages/6f/ff/4459e4146afd0462fb483bb98aa2436d69c484737feaceba1341615fb0ac/pydantic_core-2.33.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d5e3d15245b08fa4a84cefc6c9222e6f37c98111c8679fbd94aa145f9a0ae23d", size = 2008753, upload-time = "2025-04-02T09:47:39.013Z" }, - { url = "https://files.pythonhosted.org/packages/7c/76/1c42e384e8d78452ededac8b583fe2550c84abfef83a0552e0e7478ccbc3/pydantic_core-2.33.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ef99779001d7ac2e2461d8ab55d3373fe7315caefdbecd8ced75304ae5a6fc6b", size = 2114849, upload-time = "2025-04-02T09:47:40.427Z" }, - { url = "https://files.pythonhosted.org/packages/00/72/7d0cf05095c15f7ffe0eb78914b166d591c0eed72f294da68378da205101/pydantic_core-2.33.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:fc6bf8869e193855e8d91d91f6bf59699a5cdfaa47a404e278e776dd7f168b39", size = 2069541, upload-time = "2025-04-02T09:47:42.01Z" }, - { url = "https://files.pythonhosted.org/packages/b3/69/94a514066bb7d8be499aa764926937409d2389c09be0b5107a970286ef81/pydantic_core-2.33.1-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:b1caa0bc2741b043db7823843e1bde8aaa58a55a58fda06083b0569f8b45693a", size = 2239225, upload-time = "2025-04-02T09:47:43.425Z" }, - { url = "https://files.pythonhosted.org/packages/84/b0/e390071eadb44b41f4f54c3cef64d8bf5f9612c92686c9299eaa09e267e2/pydantic_core-2.33.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:ec259f62538e8bf364903a7d0d0239447059f9434b284f5536e8402b7dd198db", size = 2248373, upload-time = "2025-04-02T09:47:44.979Z" }, - { url = "https://files.pythonhosted.org/packages/d6/b2/288b3579ffc07e92af66e2f1a11be3b056fe1214aab314748461f21a31c3/pydantic_core-2.33.1-cp312-cp312-win32.whl", hash = "sha256:e14f369c98a7c15772b9da98987f58e2b509a93235582838bd0d1d8c08b68fda", size = 1907034, upload-time = "2025-04-02T09:47:46.843Z" }, - { url = "https://files.pythonhosted.org/packages/02/28/58442ad1c22b5b6742b992ba9518420235adced665513868f99a1c2638a5/pydantic_core-2.33.1-cp312-cp312-win_amd64.whl", hash = "sha256:1c607801d85e2e123357b3893f82c97a42856192997b95b4d8325deb1cd0c5f4", size = 1956848, upload-time = "2025-04-02T09:47:48.404Z" }, - { url = "https://files.pythonhosted.org/packages/a1/eb/f54809b51c7e2a1d9f439f158b8dd94359321abcc98767e16fc48ae5a77e/pydantic_core-2.33.1-cp312-cp312-win_arm64.whl", hash = "sha256:8d13f0276806ee722e70a1c93da19748594f19ac4299c7e41237fc791d1861ea", size = 1903986, upload-time = "2025-04-02T09:47:49.839Z" }, - { url = "https://files.pythonhosted.org/packages/7a/24/eed3466a4308d79155f1cdd5c7432c80ddcc4530ba8623b79d5ced021641/pydantic_core-2.33.1-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:70af6a21237b53d1fe7b9325b20e65cbf2f0a848cf77bed492b029139701e66a", size = 2033551, upload-time = "2025-04-02T09:47:51.648Z" }, - { url = "https://files.pythonhosted.org/packages/ab/14/df54b1a0bc9b6ded9b758b73139d2c11b4e8eb43e8ab9c5847c0a2913ada/pydantic_core-2.33.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:282b3fe1bbbe5ae35224a0dbd05aed9ccabccd241e8e6b60370484234b456266", size = 1852785, upload-time = "2025-04-02T09:47:53.149Z" }, - { url = "https://files.pythonhosted.org/packages/fa/96/e275f15ff3d34bb04b0125d9bc8848bf69f25d784d92a63676112451bfb9/pydantic_core-2.33.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4b315e596282bbb5822d0c7ee9d255595bd7506d1cb20c2911a4da0b970187d3", size = 1897758, upload-time = "2025-04-02T09:47:55.006Z" }, - { url = "https://files.pythonhosted.org/packages/b7/d8/96bc536e975b69e3a924b507d2a19aedbf50b24e08c80fb00e35f9baaed8/pydantic_core-2.33.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1dfae24cf9921875ca0ca6a8ecb4bb2f13c855794ed0d468d6abbec6e6dcd44a", size = 1986109, upload-time = "2025-04-02T09:47:56.532Z" }, - { url = "https://files.pythonhosted.org/packages/90/72/ab58e43ce7e900b88cb571ed057b2fcd0e95b708a2e0bed475b10130393e/pydantic_core-2.33.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6dd8ecfde08d8bfadaea669e83c63939af76f4cf5538a72597016edfa3fad516", size = 2129159, upload-time = "2025-04-02T09:47:58.088Z" }, - { url = "https://files.pythonhosted.org/packages/dc/3f/52d85781406886c6870ac995ec0ba7ccc028b530b0798c9080531b409fdb/pydantic_core-2.33.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2f593494876eae852dc98c43c6f260f45abdbfeec9e4324e31a481d948214764", size = 2680222, upload-time = "2025-04-02T09:47:59.591Z" }, - { url = "https://files.pythonhosted.org/packages/f4/56/6e2ef42f363a0eec0fd92f74a91e0ac48cd2e49b695aac1509ad81eee86a/pydantic_core-2.33.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:948b73114f47fd7016088e5186d13faf5e1b2fe83f5e320e371f035557fd264d", size = 2006980, upload-time = "2025-04-02T09:48:01.397Z" }, - { url = "https://files.pythonhosted.org/packages/4c/c0/604536c4379cc78359f9ee0aa319f4aedf6b652ec2854953f5a14fc38c5a/pydantic_core-2.33.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e11f3864eb516af21b01e25fac915a82e9ddad3bb0fb9e95a246067398b435a4", size = 2120840, upload-time = "2025-04-02T09:48:03.056Z" }, - { url = "https://files.pythonhosted.org/packages/1f/46/9eb764814f508f0edfb291a0f75d10854d78113fa13900ce13729aaec3ae/pydantic_core-2.33.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:549150be302428b56fdad0c23c2741dcdb5572413776826c965619a25d9c6bde", size = 2072518, upload-time = "2025-04-02T09:48:04.662Z" }, - { url = "https://files.pythonhosted.org/packages/42/e3/fb6b2a732b82d1666fa6bf53e3627867ea3131c5f39f98ce92141e3e3dc1/pydantic_core-2.33.1-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:495bc156026efafd9ef2d82372bd38afce78ddd82bf28ef5276c469e57c0c83e", size = 2248025, upload-time = "2025-04-02T09:48:06.226Z" }, - { url = "https://files.pythonhosted.org/packages/5c/9d/fbe8fe9d1aa4dac88723f10a921bc7418bd3378a567cb5e21193a3c48b43/pydantic_core-2.33.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ec79de2a8680b1a67a07490bddf9636d5c2fab609ba8c57597e855fa5fa4dacd", size = 2254991, upload-time = "2025-04-02T09:48:08.114Z" }, - { url = "https://files.pythonhosted.org/packages/aa/99/07e2237b8a66438d9b26482332cda99a9acccb58d284af7bc7c946a42fd3/pydantic_core-2.33.1-cp313-cp313-win32.whl", hash = "sha256:ee12a7be1742f81b8a65b36c6921022301d466b82d80315d215c4c691724986f", size = 1915262, upload-time = "2025-04-02T09:48:09.708Z" }, - { url = "https://files.pythonhosted.org/packages/8a/f4/e457a7849beeed1e5defbcf5051c6f7b3c91a0624dd31543a64fc9adcf52/pydantic_core-2.33.1-cp313-cp313-win_amd64.whl", hash = "sha256:ede9b407e39949d2afc46385ce6bd6e11588660c26f80576c11c958e6647bc40", size = 1956626, upload-time = "2025-04-02T09:48:11.288Z" }, - { url = "https://files.pythonhosted.org/packages/20/d0/e8d567a7cff7b04e017ae164d98011f1e1894269fe8e90ea187a3cbfb562/pydantic_core-2.33.1-cp313-cp313-win_arm64.whl", hash = "sha256:aa687a23d4b7871a00e03ca96a09cad0f28f443690d300500603bd0adba4b523", size = 1909590, upload-time = "2025-04-02T09:48:12.861Z" }, - { url = "https://files.pythonhosted.org/packages/ef/fd/24ea4302d7a527d672c5be06e17df16aabfb4e9fdc6e0b345c21580f3d2a/pydantic_core-2.33.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:401d7b76e1000d0dd5538e6381d28febdcacb097c8d340dde7d7fc6e13e9f95d", size = 1812963, upload-time = "2025-04-02T09:48:14.553Z" }, - { url = "https://files.pythonhosted.org/packages/5f/95/4fbc2ecdeb5c1c53f1175a32d870250194eb2fdf6291b795ab08c8646d5d/pydantic_core-2.33.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7aeb055a42d734c0255c9e489ac67e75397d59c6fbe60d155851e9782f276a9c", size = 1986896, upload-time = "2025-04-02T09:48:16.222Z" }, - { url = "https://files.pythonhosted.org/packages/71/ae/fe31e7f4a62431222d8f65a3bd02e3fa7e6026d154a00818e6d30520ea77/pydantic_core-2.33.1-cp313-cp313t-win_amd64.whl", hash = "sha256:338ea9b73e6e109f15ab439e62cb3b78aa752c7fd9536794112e14bee02c8d18", size = 1931810, upload-time = "2025-04-02T09:48:17.97Z" }, - { url = "https://files.pythonhosted.org/packages/49/78/b86bad645cc3e8dfa6858c70ec38939bf350e54004837c48de09474b2b9e/pydantic_core-2.33.1-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:5ab77f45d33d264de66e1884fca158bc920cb5e27fd0764a72f72f5756ae8bdb", size = 2044282, upload-time = "2025-04-02T09:48:19.849Z" }, - { url = "https://files.pythonhosted.org/packages/3b/00/a02531331773b2bf08743d84c6b776bd6a449d23b3ae6b0e3229d568bac4/pydantic_core-2.33.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e7aaba1b4b03aaea7bb59e1b5856d734be011d3e6d98f5bcaa98cb30f375f2ad", size = 1877598, upload-time = "2025-04-02T09:48:22.863Z" }, - { url = "https://files.pythonhosted.org/packages/a1/fa/32cc152b84a1f420f8a7d80161373e8d87d4ffa077e67d6c8aab3ce1a6ab/pydantic_core-2.33.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7fb66263e9ba8fea2aa85e1e5578980d127fb37d7f2e292773e7bc3a38fb0c7b", size = 1911021, upload-time = "2025-04-02T09:48:24.592Z" }, - { url = "https://files.pythonhosted.org/packages/5e/87/ea553e0d98bce6c4876f8c50f65cb45597eff6e0aaa8b15813e9972bb19d/pydantic_core-2.33.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3f2648b9262607a7fb41d782cc263b48032ff7a03a835581abbf7a3bec62bcf5", size = 1997276, upload-time = "2025-04-02T09:48:26.314Z" }, - { url = "https://files.pythonhosted.org/packages/f7/9b/60cb9f4b52158b3adac0066492bbadd0b8473f4f8da5bcc73972655b76ef/pydantic_core-2.33.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:723c5630c4259400818b4ad096735a829074601805d07f8cafc366d95786d331", size = 2141348, upload-time = "2025-04-02T09:48:28.298Z" }, - { url = "https://files.pythonhosted.org/packages/9b/38/374d254e270d4de0add68a8239f4ed0f444fdd7b766ea69244fb9491dccb/pydantic_core-2.33.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d100e3ae783d2167782391e0c1c7a20a31f55f8015f3293647544df3f9c67824", size = 2753708, upload-time = "2025-04-02T09:48:29.987Z" }, - { url = "https://files.pythonhosted.org/packages/05/a8/fd79111eb5ab9bc4ef98d8fb0b3a2ffdc80107b2c59859a741ab379c96f8/pydantic_core-2.33.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:177d50460bc976a0369920b6c744d927b0ecb8606fb56858ff542560251b19e5", size = 2008699, upload-time = "2025-04-02T09:48:31.76Z" }, - { url = "https://files.pythonhosted.org/packages/35/31/2e06619868eb4c18642c5601db420599c1cf9cf50fe868c9ac09cd298e24/pydantic_core-2.33.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a3edde68d1a1f9af1273b2fe798997b33f90308fb6d44d8550c89fc6a3647cf6", size = 2123426, upload-time = "2025-04-02T09:48:33.623Z" }, - { url = "https://files.pythonhosted.org/packages/4a/d0/3531e8783a311802e3db7ee5a1a5ed79e5706e930b1b4e3109ce15eeb681/pydantic_core-2.33.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:a62c3c3ef6a7e2c45f7853b10b5bc4ddefd6ee3cd31024754a1a5842da7d598d", size = 2087330, upload-time = "2025-04-02T09:48:35.387Z" }, - { url = "https://files.pythonhosted.org/packages/ac/32/5ff252ed73bacd7677a706ab17723e261a76793f98b305aa20cfc10bbd56/pydantic_core-2.33.1-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:c91dbb0ab683fa0cd64a6e81907c8ff41d6497c346890e26b23de7ee55353f96", size = 2258171, upload-time = "2025-04-02T09:48:37.559Z" }, - { url = "https://files.pythonhosted.org/packages/c9/f9/e96e00f92b8f5b3e2cddc80c5ee6cf038f8a0f238c44b67b01759943a7b4/pydantic_core-2.33.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9f466e8bf0a62dc43e068c12166281c2eca72121dd2adc1040f3aa1e21ef8599", size = 2258745, upload-time = "2025-04-02T09:48:39.413Z" }, - { url = "https://files.pythonhosted.org/packages/54/1e/51c86688e809d94797fdf0efc41514f001caec982a05f62d90c180a9639d/pydantic_core-2.33.1-cp39-cp39-win32.whl", hash = "sha256:ab0277cedb698749caada82e5d099dc9fed3f906a30d4c382d1a21725777a1e5", size = 1923626, upload-time = "2025-04-02T09:48:41.24Z" }, - { url = "https://files.pythonhosted.org/packages/57/18/c2da959fd8d019b70cadafdda2bf845378ada47973e0bad6cc84f56dbe6e/pydantic_core-2.33.1-cp39-cp39-win_amd64.whl", hash = "sha256:5773da0ee2d17136b1f1c6fbde543398d452a6ad2a7b54ea1033e2daa739b8d2", size = 1953703, upload-time = "2025-04-02T09:48:43.196Z" }, - { url = "https://files.pythonhosted.org/packages/9c/c7/8b311d5adb0fe00a93ee9b4e92a02b0ec08510e9838885ef781ccbb20604/pydantic_core-2.33.1-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5c834f54f8f4640fd7e4b193f80eb25a0602bba9e19b3cd2fc7ffe8199f5ae02", size = 2041659, upload-time = "2025-04-02T09:48:45.342Z" }, - { url = "https://files.pythonhosted.org/packages/8a/d6/4f58d32066a9e26530daaf9adc6664b01875ae0691570094968aaa7b8fcc/pydantic_core-2.33.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:049e0de24cf23766f12cc5cc71d8abc07d4a9deb9061b334b62093dedc7cb068", size = 1873294, upload-time = "2025-04-02T09:48:47.548Z" }, - { url = "https://files.pythonhosted.org/packages/f7/3f/53cc9c45d9229da427909c751f8ed2bf422414f7664ea4dde2d004f596ba/pydantic_core-2.33.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1a28239037b3d6f16916a4c831a5a0eadf856bdd6d2e92c10a0da3a59eadcf3e", size = 1903771, upload-time = "2025-04-02T09:48:49.468Z" }, - { url = "https://files.pythonhosted.org/packages/f0/49/bf0783279ce674eb9903fb9ae43f6c614cb2f1c4951370258823f795368b/pydantic_core-2.33.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9d3da303ab5f378a268fa7d45f37d7d85c3ec19769f28d2cc0c61826a8de21fe", size = 2083558, upload-time = "2025-04-02T09:48:51.409Z" }, - { url = "https://files.pythonhosted.org/packages/9c/5b/0d998367687f986c7d8484a2c476d30f07bf5b8b1477649a6092bd4c540e/pydantic_core-2.33.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:25626fb37b3c543818c14821afe0fd3830bc327a43953bc88db924b68c5723f1", size = 2118038, upload-time = "2025-04-02T09:48:53.702Z" }, - { url = "https://files.pythonhosted.org/packages/b3/33/039287d410230ee125daee57373ac01940d3030d18dba1c29cd3089dc3ca/pydantic_core-2.33.1-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:3ab2d36e20fbfcce8f02d73c33a8a7362980cff717926bbae030b93ae46b56c7", size = 2079315, upload-time = "2025-04-02T09:48:55.555Z" }, - { url = "https://files.pythonhosted.org/packages/1f/85/6d8b2646d99c062d7da2d0ab2faeb0d6ca9cca4c02da6076376042a20da3/pydantic_core-2.33.1-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:2f9284e11c751b003fd4215ad92d325d92c9cb19ee6729ebd87e3250072cdcde", size = 2249063, upload-time = "2025-04-02T09:48:57.479Z" }, - { url = "https://files.pythonhosted.org/packages/17/d7/c37d208d5738f7b9ad8f22ae8a727d88ebf9c16c04ed2475122cc3f7224a/pydantic_core-2.33.1-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:048c01eee07d37cbd066fc512b9d8b5ea88ceeb4e629ab94b3e56965ad655add", size = 2254631, upload-time = "2025-04-02T09:48:59.581Z" }, - { url = "https://files.pythonhosted.org/packages/13/e0/bafa46476d328e4553b85ab9b2f7409e7aaef0ce4c937c894821c542d347/pydantic_core-2.33.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:5ccd429694cf26af7997595d627dd2637e7932214486f55b8a357edaac9dae8c", size = 2080877, upload-time = "2025-04-02T09:49:01.52Z" }, - { url = "https://files.pythonhosted.org/packages/0b/76/1794e440c1801ed35415238d2c728f26cd12695df9057154ad768b7b991c/pydantic_core-2.33.1-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:3a371dc00282c4b84246509a5ddc808e61b9864aa1eae9ecc92bb1268b82db4a", size = 2042858, upload-time = "2025-04-02T09:49:03.419Z" }, - { url = "https://files.pythonhosted.org/packages/73/b4/9cd7b081fb0b1b4f8150507cd59d27b275c3e22ad60b35cb19ea0977d9b9/pydantic_core-2.33.1-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:f59295ecc75a1788af8ba92f2e8c6eeaa5a94c22fc4d151e8d9638814f85c8fc", size = 1873745, upload-time = "2025-04-02T09:49:05.391Z" }, - { url = "https://files.pythonhosted.org/packages/e1/d7/9ddb7575d4321e40d0363903c2576c8c0c3280ebea137777e5ab58d723e3/pydantic_core-2.33.1-pp311-pypy311_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:08530b8ac922003033f399128505f513e30ca770527cc8bbacf75a84fcc2c74b", size = 1904188, upload-time = "2025-04-02T09:49:07.352Z" }, - { url = "https://files.pythonhosted.org/packages/d1/a8/3194ccfe461bb08da19377ebec8cb4f13c9bd82e13baebc53c5c7c39a029/pydantic_core-2.33.1-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bae370459da6a5466978c0eacf90690cb57ec9d533f8e63e564ef3822bfa04fe", size = 2083479, upload-time = "2025-04-02T09:49:09.304Z" }, - { url = "https://files.pythonhosted.org/packages/42/c7/84cb569555d7179ca0b3f838cef08f66f7089b54432f5b8599aac6e9533e/pydantic_core-2.33.1-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e3de2777e3b9f4d603112f78006f4ae0acb936e95f06da6cb1a45fbad6bdb4b5", size = 2118415, upload-time = "2025-04-02T09:49:11.25Z" }, - { url = "https://files.pythonhosted.org/packages/3b/67/72abb8c73e0837716afbb58a59cc9e3ae43d1aa8677f3b4bc72c16142716/pydantic_core-2.33.1-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:3a64e81e8cba118e108d7126362ea30e021291b7805d47e4896e52c791be2761", size = 2079623, upload-time = "2025-04-02T09:49:13.292Z" }, - { url = "https://files.pythonhosted.org/packages/0b/cd/c59707e35a47ba4cbbf153c3f7c56420c58653b5801b055dc52cccc8e2dc/pydantic_core-2.33.1-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:52928d8c1b6bda03cc6d811e8923dffc87a2d3c8b3bfd2ce16471c7147a24850", size = 2250175, upload-time = "2025-04-02T09:49:15.597Z" }, - { url = "https://files.pythonhosted.org/packages/84/32/e4325a6676b0bed32d5b084566ec86ed7fd1e9bcbfc49c578b1755bde920/pydantic_core-2.33.1-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:1b30d92c9412beb5ac6b10a3eb7ef92ccb14e3f2a8d7732e2d739f58b3aa7544", size = 2254674, upload-time = "2025-04-02T09:49:17.61Z" }, - { url = "https://files.pythonhosted.org/packages/12/6f/5596dc418f2e292ffc661d21931ab34591952e2843e7168ea5a52591f6ff/pydantic_core-2.33.1-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:f995719707e0e29f0f41a8aa3bcea6e761a36c9136104d3189eafb83f5cec5e5", size = 2080951, upload-time = "2025-04-02T09:49:19.559Z" }, - { url = "https://files.pythonhosted.org/packages/2d/a8/c2c8f29bd18f7ef52de32a6deb9e3ee87ba18b7b2122636aa9f4438cf627/pydantic_core-2.33.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:7edbc454a29fc6aeae1e1eecba4f07b63b8d76e76a748532233c4c167b4cb9ea", size = 2041791, upload-time = "2025-04-02T09:49:21.617Z" }, - { url = "https://files.pythonhosted.org/packages/08/ad/328081b1c82543ae49d0650048305058583c51f1a9a56a0d6e87bb3a2443/pydantic_core-2.33.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:ad05b683963f69a1d5d2c2bdab1274a31221ca737dbbceaa32bcb67359453cdd", size = 1873579, upload-time = "2025-04-02T09:49:23.667Z" }, - { url = "https://files.pythonhosted.org/packages/6e/8a/bc65dbf7e501e88367cdab06a2c1340457c785f0c72288cae737fd80c0fa/pydantic_core-2.33.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:df6a94bf9452c6da9b5d76ed229a5683d0306ccb91cca8e1eea883189780d568", size = 1904189, upload-time = "2025-04-02T09:49:25.821Z" }, - { url = "https://files.pythonhosted.org/packages/9a/db/30ca6aefda211fb01ef185ca73cb7a0c6e7fe952c524025c8782b5acd771/pydantic_core-2.33.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7965c13b3967909a09ecc91f21d09cfc4576bf78140b988904e94f130f188396", size = 2084446, upload-time = "2025-04-02T09:49:27.866Z" }, - { url = "https://files.pythonhosted.org/packages/f2/89/a12b55286e30c9f476eab7c53c9249ec76faf70430596496ab0309f28629/pydantic_core-2.33.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:3f1fdb790440a34f6ecf7679e1863b825cb5ffde858a9197f851168ed08371e5", size = 2118215, upload-time = "2025-04-02T09:49:30.321Z" }, - { url = "https://files.pythonhosted.org/packages/8e/55/12721c4a8d7951584ad3d9848b44442559cf1876e0bb424148d1060636b3/pydantic_core-2.33.1-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:5277aec8d879f8d05168fdd17ae811dd313b8ff894aeeaf7cd34ad28b4d77e33", size = 2079963, upload-time = "2025-04-02T09:49:32.804Z" }, - { url = "https://files.pythonhosted.org/packages/bd/0c/3391bd5d6ff62ea998db94732528d9bc32c560b0ed861c39119759461946/pydantic_core-2.33.1-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:8ab581d3530611897d863d1a649fb0644b860286b4718db919bfd51ece41f10b", size = 2249388, upload-time = "2025-04-02T09:49:34.906Z" }, - { url = "https://files.pythonhosted.org/packages/d3/5f/3e4feb042998d7886a9b523b372d83955cbc192a07013dcd24276db078ee/pydantic_core-2.33.1-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:0483847fa9ad5e3412265c1bd72aad35235512d9ce9d27d81a56d935ef489672", size = 2255226, upload-time = "2025-04-02T09:49:37.412Z" }, - { url = "https://files.pythonhosted.org/packages/25/f2/1647933efaaad61846109a27619f3704929e758a09e6431b8f932a053d40/pydantic_core-2.33.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:de9e06abe3cc5ec6a2d5f75bc99b0bdca4f5c719a5b34026f8c57efbdecd2ee3", size = 2081073, upload-time = "2025-04-02T09:49:39.531Z" }, +sdist = { url = "https://files.pythonhosted.org/packages/ad/88/5f2260bdfae97aabf98f1778d43f69574390ad787afb646292a638c923d4/pydantic_core-2.33.2.tar.gz", hash = "sha256:7cb8bc3605c29176e1b105350d2e6474142d7c1bd1d9327c4a9bdb46bf827acc", size = 435195, upload-time = "2025-04-23T18:33:52.104Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e5/92/b31726561b5dae176c2d2c2dc43a9c5bfba5d32f96f8b4c0a600dd492447/pydantic_core-2.33.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:2b3d326aaef0c0399d9afffeb6367d5e26ddc24d351dbc9c636840ac355dc5d8", size = 2028817, upload-time = "2025-04-23T18:30:43.919Z" }, + { url = "https://files.pythonhosted.org/packages/a3/44/3f0b95fafdaca04a483c4e685fe437c6891001bf3ce8b2fded82b9ea3aa1/pydantic_core-2.33.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0e5b2671f05ba48b94cb90ce55d8bdcaaedb8ba00cc5359f6810fc918713983d", size = 1861357, upload-time = "2025-04-23T18:30:46.372Z" }, + { url = "https://files.pythonhosted.org/packages/30/97/e8f13b55766234caae05372826e8e4b3b96e7b248be3157f53237682e43c/pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0069c9acc3f3981b9ff4cdfaf088e98d83440a4c7ea1bc07460af3d4dc22e72d", size = 1898011, upload-time = "2025-04-23T18:30:47.591Z" }, + { url = "https://files.pythonhosted.org/packages/9b/a3/99c48cf7bafc991cc3ee66fd544c0aae8dc907b752f1dad2d79b1b5a471f/pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d53b22f2032c42eaaf025f7c40c2e3b94568ae077a606f006d206a463bc69572", size = 1982730, upload-time = "2025-04-23T18:30:49.328Z" }, + { url = "https://files.pythonhosted.org/packages/de/8e/a5b882ec4307010a840fb8b58bd9bf65d1840c92eae7534c7441709bf54b/pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0405262705a123b7ce9f0b92f123334d67b70fd1f20a9372b907ce1080c7ba02", size = 2136178, upload-time = "2025-04-23T18:30:50.907Z" }, + { url = "https://files.pythonhosted.org/packages/e4/bb/71e35fc3ed05af6834e890edb75968e2802fe98778971ab5cba20a162315/pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4b25d91e288e2c4e0662b8038a28c6a07eaac3e196cfc4ff69de4ea3db992a1b", size = 2736462, upload-time = "2025-04-23T18:30:52.083Z" }, + { url = "https://files.pythonhosted.org/packages/31/0d/c8f7593e6bc7066289bbc366f2235701dcbebcd1ff0ef8e64f6f239fb47d/pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6bdfe4b3789761f3bcb4b1ddf33355a71079858958e3a552f16d5af19768fef2", size = 2005652, upload-time = "2025-04-23T18:30:53.389Z" }, + { url = "https://files.pythonhosted.org/packages/d2/7a/996d8bd75f3eda405e3dd219ff5ff0a283cd8e34add39d8ef9157e722867/pydantic_core-2.33.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:efec8db3266b76ef9607c2c4c419bdb06bf335ae433b80816089ea7585816f6a", size = 2113306, upload-time = "2025-04-23T18:30:54.661Z" }, + { url = "https://files.pythonhosted.org/packages/ff/84/daf2a6fb2db40ffda6578a7e8c5a6e9c8affb251a05c233ae37098118788/pydantic_core-2.33.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:031c57d67ca86902726e0fae2214ce6770bbe2f710dc33063187a68744a5ecac", size = 2073720, upload-time = "2025-04-23T18:30:56.11Z" }, + { url = "https://files.pythonhosted.org/packages/77/fb/2258da019f4825128445ae79456a5499c032b55849dbd5bed78c95ccf163/pydantic_core-2.33.2-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:f8de619080e944347f5f20de29a975c2d815d9ddd8be9b9b7268e2e3ef68605a", size = 2244915, upload-time = "2025-04-23T18:30:57.501Z" }, + { url = "https://files.pythonhosted.org/packages/d8/7a/925ff73756031289468326e355b6fa8316960d0d65f8b5d6b3a3e7866de7/pydantic_core-2.33.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:73662edf539e72a9440129f231ed3757faab89630d291b784ca99237fb94db2b", size = 2241884, upload-time = "2025-04-23T18:30:58.867Z" }, + { url = "https://files.pythonhosted.org/packages/0b/b0/249ee6d2646f1cdadcb813805fe76265745c4010cf20a8eba7b0e639d9b2/pydantic_core-2.33.2-cp310-cp310-win32.whl", hash = "sha256:0a39979dcbb70998b0e505fb1556a1d550a0781463ce84ebf915ba293ccb7e22", size = 1910496, upload-time = "2025-04-23T18:31:00.078Z" }, + { url = "https://files.pythonhosted.org/packages/66/ff/172ba8f12a42d4b552917aa65d1f2328990d3ccfc01d5b7c943ec084299f/pydantic_core-2.33.2-cp310-cp310-win_amd64.whl", hash = "sha256:b0379a2b24882fef529ec3b4987cb5d003b9cda32256024e6fe1586ac45fc640", size = 1955019, upload-time = "2025-04-23T18:31:01.335Z" }, + { url = "https://files.pythonhosted.org/packages/3f/8d/71db63483d518cbbf290261a1fc2839d17ff89fce7089e08cad07ccfce67/pydantic_core-2.33.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:4c5b0a576fb381edd6d27f0a85915c6daf2f8138dc5c267a57c08a62900758c7", size = 2028584, upload-time = "2025-04-23T18:31:03.106Z" }, + { url = "https://files.pythonhosted.org/packages/24/2f/3cfa7244ae292dd850989f328722d2aef313f74ffc471184dc509e1e4e5a/pydantic_core-2.33.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e799c050df38a639db758c617ec771fd8fb7a5f8eaaa4b27b101f266b216a246", size = 1855071, upload-time = "2025-04-23T18:31:04.621Z" }, + { url = "https://files.pythonhosted.org/packages/b3/d3/4ae42d33f5e3f50dd467761304be2fa0a9417fbf09735bc2cce003480f2a/pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dc46a01bf8d62f227d5ecee74178ffc448ff4e5197c756331f71efcc66dc980f", size = 1897823, upload-time = "2025-04-23T18:31:06.377Z" }, + { url = "https://files.pythonhosted.org/packages/f4/f3/aa5976e8352b7695ff808599794b1fba2a9ae2ee954a3426855935799488/pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a144d4f717285c6d9234a66778059f33a89096dfb9b39117663fd8413d582dcc", size = 1983792, upload-time = "2025-04-23T18:31:07.93Z" }, + { url = "https://files.pythonhosted.org/packages/d5/7a/cda9b5a23c552037717f2b2a5257e9b2bfe45e687386df9591eff7b46d28/pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:73cf6373c21bc80b2e0dc88444f41ae60b2f070ed02095754eb5a01df12256de", size = 2136338, upload-time = "2025-04-23T18:31:09.283Z" }, + { url = "https://files.pythonhosted.org/packages/2b/9f/b8f9ec8dd1417eb9da784e91e1667d58a2a4a7b7b34cf4af765ef663a7e5/pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3dc625f4aa79713512d1976fe9f0bc99f706a9dee21dfd1810b4bbbf228d0e8a", size = 2730998, upload-time = "2025-04-23T18:31:11.7Z" }, + { url = "https://files.pythonhosted.org/packages/47/bc/cd720e078576bdb8255d5032c5d63ee5c0bf4b7173dd955185a1d658c456/pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:881b21b5549499972441da4758d662aeea93f1923f953e9cbaff14b8b9565aef", size = 2003200, upload-time = "2025-04-23T18:31:13.536Z" }, + { url = "https://files.pythonhosted.org/packages/ca/22/3602b895ee2cd29d11a2b349372446ae9727c32e78a94b3d588a40fdf187/pydantic_core-2.33.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:bdc25f3681f7b78572699569514036afe3c243bc3059d3942624e936ec93450e", size = 2113890, upload-time = "2025-04-23T18:31:15.011Z" }, + { url = "https://files.pythonhosted.org/packages/ff/e6/e3c5908c03cf00d629eb38393a98fccc38ee0ce8ecce32f69fc7d7b558a7/pydantic_core-2.33.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:fe5b32187cbc0c862ee201ad66c30cf218e5ed468ec8dc1cf49dec66e160cc4d", size = 2073359, upload-time = "2025-04-23T18:31:16.393Z" }, + { url = "https://files.pythonhosted.org/packages/12/e7/6a36a07c59ebefc8777d1ffdaf5ae71b06b21952582e4b07eba88a421c79/pydantic_core-2.33.2-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:bc7aee6f634a6f4a95676fcb5d6559a2c2a390330098dba5e5a5f28a2e4ada30", size = 2245883, upload-time = "2025-04-23T18:31:17.892Z" }, + { url = "https://files.pythonhosted.org/packages/16/3f/59b3187aaa6cc0c1e6616e8045b284de2b6a87b027cce2ffcea073adf1d2/pydantic_core-2.33.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:235f45e5dbcccf6bd99f9f472858849f73d11120d76ea8707115415f8e5ebebf", size = 2241074, upload-time = "2025-04-23T18:31:19.205Z" }, + { url = "https://files.pythonhosted.org/packages/e0/ed/55532bb88f674d5d8f67ab121a2a13c385df382de2a1677f30ad385f7438/pydantic_core-2.33.2-cp311-cp311-win32.whl", hash = "sha256:6368900c2d3ef09b69cb0b913f9f8263b03786e5b2a387706c5afb66800efd51", size = 1910538, upload-time = "2025-04-23T18:31:20.541Z" }, + { url = "https://files.pythonhosted.org/packages/fe/1b/25b7cccd4519c0b23c2dd636ad39d381abf113085ce4f7bec2b0dc755eb1/pydantic_core-2.33.2-cp311-cp311-win_amd64.whl", hash = "sha256:1e063337ef9e9820c77acc768546325ebe04ee38b08703244c1309cccc4f1bab", size = 1952909, upload-time = "2025-04-23T18:31:22.371Z" }, + { url = "https://files.pythonhosted.org/packages/49/a9/d809358e49126438055884c4366a1f6227f0f84f635a9014e2deb9b9de54/pydantic_core-2.33.2-cp311-cp311-win_arm64.whl", hash = "sha256:6b99022f1d19bc32a4c2a0d544fc9a76e3be90f0b3f4af413f87d38749300e65", size = 1897786, upload-time = "2025-04-23T18:31:24.161Z" }, + { url = "https://files.pythonhosted.org/packages/18/8a/2b41c97f554ec8c71f2a8a5f85cb56a8b0956addfe8b0efb5b3d77e8bdc3/pydantic_core-2.33.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:a7ec89dc587667f22b6a0b6579c249fca9026ce7c333fc142ba42411fa243cdc", size = 2009000, upload-time = "2025-04-23T18:31:25.863Z" }, + { url = "https://files.pythonhosted.org/packages/a1/02/6224312aacb3c8ecbaa959897af57181fb6cf3a3d7917fd44d0f2917e6f2/pydantic_core-2.33.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:3c6db6e52c6d70aa0d00d45cdb9b40f0433b96380071ea80b09277dba021ddf7", size = 1847996, upload-time = "2025-04-23T18:31:27.341Z" }, + { url = "https://files.pythonhosted.org/packages/d6/46/6dcdf084a523dbe0a0be59d054734b86a981726f221f4562aed313dbcb49/pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e61206137cbc65e6d5256e1166f88331d3b6238e082d9f74613b9b765fb9025", size = 1880957, upload-time = "2025-04-23T18:31:28.956Z" }, + { url = "https://files.pythonhosted.org/packages/ec/6b/1ec2c03837ac00886ba8160ce041ce4e325b41d06a034adbef11339ae422/pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:eb8c529b2819c37140eb51b914153063d27ed88e3bdc31b71198a198e921e011", size = 1964199, upload-time = "2025-04-23T18:31:31.025Z" }, + { url = "https://files.pythonhosted.org/packages/2d/1d/6bf34d6adb9debd9136bd197ca72642203ce9aaaa85cfcbfcf20f9696e83/pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c52b02ad8b4e2cf14ca7b3d918f3eb0ee91e63b3167c32591e57c4317e134f8f", size = 2120296, upload-time = "2025-04-23T18:31:32.514Z" }, + { url = "https://files.pythonhosted.org/packages/e0/94/2bd0aaf5a591e974b32a9f7123f16637776c304471a0ab33cf263cf5591a/pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:96081f1605125ba0855dfda83f6f3df5ec90c61195421ba72223de35ccfb2f88", size = 2676109, upload-time = "2025-04-23T18:31:33.958Z" }, + { url = "https://files.pythonhosted.org/packages/f9/41/4b043778cf9c4285d59742281a769eac371b9e47e35f98ad321349cc5d61/pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f57a69461af2a5fa6e6bbd7a5f60d3b7e6cebb687f55106933188e79ad155c1", size = 2002028, upload-time = "2025-04-23T18:31:39.095Z" }, + { url = "https://files.pythonhosted.org/packages/cb/d5/7bb781bf2748ce3d03af04d5c969fa1308880e1dca35a9bd94e1a96a922e/pydantic_core-2.33.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:572c7e6c8bb4774d2ac88929e3d1f12bc45714ae5ee6d9a788a9fb35e60bb04b", size = 2100044, upload-time = "2025-04-23T18:31:41.034Z" }, + { url = "https://files.pythonhosted.org/packages/fe/36/def5e53e1eb0ad896785702a5bbfd25eed546cdcf4087ad285021a90ed53/pydantic_core-2.33.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:db4b41f9bd95fbe5acd76d89920336ba96f03e149097365afe1cb092fceb89a1", size = 2058881, upload-time = "2025-04-23T18:31:42.757Z" }, + { url = "https://files.pythonhosted.org/packages/01/6c/57f8d70b2ee57fc3dc8b9610315949837fa8c11d86927b9bb044f8705419/pydantic_core-2.33.2-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:fa854f5cf7e33842a892e5c73f45327760bc7bc516339fda888c75ae60edaeb6", size = 2227034, upload-time = "2025-04-23T18:31:44.304Z" }, + { url = "https://files.pythonhosted.org/packages/27/b9/9c17f0396a82b3d5cbea4c24d742083422639e7bb1d5bf600e12cb176a13/pydantic_core-2.33.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:5f483cfb75ff703095c59e365360cb73e00185e01aaea067cd19acffd2ab20ea", size = 2234187, upload-time = "2025-04-23T18:31:45.891Z" }, + { url = "https://files.pythonhosted.org/packages/b0/6a/adf5734ffd52bf86d865093ad70b2ce543415e0e356f6cacabbc0d9ad910/pydantic_core-2.33.2-cp312-cp312-win32.whl", hash = "sha256:9cb1da0f5a471435a7bc7e439b8a728e8b61e59784b2af70d7c169f8dd8ae290", size = 1892628, upload-time = "2025-04-23T18:31:47.819Z" }, + { url = "https://files.pythonhosted.org/packages/43/e4/5479fecb3606c1368d496a825d8411e126133c41224c1e7238be58b87d7e/pydantic_core-2.33.2-cp312-cp312-win_amd64.whl", hash = "sha256:f941635f2a3d96b2973e867144fde513665c87f13fe0e193c158ac51bfaaa7b2", size = 1955866, upload-time = "2025-04-23T18:31:49.635Z" }, + { url = "https://files.pythonhosted.org/packages/0d/24/8b11e8b3e2be9dd82df4b11408a67c61bb4dc4f8e11b5b0fc888b38118b5/pydantic_core-2.33.2-cp312-cp312-win_arm64.whl", hash = "sha256:cca3868ddfaccfbc4bfb1d608e2ccaaebe0ae628e1416aeb9c4d88c001bb45ab", size = 1888894, upload-time = "2025-04-23T18:31:51.609Z" }, + { url = "https://files.pythonhosted.org/packages/46/8c/99040727b41f56616573a28771b1bfa08a3d3fe74d3d513f01251f79f172/pydantic_core-2.33.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:1082dd3e2d7109ad8b7da48e1d4710c8d06c253cbc4a27c1cff4fbcaa97a9e3f", size = 2015688, upload-time = "2025-04-23T18:31:53.175Z" }, + { url = "https://files.pythonhosted.org/packages/3a/cc/5999d1eb705a6cefc31f0b4a90e9f7fc400539b1a1030529700cc1b51838/pydantic_core-2.33.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f517ca031dfc037a9c07e748cefd8d96235088b83b4f4ba8939105d20fa1dcd6", size = 1844808, upload-time = "2025-04-23T18:31:54.79Z" }, + { url = "https://files.pythonhosted.org/packages/6f/5e/a0a7b8885c98889a18b6e376f344da1ef323d270b44edf8174d6bce4d622/pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0a9f2c9dd19656823cb8250b0724ee9c60a82f3cdf68a080979d13092a3b0fef", size = 1885580, upload-time = "2025-04-23T18:31:57.393Z" }, + { url = "https://files.pythonhosted.org/packages/3b/2a/953581f343c7d11a304581156618c3f592435523dd9d79865903272c256a/pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2b0a451c263b01acebe51895bfb0e1cc842a5c666efe06cdf13846c7418caa9a", size = 1973859, upload-time = "2025-04-23T18:31:59.065Z" }, + { url = "https://files.pythonhosted.org/packages/e6/55/f1a813904771c03a3f97f676c62cca0c0a4138654107c1b61f19c644868b/pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ea40a64d23faa25e62a70ad163571c0b342b8bf66d5fa612ac0dec4f069d916", size = 2120810, upload-time = "2025-04-23T18:32:00.78Z" }, + { url = "https://files.pythonhosted.org/packages/aa/c3/053389835a996e18853ba107a63caae0b9deb4a276c6b472931ea9ae6e48/pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0fb2d542b4d66f9470e8065c5469ec676978d625a8b7a363f07d9a501a9cb36a", size = 2676498, upload-time = "2025-04-23T18:32:02.418Z" }, + { url = "https://files.pythonhosted.org/packages/eb/3c/f4abd740877a35abade05e437245b192f9d0ffb48bbbbd708df33d3cda37/pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fdac5d6ffa1b5a83bca06ffe7583f5576555e6c8b3a91fbd25ea7780f825f7d", size = 2000611, upload-time = "2025-04-23T18:32:04.152Z" }, + { url = "https://files.pythonhosted.org/packages/59/a7/63ef2fed1837d1121a894d0ce88439fe3e3b3e48c7543b2a4479eb99c2bd/pydantic_core-2.33.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:04a1a413977ab517154eebb2d326da71638271477d6ad87a769102f7c2488c56", size = 2107924, upload-time = "2025-04-23T18:32:06.129Z" }, + { url = "https://files.pythonhosted.org/packages/04/8f/2551964ef045669801675f1cfc3b0d74147f4901c3ffa42be2ddb1f0efc4/pydantic_core-2.33.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:c8e7af2f4e0194c22b5b37205bfb293d166a7344a5b0d0eaccebc376546d77d5", size = 2063196, upload-time = "2025-04-23T18:32:08.178Z" }, + { url = "https://files.pythonhosted.org/packages/26/bd/d9602777e77fc6dbb0c7db9ad356e9a985825547dce5ad1d30ee04903918/pydantic_core-2.33.2-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:5c92edd15cd58b3c2d34873597a1e20f13094f59cf88068adb18947df5455b4e", size = 2236389, upload-time = "2025-04-23T18:32:10.242Z" }, + { url = "https://files.pythonhosted.org/packages/42/db/0e950daa7e2230423ab342ae918a794964b053bec24ba8af013fc7c94846/pydantic_core-2.33.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:65132b7b4a1c0beded5e057324b7e16e10910c106d43675d9bd87d4f38dde162", size = 2239223, upload-time = "2025-04-23T18:32:12.382Z" }, + { url = "https://files.pythonhosted.org/packages/58/4d/4f937099c545a8a17eb52cb67fe0447fd9a373b348ccfa9a87f141eeb00f/pydantic_core-2.33.2-cp313-cp313-win32.whl", hash = "sha256:52fb90784e0a242bb96ec53f42196a17278855b0f31ac7c3cc6f5c1ec4811849", size = 1900473, upload-time = "2025-04-23T18:32:14.034Z" }, + { url = "https://files.pythonhosted.org/packages/a0/75/4a0a9bac998d78d889def5e4ef2b065acba8cae8c93696906c3a91f310ca/pydantic_core-2.33.2-cp313-cp313-win_amd64.whl", hash = "sha256:c083a3bdd5a93dfe480f1125926afcdbf2917ae714bdb80b36d34318b2bec5d9", size = 1955269, upload-time = "2025-04-23T18:32:15.783Z" }, + { url = "https://files.pythonhosted.org/packages/f9/86/1beda0576969592f1497b4ce8e7bc8cbdf614c352426271b1b10d5f0aa64/pydantic_core-2.33.2-cp313-cp313-win_arm64.whl", hash = "sha256:e80b087132752f6b3d714f041ccf74403799d3b23a72722ea2e6ba2e892555b9", size = 1893921, upload-time = "2025-04-23T18:32:18.473Z" }, + { url = "https://files.pythonhosted.org/packages/a4/7d/e09391c2eebeab681df2b74bfe6c43422fffede8dc74187b2b0bf6fd7571/pydantic_core-2.33.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:61c18fba8e5e9db3ab908620af374db0ac1baa69f0f32df4f61ae23f15e586ac", size = 1806162, upload-time = "2025-04-23T18:32:20.188Z" }, + { url = "https://files.pythonhosted.org/packages/f1/3d/847b6b1fed9f8ed3bb95a9ad04fbd0b212e832d4f0f50ff4d9ee5a9f15cf/pydantic_core-2.33.2-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:95237e53bb015f67b63c91af7518a62a8660376a6a0db19b89acc77a4d6199f5", size = 1981560, upload-time = "2025-04-23T18:32:22.354Z" }, + { url = "https://files.pythonhosted.org/packages/6f/9a/e73262f6c6656262b5fdd723ad90f518f579b7bc8622e43a942eec53c938/pydantic_core-2.33.2-cp313-cp313t-win_amd64.whl", hash = "sha256:c2fc0a768ef76c15ab9238afa6da7f69895bb5d1ee83aeea2e3509af4472d0b9", size = 1935777, upload-time = "2025-04-23T18:32:25.088Z" }, + { url = "https://files.pythonhosted.org/packages/53/ea/bbe9095cdd771987d13c82d104a9c8559ae9aec1e29f139e286fd2e9256e/pydantic_core-2.33.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:a2b911a5b90e0374d03813674bf0a5fbbb7741570dcd4b4e85a2e48d17def29d", size = 2028677, upload-time = "2025-04-23T18:32:27.227Z" }, + { url = "https://files.pythonhosted.org/packages/49/1d/4ac5ed228078737d457a609013e8f7edc64adc37b91d619ea965758369e5/pydantic_core-2.33.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:6fa6dfc3e4d1f734a34710f391ae822e0a8eb8559a85c6979e14e65ee6ba2954", size = 1864735, upload-time = "2025-04-23T18:32:29.019Z" }, + { url = "https://files.pythonhosted.org/packages/23/9a/2e70d6388d7cda488ae38f57bc2f7b03ee442fbcf0d75d848304ac7e405b/pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c54c939ee22dc8e2d545da79fc5381f1c020d6d3141d3bd747eab59164dc89fb", size = 1898467, upload-time = "2025-04-23T18:32:31.119Z" }, + { url = "https://files.pythonhosted.org/packages/ff/2e/1568934feb43370c1ffb78a77f0baaa5a8b6897513e7a91051af707ffdc4/pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:53a57d2ed685940a504248187d5685e49eb5eef0f696853647bf37c418c538f7", size = 1983041, upload-time = "2025-04-23T18:32:33.655Z" }, + { url = "https://files.pythonhosted.org/packages/01/1a/1a1118f38ab64eac2f6269eb8c120ab915be30e387bb561e3af904b12499/pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:09fb9dd6571aacd023fe6aaca316bd01cf60ab27240d7eb39ebd66a3a15293b4", size = 2136503, upload-time = "2025-04-23T18:32:35.519Z" }, + { url = "https://files.pythonhosted.org/packages/5c/da/44754d1d7ae0f22d6d3ce6c6b1486fc07ac2c524ed8f6eca636e2e1ee49b/pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0e6116757f7959a712db11f3e9c0a99ade00a5bbedae83cb801985aa154f071b", size = 2736079, upload-time = "2025-04-23T18:32:37.659Z" }, + { url = "https://files.pythonhosted.org/packages/4d/98/f43cd89172220ec5aa86654967b22d862146bc4d736b1350b4c41e7c9c03/pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d55ab81c57b8ff8548c3e4947f119551253f4e3787a7bbc0b6b3ca47498a9d3", size = 2006508, upload-time = "2025-04-23T18:32:39.637Z" }, + { url = "https://files.pythonhosted.org/packages/2b/cc/f77e8e242171d2158309f830f7d5d07e0531b756106f36bc18712dc439df/pydantic_core-2.33.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c20c462aa4434b33a2661701b861604913f912254e441ab8d78d30485736115a", size = 2113693, upload-time = "2025-04-23T18:32:41.818Z" }, + { url = "https://files.pythonhosted.org/packages/54/7a/7be6a7bd43e0a47c147ba7fbf124fe8aaf1200bc587da925509641113b2d/pydantic_core-2.33.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:44857c3227d3fb5e753d5fe4a3420d6376fa594b07b621e220cd93703fe21782", size = 2074224, upload-time = "2025-04-23T18:32:44.033Z" }, + { url = "https://files.pythonhosted.org/packages/2a/07/31cf8fadffbb03be1cb520850e00a8490c0927ec456e8293cafda0726184/pydantic_core-2.33.2-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:eb9b459ca4df0e5c87deb59d37377461a538852765293f9e6ee834f0435a93b9", size = 2245403, upload-time = "2025-04-23T18:32:45.836Z" }, + { url = "https://files.pythonhosted.org/packages/b6/8d/bbaf4c6721b668d44f01861f297eb01c9b35f612f6b8e14173cb204e6240/pydantic_core-2.33.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9fcd347d2cc5c23b06de6d3b7b8275be558a0c90549495c699e379a80bf8379e", size = 2242331, upload-time = "2025-04-23T18:32:47.618Z" }, + { url = "https://files.pythonhosted.org/packages/bb/93/3cc157026bca8f5006250e74515119fcaa6d6858aceee8f67ab6dc548c16/pydantic_core-2.33.2-cp39-cp39-win32.whl", hash = "sha256:83aa99b1285bc8f038941ddf598501a86f1536789740991d7d8756e34f1e74d9", size = 1910571, upload-time = "2025-04-23T18:32:49.401Z" }, + { url = "https://files.pythonhosted.org/packages/5b/90/7edc3b2a0d9f0dda8806c04e511a67b0b7a41d2187e2003673a996fb4310/pydantic_core-2.33.2-cp39-cp39-win_amd64.whl", hash = "sha256:f481959862f57f29601ccced557cc2e817bce7533ab8e01a797a48b49c9692b3", size = 1956504, upload-time = "2025-04-23T18:32:51.287Z" }, + { url = "https://files.pythonhosted.org/packages/30/68/373d55e58b7e83ce371691f6eaa7175e3a24b956c44628eb25d7da007917/pydantic_core-2.33.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5c4aa4e82353f65e548c476b37e64189783aa5384903bfea4f41580f255fddfa", size = 2023982, upload-time = "2025-04-23T18:32:53.14Z" }, + { url = "https://files.pythonhosted.org/packages/a4/16/145f54ac08c96a63d8ed6442f9dec17b2773d19920b627b18d4f10a061ea/pydantic_core-2.33.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:d946c8bf0d5c24bf4fe333af284c59a19358aa3ec18cb3dc4370080da1e8ad29", size = 1858412, upload-time = "2025-04-23T18:32:55.52Z" }, + { url = "https://files.pythonhosted.org/packages/41/b1/c6dc6c3e2de4516c0bb2c46f6a373b91b5660312342a0cf5826e38ad82fa/pydantic_core-2.33.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:87b31b6846e361ef83fedb187bb5b4372d0da3f7e28d85415efa92d6125d6e6d", size = 1892749, upload-time = "2025-04-23T18:32:57.546Z" }, + { url = "https://files.pythonhosted.org/packages/12/73/8cd57e20afba760b21b742106f9dbdfa6697f1570b189c7457a1af4cd8a0/pydantic_core-2.33.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa9d91b338f2df0508606f7009fde642391425189bba6d8c653afd80fd6bb64e", size = 2067527, upload-time = "2025-04-23T18:32:59.771Z" }, + { url = "https://files.pythonhosted.org/packages/e3/d5/0bb5d988cc019b3cba4a78f2d4b3854427fc47ee8ec8e9eaabf787da239c/pydantic_core-2.33.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2058a32994f1fde4ca0480ab9d1e75a0e8c87c22b53a3ae66554f9af78f2fe8c", size = 2108225, upload-time = "2025-04-23T18:33:04.51Z" }, + { url = "https://files.pythonhosted.org/packages/f1/c5/00c02d1571913d496aabf146106ad8239dc132485ee22efe08085084ff7c/pydantic_core-2.33.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:0e03262ab796d986f978f79c943fc5f620381be7287148b8010b4097f79a39ec", size = 2069490, upload-time = "2025-04-23T18:33:06.391Z" }, + { url = "https://files.pythonhosted.org/packages/22/a8/dccc38768274d3ed3a59b5d06f59ccb845778687652daa71df0cab4040d7/pydantic_core-2.33.2-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:1a8695a8d00c73e50bff9dfda4d540b7dee29ff9b8053e38380426a85ef10052", size = 2237525, upload-time = "2025-04-23T18:33:08.44Z" }, + { url = "https://files.pythonhosted.org/packages/d4/e7/4f98c0b125dda7cf7ccd14ba936218397b44f50a56dd8c16a3091df116c3/pydantic_core-2.33.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:fa754d1850735a0b0e03bcffd9d4b4343eb417e47196e4485d9cca326073a42c", size = 2238446, upload-time = "2025-04-23T18:33:10.313Z" }, + { url = "https://files.pythonhosted.org/packages/ce/91/2ec36480fdb0b783cd9ef6795753c1dea13882f2e68e73bce76ae8c21e6a/pydantic_core-2.33.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:a11c8d26a50bfab49002947d3d237abe4d9e4b5bdc8846a63537b6488e197808", size = 2066678, upload-time = "2025-04-23T18:33:12.224Z" }, + { url = "https://files.pythonhosted.org/packages/7b/27/d4ae6487d73948d6f20dddcd94be4ea43e74349b56eba82e9bdee2d7494c/pydantic_core-2.33.2-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:dd14041875d09cc0f9308e37a6f8b65f5585cf2598a53aa0123df8b129d481f8", size = 2025200, upload-time = "2025-04-23T18:33:14.199Z" }, + { url = "https://files.pythonhosted.org/packages/f1/b8/b3cb95375f05d33801024079b9392a5ab45267a63400bf1866e7ce0f0de4/pydantic_core-2.33.2-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:d87c561733f66531dced0da6e864f44ebf89a8fba55f31407b00c2f7f9449593", size = 1859123, upload-time = "2025-04-23T18:33:16.555Z" }, + { url = "https://files.pythonhosted.org/packages/05/bc/0d0b5adeda59a261cd30a1235a445bf55c7e46ae44aea28f7bd6ed46e091/pydantic_core-2.33.2-pp311-pypy311_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2f82865531efd18d6e07a04a17331af02cb7a651583c418df8266f17a63c6612", size = 1892852, upload-time = "2025-04-23T18:33:18.513Z" }, + { url = "https://files.pythonhosted.org/packages/3e/11/d37bdebbda2e449cb3f519f6ce950927b56d62f0b84fd9cb9e372a26a3d5/pydantic_core-2.33.2-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2bfb5112df54209d820d7bf9317c7a6c9025ea52e49f46b6a2060104bba37de7", size = 2067484, upload-time = "2025-04-23T18:33:20.475Z" }, + { url = "https://files.pythonhosted.org/packages/8c/55/1f95f0a05ce72ecb02a8a8a1c3be0579bbc29b1d5ab68f1378b7bebc5057/pydantic_core-2.33.2-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:64632ff9d614e5eecfb495796ad51b0ed98c453e447a76bcbeeb69615079fc7e", size = 2108896, upload-time = "2025-04-23T18:33:22.501Z" }, + { url = "https://files.pythonhosted.org/packages/53/89/2b2de6c81fa131f423246a9109d7b2a375e83968ad0800d6e57d0574629b/pydantic_core-2.33.2-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:f889f7a40498cc077332c7ab6b4608d296d852182211787d4f3ee377aaae66e8", size = 2069475, upload-time = "2025-04-23T18:33:24.528Z" }, + { url = "https://files.pythonhosted.org/packages/b8/e9/1f7efbe20d0b2b10f6718944b5d8ece9152390904f29a78e68d4e7961159/pydantic_core-2.33.2-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:de4b83bb311557e439b9e186f733f6c645b9417c84e2eb8203f3f820a4b988bf", size = 2239013, upload-time = "2025-04-23T18:33:26.621Z" }, + { url = "https://files.pythonhosted.org/packages/3c/b2/5309c905a93811524a49b4e031e9851a6b00ff0fb668794472ea7746b448/pydantic_core-2.33.2-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:82f68293f055f51b51ea42fafc74b6aad03e70e191799430b90c13d643059ebb", size = 2238715, upload-time = "2025-04-23T18:33:28.656Z" }, + { url = "https://files.pythonhosted.org/packages/32/56/8a7ca5d2cd2cda1d245d34b1c9a942920a718082ae8e54e5f3e5a58b7add/pydantic_core-2.33.2-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:329467cecfb529c925cf2bbd4d60d2c509bc2fb52a20c1045bf09bb70971a9c1", size = 2066757, upload-time = "2025-04-23T18:33:30.645Z" }, + { url = "https://files.pythonhosted.org/packages/08/98/dbf3fdfabaf81cda5622154fda78ea9965ac467e3239078e0dcd6df159e7/pydantic_core-2.33.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:87acbfcf8e90ca885206e98359d7dca4bcbb35abdc0ff66672a293e1d7a19101", size = 2024034, upload-time = "2025-04-23T18:33:32.843Z" }, + { url = "https://files.pythonhosted.org/packages/8d/99/7810aa9256e7f2ccd492590f86b79d370df1e9292f1f80b000b6a75bd2fb/pydantic_core-2.33.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:7f92c15cd1e97d4b12acd1cc9004fa092578acfa57b67ad5e43a197175d01a64", size = 1858578, upload-time = "2025-04-23T18:33:34.912Z" }, + { url = "https://files.pythonhosted.org/packages/d8/60/bc06fa9027c7006cc6dd21e48dbf39076dc39d9abbaf718a1604973a9670/pydantic_core-2.33.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d3f26877a748dc4251cfcfda9dfb5f13fcb034f5308388066bcfe9031b63ae7d", size = 1892858, upload-time = "2025-04-23T18:33:36.933Z" }, + { url = "https://files.pythonhosted.org/packages/f2/40/9d03997d9518816c68b4dfccb88969756b9146031b61cd37f781c74c9b6a/pydantic_core-2.33.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dac89aea9af8cd672fa7b510e7b8c33b0bba9a43186680550ccf23020f32d535", size = 2068498, upload-time = "2025-04-23T18:33:38.997Z" }, + { url = "https://files.pythonhosted.org/packages/d8/62/d490198d05d2d86672dc269f52579cad7261ced64c2df213d5c16e0aecb1/pydantic_core-2.33.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:970919794d126ba8645f3837ab6046fb4e72bbc057b3709144066204c19a455d", size = 2108428, upload-time = "2025-04-23T18:33:41.18Z" }, + { url = "https://files.pythonhosted.org/packages/9a/ec/4cd215534fd10b8549015f12ea650a1a973da20ce46430b68fc3185573e8/pydantic_core-2.33.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:3eb3fe62804e8f859c49ed20a8451342de53ed764150cb14ca71357c765dc2a6", size = 2069854, upload-time = "2025-04-23T18:33:43.446Z" }, + { url = "https://files.pythonhosted.org/packages/1a/1a/abbd63d47e1d9b0d632fee6bb15785d0889c8a6e0a6c3b5a8e28ac1ec5d2/pydantic_core-2.33.2-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:3abcd9392a36025e3bd55f9bd38d908bd17962cc49bc6da8e7e96285336e2bca", size = 2237859, upload-time = "2025-04-23T18:33:45.56Z" }, + { url = "https://files.pythonhosted.org/packages/80/1c/fa883643429908b1c90598fd2642af8839efd1d835b65af1f75fba4d94fe/pydantic_core-2.33.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:3a1c81334778f9e3af2f8aeb7a960736e5cab1dfebfb26aabca09afd2906c039", size = 2239059, upload-time = "2025-04-23T18:33:47.735Z" }, + { url = "https://files.pythonhosted.org/packages/d4/29/3cade8a924a61f60ccfa10842f75eb12787e1440e2b8660ceffeb26685e7/pydantic_core-2.33.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:2807668ba86cb38c6817ad9bc66215ab8584d1d304030ce4f0887336f28a5e27", size = 2066661, upload-time = "2025-04-23T18:33:49.995Z" }, ] [[package]] name = "pydantic-settings" -version = "2.8.1" +version = "2.10.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "pydantic", marker = "python_full_version >= '3.10'" }, { name = "python-dotenv", marker = "python_full_version >= '3.10'" }, + { name = "typing-inspection", marker = "python_full_version >= '3.10'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/88/82/c79424d7d8c29b994fb01d277da57b0a9b09cc03c3ff875f9bd8a86b2145/pydantic_settings-2.8.1.tar.gz", hash = "sha256:d5c663dfbe9db9d5e1c646b2e161da12f0d734d422ee56f567d0ea2cee4e8585", size = 83550, upload-time = "2025-02-27T10:10:32.338Z" } +sdist = { url = "https://files.pythonhosted.org/packages/68/85/1ea668bbab3c50071ca613c6ab30047fb36ab0da1b92fa8f17bbc38fd36c/pydantic_settings-2.10.1.tar.gz", hash = "sha256:06f0062169818d0f5524420a360d632d5857b83cffd4d42fe29597807a1614ee", size = 172583, upload-time = "2025-06-24T13:26:46.841Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/0b/53/a64f03044927dc47aafe029c42a5b7aabc38dfb813475e0e1bf71c4a59d0/pydantic_settings-2.8.1-py3-none-any.whl", hash = "sha256:81942d5ac3d905f7f3ee1a70df5dfb62d5569c12f51a5a647defc1c3d9ee2e9c", size = 30839, upload-time = "2025-02-27T10:10:30.711Z" }, + { url = "https://files.pythonhosted.org/packages/58/f0/427018098906416f580e3cf1366d3b1abfb408a0652e9f31600c24a1903c/pydantic_settings-2.10.1-py3-none-any.whl", hash = "sha256:a60952460b99cf661dc25c29c0ef171721f98bfcb52ef8d9ea4c943d7c8cc796", size = 45235, upload-time = "2025-06-24T13:26:45.485Z" }, ] [[package]] @@ -1903,24 +2322,24 @@ wheels = [ [[package]] name = "pygments" -version = "2.19.1" +version = "2.19.2" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/7c/2d/c3338d48ea6cc0feb8446d8e6937e1408088a72a39937982cc6111d17f84/pygments-2.19.1.tar.gz", hash = "sha256:61c16d2a8576dc0649d9f39e089b5f02bcd27fba10d8fb4dcc28173f7a45151f", size = 4968581, upload-time = "2025-01-06T17:26:30.443Z" } +sdist = { url = "https://files.pythonhosted.org/packages/b0/77/a5b8c569bf593b0140bde72ea885a803b82086995367bf2037de0159d924/pygments-2.19.2.tar.gz", hash = "sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887", size = 4968631, upload-time = "2025-06-21T13:39:12.283Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/8a/0b/9fcc47d19c48b59121088dd6da2488a49d5f72dacf8262e2790a1d2c7d15/pygments-2.19.1-py3-none-any.whl", hash = "sha256:9ea1544ad55cecf4b8242fab6dd35a93bbce657034b0611ee383099054ab6d8c", size = 1225293, upload-time = "2025-01-06T17:26:25.553Z" }, + { url = "https://files.pythonhosted.org/packages/c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/pygments-2.19.2-py3-none-any.whl", hash = "sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b", size = 1225217, upload-time = "2025-06-21T13:39:07.939Z" }, ] [[package]] name = "pymdown-extensions" -version = "10.14.3" +version = "10.16.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "markdown" }, { name = "pyyaml" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/7c/44/e6de2fdc880ad0ec7547ca2e087212be815efbc9a425a8d5ba9ede602cbb/pymdown_extensions-10.14.3.tar.gz", hash = "sha256:41e576ce3f5d650be59e900e4ceff231e0aed2a88cf30acaee41e02f063a061b", size = 846846, upload-time = "2025-02-01T15:43:15.42Z" } +sdist = { url = "https://files.pythonhosted.org/packages/55/b3/6d2b3f149bc5413b0a29761c2c5832d8ce904a1d7f621e86616d96f505cc/pymdown_extensions-10.16.1.tar.gz", hash = "sha256:aace82bcccba3efc03e25d584e6a22d27a8e17caa3f4dd9f207e49b787aa9a91", size = 853277, upload-time = "2025-07-28T16:19:34.167Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/eb/f5/b9e2a42aa8f9e34d52d66de87941ecd236570c7ed2e87775ed23bbe4e224/pymdown_extensions-10.14.3-py3-none-any.whl", hash = "sha256:05e0bee73d64b9c71a4ae17c72abc2f700e8bc8403755a00580b49a4e9f189e9", size = 264467, upload-time = "2025-02-01T15:43:13.995Z" }, + { url = "https://files.pythonhosted.org/packages/e4/06/43084e6cbd4b3bc0e80f6be743b2e79fbc6eed8de9ad8c629939fa55d972/pymdown_extensions-10.16.1-py3-none-any.whl", hash = "sha256:d6ba157a6c03146a7fb122b2b9a121300056384eafeec9c9f9e584adfdb2a32d", size = 266178, upload-time = "2025-07-28T16:19:31.401Z" }, ] [[package]] @@ -1941,21 +2360,23 @@ wheels = [ [[package]] name = "pyobjc-core" -version = "11.0" +version = "11.1" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/5c/94/a111239b98260869780a5767e5d74bfd3a8c13a40457f479c28dcd91f89d/pyobjc_core-11.0.tar.gz", hash = "sha256:63bced211cb8a8fb5c8ff46473603da30e51112861bd02c438fbbbc8578d9a70", size = 994931, upload-time = "2025-01-14T19:02:13.938Z" } +sdist = { url = "https://files.pythonhosted.org/packages/e8/e9/0b85c81e2b441267bca707b5d89f56c2f02578ef8f3eafddf0e0c0b8848c/pyobjc_core-11.1.tar.gz", hash = "sha256:b63d4d90c5df7e762f34739b39cc55bc63dbcf9fb2fb3f2671e528488c7a87fe", size = 974602, upload-time = "2025-06-14T20:56:34.189Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/bc/21/ccc992b38670176a615fb67686d709e03be989511da687f6f49ddc4ff6c8/pyobjc_core-11.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:10866b3a734d47caf48e456eea0d4815c2c9b21856157db5917b61dee06893a1", size = 732162, upload-time = "2025-01-14T18:46:47.176Z" }, - { url = "https://files.pythonhosted.org/packages/52/05/fa97309c3b1bc1ec90d701db89902e0bd5e1024023aa2c5387b889458b1b/pyobjc_core-11.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:50675c0bb8696fe960a28466f9baf6943df2928a1fd85625d678fa2f428bd0bd", size = 727295, upload-time = "2025-01-14T18:46:50.208Z" }, - { url = "https://files.pythonhosted.org/packages/56/ce/bf3ff9a9347721a398c3dfb83e29b43fb166b7ef590f3f7b7ddcd283df39/pyobjc_core-11.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:a03061d4955c62ddd7754224a80cdadfdf17b6b5f60df1d9169a3b1b02923f0b", size = 739750, upload-time = "2025-01-14T18:46:53.039Z" }, - { url = "https://files.pythonhosted.org/packages/72/16/0c468e73dbecb821e3da8819236fe832dfc53eb5f66a11775b055a7589ea/pyobjc_core-11.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:c338c1deb7ab2e9436d4175d1127da2eeed4a1b564b3d83b9f3ae4844ba97e86", size = 743900, upload-time = "2025-01-14T18:46:54.654Z" }, - { url = "https://files.pythonhosted.org/packages/f3/88/cecec88fd51f62a6cd7775cc4fb6bfde16652f97df88d28c84fb77ca0c18/pyobjc_core-11.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:b4e9dc4296110f251a4033ff3f40320b35873ea7f876bd29a1c9705bb5e08c59", size = 791905, upload-time = "2025-01-14T18:46:56.473Z" }, - { url = "https://files.pythonhosted.org/packages/14/ba/1c459d0f1fc4c80314040ea6efea433c0641adffa6701679ec3a917b51a3/pyobjc_core-11.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:02406ece449d0f41b31e579e47ca77ced3eb57533df955281bfcecc99da74fba", size = 732648, upload-time = "2025-01-14T18:46:59.268Z" }, + { url = "https://files.pythonhosted.org/packages/a5/c5/9fa74ef6b83924e657c5098d37b36b66d1e16d13bc45c44248c6248e7117/pyobjc_core-11.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:4c7536f3e94de0a3eae6bb382d75f1219280aa867cdf37beef39d9e7d580173c", size = 676323, upload-time = "2025-06-14T20:44:44.675Z" }, + { url = "https://files.pythonhosted.org/packages/5a/a7/55afc166d89e3fcd87966f48f8bca3305a3a2d7c62100715b9ffa7153a90/pyobjc_core-11.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:ec36680b5c14e2f73d432b03ba7c1457dc6ca70fa59fd7daea1073f2b4157d33", size = 671075, upload-time = "2025-06-14T20:44:46.594Z" }, + { url = "https://files.pythonhosted.org/packages/c0/09/e83228e878e73bf756749939f906a872da54488f18d75658afa7f1abbab1/pyobjc_core-11.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:765b97dea6b87ec4612b3212258024d8496ea23517c95a1c5f0735f96b7fd529", size = 677985, upload-time = "2025-06-14T20:44:48.375Z" }, + { url = "https://files.pythonhosted.org/packages/c5/24/12e4e2dae5f85fd0c0b696404ed3374ea6ca398e7db886d4f1322eb30799/pyobjc_core-11.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:18986f83998fbd5d3f56d8a8428b2f3e0754fd15cef3ef786ca0d29619024f2c", size = 676431, upload-time = "2025-06-14T20:44:49.908Z" }, + { url = "https://files.pythonhosted.org/packages/f7/79/031492497624de4c728f1857181b06ce8c56444db4d49418fa459cba217c/pyobjc_core-11.1-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:8849e78cfe6595c4911fbba29683decfb0bf57a350aed8a43316976ba6f659d2", size = 719330, upload-time = "2025-06-14T20:44:51.621Z" }, + { url = "https://files.pythonhosted.org/packages/ed/7d/6169f16a0c7ec15b9381f8bf33872baf912de2ef68d96c798ca4c6ee641f/pyobjc_core-11.1-cp314-cp314-macosx_11_0_universal2.whl", hash = "sha256:8cb9ed17a8d84a312a6e8b665dd22393d48336ea1d8277e7ad20c19a38edf731", size = 667203, upload-time = "2025-06-14T20:44:53.262Z" }, + { url = "https://files.pythonhosted.org/packages/49/0f/f5ab2b0e57430a3bec9a62b6153c0e79c05a30d77b564efdb9f9446eeac5/pyobjc_core-11.1-cp314-cp314t-macosx_11_0_universal2.whl", hash = "sha256:f2455683e807f8541f0d83fbba0f5d9a46128ab0d5cc83ea208f0bec759b7f96", size = 708807, upload-time = "2025-06-14T20:44:54.851Z" }, + { url = "https://files.pythonhosted.org/packages/0b/3c/98f04333e4f958ee0c44ceccaf0342c2502d361608e00f29a5d50e16a569/pyobjc_core-11.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:4a99e6558b48b8e47c092051e7b3be05df1c8d0617b62f6fa6a316c01902d157", size = 677089, upload-time = "2025-06-14T20:44:56.15Z" }, ] [[package]] name = "pyobjc-framework-applicationservices" -version = "11.0" +version = "11.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "pyobjc-core" }, @@ -1963,73 +2384,81 @@ dependencies = [ { name = "pyobjc-framework-coretext" }, { name = "pyobjc-framework-quartz" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/ba/fb/4e42573b0d3baa3fa18ec53614cf979f951313f1451e8f2e17df9429da1f/pyobjc_framework_applicationservices-11.0.tar.gz", hash = "sha256:d6ea18dfc7d5626a3ecf4ac72d510405c0d3a648ca38cae8db841acdebecf4d2", size = 224334, upload-time = "2025-01-14T19:02:26.828Z" } +sdist = { url = "https://files.pythonhosted.org/packages/be/3f/b33ce0cecc3a42f6c289dcbf9ff698b0d9e85f5796db2e9cb5dadccffbb9/pyobjc_framework_applicationservices-11.1.tar.gz", hash = "sha256:03fcd8c0c600db98fa8b85eb7b3bc31491701720c795e3f762b54e865138bbaf", size = 224842, upload-time = "2025-06-14T20:56:40.648Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/29/2e/23d996e8294cc4d4ac719c410b1d210dfb1f64eecf87170d5e72c966592a/pyobjc_framework_ApplicationServices-11.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:bc8f34b5b59ffd3c210ae883d794345c1197558ff3da0f5800669cf16435271e", size = 30839, upload-time = "2025-01-14T18:48:05.11Z" }, - { url = "https://files.pythonhosted.org/packages/99/37/3d4dc6c004aaeb67bd43f7261d7c169ff45b8fc0eefbc7ba8cd6b0c881bc/pyobjc_framework_ApplicationServices-11.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:61a99eef23abb704257310db4f5271137707e184768f6407030c01de4731b67b", size = 30846, upload-time = "2025-01-14T18:48:06.286Z" }, - { url = "https://files.pythonhosted.org/packages/74/a9/7a45a67e126d32c61ea22ffd80e87ff7e05b4acf32bede6cce071fbfffc8/pyobjc_framework_ApplicationServices-11.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:5fbeb425897d6129471d451ec61a29ddd5b1386eb26b1dd49cb313e34616ee21", size = 30908, upload-time = "2025-01-14T18:48:07.177Z" }, - { url = "https://files.pythonhosted.org/packages/82/47/ab4155ec966aff2f8f0f6978b40f12255e8ef46111ca0bda7987959b4052/pyobjc_framework_ApplicationServices-11.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:59becf3cd87a4f4cedf4be02ff6cf46ed736f5c1123ce629f788aaafad91eff0", size = 30924, upload-time = "2025-01-14T18:48:08.165Z" }, - { url = "https://files.pythonhosted.org/packages/a3/73/747aab95970e0b7b5d38c650028e5e034c0432d9451335ff790ca104f11a/pyobjc_framework_ApplicationServices-11.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:44b466e8745fb49e8ac20f29f2ffd7895b45e97aa63a844b2a80a97c3a34346f", size = 31279, upload-time = "2025-01-14T18:48:09.112Z" }, - { url = "https://files.pythonhosted.org/packages/a7/db/e8895fffa91031ab348ccad426dbd4c7d787ee0f48e1590ccba841669755/pyobjc_framework_ApplicationServices-11.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:74963e15a751d1454c1b8060914f116956e3a68f6a117c2163f491609125283b", size = 30809, upload-time = "2025-01-14T18:48:10.009Z" }, + { url = "https://files.pythonhosted.org/packages/d9/2b/b46566639b13354d348092f932b4debda2e8604c9b1b416eb3619676e997/pyobjc_framework_applicationservices-11.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:89aa713f16f1de66efd82f3be77c632ad1068e51e0ef0c2b0237ac7c7f580814", size = 30991, upload-time = "2025-06-14T20:45:17.223Z" }, + { url = "https://files.pythonhosted.org/packages/39/2d/9fde6de0b2a95fbb3d77ba11b3cc4f289dd208f38cb3a28389add87c0f44/pyobjc_framework_applicationservices-11.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:cf45d15eddae36dec2330a9992fc852476b61c8f529874b9ec2805c768a75482", size = 30991, upload-time = "2025-06-14T20:45:18.169Z" }, + { url = "https://files.pythonhosted.org/packages/38/ec/46a5c710e2d7edf55105223c34fed5a7b7cc7aba7d00a3a7b0405d6a2d1a/pyobjc_framework_applicationservices-11.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:f4a85ccd78bab84f7f05ac65ff9be117839dfc09d48c39edd65c617ed73eb01c", size = 31056, upload-time = "2025-06-14T20:45:18.925Z" }, + { url = "https://files.pythonhosted.org/packages/c4/06/c2a309e6f37bfa73a2a581d3301321b2033e25b249e2a01e417a3c34e799/pyobjc_framework_applicationservices-11.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:385a89f4d0838c97a331e247519d9e9745aa3f7427169d18570e3c664076a63c", size = 31072, upload-time = "2025-06-14T20:45:19.707Z" }, + { url = "https://files.pythonhosted.org/packages/b4/5f/357bf498c27f1b4d48385860d8374b2569adc1522aabe32befd77089c070/pyobjc_framework_applicationservices-11.1-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:f480fab20f3005e559c9d06c9a3874a1f1c60dde52c6d28a53ab59b45e79d55f", size = 31335, upload-time = "2025-06-14T20:45:20.462Z" }, + { url = "https://files.pythonhosted.org/packages/ab/b6/797fdd81399fe8251196f29a621ba3f3f04d5c579d95fd304489f5558202/pyobjc_framework_applicationservices-11.1-cp314-cp314-macosx_11_0_universal2.whl", hash = "sha256:e8dee91c6a14fd042f98819dc0ac4a182e0e816282565534032f0e544bfab143", size = 31196, upload-time = "2025-06-14T20:45:21.555Z" }, + { url = "https://files.pythonhosted.org/packages/68/45/47eba8d7cdf16d778240ed13fb405e8d712464170ed29d0463363a695194/pyobjc_framework_applicationservices-11.1-cp314-cp314t-macosx_11_0_universal2.whl", hash = "sha256:a0ce40a57a9b993793b6f72c4fd93f80618ef54a69d76a1da97b8360a2f3ffc5", size = 31446, upload-time = "2025-06-14T20:45:22.313Z" }, + { url = "https://files.pythonhosted.org/packages/0c/b8/abe434d87e2e62835cb575c098a1917a56295b533c03a2ed407696afa500/pyobjc_framework_applicationservices-11.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:ba671fc6b695de69b2ed5e350b09cc1806f39352e8ad07635c94ef17730f6fe0", size = 30983, upload-time = "2025-06-14T20:45:23.069Z" }, ] [[package]] name = "pyobjc-framework-cocoa" -version = "11.0" +version = "11.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "pyobjc-core" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/c5/32/53809096ad5fc3e7a2c5ddea642590a5f2cb5b81d0ad6ea67fdb2263d9f9/pyobjc_framework_cocoa-11.0.tar.gz", hash = "sha256:00346a8cb81ad7b017b32ff7bf596000f9faa905807b1bd234644ebd47f692c5", size = 6173848, upload-time = "2025-01-14T19:03:00.125Z" } +sdist = { url = "https://files.pythonhosted.org/packages/4b/c5/7a866d24bc026f79239b74d05e2cf3088b03263da66d53d1b4cf5207f5ae/pyobjc_framework_cocoa-11.1.tar.gz", hash = "sha256:87df76b9b73e7ca699a828ff112564b59251bb9bbe72e610e670a4dc9940d038", size = 5565335, upload-time = "2025-06-14T20:56:59.683Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/37/16/905a32c5241848ddd91d94bae346342750f28f49fadb3746e9e796f929f3/pyobjc_framework_Cocoa-11.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:fbc65f260d617d5463c7fb9dbaaffc23c9a4fabfe3b1a50b039b61870b8daefd", size = 385509, upload-time = "2025-01-14T18:49:25.149Z" }, - { url = "https://files.pythonhosted.org/packages/23/97/81fd41ad90e9c241172110aa635a6239d56f50d75923aaedbbe351828580/pyobjc_framework_Cocoa-11.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:3ea7be6e6dd801b297440de02d312ba3fa7fd3c322db747ae1cb237e975f5d33", size = 385534, upload-time = "2025-01-14T18:49:27.898Z" }, - { url = "https://files.pythonhosted.org/packages/5b/8d/0e2558447c26b3ba64f7c9776a5a6c9d2ae8abf9d34308b174ae0934402e/pyobjc_framework_Cocoa-11.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:280a577b83c68175a28b2b7138d1d2d3111f2b2b66c30e86f81a19c2b02eae71", size = 385811, upload-time = "2025-01-14T18:49:29.259Z" }, - { url = "https://files.pythonhosted.org/packages/1d/a5/609281a7e89efefbef9db1d8fe66bc0458c3b4e74e2227c644f9c18926fa/pyobjc_framework_Cocoa-11.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:15b2bd977ed340074f930f1330f03d42912d5882b697d78bd06f8ebe263ef92e", size = 385889, upload-time = "2025-01-14T18:49:30.605Z" }, - { url = "https://files.pythonhosted.org/packages/93/f6/2d5a863673ef7b85a3cba875c43e6c495fb1307427a6801001ae94bb5e54/pyobjc_framework_Cocoa-11.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:5750001db544e67f2b66f02067d8f0da96bb2ef71732bde104f01b8628f9d7ea", size = 389831, upload-time = "2025-01-14T18:49:31.963Z" }, - { url = "https://files.pythonhosted.org/packages/27/29/459cacd815c2e13de60b919c0af3d1056f74ff52172a4841684b5b946492/pyobjc_framework_Cocoa-11.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:ddff25b0755d59873d186e1e07d6aaddb19d55e3ae890d69ff2d9babf8627657", size = 385407, upload-time = "2025-01-14T18:49:34.56Z" }, + { url = "https://files.pythonhosted.org/packages/87/8f/67a7e166b615feb96385d886c6732dfb90afed565b8b1f34673683d73cd9/pyobjc_framework_cocoa-11.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:b27a5bdb3ab6cdeb998443ff3fce194ffae5f518c6a079b832dbafc4426937f9", size = 388187, upload-time = "2025-06-14T20:46:49.74Z" }, + { url = "https://files.pythonhosted.org/packages/90/43/6841046aa4e257b6276cd23e53cacedfb842ecaf3386bb360fa9cc319aa1/pyobjc_framework_cocoa-11.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:7b9a9b8ba07f5bf84866399e3de2aa311ed1c34d5d2788a995bdbe82cc36cfa0", size = 388177, upload-time = "2025-06-14T20:46:51.454Z" }, + { url = "https://files.pythonhosted.org/packages/68/da/41c0f7edc92ead461cced7e67813e27fa17da3c5da428afdb4086c69d7ba/pyobjc_framework_cocoa-11.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:806de56f06dfba8f301a244cce289d54877c36b4b19818e3b53150eb7c2424d0", size = 388983, upload-time = "2025-06-14T20:46:52.591Z" }, + { url = "https://files.pythonhosted.org/packages/4e/0b/a01477cde2a040f97e226f3e15e5ffd1268fcb6d1d664885a95ba592eca9/pyobjc_framework_cocoa-11.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:54e93e1d9b0fc41c032582a6f0834befe1d418d73893968f3f450281b11603da", size = 389049, upload-time = "2025-06-14T20:46:53.757Z" }, + { url = "https://files.pythonhosted.org/packages/bc/e6/64cf2661f6ab7c124d0486ec6d1d01a9bb2838a0d2a46006457d8c5e6845/pyobjc_framework_cocoa-11.1-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:fd5245ee1997d93e78b72703be1289d75d88ff6490af94462b564892e9266350", size = 393110, upload-time = "2025-06-14T20:46:54.894Z" }, + { url = "https://files.pythonhosted.org/packages/33/87/01e35c5a3c5bbdc93d5925366421e10835fcd7b23347b6c267df1b16d0b3/pyobjc_framework_cocoa-11.1-cp314-cp314-macosx_11_0_universal2.whl", hash = "sha256:aede53a1afc5433e1e7d66568cc52acceeb171b0a6005407a42e8e82580b4fc0", size = 392644, upload-time = "2025-06-14T20:46:56.503Z" }, + { url = "https://files.pythonhosted.org/packages/c1/7c/54afe9ffee547c41e1161691e72067a37ed27466ac71c089bfdcd07ca70d/pyobjc_framework_cocoa-11.1-cp314-cp314t-macosx_11_0_universal2.whl", hash = "sha256:1b5de4e1757bb65689d6dc1f8d8717de9ec8587eb0c4831c134f13aba29f9b71", size = 396742, upload-time = "2025-06-14T20:46:57.64Z" }, + { url = "https://files.pythonhosted.org/packages/b2/9b/5499d1ed6790b037b12831d7038eb21031ab90a033d4cfa43c9b51085925/pyobjc_framework_cocoa-11.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:bbee71eeb93b1b31ffbac8560b59a0524a8a4b90846a260d2c4f2188f3d4c721", size = 388163, upload-time = "2025-06-14T20:46:58.72Z" }, ] [[package]] name = "pyobjc-framework-coretext" -version = "11.0" +version = "11.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "pyobjc-core" }, { name = "pyobjc-framework-cocoa" }, { name = "pyobjc-framework-quartz" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/9d/e8/9b68dc788828e38143a3e834e66346713751cb83d7f0955016323005c1a2/pyobjc_framework_coretext-11.0.tar.gz", hash = "sha256:a68437153e627847e3898754dd3f13ae0cb852246b016a91f9c9cbccb9f91a43", size = 274222, upload-time = "2025-01-14T19:03:21.521Z" } +sdist = { url = "https://files.pythonhosted.org/packages/65/e9/d3231c4f87d07b8525401fd6ad3c56607c9e512c5490f0a7a6abb13acab6/pyobjc_framework_coretext-11.1.tar.gz", hash = "sha256:a29bbd5d85c77f46a8ee81d381b847244c88a3a5a96ac22f509027ceceaffaf6", size = 274702, upload-time = "2025-06-14T20:57:16.059Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/ce/af/aa4ab3e029a9f539e782eab894c57590791700d892cda73a324fe22e09a6/pyobjc_framework_CoreText-11.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:6939b4ea745b349b5c964823a2071f155f5defdc9b9fc3a13f036d859d7d0439", size = 30395, upload-time = "2025-01-14T18:51:34.479Z" }, - { url = "https://files.pythonhosted.org/packages/f6/20/b8a967101b585a2425ffe645135f8618edd51e1430aeb668373475a07d1f/pyobjc_framework_CoreText-11.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:56a4889858308b0d9f147d568b4d91c441cc0ffd332497cb4f709bb1990450c1", size = 30397, upload-time = "2025-01-14T18:51:35.844Z" }, - { url = "https://files.pythonhosted.org/packages/0d/14/d300b8bf18acd1d98d40820d2a9b5c5b6cf96325bdfc5020bc963218e001/pyobjc_framework_CoreText-11.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:fb90e7f370b3fd7cb2fb442e3dc63fedf0b4af6908db1c18df694d10dc94669d", size = 30456, upload-time = "2025-01-14T18:51:36.962Z" }, - { url = "https://files.pythonhosted.org/packages/94/f0/53b681481e9429e8f9ac2c039da6a820d7417ca92f763f01d629db36c530/pyobjc_framework_CoreText-11.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:7947f755782456bd663e0b00c7905eeffd10f839f0bf2af031f68ded6a1ea360", size = 30453, upload-time = "2025-01-14T18:51:38.478Z" }, - { url = "https://files.pythonhosted.org/packages/2a/3f/a6d09952e83d70be6d337a5f1d457018459a57a110a91c3e771a2f2a7de0/pyobjc_framework_CoreText-11.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:5356116bae33ec49f1f212c301378a7d08000440a2d6a7281aab351945528ab9", size = 31092, upload-time = "2025-01-14T18:51:39.423Z" }, - { url = "https://files.pythonhosted.org/packages/c8/26/d18fd9fbb71dac6f43bd85d74aae3f3b4294ca96f0375878710763140b4b/pyobjc_framework_CoreText-11.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:4a76e1307747f2ee8180d38844cd62b8bb1701b4203d9234cc41f6603d4ae654", size = 30377, upload-time = "2025-01-14T18:51:40.43Z" }, + { url = "https://files.pythonhosted.org/packages/59/0c/0117d5353b1d18f8f8dd1e0f48374e4819cfcf3e8c34c676353e87320e8f/pyobjc_framework_coretext-11.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:515be6beb48c084ee413c00c4e9fbd6e730c1b8a24270f4c618fc6c7ba0011ce", size = 30072, upload-time = "2025-06-14T20:48:33.341Z" }, + { url = "https://files.pythonhosted.org/packages/4c/59/d6cc5470157cfd328b2d1ee2c1b6f846a5205307fce17291b57236d9f46e/pyobjc_framework_coretext-11.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:b4f4d2d2a6331fa64465247358d7aafce98e4fb654b99301a490627a073d021e", size = 30072, upload-time = "2025-06-14T20:48:34.248Z" }, + { url = "https://files.pythonhosted.org/packages/32/67/9cc5189c366e67dc3e5b5976fac73cc6405841095f795d3fa0d5fc43d76a/pyobjc_framework_coretext-11.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:1597bf7234270ee1b9963bf112e9061050d5fb8e1384b3f50c11bde2fe2b1570", size = 30175, upload-time = "2025-06-14T20:48:35.023Z" }, + { url = "https://files.pythonhosted.org/packages/b0/d1/6ec2ef4f8133177203a742d5db4db90bbb3ae100aec8d17f667208da84c9/pyobjc_framework_coretext-11.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:37e051e8f12a0f47a81b8efc8c902156eb5bc3d8123c43e5bd4cebd24c222228", size = 30180, upload-time = "2025-06-14T20:48:35.766Z" }, + { url = "https://files.pythonhosted.org/packages/0a/84/d4a95e49f6af59503ba257fbed0471b6932f0afe8b3725c018dd3ba40150/pyobjc_framework_coretext-11.1-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:56a3a02202e0d50be3c43e781c00f9f1859ab9b73a8342ff56260b908e911e37", size = 30768, upload-time = "2025-06-14T20:48:36.869Z" }, + { url = "https://files.pythonhosted.org/packages/64/4c/16e1504e06a5cb23eec6276835ddddb087637beba66cf84b5c587eba99be/pyobjc_framework_coretext-11.1-cp314-cp314-macosx_11_0_universal2.whl", hash = "sha256:15650ba99692d00953e91e53118c11636056a22c90d472020f7ba31500577bf5", size = 30155, upload-time = "2025-06-14T20:48:37.948Z" }, + { url = "https://files.pythonhosted.org/packages/ad/a4/cbfa9c874b2770fb1ba5c38c42b0e12a8b5aa177a5a86d0ad49b935aa626/pyobjc_framework_coretext-11.1-cp314-cp314t-macosx_11_0_universal2.whl", hash = "sha256:fb27f66a56660c31bb956191d64b85b95bac99cfb833f6e99622ca0ac4b3ba12", size = 30768, upload-time = "2025-06-14T20:48:38.734Z" }, + { url = "https://files.pythonhosted.org/packages/08/76/83713004b6eae70af1083cc6c8a8574f144d2bcaf563fe8a48e13168b37b/pyobjc_framework_coretext-11.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:7fee99a1ac96e3f70d482731bc39a546da82a58f87fa9f0e2b784a5febaff33d", size = 30064, upload-time = "2025-06-14T20:48:39.481Z" }, ] [[package]] name = "pyobjc-framework-quartz" -version = "11.0" +version = "11.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "pyobjc-core" }, { name = "pyobjc-framework-cocoa" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/a5/ad/f00f3f53387c23bbf4e0bb1410e11978cbf87c82fa6baff0ee86f74c5fb6/pyobjc_framework_quartz-11.0.tar.gz", hash = "sha256:3205bf7795fb9ae34747f701486b3db6dfac71924894d1f372977c4d70c3c619", size = 3952463, upload-time = "2025-01-14T19:05:07.931Z" } +sdist = { url = "https://files.pythonhosted.org/packages/c7/ac/6308fec6c9ffeda9942fef72724f4094c6df4933560f512e63eac37ebd30/pyobjc_framework_quartz-11.1.tar.gz", hash = "sha256:a57f35ccfc22ad48c87c5932818e583777ff7276605fef6afad0ac0741169f75", size = 3953275, upload-time = "2025-06-14T20:58:17.924Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/bd/b3/75fccb0406aac00eecbd14f278a9b6e6fc0e4483220d57eb3aff68666fb1/pyobjc_framework_Quartz-11.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:da3ab13c9f92361959b41b0ad4cdd41ae872f90a6d8c58a9ed699bc08ab1c45c", size = 212343, upload-time = "2025-01-14T18:58:06.353Z" }, - { url = "https://files.pythonhosted.org/packages/a3/6a/68957c8c5e8f0128d4d419728bac397d48fa7ad7a66e82b70e64d129ffca/pyobjc_framework_Quartz-11.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:d251696bfd8e8ef72fbc90eb29fec95cb9d1cc409008a183d5cc3246130ae8c2", size = 212349, upload-time = "2025-01-14T18:58:08.963Z" }, - { url = "https://files.pythonhosted.org/packages/60/5d/df827b78dcb5140652ad08af8038c9ddd7e01e6bdf84462bfee644e6e661/pyobjc_framework_Quartz-11.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:cb4a9f2d9d580ea15e25e6b270f47681afb5689cafc9e25712445ce715bcd18e", size = 212061, upload-time = "2025-01-14T18:58:10.2Z" }, - { url = "https://files.pythonhosted.org/packages/a6/9e/54c48fe8faab06ee5eb80796c8c17ec61fc313d84398540ee70abeaf7070/pyobjc_framework_Quartz-11.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:973b4f9b8ab844574461a038bd5269f425a7368d6e677e3cc81fcc9b27b65498", size = 212478, upload-time = "2025-01-14T18:58:11.491Z" }, - { url = "https://files.pythonhosted.org/packages/4a/28/456b54a59bfe11a91b7b4e94f8ffdcf174ffd1efa169f4283e5b3bc10194/pyobjc_framework_Quartz-11.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:66ab58d65348863b8707e63b2ec5cdc54569ee8189d1af90d52f29f5fdf6272c", size = 217973, upload-time = "2025-01-14T18:58:12.739Z" }, - { url = "https://files.pythonhosted.org/packages/89/a9/c7efb146a2b9c9a7754fed1dd725f7342959644d903006dec28aa65a637e/pyobjc_framework_Quartz-11.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:1032f63f2a4ee98366764e69c249f1d93813821e17d224cf626cf11fb1801fc4", size = 212182, upload-time = "2025-01-14T18:58:13.976Z" }, + { url = "https://files.pythonhosted.org/packages/b9/62/f8d9bb4cba92d5f220327cf1def2c2c5be324880d54ee57e7bea43aa28b2/pyobjc_framework_quartz-11.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:b5ef75c416b0209e25b2eb07a27bd7eedf14a8c6b2f968711969d45ceceb0f84", size = 215586, upload-time = "2025-06-14T20:53:34.018Z" }, + { url = "https://files.pythonhosted.org/packages/77/cb/38172fdb350b3f47e18d87c5760e50f4efbb4da6308182b5e1310ff0cde4/pyobjc_framework_quartz-11.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:2d501fe95ef15d8acf587cb7dc4ab4be3c5a84e2252017da8dbb7df1bbe7a72a", size = 215565, upload-time = "2025-06-14T20:53:35.262Z" }, + { url = "https://files.pythonhosted.org/packages/9b/37/ee6e0bdd31b3b277fec00e5ee84d30eb1b5b8b0e025095e24ddc561697d0/pyobjc_framework_quartz-11.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:9ac806067541917d6119b98d90390a6944e7d9bd737f5c0a79884202327c9204", size = 216410, upload-time = "2025-06-14T20:53:36.346Z" }, + { url = "https://files.pythonhosted.org/packages/bd/27/4f4fc0e6a0652318c2844608dd7c41e49ba6006ee5fb60c7ae417c338357/pyobjc_framework_quartz-11.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:43a1138280571bbf44df27a7eef519184b5c4183a588598ebaaeb887b9e73e76", size = 216816, upload-time = "2025-06-14T20:53:37.358Z" }, + { url = "https://files.pythonhosted.org/packages/b8/8a/1d15e42496bef31246f7401aad1ebf0f9e11566ce0de41c18431715aafbc/pyobjc_framework_quartz-11.1-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:b23d81c30c564adf6336e00b357f355b35aad10075dd7e837cfd52a9912863e5", size = 221941, upload-time = "2025-06-14T20:53:38.34Z" }, + { url = "https://files.pythonhosted.org/packages/32/a8/a3f84d06e567efc12c104799c7fd015f9bea272a75f799eda8b79e8163c6/pyobjc_framework_quartz-11.1-cp314-cp314-macosx_11_0_universal2.whl", hash = "sha256:07cbda78b4a8fcf3a2d96e047a2ff01f44e3e1820f46f0f4b3b6d77ff6ece07c", size = 221312, upload-time = "2025-06-14T20:53:39.435Z" }, + { url = "https://files.pythonhosted.org/packages/76/ef/8c08d4f255bb3efe8806609d1f0b1ddd29684ab0f9ffb5e26d3ad7957b29/pyobjc_framework_quartz-11.1-cp314-cp314t-macosx_11_0_universal2.whl", hash = "sha256:39d02a3df4b5e3eee1e0da0fb150259476910d2a9aa638ab94153c24317a9561", size = 226353, upload-time = "2025-06-14T20:53:40.655Z" }, + { url = "https://files.pythonhosted.org/packages/4a/ca/204d08ea73125402f408cf139946b90c0d0ccf19d6b5efac616548fbdbbd/pyobjc_framework_quartz-11.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:9b1f451ddb5243d8d6316af55f240a02b0fffbfe165bff325628bf73f3df7f44", size = 215537, upload-time = "2025-06-14T20:53:42.015Z" }, ] [[package]] name = "pytest" -version = "8.3.5" +version = "8.4.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "colorama", marker = "sys_platform == 'win32'" }, @@ -2037,36 +2466,38 @@ dependencies = [ { name = "iniconfig" }, { name = "packaging" }, { name = "pluggy" }, + { name = "pygments" }, { name = "tomli", marker = "python_full_version < '3.11'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/ae/3c/c9d525a414d506893f0cd8a8d0de7706446213181570cdbd766691164e40/pytest-8.3.5.tar.gz", hash = "sha256:f4efe70cc14e511565ac476b57c279e12a855b11f48f212af1080ef2263d3845", size = 1450891, upload-time = "2025-03-02T12:54:54.503Z" } +sdist = { url = "https://files.pythonhosted.org/packages/08/ba/45911d754e8eba3d5a841a5ce61a65a685ff1798421ac054f85aa8747dfb/pytest-8.4.1.tar.gz", hash = "sha256:7c67fd69174877359ed9371ec3af8a3d2b04741818c51e5e99cc1742251fa93c", size = 1517714, upload-time = "2025-06-18T05:48:06.109Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/30/3d/64ad57c803f1fa1e963a7946b6e0fea4a70df53c1a7fed304586539c2bac/pytest-8.3.5-py3-none-any.whl", hash = "sha256:c69214aa47deac29fad6c2a4f590b9c4a9fdb16a403176fe154b79c0b4d4d820", size = 343634, upload-time = "2025-03-02T12:54:52.069Z" }, + { url = "https://files.pythonhosted.org/packages/29/16/c8a903f4c4dffe7a12843191437d7cd8e32751d5de349d45d3fe69544e87/pytest-8.4.1-py3-none-any.whl", hash = "sha256:539c70ba6fcead8e78eebbf1115e8b589e7565830d7d006a8723f19ac8a0afb7", size = 365474, upload-time = "2025-06-18T05:48:03.955Z" }, ] [[package]] name = "pytest-asyncio" -version = "0.26.0" +version = "1.1.0" source = { registry = "https://pypi.org/simple" } dependencies = [ + { name = "backports-asyncio-runner", marker = "python_full_version < '3.11'" }, { name = "pytest" }, { name = "typing-extensions", marker = "python_full_version < '3.10'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/8e/c4/453c52c659521066969523e87d85d54139bbd17b78f09532fb8eb8cdb58e/pytest_asyncio-0.26.0.tar.gz", hash = "sha256:c4df2a697648241ff39e7f0e4a73050b03f123f760673956cf0d72a4990e312f", size = 54156, upload-time = "2025-03-25T06:22:28.883Z" } +sdist = { url = "https://files.pythonhosted.org/packages/4e/51/f8794af39eeb870e87a8c8068642fc07bce0c854d6865d7dd0f2a9d338c2/pytest_asyncio-1.1.0.tar.gz", hash = "sha256:796aa822981e01b68c12e4827b8697108f7205020f24b5793b3c41555dab68ea", size = 46652, upload-time = "2025-07-16T04:29:26.393Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/20/7f/338843f449ace853647ace35870874f69a764d251872ed1b4de9f234822c/pytest_asyncio-0.26.0-py3-none-any.whl", hash = "sha256:7b51ed894f4fbea1340262bdae5135797ebbe21d8638978e35d31c6d19f72fb0", size = 19694, upload-time = "2025-03-25T06:22:27.807Z" }, + { url = "https://files.pythonhosted.org/packages/c7/9d/bf86eddabf8c6c9cb1ea9a869d6873b46f105a5d292d3a6f7071f5b07935/pytest_asyncio-1.1.0-py3-none-any.whl", hash = "sha256:5fe2d69607b0bd75c656d1211f969cadba035030156745ee09e7d71740e58ecf", size = 15157, upload-time = "2025-07-16T04:29:24.929Z" }, ] [[package]] name = "pytest-mock" -version = "3.14.0" +version = "3.14.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "pytest" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/c6/90/a955c3ab35ccd41ad4de556596fa86685bf4fc5ffcc62d22d856cfd4e29a/pytest-mock-3.14.0.tar.gz", hash = "sha256:2719255a1efeceadbc056d6bf3df3d1c5015530fb40cf347c0f9afac88410bd0", size = 32814, upload-time = "2024-03-21T22:14:04.964Z" } +sdist = { url = "https://files.pythonhosted.org/packages/71/28/67172c96ba684058a4d24ffe144d64783d2a270d0af0d9e792737bddc75c/pytest_mock-3.14.1.tar.gz", hash = "sha256:159e9edac4c451ce77a5cdb9fc5d1100708d2dd4ba3c3df572f14097351af80e", size = 33241, upload-time = "2025-05-26T13:58:45.167Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/f2/3b/b26f90f74e2986a82df6e7ac7e319b8ea7ccece1caec9f8ab6104dc70603/pytest_mock-3.14.0-py3-none-any.whl", hash = "sha256:0b72c38033392a5f4621342fe11e9219ac11ec9d375f8e2a0c164539e0d70f6f", size = 9863, upload-time = "2024-03-21T22:14:02.694Z" }, + { url = "https://files.pythonhosted.org/packages/b2/05/77b60e520511c53d1c1ca75f1930c7dd8e971d0c4379b7f4b3f9644685ba/pytest_mock-3.14.1-py3-none-any.whl", hash = "sha256:178aefcd11307d874b4cd3100344e7e2d888d9791a6a1d9bfe90fbc1b74fd1d0", size = 9923, upload-time = "2025-05-26T13:58:43.487Z" }, ] [[package]] @@ -2083,11 +2514,11 @@ wheels = [ [[package]] name = "python-dotenv" -version = "1.1.0" +version = "1.1.1" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/88/2c/7bb1416c5620485aa793f2de31d3df393d3686aa8a8506d11e10e13c5baf/python_dotenv-1.1.0.tar.gz", hash = "sha256:41f90bc6f5f177fb41f53e87666db362025010eb28f60a01c9143bfa33a2b2d5", size = 39920, upload-time = "2025-03-25T10:14:56.835Z" } +sdist = { url = "https://files.pythonhosted.org/packages/f6/b0/4bc07ccd3572a2f9df7e6782f52b0c6c90dcbb803ac4a167702d7d0dfe1e/python_dotenv-1.1.1.tar.gz", hash = "sha256:a8a6399716257f45be6a007360200409fce5cda2661e3dec71d23dc15f6189ab", size = 41978, upload-time = "2025-06-24T04:21:07.341Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/1e/18/98a99ad95133c6a6e2005fe89faedf294a748bd5dc803008059409ac9b1e/python_dotenv-1.1.0-py3-none-any.whl", hash = "sha256:d7c01d9e2293916c18baf562d95698754b0dbbb5e74d457c45d4f6561fb9d55d", size = 20256, upload-time = "2025-03-25T10:14:55.034Z" }, + { url = "https://files.pythonhosted.org/packages/5f/ed/539768cf28c661b5b068d66d96a2f155c4971a5d55684a514c1a0e0dec2f/python_dotenv-1.1.1-py3-none-any.whl", hash = "sha256:31f23644fe2602f88ff55e1f5c79ba497e01224ee7737937930c448e4d0e24dc", size = 20556, upload-time = "2025-06-24T04:21:06.073Z" }, ] [[package]] @@ -2111,6 +2542,31 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/fc/b8/ff33610932e0ee81ae7f1269c890f697d56ff74b9f5b2ee5d9b7fa2c5355/python_xlib-0.33-py2.py3-none-any.whl", hash = "sha256:c3534038d42e0df2f1392a1b30a15a4ff5fdc2b86cfa94f072bf11b10a164398", size = 182185, upload-time = "2022-12-25T18:52:58.662Z" }, ] +[[package]] +name = "pywin32" +version = "311" +source = { registry = "https://pypi.org/simple" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7b/40/44efbb0dfbd33aca6a6483191dae0716070ed99e2ecb0c53683f400a0b4f/pywin32-311-cp310-cp310-win32.whl", hash = "sha256:d03ff496d2a0cd4a5893504789d4a15399133fe82517455e78bad62efbb7f0a3", size = 8760432, upload-time = "2025-07-14T20:13:05.9Z" }, + { url = "https://files.pythonhosted.org/packages/5e/bf/360243b1e953bd254a82f12653974be395ba880e7ec23e3731d9f73921cc/pywin32-311-cp310-cp310-win_amd64.whl", hash = "sha256:797c2772017851984b97180b0bebe4b620bb86328e8a884bb626156295a63b3b", size = 9590103, upload-time = "2025-07-14T20:13:07.698Z" }, + { url = "https://files.pythonhosted.org/packages/57/38/d290720e6f138086fb3d5ffe0b6caa019a791dd57866940c82e4eeaf2012/pywin32-311-cp310-cp310-win_arm64.whl", hash = "sha256:0502d1facf1fed4839a9a51ccbcc63d952cf318f78ffc00a7e78528ac27d7a2b", size = 8778557, upload-time = "2025-07-14T20:13:11.11Z" }, + { url = "https://files.pythonhosted.org/packages/7c/af/449a6a91e5d6db51420875c54f6aff7c97a86a3b13a0b4f1a5c13b988de3/pywin32-311-cp311-cp311-win32.whl", hash = "sha256:184eb5e436dea364dcd3d2316d577d625c0351bf237c4e9a5fabbcfa5a58b151", size = 8697031, upload-time = "2025-07-14T20:13:13.266Z" }, + { url = "https://files.pythonhosted.org/packages/51/8f/9bb81dd5bb77d22243d33c8397f09377056d5c687aa6d4042bea7fbf8364/pywin32-311-cp311-cp311-win_amd64.whl", hash = "sha256:3ce80b34b22b17ccbd937a6e78e7225d80c52f5ab9940fe0506a1a16f3dab503", size = 9508308, upload-time = "2025-07-14T20:13:15.147Z" }, + { url = "https://files.pythonhosted.org/packages/44/7b/9c2ab54f74a138c491aba1b1cd0795ba61f144c711daea84a88b63dc0f6c/pywin32-311-cp311-cp311-win_arm64.whl", hash = "sha256:a733f1388e1a842abb67ffa8e7aad0e70ac519e09b0f6a784e65a136ec7cefd2", size = 8703930, upload-time = "2025-07-14T20:13:16.945Z" }, + { url = "https://files.pythonhosted.org/packages/e7/ab/01ea1943d4eba0f850c3c61e78e8dd59757ff815ff3ccd0a84de5f541f42/pywin32-311-cp312-cp312-win32.whl", hash = "sha256:750ec6e621af2b948540032557b10a2d43b0cee2ae9758c54154d711cc852d31", size = 8706543, upload-time = "2025-07-14T20:13:20.765Z" }, + { url = "https://files.pythonhosted.org/packages/d1/a8/a0e8d07d4d051ec7502cd58b291ec98dcc0c3fff027caad0470b72cfcc2f/pywin32-311-cp312-cp312-win_amd64.whl", hash = "sha256:b8c095edad5c211ff31c05223658e71bf7116daa0ecf3ad85f3201ea3190d067", size = 9495040, upload-time = "2025-07-14T20:13:22.543Z" }, + { url = "https://files.pythonhosted.org/packages/ba/3a/2ae996277b4b50f17d61f0603efd8253cb2d79cc7ae159468007b586396d/pywin32-311-cp312-cp312-win_arm64.whl", hash = "sha256:e286f46a9a39c4a18b319c28f59b61de793654af2f395c102b4f819e584b5852", size = 8710102, upload-time = "2025-07-14T20:13:24.682Z" }, + { url = "https://files.pythonhosted.org/packages/a5/be/3fd5de0979fcb3994bfee0d65ed8ca9506a8a1260651b86174f6a86f52b3/pywin32-311-cp313-cp313-win32.whl", hash = "sha256:f95ba5a847cba10dd8c4d8fefa9f2a6cf283b8b88ed6178fa8a6c1ab16054d0d", size = 8705700, upload-time = "2025-07-14T20:13:26.471Z" }, + { url = "https://files.pythonhosted.org/packages/e3/28/e0a1909523c6890208295a29e05c2adb2126364e289826c0a8bc7297bd5c/pywin32-311-cp313-cp313-win_amd64.whl", hash = "sha256:718a38f7e5b058e76aee1c56ddd06908116d35147e133427e59a3983f703a20d", size = 9494700, upload-time = "2025-07-14T20:13:28.243Z" }, + { url = "https://files.pythonhosted.org/packages/04/bf/90339ac0f55726dce7d794e6d79a18a91265bdf3aa70b6b9ca52f35e022a/pywin32-311-cp313-cp313-win_arm64.whl", hash = "sha256:7b4075d959648406202d92a2310cb990fea19b535c7f4a78d3f5e10b926eeb8a", size = 8709318, upload-time = "2025-07-14T20:13:30.348Z" }, + { url = "https://files.pythonhosted.org/packages/c9/31/097f2e132c4f16d99a22bfb777e0fd88bd8e1c634304e102f313af69ace5/pywin32-311-cp314-cp314-win32.whl", hash = "sha256:b7a2c10b93f8986666d0c803ee19b5990885872a7de910fc460f9b0c2fbf92ee", size = 8840714, upload-time = "2025-07-14T20:13:32.449Z" }, + { url = "https://files.pythonhosted.org/packages/90/4b/07c77d8ba0e01349358082713400435347df8426208171ce297da32c313d/pywin32-311-cp314-cp314-win_amd64.whl", hash = "sha256:3aca44c046bd2ed8c90de9cb8427f581c479e594e99b5c0bb19b29c10fd6cb87", size = 9656800, upload-time = "2025-07-14T20:13:34.312Z" }, + { url = "https://files.pythonhosted.org/packages/c0/d2/21af5c535501a7233e734b8af901574572da66fcc254cb35d0609c9080dd/pywin32-311-cp314-cp314-win_arm64.whl", hash = "sha256:a508e2d9025764a8270f93111a970e1d0fbfc33f4153b388bb649b7eec4f9b42", size = 8932540, upload-time = "2025-07-14T20:13:36.379Z" }, + { url = "https://files.pythonhosted.org/packages/59/42/b86689aac0cdaee7ae1c58d464b0ff04ca909c19bb6502d4973cdd9f9544/pywin32-311-cp39-cp39-win32.whl", hash = "sha256:aba8f82d551a942cb20d4a83413ccbac30790b50efb89a75e4f586ac0bb8056b", size = 8760837, upload-time = "2025-07-14T20:12:59.59Z" }, + { url = "https://files.pythonhosted.org/packages/9f/8a/1403d0353f8c5a2f0829d2b1c4becbf9da2f0a4d040886404fc4a5431e4d/pywin32-311-cp39-cp39-win_amd64.whl", hash = "sha256:e0c4cfb0621281fe40387df582097fd796e80430597cb9944f0ae70447bacd91", size = 9590187, upload-time = "2025-07-14T20:13:01.419Z" }, + { url = "https://files.pythonhosted.org/packages/60/22/e0e8d802f124772cec9c75430b01a212f86f9de7546bda715e54140d5aeb/pywin32-311-cp39-cp39-win_arm64.whl", hash = "sha256:62ea666235135fee79bb154e695f3ff67370afefd71bd7fea7512fc70ef31e3d", size = 8778162, upload-time = "2025-07-14T20:13:03.544Z" }, +] + [[package]] name = "pyyaml" version = "6.0.2" @@ -2166,14 +2622,26 @@ wheels = [ [[package]] name = "pyyaml-env-tag" -version = "0.1" +version = "1.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "pyyaml" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/fb/8e/da1c6c58f751b70f8ceb1eb25bc25d524e8f14fe16edcce3f4e3ba08629c/pyyaml_env_tag-0.1.tar.gz", hash = "sha256:70092675bda14fdec33b31ba77e7543de9ddc88f2e5b99160396572d11525bdb", size = 5631, upload-time = "2020-11-12T02:38:26.239Z" } +sdist = { url = "https://files.pythonhosted.org/packages/eb/2e/79c822141bfd05a853236b504869ebc6b70159afc570e1d5a20641782eaa/pyyaml_env_tag-1.1.tar.gz", hash = "sha256:2eb38b75a2d21ee0475d6d97ec19c63287a7e140231e4214969d0eac923cd7ff", size = 5737, upload-time = "2025-05-13T15:24:01.64Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/5a/66/bbb1dd374f5c870f59c5bb1db0e18cbe7fa739415a24cbd95b2d1f5ae0c4/pyyaml_env_tag-0.1-py3-none-any.whl", hash = "sha256:af31106dec8a4d68c60207c1886031cbf839b68aa7abccdb19868200532c2069", size = 3911, upload-time = "2020-11-12T02:38:24.638Z" }, + { url = "https://files.pythonhosted.org/packages/04/11/432f32f8097b03e3cd5fe57e88efb685d964e2e5178a48ed61e841f7fdce/pyyaml_env_tag-1.1-py3-none-any.whl", hash = "sha256:17109e1a528561e32f026364712fee1264bc2ea6715120891174ed1b980d2e04", size = 4722, upload-time = "2025-05-13T15:23:59.629Z" }, +] + +[[package]] +name = "redis" +version = "6.4.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "async-timeout", marker = "python_full_version < '3.11.3'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/0d/d6/e8b92798a5bd67d659d51a18170e91c16ac3b59738d91894651ee255ed49/redis-6.4.0.tar.gz", hash = "sha256:b01bc7282b8444e28ec36b261df5375183bb47a07eb9c603f284e89cbc5ef010", size = 4647399, upload-time = "2025-08-07T08:10:11.441Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e8/02/89e2ed7e85db6c93dfa9e8f691c5087df4e3551ab39081a4d7c6d1f90e05/redis-6.4.0-py3-none-any.whl", hash = "sha256:f0544fa9604264e9464cdf4814e7d4830f74b165d52f2a330a760a88dd248b7f", size = 279847, upload-time = "2025-08-07T08:10:09.84Z" }, ] [[package]] @@ -2192,92 +2660,101 @@ wheels = [ [[package]] name = "regex" -version = "2024.11.6" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/8e/5f/bd69653fbfb76cf8604468d3b4ec4c403197144c7bfe0e6a5fc9e02a07cb/regex-2024.11.6.tar.gz", hash = "sha256:7ab159b063c52a0333c884e4679f8d7a85112ee3078fe3d9004b2dd875585519", size = 399494, upload-time = "2024-11-06T20:12:31.635Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/95/3c/4651f6b130c6842a8f3df82461a8950f923925db8b6961063e82744bddcc/regex-2024.11.6-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:ff590880083d60acc0433f9c3f713c51f7ac6ebb9adf889c79a261ecf541aa91", size = 482674, upload-time = "2024-11-06T20:08:57.575Z" }, - { url = "https://files.pythonhosted.org/packages/15/51/9f35d12da8434b489c7b7bffc205c474a0a9432a889457026e9bc06a297a/regex-2024.11.6-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:658f90550f38270639e83ce492f27d2c8d2cd63805c65a13a14d36ca126753f0", size = 287684, upload-time = "2024-11-06T20:08:59.787Z" }, - { url = "https://files.pythonhosted.org/packages/bd/18/b731f5510d1b8fb63c6b6d3484bfa9a59b84cc578ac8b5172970e05ae07c/regex-2024.11.6-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:164d8b7b3b4bcb2068b97428060b2a53be050085ef94eca7f240e7947f1b080e", size = 284589, upload-time = "2024-11-06T20:09:01.896Z" }, - { url = "https://files.pythonhosted.org/packages/78/a2/6dd36e16341ab95e4c6073426561b9bfdeb1a9c9b63ab1b579c2e96cb105/regex-2024.11.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d3660c82f209655a06b587d55e723f0b813d3a7db2e32e5e7dc64ac2a9e86fde", size = 782511, upload-time = "2024-11-06T20:09:04.062Z" }, - { url = "https://files.pythonhosted.org/packages/1b/2b/323e72d5d2fd8de0d9baa443e1ed70363ed7e7b2fb526f5950c5cb99c364/regex-2024.11.6-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d22326fcdef5e08c154280b71163ced384b428343ae16a5ab2b3354aed12436e", size = 821149, upload-time = "2024-11-06T20:09:06.237Z" }, - { url = "https://files.pythonhosted.org/packages/90/30/63373b9ea468fbef8a907fd273e5c329b8c9535fee36fc8dba5fecac475d/regex-2024.11.6-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f1ac758ef6aebfc8943560194e9fd0fa18bcb34d89fd8bd2af18183afd8da3a2", size = 809707, upload-time = "2024-11-06T20:09:07.715Z" }, - { url = "https://files.pythonhosted.org/packages/f2/98/26d3830875b53071f1f0ae6d547f1d98e964dd29ad35cbf94439120bb67a/regex-2024.11.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:997d6a487ff00807ba810e0f8332c18b4eb8d29463cfb7c820dc4b6e7562d0cf", size = 781702, upload-time = "2024-11-06T20:09:10.101Z" }, - { url = "https://files.pythonhosted.org/packages/87/55/eb2a068334274db86208ab9d5599ffa63631b9f0f67ed70ea7c82a69bbc8/regex-2024.11.6-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:02a02d2bb04fec86ad61f3ea7f49c015a0681bf76abb9857f945d26159d2968c", size = 771976, upload-time = "2024-11-06T20:09:11.566Z" }, - { url = "https://files.pythonhosted.org/packages/74/c0/be707bcfe98254d8f9d2cff55d216e946f4ea48ad2fd8cf1428f8c5332ba/regex-2024.11.6-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f02f93b92358ee3f78660e43b4b0091229260c5d5c408d17d60bf26b6c900e86", size = 697397, upload-time = "2024-11-06T20:09:13.119Z" }, - { url = "https://files.pythonhosted.org/packages/49/dc/bb45572ceb49e0f6509f7596e4ba7031f6819ecb26bc7610979af5a77f45/regex-2024.11.6-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:06eb1be98df10e81ebaded73fcd51989dcf534e3c753466e4b60c4697a003b67", size = 768726, upload-time = "2024-11-06T20:09:14.85Z" }, - { url = "https://files.pythonhosted.org/packages/5a/db/f43fd75dc4c0c2d96d0881967897926942e935d700863666f3c844a72ce6/regex-2024.11.6-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:040df6fe1a5504eb0f04f048e6d09cd7c7110fef851d7c567a6b6e09942feb7d", size = 775098, upload-time = "2024-11-06T20:09:16.504Z" }, - { url = "https://files.pythonhosted.org/packages/99/d7/f94154db29ab5a89d69ff893159b19ada89e76b915c1293e98603d39838c/regex-2024.11.6-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:fdabbfc59f2c6edba2a6622c647b716e34e8e3867e0ab975412c5c2f79b82da2", size = 839325, upload-time = "2024-11-06T20:09:18.698Z" }, - { url = "https://files.pythonhosted.org/packages/f7/17/3cbfab1f23356fbbf07708220ab438a7efa1e0f34195bf857433f79f1788/regex-2024.11.6-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:8447d2d39b5abe381419319f942de20b7ecd60ce86f16a23b0698f22e1b70008", size = 843277, upload-time = "2024-11-06T20:09:21.725Z" }, - { url = "https://files.pythonhosted.org/packages/7e/f2/48b393b51900456155de3ad001900f94298965e1cad1c772b87f9cfea011/regex-2024.11.6-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:da8f5fc57d1933de22a9e23eec290a0d8a5927a5370d24bda9a6abe50683fe62", size = 773197, upload-time = "2024-11-06T20:09:24.092Z" }, - { url = "https://files.pythonhosted.org/packages/45/3f/ef9589aba93e084cd3f8471fded352826dcae8489b650d0b9b27bc5bba8a/regex-2024.11.6-cp310-cp310-win32.whl", hash = "sha256:b489578720afb782f6ccf2840920f3a32e31ba28a4b162e13900c3e6bd3f930e", size = 261714, upload-time = "2024-11-06T20:09:26.36Z" }, - { url = "https://files.pythonhosted.org/packages/42/7e/5f1b92c8468290c465fd50c5318da64319133231415a8aa6ea5ab995a815/regex-2024.11.6-cp310-cp310-win_amd64.whl", hash = "sha256:5071b2093e793357c9d8b2929dfc13ac5f0a6c650559503bb81189d0a3814519", size = 274042, upload-time = "2024-11-06T20:09:28.762Z" }, - { url = "https://files.pythonhosted.org/packages/58/58/7e4d9493a66c88a7da6d205768119f51af0f684fe7be7bac8328e217a52c/regex-2024.11.6-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:5478c6962ad548b54a591778e93cd7c456a7a29f8eca9c49e4f9a806dcc5d638", size = 482669, upload-time = "2024-11-06T20:09:31.064Z" }, - { url = "https://files.pythonhosted.org/packages/34/4c/8f8e631fcdc2ff978609eaeef1d6994bf2f028b59d9ac67640ed051f1218/regex-2024.11.6-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2c89a8cc122b25ce6945f0423dc1352cb9593c68abd19223eebbd4e56612c5b7", size = 287684, upload-time = "2024-11-06T20:09:32.915Z" }, - { url = "https://files.pythonhosted.org/packages/c5/1b/f0e4d13e6adf866ce9b069e191f303a30ab1277e037037a365c3aad5cc9c/regex-2024.11.6-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:94d87b689cdd831934fa3ce16cc15cd65748e6d689f5d2b8f4f4df2065c9fa20", size = 284589, upload-time = "2024-11-06T20:09:35.504Z" }, - { url = "https://files.pythonhosted.org/packages/25/4d/ab21047f446693887f25510887e6820b93f791992994f6498b0318904d4a/regex-2024.11.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1062b39a0a2b75a9c694f7a08e7183a80c63c0d62b301418ffd9c35f55aaa114", size = 792121, upload-time = "2024-11-06T20:09:37.701Z" }, - { url = "https://files.pythonhosted.org/packages/45/ee/c867e15cd894985cb32b731d89576c41a4642a57850c162490ea34b78c3b/regex-2024.11.6-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:167ed4852351d8a750da48712c3930b031f6efdaa0f22fa1933716bfcd6bf4a3", size = 831275, upload-time = "2024-11-06T20:09:40.371Z" }, - { url = "https://files.pythonhosted.org/packages/b3/12/b0f480726cf1c60f6536fa5e1c95275a77624f3ac8fdccf79e6727499e28/regex-2024.11.6-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2d548dafee61f06ebdb584080621f3e0c23fff312f0de1afc776e2a2ba99a74f", size = 818257, upload-time = "2024-11-06T20:09:43.059Z" }, - { url = "https://files.pythonhosted.org/packages/bf/ce/0d0e61429f603bac433910d99ef1a02ce45a8967ffbe3cbee48599e62d88/regex-2024.11.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f2a19f302cd1ce5dd01a9099aaa19cae6173306d1302a43b627f62e21cf18ac0", size = 792727, upload-time = "2024-11-06T20:09:48.19Z" }, - { url = "https://files.pythonhosted.org/packages/e4/c1/243c83c53d4a419c1556f43777ccb552bccdf79d08fda3980e4e77dd9137/regex-2024.11.6-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bec9931dfb61ddd8ef2ebc05646293812cb6b16b60cf7c9511a832b6f1854b55", size = 780667, upload-time = "2024-11-06T20:09:49.828Z" }, - { url = "https://files.pythonhosted.org/packages/c5/f4/75eb0dd4ce4b37f04928987f1d22547ddaf6c4bae697623c1b05da67a8aa/regex-2024.11.6-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:9714398225f299aa85267fd222f7142fcb5c769e73d7733344efc46f2ef5cf89", size = 776963, upload-time = "2024-11-06T20:09:51.819Z" }, - { url = "https://files.pythonhosted.org/packages/16/5d/95c568574e630e141a69ff8a254c2f188b4398e813c40d49228c9bbd9875/regex-2024.11.6-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:202eb32e89f60fc147a41e55cb086db2a3f8cb82f9a9a88440dcfc5d37faae8d", size = 784700, upload-time = "2024-11-06T20:09:53.982Z" }, - { url = "https://files.pythonhosted.org/packages/8e/b5/f8495c7917f15cc6fee1e7f395e324ec3e00ab3c665a7dc9d27562fd5290/regex-2024.11.6-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:4181b814e56078e9b00427ca358ec44333765f5ca1b45597ec7446d3a1ef6e34", size = 848592, upload-time = "2024-11-06T20:09:56.222Z" }, - { url = "https://files.pythonhosted.org/packages/1c/80/6dd7118e8cb212c3c60b191b932dc57db93fb2e36fb9e0e92f72a5909af9/regex-2024.11.6-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:068376da5a7e4da51968ce4c122a7cd31afaaec4fccc7856c92f63876e57b51d", size = 852929, upload-time = "2024-11-06T20:09:58.642Z" }, - { url = "https://files.pythonhosted.org/packages/11/9b/5a05d2040297d2d254baf95eeeb6df83554e5e1df03bc1a6687fc4ba1f66/regex-2024.11.6-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:ac10f2c4184420d881a3475fb2c6f4d95d53a8d50209a2500723d831036f7c45", size = 781213, upload-time = "2024-11-06T20:10:00.867Z" }, - { url = "https://files.pythonhosted.org/packages/26/b7/b14e2440156ab39e0177506c08c18accaf2b8932e39fb092074de733d868/regex-2024.11.6-cp311-cp311-win32.whl", hash = "sha256:c36f9b6f5f8649bb251a5f3f66564438977b7ef8386a52460ae77e6070d309d9", size = 261734, upload-time = "2024-11-06T20:10:03.361Z" }, - { url = "https://files.pythonhosted.org/packages/80/32/763a6cc01d21fb3819227a1cc3f60fd251c13c37c27a73b8ff4315433a8e/regex-2024.11.6-cp311-cp311-win_amd64.whl", hash = "sha256:02e28184be537f0e75c1f9b2f8847dc51e08e6e171c6bde130b2687e0c33cf60", size = 274052, upload-time = "2024-11-06T20:10:05.179Z" }, - { url = "https://files.pythonhosted.org/packages/ba/30/9a87ce8336b172cc232a0db89a3af97929d06c11ceaa19d97d84fa90a8f8/regex-2024.11.6-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:52fb28f528778f184f870b7cf8f225f5eef0a8f6e3778529bdd40c7b3920796a", size = 483781, upload-time = "2024-11-06T20:10:07.07Z" }, - { url = "https://files.pythonhosted.org/packages/01/e8/00008ad4ff4be8b1844786ba6636035f7ef926db5686e4c0f98093612add/regex-2024.11.6-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:fdd6028445d2460f33136c55eeb1f601ab06d74cb3347132e1c24250187500d9", size = 288455, upload-time = "2024-11-06T20:10:09.117Z" }, - { url = "https://files.pythonhosted.org/packages/60/85/cebcc0aff603ea0a201667b203f13ba75d9fc8668fab917ac5b2de3967bc/regex-2024.11.6-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:805e6b60c54bf766b251e94526ebad60b7de0c70f70a4e6210ee2891acb70bf2", size = 284759, upload-time = "2024-11-06T20:10:11.155Z" }, - { url = "https://files.pythonhosted.org/packages/94/2b/701a4b0585cb05472a4da28ee28fdfe155f3638f5e1ec92306d924e5faf0/regex-2024.11.6-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b85c2530be953a890eaffde05485238f07029600e8f098cdf1848d414a8b45e4", size = 794976, upload-time = "2024-11-06T20:10:13.24Z" }, - { url = "https://files.pythonhosted.org/packages/4b/bf/fa87e563bf5fee75db8915f7352e1887b1249126a1be4813837f5dbec965/regex-2024.11.6-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bb26437975da7dc36b7efad18aa9dd4ea569d2357ae6b783bf1118dabd9ea577", size = 833077, upload-time = "2024-11-06T20:10:15.37Z" }, - { url = "https://files.pythonhosted.org/packages/a1/56/7295e6bad94b047f4d0834e4779491b81216583c00c288252ef625c01d23/regex-2024.11.6-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:abfa5080c374a76a251ba60683242bc17eeb2c9818d0d30117b4486be10c59d3", size = 823160, upload-time = "2024-11-06T20:10:19.027Z" }, - { url = "https://files.pythonhosted.org/packages/fb/13/e3b075031a738c9598c51cfbc4c7879e26729c53aa9cca59211c44235314/regex-2024.11.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:70b7fa6606c2881c1db9479b0eaa11ed5dfa11c8d60a474ff0e095099f39d98e", size = 796896, upload-time = "2024-11-06T20:10:21.85Z" }, - { url = "https://files.pythonhosted.org/packages/24/56/0b3f1b66d592be6efec23a795b37732682520b47c53da5a32c33ed7d84e3/regex-2024.11.6-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0c32f75920cf99fe6b6c539c399a4a128452eaf1af27f39bce8909c9a3fd8cbe", size = 783997, upload-time = "2024-11-06T20:10:24.329Z" }, - { url = "https://files.pythonhosted.org/packages/f9/a1/eb378dada8b91c0e4c5f08ffb56f25fcae47bf52ad18f9b2f33b83e6d498/regex-2024.11.6-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:982e6d21414e78e1f51cf595d7f321dcd14de1f2881c5dc6a6e23bbbbd68435e", size = 781725, upload-time = "2024-11-06T20:10:28.067Z" }, - { url = "https://files.pythonhosted.org/packages/83/f2/033e7dec0cfd6dda93390089864732a3409246ffe8b042e9554afa9bff4e/regex-2024.11.6-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:a7c2155f790e2fb448faed6dd241386719802296ec588a8b9051c1f5c481bc29", size = 789481, upload-time = "2024-11-06T20:10:31.612Z" }, - { url = "https://files.pythonhosted.org/packages/83/23/15d4552ea28990a74e7696780c438aadd73a20318c47e527b47a4a5a596d/regex-2024.11.6-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:149f5008d286636e48cd0b1dd65018548944e495b0265b45e1bffecce1ef7f39", size = 852896, upload-time = "2024-11-06T20:10:34.054Z" }, - { url = "https://files.pythonhosted.org/packages/e3/39/ed4416bc90deedbfdada2568b2cb0bc1fdb98efe11f5378d9892b2a88f8f/regex-2024.11.6-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:e5364a4502efca094731680e80009632ad6624084aff9a23ce8c8c6820de3e51", size = 860138, upload-time = "2024-11-06T20:10:36.142Z" }, - { url = "https://files.pythonhosted.org/packages/93/2d/dd56bb76bd8e95bbce684326302f287455b56242a4f9c61f1bc76e28360e/regex-2024.11.6-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:0a86e7eeca091c09e021db8eb72d54751e527fa47b8d5787caf96d9831bd02ad", size = 787692, upload-time = "2024-11-06T20:10:38.394Z" }, - { url = "https://files.pythonhosted.org/packages/0b/55/31877a249ab7a5156758246b9c59539abbeba22461b7d8adc9e8475ff73e/regex-2024.11.6-cp312-cp312-win32.whl", hash = "sha256:32f9a4c643baad4efa81d549c2aadefaeba12249b2adc5af541759237eee1c54", size = 262135, upload-time = "2024-11-06T20:10:40.367Z" }, - { url = "https://files.pythonhosted.org/packages/38/ec/ad2d7de49a600cdb8dd78434a1aeffe28b9d6fc42eb36afab4a27ad23384/regex-2024.11.6-cp312-cp312-win_amd64.whl", hash = "sha256:a93c194e2df18f7d264092dc8539b8ffb86b45b899ab976aa15d48214138e81b", size = 273567, upload-time = "2024-11-06T20:10:43.467Z" }, - { url = "https://files.pythonhosted.org/packages/90/73/bcb0e36614601016552fa9344544a3a2ae1809dc1401b100eab02e772e1f/regex-2024.11.6-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:a6ba92c0bcdf96cbf43a12c717eae4bc98325ca3730f6b130ffa2e3c3c723d84", size = 483525, upload-time = "2024-11-06T20:10:45.19Z" }, - { url = "https://files.pythonhosted.org/packages/0f/3f/f1a082a46b31e25291d830b369b6b0c5576a6f7fb89d3053a354c24b8a83/regex-2024.11.6-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:525eab0b789891ac3be914d36893bdf972d483fe66551f79d3e27146191a37d4", size = 288324, upload-time = "2024-11-06T20:10:47.177Z" }, - { url = "https://files.pythonhosted.org/packages/09/c9/4e68181a4a652fb3ef5099e077faf4fd2a694ea6e0f806a7737aff9e758a/regex-2024.11.6-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:086a27a0b4ca227941700e0b31425e7a28ef1ae8e5e05a33826e17e47fbfdba0", size = 284617, upload-time = "2024-11-06T20:10:49.312Z" }, - { url = "https://files.pythonhosted.org/packages/fc/fd/37868b75eaf63843165f1d2122ca6cb94bfc0271e4428cf58c0616786dce/regex-2024.11.6-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bde01f35767c4a7899b7eb6e823b125a64de314a8ee9791367c9a34d56af18d0", size = 795023, upload-time = "2024-11-06T20:10:51.102Z" }, - { url = "https://files.pythonhosted.org/packages/c4/7c/d4cd9c528502a3dedb5c13c146e7a7a539a3853dc20209c8e75d9ba9d1b2/regex-2024.11.6-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b583904576650166b3d920d2bcce13971f6f9e9a396c673187f49811b2769dc7", size = 833072, upload-time = "2024-11-06T20:10:52.926Z" }, - { url = "https://files.pythonhosted.org/packages/4f/db/46f563a08f969159c5a0f0e722260568425363bea43bb7ae370becb66a67/regex-2024.11.6-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1c4de13f06a0d54fa0d5ab1b7138bfa0d883220965a29616e3ea61b35d5f5fc7", size = 823130, upload-time = "2024-11-06T20:10:54.828Z" }, - { url = "https://files.pythonhosted.org/packages/db/60/1eeca2074f5b87df394fccaa432ae3fc06c9c9bfa97c5051aed70e6e00c2/regex-2024.11.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3cde6e9f2580eb1665965ce9bf17ff4952f34f5b126beb509fee8f4e994f143c", size = 796857, upload-time = "2024-11-06T20:10:56.634Z" }, - { url = "https://files.pythonhosted.org/packages/10/db/ac718a08fcee981554d2f7bb8402f1faa7e868c1345c16ab1ebec54b0d7b/regex-2024.11.6-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0d7f453dca13f40a02b79636a339c5b62b670141e63efd511d3f8f73fba162b3", size = 784006, upload-time = "2024-11-06T20:10:59.369Z" }, - { url = "https://files.pythonhosted.org/packages/c2/41/7da3fe70216cea93144bf12da2b87367590bcf07db97604edeea55dac9ad/regex-2024.11.6-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:59dfe1ed21aea057a65c6b586afd2a945de04fc7db3de0a6e3ed5397ad491b07", size = 781650, upload-time = "2024-11-06T20:11:02.042Z" }, - { url = "https://files.pythonhosted.org/packages/a7/d5/880921ee4eec393a4752e6ab9f0fe28009435417c3102fc413f3fe81c4e5/regex-2024.11.6-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:b97c1e0bd37c5cd7902e65f410779d39eeda155800b65fc4d04cc432efa9bc6e", size = 789545, upload-time = "2024-11-06T20:11:03.933Z" }, - { url = "https://files.pythonhosted.org/packages/dc/96/53770115e507081122beca8899ab7f5ae28ae790bfcc82b5e38976df6a77/regex-2024.11.6-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:f9d1e379028e0fc2ae3654bac3cbbef81bf3fd571272a42d56c24007979bafb6", size = 853045, upload-time = "2024-11-06T20:11:06.497Z" }, - { url = "https://files.pythonhosted.org/packages/31/d3/1372add5251cc2d44b451bd94f43b2ec78e15a6e82bff6a290ef9fd8f00a/regex-2024.11.6-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:13291b39131e2d002a7940fb176e120bec5145f3aeb7621be6534e46251912c4", size = 860182, upload-time = "2024-11-06T20:11:09.06Z" }, - { url = "https://files.pythonhosted.org/packages/ed/e3/c446a64984ea9f69982ba1a69d4658d5014bc7a0ea468a07e1a1265db6e2/regex-2024.11.6-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4f51f88c126370dcec4908576c5a627220da6c09d0bff31cfa89f2523843316d", size = 787733, upload-time = "2024-11-06T20:11:11.256Z" }, - { url = "https://files.pythonhosted.org/packages/2b/f1/e40c8373e3480e4f29f2692bd21b3e05f296d3afebc7e5dcf21b9756ca1c/regex-2024.11.6-cp313-cp313-win32.whl", hash = "sha256:63b13cfd72e9601125027202cad74995ab26921d8cd935c25f09c630436348ff", size = 262122, upload-time = "2024-11-06T20:11:13.161Z" }, - { url = "https://files.pythonhosted.org/packages/45/94/bc295babb3062a731f52621cdc992d123111282e291abaf23faa413443ea/regex-2024.11.6-cp313-cp313-win_amd64.whl", hash = "sha256:2b3361af3198667e99927da8b84c1b010752fa4b1115ee30beaa332cabc3ef1a", size = 273545, upload-time = "2024-11-06T20:11:15Z" }, - { url = "https://files.pythonhosted.org/packages/89/23/c4a86df398e57e26f93b13ae63acce58771e04bdde86092502496fa57f9c/regex-2024.11.6-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:5704e174f8ccab2026bd2f1ab6c510345ae8eac818b613d7d73e785f1310f839", size = 482682, upload-time = "2024-11-06T20:11:52.65Z" }, - { url = "https://files.pythonhosted.org/packages/3c/8b/45c24ab7a51a1658441b961b86209c43e6bb9d39caf1e63f46ce6ea03bc7/regex-2024.11.6-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:220902c3c5cc6af55d4fe19ead504de80eb91f786dc102fbd74894b1551f095e", size = 287679, upload-time = "2024-11-06T20:11:55.011Z" }, - { url = "https://files.pythonhosted.org/packages/7a/d1/598de10b17fdafc452d11f7dada11c3be4e379a8671393e4e3da3c4070df/regex-2024.11.6-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:5e7e351589da0850c125f1600a4c4ba3c722efefe16b297de54300f08d734fbf", size = 284578, upload-time = "2024-11-06T20:11:57.033Z" }, - { url = "https://files.pythonhosted.org/packages/49/70/c7eaa219efa67a215846766fde18d92d54cb590b6a04ffe43cef30057622/regex-2024.11.6-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5056b185ca113c88e18223183aa1a50e66507769c9640a6ff75859619d73957b", size = 782012, upload-time = "2024-11-06T20:11:59.218Z" }, - { url = "https://files.pythonhosted.org/packages/89/e5/ef52c7eb117dd20ff1697968219971d052138965a4d3d9b95e92e549f505/regex-2024.11.6-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2e34b51b650b23ed3354b5a07aab37034d9f923db2a40519139af34f485f77d0", size = 820580, upload-time = "2024-11-06T20:12:01.969Z" }, - { url = "https://files.pythonhosted.org/packages/5f/3f/9f5da81aff1d4167ac52711acf789df13e789fe6ac9545552e49138e3282/regex-2024.11.6-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5670bce7b200273eee1840ef307bfa07cda90b38ae56e9a6ebcc9f50da9c469b", size = 809110, upload-time = "2024-11-06T20:12:04.786Z" }, - { url = "https://files.pythonhosted.org/packages/86/44/2101cc0890c3621b90365c9ee8d7291a597c0722ad66eccd6ffa7f1bcc09/regex-2024.11.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:08986dce1339bc932923e7d1232ce9881499a0e02925f7402fb7c982515419ef", size = 780919, upload-time = "2024-11-06T20:12:06.944Z" }, - { url = "https://files.pythonhosted.org/packages/ce/2e/3e0668d8d1c7c3c0d397bf54d92fc182575b3a26939aed5000d3cc78760f/regex-2024.11.6-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:93c0b12d3d3bc25af4ebbf38f9ee780a487e8bf6954c115b9f015822d3bb8e48", size = 771515, upload-time = "2024-11-06T20:12:09.9Z" }, - { url = "https://files.pythonhosted.org/packages/a6/49/1bc4584254355e3dba930a3a2fd7ad26ccba3ebbab7d9100db0aff2eedb0/regex-2024.11.6-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:764e71f22ab3b305e7f4c21f1a97e1526a25ebdd22513e251cf376760213da13", size = 696957, upload-time = "2024-11-06T20:12:12.319Z" }, - { url = "https://files.pythonhosted.org/packages/c8/dd/42879c1fc8a37a887cd08e358af3d3ba9e23038cd77c7fe044a86d9450ba/regex-2024.11.6-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:f056bf21105c2515c32372bbc057f43eb02aae2fda61052e2f7622c801f0b4e2", size = 768088, upload-time = "2024-11-06T20:12:15.149Z" }, - { url = "https://files.pythonhosted.org/packages/89/96/c05a0fe173cd2acd29d5e13c1adad8b706bcaa71b169e1ee57dcf2e74584/regex-2024.11.6-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:69ab78f848845569401469da20df3e081e6b5a11cb086de3eed1d48f5ed57c95", size = 774752, upload-time = "2024-11-06T20:12:17.416Z" }, - { url = "https://files.pythonhosted.org/packages/b5/f3/a757748066255f97f14506483436c5f6aded7af9e37bca04ec30c90ca683/regex-2024.11.6-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:86fddba590aad9208e2fa8b43b4c098bb0ec74f15718bb6a704e3c63e2cef3e9", size = 838862, upload-time = "2024-11-06T20:12:19.639Z" }, - { url = "https://files.pythonhosted.org/packages/5c/93/c6d2092fd479dcaeea40fc8fa673822829181ded77d294a7f950f1dda6e2/regex-2024.11.6-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:684d7a212682996d21ca12ef3c17353c021fe9de6049e19ac8481ec35574a70f", size = 842622, upload-time = "2024-11-06T20:12:21.841Z" }, - { url = "https://files.pythonhosted.org/packages/ff/9c/daa99532c72f25051a90ef90e1413a8d54413a9e64614d9095b0c1c154d0/regex-2024.11.6-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:a03e02f48cd1abbd9f3b7e3586d97c8f7a9721c436f51a5245b3b9483044480b", size = 772713, upload-time = "2024-11-06T20:12:24.785Z" }, - { url = "https://files.pythonhosted.org/packages/13/5d/61a533ccb8c231b474ac8e3a7d70155b00dfc61af6cafdccd1947df6d735/regex-2024.11.6-cp39-cp39-win32.whl", hash = "sha256:41758407fc32d5c3c5de163888068cfee69cb4c2be844e7ac517a52770f9af57", size = 261756, upload-time = "2024-11-06T20:12:26.975Z" }, - { url = "https://files.pythonhosted.org/packages/dc/7b/e59b7f7c91ae110d154370c24133f947262525b5d6406df65f23422acc17/regex-2024.11.6-cp39-cp39-win_amd64.whl", hash = "sha256:b2837718570f95dd41675328e111345f9b7095d821bac435aac173ac80b19983", size = 274110, upload-time = "2024-11-06T20:12:29.368Z" }, +version = "2025.7.34" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/0b/de/e13fa6dc61d78b30ba47481f99933a3b49a57779d625c392d8036770a60d/regex-2025.7.34.tar.gz", hash = "sha256:9ead9765217afd04a86822dfcd4ed2747dfe426e887da413b15ff0ac2457e21a", size = 400714, upload-time = "2025-07-31T00:21:16.262Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/50/d2/0a44a9d92370e5e105f16669acf801b215107efea9dea4317fe96e9aad67/regex-2025.7.34-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:d856164d25e2b3b07b779bfed813eb4b6b6ce73c2fd818d46f47c1eb5cd79bd6", size = 484591, upload-time = "2025-07-31T00:18:46.675Z" }, + { url = "https://files.pythonhosted.org/packages/2e/b1/00c4f83aa902f1048495de9f2f33638ce970ce1cf9447b477d272a0e22bb/regex-2025.7.34-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:2d15a9da5fad793e35fb7be74eec450d968e05d2e294f3e0e77ab03fa7234a83", size = 289293, upload-time = "2025-07-31T00:18:53.069Z" }, + { url = "https://files.pythonhosted.org/packages/f3/b0/5bc5c8ddc418e8be5530b43ae1f7c9303f43aeff5f40185c4287cf6732f2/regex-2025.7.34-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:95b4639c77d414efa93c8de14ce3f7965a94d007e068a94f9d4997bb9bd9c81f", size = 285932, upload-time = "2025-07-31T00:18:54.673Z" }, + { url = "https://files.pythonhosted.org/packages/46/c7/a1a28d050b23665a5e1eeb4d7f13b83ea86f0bc018da7b8f89f86ff7f094/regex-2025.7.34-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5d7de1ceed5a5f84f342ba4a9f4ae589524adf9744b2ee61b5da884b5b659834", size = 780361, upload-time = "2025-07-31T00:18:56.13Z" }, + { url = "https://files.pythonhosted.org/packages/cb/0d/82e7afe7b2c9fe3d488a6ab6145d1d97e55f822dfb9b4569aba2497e3d09/regex-2025.7.34-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:02e5860a250cd350c4933cf376c3bc9cb28948e2c96a8bc042aee7b985cfa26f", size = 849176, upload-time = "2025-07-31T00:18:57.483Z" }, + { url = "https://files.pythonhosted.org/packages/bf/16/3036e16903d8194f1490af457a7e33b06d9e9edd9576b1fe6c7ac660e9ed/regex-2025.7.34-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:0a5966220b9a1a88691282b7e4350e9599cf65780ca60d914a798cb791aa1177", size = 897222, upload-time = "2025-07-31T00:18:58.721Z" }, + { url = "https://files.pythonhosted.org/packages/5a/c2/010e089ae00d31418e7d2c6601760eea1957cde12be719730c7133b8c165/regex-2025.7.34-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:48fb045bbd4aab2418dc1ba2088a5e32de4bfe64e1457b948bb328a8dc2f1c2e", size = 789831, upload-time = "2025-07-31T00:19:00.436Z" }, + { url = "https://files.pythonhosted.org/packages/dd/86/b312b7bf5c46d21dbd9a3fdc4a80fde56ea93c9c0b89cf401879635e094d/regex-2025.7.34-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:20ff8433fa45e131f7316594efe24d4679c5449c0ca69d91c2f9d21846fdf064", size = 780665, upload-time = "2025-07-31T00:19:01.828Z" }, + { url = "https://files.pythonhosted.org/packages/40/e5/674b82bfff112c820b09e3c86a423d4a568143ede7f8440fdcbce259e895/regex-2025.7.34-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:c436fd1e95c04c19039668cfb548450a37c13f051e8659f40aed426e36b3765f", size = 773511, upload-time = "2025-07-31T00:19:03.654Z" }, + { url = "https://files.pythonhosted.org/packages/2d/18/39e7c578eb6cf1454db2b64e4733d7e4f179714867a75d84492ec44fa9b2/regex-2025.7.34-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:0b85241d3cfb9f8a13cefdfbd58a2843f208f2ed2c88181bf84e22e0c7fc066d", size = 843990, upload-time = "2025-07-31T00:19:05.61Z" }, + { url = "https://files.pythonhosted.org/packages/b6/d9/522a6715aefe2f463dc60c68924abeeb8ab6893f01adf5720359d94ede8c/regex-2025.7.34-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:075641c94126b064c65ab86e7e71fc3d63e7ff1bea1fb794f0773c97cdad3a03", size = 834676, upload-time = "2025-07-31T00:19:07.023Z" }, + { url = "https://files.pythonhosted.org/packages/59/53/c4d5284cb40543566542e24f1badc9f72af68d01db21e89e36e02292eee0/regex-2025.7.34-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:70645cad3407d103d1dbcb4841839d2946f7d36cf38acbd40120fee1682151e5", size = 778420, upload-time = "2025-07-31T00:19:08.511Z" }, + { url = "https://files.pythonhosted.org/packages/ea/4a/b779a7707d4a44a7e6ee9d0d98e40b2a4de74d622966080e9c95e25e2d24/regex-2025.7.34-cp310-cp310-win32.whl", hash = "sha256:3b836eb4a95526b263c2a3359308600bd95ce7848ebd3c29af0c37c4f9627cd3", size = 263999, upload-time = "2025-07-31T00:19:10.072Z" }, + { url = "https://files.pythonhosted.org/packages/ef/6e/33c7583f5427aa039c28bff7f4103c2de5b6aa5b9edc330c61ec576b1960/regex-2025.7.34-cp310-cp310-win_amd64.whl", hash = "sha256:cbfaa401d77334613cf434f723c7e8ba585df162be76474bccc53ae4e5520b3a", size = 276023, upload-time = "2025-07-31T00:19:11.34Z" }, + { url = "https://files.pythonhosted.org/packages/9f/fc/00b32e0ac14213d76d806d952826402b49fd06d42bfabacdf5d5d016bc47/regex-2025.7.34-cp310-cp310-win_arm64.whl", hash = "sha256:bca11d3c38a47c621769433c47f364b44e8043e0de8e482c5968b20ab90a3986", size = 268357, upload-time = "2025-07-31T00:19:12.729Z" }, + { url = "https://files.pythonhosted.org/packages/0d/85/f497b91577169472f7c1dc262a5ecc65e39e146fc3a52c571e5daaae4b7d/regex-2025.7.34-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:da304313761b8500b8e175eb2040c4394a875837d5635f6256d6fa0377ad32c8", size = 484594, upload-time = "2025-07-31T00:19:13.927Z" }, + { url = "https://files.pythonhosted.org/packages/1c/c5/ad2a5c11ce9e6257fcbfd6cd965d07502f6054aaa19d50a3d7fd991ec5d1/regex-2025.7.34-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:35e43ebf5b18cd751ea81455b19acfdec402e82fe0dc6143edfae4c5c4b3909a", size = 289294, upload-time = "2025-07-31T00:19:15.395Z" }, + { url = "https://files.pythonhosted.org/packages/8e/01/83ffd9641fcf5e018f9b51aa922c3e538ac9439424fda3df540b643ecf4f/regex-2025.7.34-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:96bbae4c616726f4661fe7bcad5952e10d25d3c51ddc388189d8864fbc1b3c68", size = 285933, upload-time = "2025-07-31T00:19:16.704Z" }, + { url = "https://files.pythonhosted.org/packages/77/20/5edab2e5766f0259bc1da7381b07ce6eb4401b17b2254d02f492cd8a81a8/regex-2025.7.34-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9feab78a1ffa4f2b1e27b1bcdaad36f48c2fed4870264ce32f52a393db093c78", size = 792335, upload-time = "2025-07-31T00:19:18.561Z" }, + { url = "https://files.pythonhosted.org/packages/30/bd/744d3ed8777dce8487b2606b94925e207e7c5931d5870f47f5b643a4580a/regex-2025.7.34-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f14b36e6d4d07f1a5060f28ef3b3561c5d95eb0651741474ce4c0a4c56ba8719", size = 858605, upload-time = "2025-07-31T00:19:20.204Z" }, + { url = "https://files.pythonhosted.org/packages/99/3d/93754176289718d7578c31d151047e7b8acc7a8c20e7706716f23c49e45e/regex-2025.7.34-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:85c3a958ef8b3d5079c763477e1f09e89d13ad22198a37e9d7b26b4b17438b33", size = 905780, upload-time = "2025-07-31T00:19:21.876Z" }, + { url = "https://files.pythonhosted.org/packages/ee/2e/c689f274a92deffa03999a430505ff2aeace408fd681a90eafa92fdd6930/regex-2025.7.34-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:37555e4ae0b93358fa7c2d240a4291d4a4227cc7c607d8f85596cdb08ec0a083", size = 798868, upload-time = "2025-07-31T00:19:23.222Z" }, + { url = "https://files.pythonhosted.org/packages/0d/9e/39673688805d139b33b4a24851a71b9978d61915c4d72b5ffda324d0668a/regex-2025.7.34-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:ee38926f31f1aa61b0232a3a11b83461f7807661c062df9eb88769d86e6195c3", size = 781784, upload-time = "2025-07-31T00:19:24.59Z" }, + { url = "https://files.pythonhosted.org/packages/18/bd/4c1cab12cfabe14beaa076523056b8ab0c882a8feaf0a6f48b0a75dab9ed/regex-2025.7.34-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:a664291c31cae9c4a30589bd8bc2ebb56ef880c9c6264cb7643633831e606a4d", size = 852837, upload-time = "2025-07-31T00:19:25.911Z" }, + { url = "https://files.pythonhosted.org/packages/cb/21/663d983cbb3bba537fc213a579abbd0f263fb28271c514123f3c547ab917/regex-2025.7.34-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:f3e5c1e0925e77ec46ddc736b756a6da50d4df4ee3f69536ffb2373460e2dafd", size = 844240, upload-time = "2025-07-31T00:19:27.688Z" }, + { url = "https://files.pythonhosted.org/packages/8e/2d/9beeeb913bc5d32faa913cf8c47e968da936af61ec20af5d269d0f84a100/regex-2025.7.34-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:d428fc7731dcbb4e2ffe43aeb8f90775ad155e7db4347a639768bc6cd2df881a", size = 787139, upload-time = "2025-07-31T00:19:29.475Z" }, + { url = "https://files.pythonhosted.org/packages/eb/f5/9b9384415fdc533551be2ba805dd8c4621873e5df69c958f403bfd3b2b6e/regex-2025.7.34-cp311-cp311-win32.whl", hash = "sha256:e154a7ee7fa18333ad90b20e16ef84daaeac61877c8ef942ec8dfa50dc38b7a1", size = 264019, upload-time = "2025-07-31T00:19:31.129Z" }, + { url = "https://files.pythonhosted.org/packages/18/9d/e069ed94debcf4cc9626d652a48040b079ce34c7e4fb174f16874958d485/regex-2025.7.34-cp311-cp311-win_amd64.whl", hash = "sha256:24257953d5c1d6d3c129ab03414c07fc1a47833c9165d49b954190b2b7f21a1a", size = 276047, upload-time = "2025-07-31T00:19:32.497Z" }, + { url = "https://files.pythonhosted.org/packages/fd/cf/3bafbe9d1fd1db77355e7fbbbf0d0cfb34501a8b8e334deca14f94c7b315/regex-2025.7.34-cp311-cp311-win_arm64.whl", hash = "sha256:3157aa512b9e606586900888cd469a444f9b898ecb7f8931996cb715f77477f0", size = 268362, upload-time = "2025-07-31T00:19:34.094Z" }, + { url = "https://files.pythonhosted.org/packages/ff/f0/31d62596c75a33f979317658e8d261574785c6cd8672c06741ce2e2e2070/regex-2025.7.34-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:7f7211a746aced993bef487de69307a38c5ddd79257d7be83f7b202cb59ddb50", size = 485492, upload-time = "2025-07-31T00:19:35.57Z" }, + { url = "https://files.pythonhosted.org/packages/d8/16/b818d223f1c9758c3434be89aa1a01aae798e0e0df36c1f143d1963dd1ee/regex-2025.7.34-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:fb31080f2bd0681484b275461b202b5ad182f52c9ec606052020fe13eb13a72f", size = 290000, upload-time = "2025-07-31T00:19:37.175Z" }, + { url = "https://files.pythonhosted.org/packages/cd/70/69506d53397b4bd6954061bae75677ad34deb7f6ca3ba199660d6f728ff5/regex-2025.7.34-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:0200a5150c4cf61e407038f4b4d5cdad13e86345dac29ff9dab3d75d905cf130", size = 286072, upload-time = "2025-07-31T00:19:38.612Z" }, + { url = "https://files.pythonhosted.org/packages/b0/73/536a216d5f66084fb577bb0543b5cb7de3272eb70a157f0c3a542f1c2551/regex-2025.7.34-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:739a74970e736df0773788377969c9fea3876c2fc13d0563f98e5503e5185f46", size = 797341, upload-time = "2025-07-31T00:19:40.119Z" }, + { url = "https://files.pythonhosted.org/packages/26/af/733f8168449e56e8f404bb807ea7189f59507cbea1b67a7bbcd92f8bf844/regex-2025.7.34-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:4fef81b2f7ea6a2029161ed6dea9ae13834c28eb5a95b8771828194a026621e4", size = 862556, upload-time = "2025-07-31T00:19:41.556Z" }, + { url = "https://files.pythonhosted.org/packages/19/dd/59c464d58c06c4f7d87de4ab1f590e430821345a40c5d345d449a636d15f/regex-2025.7.34-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:ea74cf81fe61a7e9d77989050d0089a927ab758c29dac4e8e1b6c06fccf3ebf0", size = 910762, upload-time = "2025-07-31T00:19:43Z" }, + { url = "https://files.pythonhosted.org/packages/37/a8/b05ccf33ceca0815a1e253693b2c86544932ebcc0049c16b0fbdf18b688b/regex-2025.7.34-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e4636a7f3b65a5f340ed9ddf53585c42e3ff37101d383ed321bfe5660481744b", size = 801892, upload-time = "2025-07-31T00:19:44.645Z" }, + { url = "https://files.pythonhosted.org/packages/5f/9a/b993cb2e634cc22810afd1652dba0cae156c40d4864285ff486c73cd1996/regex-2025.7.34-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:6cef962d7834437fe8d3da6f9bfc6f93f20f218266dcefec0560ed7765f5fe01", size = 786551, upload-time = "2025-07-31T00:19:46.127Z" }, + { url = "https://files.pythonhosted.org/packages/2d/79/7849d67910a0de4e26834b5bb816e028e35473f3d7ae563552ea04f58ca2/regex-2025.7.34-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:cbe1698e5b80298dbce8df4d8d1182279fbdaf1044e864cbc9d53c20e4a2be77", size = 856457, upload-time = "2025-07-31T00:19:47.562Z" }, + { url = "https://files.pythonhosted.org/packages/91/c6/de516bc082524b27e45cb4f54e28bd800c01efb26d15646a65b87b13a91e/regex-2025.7.34-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:32b9f9bcf0f605eb094b08e8da72e44badabb63dde6b83bd530580b488d1c6da", size = 848902, upload-time = "2025-07-31T00:19:49.312Z" }, + { url = "https://files.pythonhosted.org/packages/7d/22/519ff8ba15f732db099b126f039586bd372da6cd4efb810d5d66a5daeda1/regex-2025.7.34-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:524c868ba527eab4e8744a9287809579f54ae8c62fbf07d62aacd89f6026b282", size = 788038, upload-time = "2025-07-31T00:19:50.794Z" }, + { url = "https://files.pythonhosted.org/packages/3f/7d/aabb467d8f57d8149895d133c88eb809a1a6a0fe262c1d508eb9dfabb6f9/regex-2025.7.34-cp312-cp312-win32.whl", hash = "sha256:d600e58ee6d036081c89696d2bdd55d507498a7180df2e19945c6642fac59588", size = 264417, upload-time = "2025-07-31T00:19:52.292Z" }, + { url = "https://files.pythonhosted.org/packages/3b/39/bd922b55a4fc5ad5c13753274e5b536f5b06ec8eb9747675668491c7ab7a/regex-2025.7.34-cp312-cp312-win_amd64.whl", hash = "sha256:9a9ab52a466a9b4b91564437b36417b76033e8778e5af8f36be835d8cb370d62", size = 275387, upload-time = "2025-07-31T00:19:53.593Z" }, + { url = "https://files.pythonhosted.org/packages/f7/3c/c61d2fdcecb754a40475a3d1ef9a000911d3e3fc75c096acf44b0dfb786a/regex-2025.7.34-cp312-cp312-win_arm64.whl", hash = "sha256:c83aec91af9c6fbf7c743274fd952272403ad9a9db05fe9bfc9df8d12b45f176", size = 268482, upload-time = "2025-07-31T00:19:55.183Z" }, + { url = "https://files.pythonhosted.org/packages/15/16/b709b2119975035169a25aa8e4940ca177b1a2e25e14f8d996d09130368e/regex-2025.7.34-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:c3c9740a77aeef3f5e3aaab92403946a8d34437db930a0280e7e81ddcada61f5", size = 485334, upload-time = "2025-07-31T00:19:56.58Z" }, + { url = "https://files.pythonhosted.org/packages/94/a6/c09136046be0595f0331bc58a0e5f89c2d324cf734e0b0ec53cf4b12a636/regex-2025.7.34-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:69ed3bc611540f2ea70a4080f853741ec698be556b1df404599f8724690edbcd", size = 289942, upload-time = "2025-07-31T00:19:57.943Z" }, + { url = "https://files.pythonhosted.org/packages/36/91/08fc0fd0f40bdfb0e0df4134ee37cfb16e66a1044ac56d36911fd01c69d2/regex-2025.7.34-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:d03c6f9dcd562c56527c42b8530aad93193e0b3254a588be1f2ed378cdfdea1b", size = 285991, upload-time = "2025-07-31T00:19:59.837Z" }, + { url = "https://files.pythonhosted.org/packages/be/2f/99dc8f6f756606f0c214d14c7b6c17270b6bbe26d5c1f05cde9dbb1c551f/regex-2025.7.34-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6164b1d99dee1dfad33f301f174d8139d4368a9fb50bf0a3603b2eaf579963ad", size = 797415, upload-time = "2025-07-31T00:20:01.668Z" }, + { url = "https://files.pythonhosted.org/packages/62/cf/2fcdca1110495458ba4e95c52ce73b361cf1cafd8a53b5c31542cde9a15b/regex-2025.7.34-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:1e4f4f62599b8142362f164ce776f19d79bdd21273e86920a7b604a4275b4f59", size = 862487, upload-time = "2025-07-31T00:20:03.142Z" }, + { url = "https://files.pythonhosted.org/packages/90/38/899105dd27fed394e3fae45607c1983e138273ec167e47882fc401f112b9/regex-2025.7.34-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:72a26dcc6a59c057b292f39d41465d8233a10fd69121fa24f8f43ec6294e5415", size = 910717, upload-time = "2025-07-31T00:20:04.727Z" }, + { url = "https://files.pythonhosted.org/packages/ee/f6/4716198dbd0bcc9c45625ac4c81a435d1c4d8ad662e8576dac06bab35b17/regex-2025.7.34-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d5273fddf7a3e602695c92716c420c377599ed3c853ea669c1fe26218867002f", size = 801943, upload-time = "2025-07-31T00:20:07.1Z" }, + { url = "https://files.pythonhosted.org/packages/40/5d/cff8896d27e4e3dd11dd72ac78797c7987eb50fe4debc2c0f2f1682eb06d/regex-2025.7.34-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:c1844be23cd40135b3a5a4dd298e1e0c0cb36757364dd6cdc6025770363e06c1", size = 786664, upload-time = "2025-07-31T00:20:08.818Z" }, + { url = "https://files.pythonhosted.org/packages/10/29/758bf83cf7b4c34f07ac3423ea03cee3eb3176941641e4ccc05620f6c0b8/regex-2025.7.34-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:dde35e2afbbe2272f8abee3b9fe6772d9b5a07d82607b5788e8508974059925c", size = 856457, upload-time = "2025-07-31T00:20:10.328Z" }, + { url = "https://files.pythonhosted.org/packages/d7/30/c19d212b619963c5b460bfed0ea69a092c6a43cba52a973d46c27b3e2975/regex-2025.7.34-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:f3f6e8e7af516a7549412ce57613e859c3be27d55341a894aacaa11703a4c31a", size = 849008, upload-time = "2025-07-31T00:20:11.823Z" }, + { url = "https://files.pythonhosted.org/packages/9e/b8/3c35da3b12c87e3cc00010ef6c3a4ae787cff0bc381aa3d251def219969a/regex-2025.7.34-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:469142fb94a869beb25b5f18ea87646d21def10fbacb0bcb749224f3509476f0", size = 788101, upload-time = "2025-07-31T00:20:13.729Z" }, + { url = "https://files.pythonhosted.org/packages/47/80/2f46677c0b3c2b723b2c358d19f9346e714113865da0f5f736ca1a883bde/regex-2025.7.34-cp313-cp313-win32.whl", hash = "sha256:da7507d083ee33ccea1310447410c27ca11fb9ef18c95899ca57ff60a7e4d8f1", size = 264401, upload-time = "2025-07-31T00:20:15.233Z" }, + { url = "https://files.pythonhosted.org/packages/be/fa/917d64dd074682606a003cba33585c28138c77d848ef72fc77cbb1183849/regex-2025.7.34-cp313-cp313-win_amd64.whl", hash = "sha256:9d644de5520441e5f7e2db63aec2748948cc39ed4d7a87fd5db578ea4043d997", size = 275368, upload-time = "2025-07-31T00:20:16.711Z" }, + { url = "https://files.pythonhosted.org/packages/65/cd/f94383666704170a2154a5df7b16be28f0c27a266bffcd843e58bc84120f/regex-2025.7.34-cp313-cp313-win_arm64.whl", hash = "sha256:7bf1c5503a9f2cbd2f52d7e260acb3131b07b6273c470abb78568174fe6bde3f", size = 268482, upload-time = "2025-07-31T00:20:18.189Z" }, + { url = "https://files.pythonhosted.org/packages/ac/23/6376f3a23cf2f3c00514b1cdd8c990afb4dfbac3cb4a68b633c6b7e2e307/regex-2025.7.34-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:8283afe7042d8270cecf27cca558873168e771183d4d593e3c5fe5f12402212a", size = 485385, upload-time = "2025-07-31T00:20:19.692Z" }, + { url = "https://files.pythonhosted.org/packages/73/5b/6d4d3a0b4d312adbfd6d5694c8dddcf1396708976dd87e4d00af439d962b/regex-2025.7.34-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:6c053f9647e3421dd2f5dff8172eb7b4eec129df9d1d2f7133a4386319b47435", size = 289788, upload-time = "2025-07-31T00:20:21.941Z" }, + { url = "https://files.pythonhosted.org/packages/92/71/5862ac9913746e5054d01cb9fb8125b3d0802c0706ef547cae1e7f4428fa/regex-2025.7.34-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:a16dd56bbcb7d10e62861c3cd000290ddff28ea142ffb5eb3470f183628011ac", size = 286136, upload-time = "2025-07-31T00:20:26.146Z" }, + { url = "https://files.pythonhosted.org/packages/27/df/5b505dc447eb71278eba10d5ec940769ca89c1af70f0468bfbcb98035dc2/regex-2025.7.34-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:69c593ff5a24c0d5c1112b0df9b09eae42b33c014bdca7022d6523b210b69f72", size = 797753, upload-time = "2025-07-31T00:20:27.919Z" }, + { url = "https://files.pythonhosted.org/packages/86/38/3e3dc953d13998fa047e9a2414b556201dbd7147034fbac129392363253b/regex-2025.7.34-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:98d0ce170fcde1a03b5df19c5650db22ab58af375aaa6ff07978a85c9f250f0e", size = 863263, upload-time = "2025-07-31T00:20:29.803Z" }, + { url = "https://files.pythonhosted.org/packages/68/e5/3ff66b29dde12f5b874dda2d9dec7245c2051f2528d8c2a797901497f140/regex-2025.7.34-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d72765a4bff8c43711d5b0f5b452991a9947853dfa471972169b3cc0ba1d0751", size = 910103, upload-time = "2025-07-31T00:20:31.313Z" }, + { url = "https://files.pythonhosted.org/packages/9e/fe/14176f2182125977fba3711adea73f472a11f3f9288c1317c59cd16ad5e6/regex-2025.7.34-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4494f8fd95a77eb434039ad8460e64d57baa0434f1395b7da44015bef650d0e4", size = 801709, upload-time = "2025-07-31T00:20:33.323Z" }, + { url = "https://files.pythonhosted.org/packages/5a/0d/80d4e66ed24f1ba876a9e8e31b709f9fd22d5c266bf5f3ab3c1afe683d7d/regex-2025.7.34-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:4f42b522259c66e918a0121a12429b2abcf696c6f967fa37bdc7b72e61469f98", size = 786726, upload-time = "2025-07-31T00:20:35.252Z" }, + { url = "https://files.pythonhosted.org/packages/12/75/c3ebb30e04a56c046f5c85179dc173818551037daae2c0c940c7b19152cb/regex-2025.7.34-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:aaef1f056d96a0a5d53ad47d019d5b4c66fe4be2da87016e0d43b7242599ffc7", size = 857306, upload-time = "2025-07-31T00:20:37.12Z" }, + { url = "https://files.pythonhosted.org/packages/b1/b2/a4dc5d8b14f90924f27f0ac4c4c4f5e195b723be98adecc884f6716614b6/regex-2025.7.34-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:656433e5b7dccc9bc0da6312da8eb897b81f5e560321ec413500e5367fcd5d47", size = 848494, upload-time = "2025-07-31T00:20:38.818Z" }, + { url = "https://files.pythonhosted.org/packages/0d/21/9ac6e07a4c5e8646a90b56b61f7e9dac11ae0747c857f91d3d2bc7c241d9/regex-2025.7.34-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:e91eb2c62c39705e17b4d42d4b86c4e86c884c0d15d9c5a47d0835f8387add8e", size = 787850, upload-time = "2025-07-31T00:20:40.478Z" }, + { url = "https://files.pythonhosted.org/packages/be/6c/d51204e28e7bc54f9a03bb799b04730d7e54ff2718862b8d4e09e7110a6a/regex-2025.7.34-cp314-cp314-win32.whl", hash = "sha256:f978ddfb6216028c8f1d6b0f7ef779949498b64117fc35a939022f67f810bdcb", size = 269730, upload-time = "2025-07-31T00:20:42.253Z" }, + { url = "https://files.pythonhosted.org/packages/74/52/a7e92d02fa1fdef59d113098cb9f02c5d03289a0e9f9e5d4d6acccd10677/regex-2025.7.34-cp314-cp314-win_amd64.whl", hash = "sha256:4b7dc33b9b48fb37ead12ffc7bdb846ac72f99a80373c4da48f64b373a7abeae", size = 278640, upload-time = "2025-07-31T00:20:44.42Z" }, + { url = "https://files.pythonhosted.org/packages/d1/78/a815529b559b1771080faa90c3ab401730661f99d495ab0071649f139ebd/regex-2025.7.34-cp314-cp314-win_arm64.whl", hash = "sha256:4b8c4d39f451e64809912c82392933d80fe2e4a87eeef8859fcc5380d0173c64", size = 271757, upload-time = "2025-07-31T00:20:46.355Z" }, + { url = "https://files.pythonhosted.org/packages/d6/7f/8333b894499c1172c0378bb45a80146c420621e5c7b27a1d8fc5456f7038/regex-2025.7.34-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:fd5edc3f453de727af267c7909d083e19f6426fc9dd149e332b6034f2a5611e6", size = 484602, upload-time = "2025-07-31T00:20:48.184Z" }, + { url = "https://files.pythonhosted.org/packages/14/47/58aac4758b659df3835e73bda070f78ec6620a028484a1fcb81daf7443ec/regex-2025.7.34-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:fa1cdfb8db96ef20137de5587954c812821966c3e8b48ffc871e22d7ec0a4938", size = 289289, upload-time = "2025-07-31T00:20:49.79Z" }, + { url = "https://files.pythonhosted.org/packages/46/cc/5c9ebdc23b34458a41b559e0ae1b759196b2212920164b9d8aae4b25aa26/regex-2025.7.34-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:89c9504fc96268e8e74b0283e548f53a80c421182a2007e3365805b74ceef936", size = 285931, upload-time = "2025-07-31T00:20:51.362Z" }, + { url = "https://files.pythonhosted.org/packages/9a/da/467a851615b040d3be478ef60fd2d54e7e2f44eeda65dc02866ad4e404df/regex-2025.7.34-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:33be70d75fa05a904ee0dc43b650844e067d14c849df7e82ad673541cd465b5f", size = 779782, upload-time = "2025-07-31T00:20:52.997Z" }, + { url = "https://files.pythonhosted.org/packages/a0/47/6eab7100b7ded84e94312c6791ab72581950b7adaa5ad48cdd3dfa329ab8/regex-2025.7.34-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:57d25b6732ea93eeb1d090e8399b6235ca84a651b52d52d272ed37d3d2efa0f1", size = 848838, upload-time = "2025-07-31T00:20:54.991Z" }, + { url = "https://files.pythonhosted.org/packages/17/86/3b07305698e7ff21cc472efae816a56e77c5d45c6b7fe250a56dd67a114e/regex-2025.7.34-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:baf2fe122a3db1c0b9f161aa44463d8f7e33eeeda47bb0309923deb743a18276", size = 896648, upload-time = "2025-07-31T00:20:56.655Z" }, + { url = "https://files.pythonhosted.org/packages/ed/9a/c8f4f0535bf953e34e068c9a30c946e7affa06a48c48c1eda6d3a7562c49/regex-2025.7.34-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1a764a83128af9c1a54be81485b34dca488cbcacefe1e1d543ef11fbace191e1", size = 789367, upload-time = "2025-07-31T00:20:58.359Z" }, + { url = "https://files.pythonhosted.org/packages/c1/4e/1892685a0e053d376fbcb8aa618e38afc5882bd69d94e9712171b9f2a412/regex-2025.7.34-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:c7f663ccc4093877f55b51477522abd7299a14c5bb7626c5238599db6a0cb95d", size = 780029, upload-time = "2025-07-31T00:21:00.383Z" }, + { url = "https://files.pythonhosted.org/packages/98/12/af86906b9342d37b051b076a3ccc925c4f33ff2a96328b3009e7b93dfc53/regex-2025.7.34-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:4913f52fbc7a744aaebf53acd8d3dc1b519e46ba481d4d7596de3c862e011ada", size = 773039, upload-time = "2025-07-31T00:21:02.093Z" }, + { url = "https://files.pythonhosted.org/packages/97/d1/03c21fb12daf73819f39927b533d09f162e8e452bd415993607242c1cd68/regex-2025.7.34-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:efac4db9e044d47fd3b6b0d40b6708f4dfa2d8131a5ac1d604064147c0f552fd", size = 843438, upload-time = "2025-07-31T00:21:04.248Z" }, + { url = "https://files.pythonhosted.org/packages/c6/7f/53569415d23dc47122c9f669db5d1e7aa2bd8954723e5c1050548cb7622e/regex-2025.7.34-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:7373afae7cfb716e3b8e15d0184510d518f9d21471f2d62918dbece85f2c588f", size = 834053, upload-time = "2025-07-31T00:21:06.298Z" }, + { url = "https://files.pythonhosted.org/packages/7a/7a/9b6b75778f7af6306ad9dcd9860be3f9c4123385cc856b6e9d099a6403b2/regex-2025.7.34-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:9960d162f3fecf6af252534a1ae337e9c2e20d74469fed782903b24e2cc9d3d7", size = 777909, upload-time = "2025-07-31T00:21:08.302Z" }, + { url = "https://files.pythonhosted.org/packages/54/34/ebdf85bef946c63dc7995e95710364de0e3e2791bc28afc1a9642373d6c1/regex-2025.7.34-cp39-cp39-win32.whl", hash = "sha256:95d538b10eb4621350a54bf14600cc80b514211d91a019dc74b8e23d2159ace5", size = 264039, upload-time = "2025-07-31T00:21:10.346Z" }, + { url = "https://files.pythonhosted.org/packages/82/0b/fba6f0dee661b838c09c85bf598a43a915d310648d62f704ece237aa3d73/regex-2025.7.34-cp39-cp39-win_amd64.whl", hash = "sha256:f7f3071b5faa605b0ea51ec4bb3ea7257277446b053f4fd3ad02b1dcb4e64353", size = 276120, upload-time = "2025-07-31T00:21:12.321Z" }, + { url = "https://files.pythonhosted.org/packages/d5/6d/183f0cf19bd8ac7628f4c3b2ca99033a5ad417ad010f86c61d11d27b4968/regex-2025.7.34-cp39-cp39-win_arm64.whl", hash = "sha256:716a47515ba1d03f8e8a61c5013041c8c90f2e21f055203498105d7571b44531", size = 268390, upload-time = "2025-07-31T00:21:14.293Z" }, ] [[package]] name = "requests" -version = "2.32.3" +version = "2.32.4" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "certifi" }, @@ -2285,9 +2762,9 @@ dependencies = [ { name = "idna" }, { name = "urllib3" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/63/70/2bf7780ad2d390a8d301ad0b550f1581eadbd9a20f896afe06353c2a2913/requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760", size = 131218, upload-time = "2024-05-29T15:37:49.536Z" } +sdist = { url = "https://files.pythonhosted.org/packages/e1/0a/929373653770d8a0d7ea76c37de6e41f11eb07559b103b1c02cafb3f7cf8/requests-2.32.4.tar.gz", hash = "sha256:27d0316682c8a29834d3264820024b62a36942083d52caf2f14c0591336d3422", size = 135258, upload-time = "2025-06-09T16:43:07.34Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/f9/9b/335f9764261e915ed497fcdeb11df5dfd6f7bf257d4a6a2a686d80da4d54/requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6", size = 64928, upload-time = "2024-05-29T15:37:47.027Z" }, + { url = "https://files.pythonhosted.org/packages/7c/e4/56027c4a6b4ae70ca9de302488c5ca95ad4a39e190093d6c1a8ace08341b/requests-2.32.4-py3-none-any.whl", hash = "sha256:27babd3cda2a6d50b30443204ee89830707d396671944c998b5975b031ac2b2c", size = 64847, upload-time = "2025-06-09T16:43:05.728Z" }, ] [[package]] @@ -2295,7 +2772,8 @@ name = "rich" version = "13.9.4" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "markdown-it-py" }, + { name = "markdown-it-py", version = "3.0.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" }, + { name = "markdown-it-py", version = "4.0.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10'" }, { name = "pygments" }, { name = "typing-extensions", marker = "python_full_version < '3.11'" }, ] @@ -2306,123 +2784,164 @@ wheels = [ [[package]] name = "rpds-py" -version = "0.24.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/0b/b3/52b213298a0ba7097c7ea96bee95e1947aa84cc816d48cebb539770cdf41/rpds_py-0.24.0.tar.gz", hash = "sha256:772cc1b2cd963e7e17e6cc55fe0371fb9c704d63e44cacec7b9b7f523b78919e", size = 26863, upload-time = "2025-03-26T14:56:01.518Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/6a/21/cbc43b220c9deb536b07fbd598c97d463bbb7afb788851891252fc920742/rpds_py-0.24.0-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:006f4342fe729a368c6df36578d7a348c7c716be1da0a1a0f86e3021f8e98724", size = 377531, upload-time = "2025-03-26T14:52:41.754Z" }, - { url = "https://files.pythonhosted.org/packages/42/15/cc4b09ef160483e49c3aab3b56f3d375eadf19c87c48718fb0147e86a446/rpds_py-0.24.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2d53747da70a4e4b17f559569d5f9506420966083a31c5fbd84e764461c4444b", size = 362273, upload-time = "2025-03-26T14:52:44.341Z" }, - { url = "https://files.pythonhosted.org/packages/8c/a2/67718a188a88dbd5138d959bed6efe1cc7413a4caa8283bd46477ed0d1ad/rpds_py-0.24.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8acd55bd5b071156bae57b555f5d33697998752673b9de554dd82f5b5352727", size = 388111, upload-time = "2025-03-26T14:52:46.944Z" }, - { url = "https://files.pythonhosted.org/packages/e5/e6/cbf1d3163405ad5f4a1a6d23f80245f2204d0c743b18525f34982dec7f4d/rpds_py-0.24.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7e80d375134ddb04231a53800503752093dbb65dad8dabacce2c84cccc78e964", size = 394447, upload-time = "2025-03-26T14:52:48.753Z" }, - { url = "https://files.pythonhosted.org/packages/21/bb/4fe220ccc8a549b38b9e9cec66212dc3385a82a5ee9e37b54411cce4c898/rpds_py-0.24.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:60748789e028d2a46fc1c70750454f83c6bdd0d05db50f5ae83e2db500b34da5", size = 448028, upload-time = "2025-03-26T14:52:50.757Z" }, - { url = "https://files.pythonhosted.org/packages/a5/41/d2d6e0fd774818c4cadb94185d30cf3768de1c2a9e0143fc8bc6ce59389e/rpds_py-0.24.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6e1daf5bf6c2be39654beae83ee6b9a12347cb5aced9a29eecf12a2d25fff664", size = 447410, upload-time = "2025-03-26T14:52:52.292Z" }, - { url = "https://files.pythonhosted.org/packages/a7/a7/6d04d438f53d8bb2356bb000bea9cf5c96a9315e405b577117e344cc7404/rpds_py-0.24.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1b221c2457d92a1fb3c97bee9095c874144d196f47c038462ae6e4a14436f7bc", size = 389531, upload-time = "2025-03-26T14:52:54.233Z" }, - { url = "https://files.pythonhosted.org/packages/23/be/72e6df39bd7ca5a66799762bf54d8e702483fdad246585af96723109d486/rpds_py-0.24.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:66420986c9afff67ef0c5d1e4cdc2d0e5262f53ad11e4f90e5e22448df485bf0", size = 420099, upload-time = "2025-03-26T14:52:56.135Z" }, - { url = "https://files.pythonhosted.org/packages/8c/c9/ca100cd4688ee0aa266197a5cb9f685231676dd7d573041ca53787b23f4e/rpds_py-0.24.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:43dba99f00f1d37b2a0265a259592d05fcc8e7c19d140fe51c6e6f16faabeb1f", size = 564950, upload-time = "2025-03-26T14:52:57.583Z" }, - { url = "https://files.pythonhosted.org/packages/05/98/908cd95686d33b3ac8ac2e582d7ae38e2c3aa2c0377bf1f5663bafd1ffb2/rpds_py-0.24.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:a88c0d17d039333a41d9bf4616bd062f0bd7aa0edeb6cafe00a2fc2a804e944f", size = 591778, upload-time = "2025-03-26T14:52:59.518Z" }, - { url = "https://files.pythonhosted.org/packages/7b/ac/e143726f1dd3215efcb974b50b03bd08a8a1556b404a0a7872af6d197e57/rpds_py-0.24.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:cc31e13ce212e14a539d430428cd365e74f8b2d534f8bc22dd4c9c55b277b875", size = 560421, upload-time = "2025-03-26T14:53:01.422Z" }, - { url = "https://files.pythonhosted.org/packages/60/28/add1c1d2fcd5aa354f7225d036d4492261759a22d449cff14841ef36a514/rpds_py-0.24.0-cp310-cp310-win32.whl", hash = "sha256:fc2c1e1b00f88317d9de6b2c2b39b012ebbfe35fe5e7bef980fd2a91f6100a07", size = 222089, upload-time = "2025-03-26T14:53:02.859Z" }, - { url = "https://files.pythonhosted.org/packages/b0/ac/81f8066c6de44c507caca488ba336ae30d35d57f61fe10578824d1a70196/rpds_py-0.24.0-cp310-cp310-win_amd64.whl", hash = "sha256:c0145295ca415668420ad142ee42189f78d27af806fcf1f32a18e51d47dd2052", size = 234622, upload-time = "2025-03-26T14:53:04.676Z" }, - { url = "https://files.pythonhosted.org/packages/80/e6/c1458bbfb257448fdb2528071f1f4e19e26798ed5ef6d47d7aab0cb69661/rpds_py-0.24.0-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:2d3ee4615df36ab8eb16c2507b11e764dcc11fd350bbf4da16d09cda11fcedef", size = 377679, upload-time = "2025-03-26T14:53:06.557Z" }, - { url = "https://files.pythonhosted.org/packages/dd/26/ea4181ef78f58b2c167548c6a833d7dc22408e5b3b181bda9dda440bb92d/rpds_py-0.24.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e13ae74a8a3a0c2f22f450f773e35f893484fcfacb00bb4344a7e0f4f48e1f97", size = 362571, upload-time = "2025-03-26T14:53:08.439Z" }, - { url = "https://files.pythonhosted.org/packages/56/fa/1ec54dd492c64c280a2249a047fc3369e2789dc474eac20445ebfc72934b/rpds_py-0.24.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cf86f72d705fc2ef776bb7dd9e5fbba79d7e1f3e258bf9377f8204ad0fc1c51e", size = 388012, upload-time = "2025-03-26T14:53:10.314Z" }, - { url = "https://files.pythonhosted.org/packages/3a/be/bad8b0e0f7e58ef4973bb75e91c472a7d51da1977ed43b09989264bf065c/rpds_py-0.24.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c43583ea8517ed2e780a345dd9960896afc1327e8cf3ac8239c167530397440d", size = 394730, upload-time = "2025-03-26T14:53:11.953Z" }, - { url = "https://files.pythonhosted.org/packages/35/56/ab417fc90c21826df048fc16e55316ac40876e4b790104ececcbce813d8f/rpds_py-0.24.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4cd031e63bc5f05bdcda120646a0d32f6d729486d0067f09d79c8db5368f4586", size = 448264, upload-time = "2025-03-26T14:53:13.42Z" }, - { url = "https://files.pythonhosted.org/packages/b6/75/4c63862d5c05408589196c8440a35a14ea4ae337fa70ded1f03638373f06/rpds_py-0.24.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:34d90ad8c045df9a4259c47d2e16a3f21fdb396665c94520dbfe8766e62187a4", size = 446813, upload-time = "2025-03-26T14:53:15.036Z" }, - { url = "https://files.pythonhosted.org/packages/e7/0c/91cf17dffa9a38835869797a9f041056091ebba6a53963d3641207e3d467/rpds_py-0.24.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e838bf2bb0b91ee67bf2b889a1a841e5ecac06dd7a2b1ef4e6151e2ce155c7ae", size = 389438, upload-time = "2025-03-26T14:53:17.037Z" }, - { url = "https://files.pythonhosted.org/packages/1b/b0/60e6c72727c978276e02851819f3986bc40668f115be72c1bc4d922c950f/rpds_py-0.24.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:04ecf5c1ff4d589987b4d9882872f80ba13da7d42427234fce8f22efb43133bc", size = 420416, upload-time = "2025-03-26T14:53:18.671Z" }, - { url = "https://files.pythonhosted.org/packages/a1/d7/f46f85b9f863fb59fd3c534b5c874c48bee86b19e93423b9da8784605415/rpds_py-0.24.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:630d3d8ea77eabd6cbcd2ea712e1c5cecb5b558d39547ac988351195db433f6c", size = 565236, upload-time = "2025-03-26T14:53:20.357Z" }, - { url = "https://files.pythonhosted.org/packages/2a/d1/1467620ded6dd70afc45ec822cdf8dfe7139537780d1f3905de143deb6fd/rpds_py-0.24.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:ebcb786b9ff30b994d5969213a8430cbb984cdd7ea9fd6df06663194bd3c450c", size = 592016, upload-time = "2025-03-26T14:53:22.216Z" }, - { url = "https://files.pythonhosted.org/packages/5d/13/fb1ded2e6adfaa0c0833106c42feb290973f665300f4facd5bf5d7891d9c/rpds_py-0.24.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:174e46569968ddbbeb8a806d9922f17cd2b524aa753b468f35b97ff9c19cb718", size = 560123, upload-time = "2025-03-26T14:53:23.733Z" }, - { url = "https://files.pythonhosted.org/packages/1e/df/09fc1857ac7cc2eb16465a7199c314cbce7edde53c8ef21d615410d7335b/rpds_py-0.24.0-cp311-cp311-win32.whl", hash = "sha256:5ef877fa3bbfb40b388a5ae1cb00636a624690dcb9a29a65267054c9ea86d88a", size = 222256, upload-time = "2025-03-26T14:53:25.217Z" }, - { url = "https://files.pythonhosted.org/packages/ff/25/939b40bc4d54bf910e5ee60fb5af99262c92458f4948239e8c06b0b750e7/rpds_py-0.24.0-cp311-cp311-win_amd64.whl", hash = "sha256:e274f62cbd274359eff63e5c7e7274c913e8e09620f6a57aae66744b3df046d6", size = 234718, upload-time = "2025-03-26T14:53:26.631Z" }, - { url = "https://files.pythonhosted.org/packages/1a/e0/1c55f4a3be5f1ca1a4fd1f3ff1504a1478c1ed48d84de24574c4fa87e921/rpds_py-0.24.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:d8551e733626afec514b5d15befabea0dd70a343a9f23322860c4f16a9430205", size = 366945, upload-time = "2025-03-26T14:53:28.149Z" }, - { url = "https://files.pythonhosted.org/packages/39/1b/a3501574fbf29118164314dbc800d568b8c1c7b3258b505360e8abb3902c/rpds_py-0.24.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:0e374c0ce0ca82e5b67cd61fb964077d40ec177dd2c4eda67dba130de09085c7", size = 351935, upload-time = "2025-03-26T14:53:29.684Z" }, - { url = "https://files.pythonhosted.org/packages/dc/47/77d3d71c55f6a374edde29f1aca0b2e547325ed00a9da820cabbc9497d2b/rpds_py-0.24.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d69d003296df4840bd445a5d15fa5b6ff6ac40496f956a221c4d1f6f7b4bc4d9", size = 390817, upload-time = "2025-03-26T14:53:31.177Z" }, - { url = "https://files.pythonhosted.org/packages/4e/ec/1e336ee27484379e19c7f9cc170f4217c608aee406d3ae3a2e45336bff36/rpds_py-0.24.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8212ff58ac6dfde49946bea57474a386cca3f7706fc72c25b772b9ca4af6b79e", size = 401983, upload-time = "2025-03-26T14:53:33.163Z" }, - { url = "https://files.pythonhosted.org/packages/07/f8/39b65cbc272c635eaea6d393c2ad1ccc81c39eca2db6723a0ca4b2108fce/rpds_py-0.24.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:528927e63a70b4d5f3f5ccc1fa988a35456eb5d15f804d276709c33fc2f19bda", size = 451719, upload-time = "2025-03-26T14:53:34.721Z" }, - { url = "https://files.pythonhosted.org/packages/32/05/05c2b27dd9c30432f31738afed0300659cb9415db0ff7429b05dfb09bbde/rpds_py-0.24.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a824d2c7a703ba6daaca848f9c3d5cb93af0505be505de70e7e66829affd676e", size = 442546, upload-time = "2025-03-26T14:53:36.26Z" }, - { url = "https://files.pythonhosted.org/packages/7d/e0/19383c8b5d509bd741532a47821c3e96acf4543d0832beba41b4434bcc49/rpds_py-0.24.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:44d51febb7a114293ffd56c6cf4736cb31cd68c0fddd6aa303ed09ea5a48e029", size = 393695, upload-time = "2025-03-26T14:53:37.728Z" }, - { url = "https://files.pythonhosted.org/packages/9d/15/39f14e96d94981d0275715ae8ea564772237f3fa89bc3c21e24de934f2c7/rpds_py-0.24.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:3fab5f4a2c64a8fb64fc13b3d139848817a64d467dd6ed60dcdd6b479e7febc9", size = 427218, upload-time = "2025-03-26T14:53:39.326Z" }, - { url = "https://files.pythonhosted.org/packages/22/b9/12da7124905a680f690da7a9de6f11de770b5e359f5649972f7181c8bf51/rpds_py-0.24.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:9be4f99bee42ac107870c61dfdb294d912bf81c3c6d45538aad7aecab468b6b7", size = 568062, upload-time = "2025-03-26T14:53:40.885Z" }, - { url = "https://files.pythonhosted.org/packages/88/17/75229017a2143d915f6f803721a6d721eca24f2659c5718a538afa276b4f/rpds_py-0.24.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:564c96b6076a98215af52f55efa90d8419cc2ef45d99e314fddefe816bc24f91", size = 596262, upload-time = "2025-03-26T14:53:42.544Z" }, - { url = "https://files.pythonhosted.org/packages/aa/64/8e8a1d8bd1b6b638d6acb6d41ab2cec7f2067a5b8b4c9175703875159a7c/rpds_py-0.24.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:75a810b7664c17f24bf2ffd7f92416c00ec84b49bb68e6a0d93e542406336b56", size = 564306, upload-time = "2025-03-26T14:53:44.2Z" }, - { url = "https://files.pythonhosted.org/packages/68/1c/a7eac8d8ed8cb234a9b1064647824c387753343c3fab6ed7c83481ed0be7/rpds_py-0.24.0-cp312-cp312-win32.whl", hash = "sha256:f6016bd950be4dcd047b7475fdf55fb1e1f59fc7403f387be0e8123e4a576d30", size = 224281, upload-time = "2025-03-26T14:53:45.769Z" }, - { url = "https://files.pythonhosted.org/packages/bb/46/b8b5424d1d21f2f2f3f2d468660085318d4f74a8df8289e3dd6ad224d488/rpds_py-0.24.0-cp312-cp312-win_amd64.whl", hash = "sha256:998c01b8e71cf051c28f5d6f1187abbdf5cf45fc0efce5da6c06447cba997034", size = 239719, upload-time = "2025-03-26T14:53:47.187Z" }, - { url = "https://files.pythonhosted.org/packages/9d/c3/3607abc770395bc6d5a00cb66385a5479fb8cd7416ddef90393b17ef4340/rpds_py-0.24.0-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:3d2d8e4508e15fc05b31285c4b00ddf2e0eb94259c2dc896771966a163122a0c", size = 367072, upload-time = "2025-03-26T14:53:48.686Z" }, - { url = "https://files.pythonhosted.org/packages/d8/35/8c7ee0fe465793e3af3298dc5a9f3013bd63e7a69df04ccfded8293a4982/rpds_py-0.24.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:0f00c16e089282ad68a3820fd0c831c35d3194b7cdc31d6e469511d9bffc535c", size = 351919, upload-time = "2025-03-26T14:53:50.229Z" }, - { url = "https://files.pythonhosted.org/packages/91/d3/7e1b972501eb5466b9aca46a9c31bcbbdc3ea5a076e9ab33f4438c1d069d/rpds_py-0.24.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:951cc481c0c395c4a08639a469d53b7d4afa252529a085418b82a6b43c45c240", size = 390360, upload-time = "2025-03-26T14:53:51.909Z" }, - { url = "https://files.pythonhosted.org/packages/a2/a8/ccabb50d3c91c26ad01f9b09a6a3b03e4502ce51a33867c38446df9f896b/rpds_py-0.24.0-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c9ca89938dff18828a328af41ffdf3902405a19f4131c88e22e776a8e228c5a8", size = 400704, upload-time = "2025-03-26T14:53:53.47Z" }, - { url = "https://files.pythonhosted.org/packages/53/ae/5fa5bf0f3bc6ce21b5ea88fc0ecd3a439e7cb09dd5f9ffb3dbe1b6894fc5/rpds_py-0.24.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ed0ef550042a8dbcd657dfb284a8ee00f0ba269d3f2286b0493b15a5694f9fe8", size = 450839, upload-time = "2025-03-26T14:53:55.005Z" }, - { url = "https://files.pythonhosted.org/packages/e3/ac/c4e18b36d9938247e2b54f6a03746f3183ca20e1edd7d3654796867f5100/rpds_py-0.24.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2b2356688e5d958c4d5cb964af865bea84db29971d3e563fb78e46e20fe1848b", size = 441494, upload-time = "2025-03-26T14:53:57.047Z" }, - { url = "https://files.pythonhosted.org/packages/bf/08/b543969c12a8f44db6c0f08ced009abf8f519191ca6985509e7c44102e3c/rpds_py-0.24.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:78884d155fd15d9f64f5d6124b486f3d3f7fd7cd71a78e9670a0f6f6ca06fb2d", size = 393185, upload-time = "2025-03-26T14:53:59.032Z" }, - { url = "https://files.pythonhosted.org/packages/da/7e/f6eb6a7042ce708f9dfc781832a86063cea8a125bbe451d663697b51944f/rpds_py-0.24.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6a4a535013aeeef13c5532f802708cecae8d66c282babb5cd916379b72110cf7", size = 426168, upload-time = "2025-03-26T14:54:00.661Z" }, - { url = "https://files.pythonhosted.org/packages/38/b0/6cd2bb0509ac0b51af4bb138e145b7c4c902bb4b724d6fd143689d6e0383/rpds_py-0.24.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:84e0566f15cf4d769dade9b366b7b87c959be472c92dffb70462dd0844d7cbad", size = 567622, upload-time = "2025-03-26T14:54:02.312Z" }, - { url = "https://files.pythonhosted.org/packages/64/b0/c401f4f077547d98e8b4c2ec6526a80e7cb04f519d416430ec1421ee9e0b/rpds_py-0.24.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:823e74ab6fbaa028ec89615ff6acb409e90ff45580c45920d4dfdddb069f2120", size = 595435, upload-time = "2025-03-26T14:54:04.388Z" }, - { url = "https://files.pythonhosted.org/packages/9f/ec/7993b6e803294c87b61c85bd63e11142ccfb2373cf88a61ec602abcbf9d6/rpds_py-0.24.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:c61a2cb0085c8783906b2f8b1f16a7e65777823c7f4d0a6aaffe26dc0d358dd9", size = 563762, upload-time = "2025-03-26T14:54:06.422Z" }, - { url = "https://files.pythonhosted.org/packages/1f/29/4508003204cb2f461dc2b83dd85f8aa2b915bc98fe6046b9d50d4aa05401/rpds_py-0.24.0-cp313-cp313-win32.whl", hash = "sha256:60d9b630c8025b9458a9d114e3af579a2c54bd32df601c4581bd054e85258143", size = 223510, upload-time = "2025-03-26T14:54:08.344Z" }, - { url = "https://files.pythonhosted.org/packages/f9/12/09e048d1814195e01f354155fb772fb0854bd3450b5f5a82224b3a319f0e/rpds_py-0.24.0-cp313-cp313-win_amd64.whl", hash = "sha256:6eea559077d29486c68218178ea946263b87f1c41ae7f996b1f30a983c476a5a", size = 239075, upload-time = "2025-03-26T14:54:09.992Z" }, - { url = "https://files.pythonhosted.org/packages/d2/03/5027cde39bb2408d61e4dd0cf81f815949bb629932a6c8df1701d0257fc4/rpds_py-0.24.0-cp313-cp313t-macosx_10_12_x86_64.whl", hash = "sha256:d09dc82af2d3c17e7dd17120b202a79b578d79f2b5424bda209d9966efeed114", size = 362974, upload-time = "2025-03-26T14:54:11.484Z" }, - { url = "https://files.pythonhosted.org/packages/bf/10/24d374a2131b1ffafb783e436e770e42dfdb74b69a2cd25eba8c8b29d861/rpds_py-0.24.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:5fc13b44de6419d1e7a7e592a4885b323fbc2f46e1f22151e3a8ed3b8b920405", size = 348730, upload-time = "2025-03-26T14:54:13.145Z" }, - { url = "https://files.pythonhosted.org/packages/7a/d1/1ef88d0516d46cd8df12e5916966dbf716d5ec79b265eda56ba1b173398c/rpds_py-0.24.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c347a20d79cedc0a7bd51c4d4b7dbc613ca4e65a756b5c3e57ec84bd43505b47", size = 387627, upload-time = "2025-03-26T14:54:14.711Z" }, - { url = "https://files.pythonhosted.org/packages/4e/35/07339051b8b901ecefd449ebf8e5522e92bcb95e1078818cbfd9db8e573c/rpds_py-0.24.0-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:20f2712bd1cc26a3cc16c5a1bfee9ed1abc33d4cdf1aabd297fe0eb724df4272", size = 394094, upload-time = "2025-03-26T14:54:16.961Z" }, - { url = "https://files.pythonhosted.org/packages/dc/62/ee89ece19e0ba322b08734e95441952062391065c157bbd4f8802316b4f1/rpds_py-0.24.0-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:aad911555286884be1e427ef0dc0ba3929e6821cbeca2194b13dc415a462c7fd", size = 449639, upload-time = "2025-03-26T14:54:19.047Z" }, - { url = "https://files.pythonhosted.org/packages/15/24/b30e9f9e71baa0b9dada3a4ab43d567c6b04a36d1cb531045f7a8a0a7439/rpds_py-0.24.0-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0aeb3329c1721c43c58cae274d7d2ca85c1690d89485d9c63a006cb79a85771a", size = 438584, upload-time = "2025-03-26T14:54:20.722Z" }, - { url = "https://files.pythonhosted.org/packages/28/d9/49f7b8f3b4147db13961e19d5e30077cd0854ccc08487026d2cb2142aa4a/rpds_py-0.24.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2a0f156e9509cee987283abd2296ec816225145a13ed0391df8f71bf1d789e2d", size = 391047, upload-time = "2025-03-26T14:54:22.426Z" }, - { url = "https://files.pythonhosted.org/packages/49/b0/e66918d0972c33a259ba3cd7b7ff10ed8bd91dbcfcbec6367b21f026db75/rpds_py-0.24.0-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:aa6800adc8204ce898c8a424303969b7aa6a5e4ad2789c13f8648739830323b7", size = 418085, upload-time = "2025-03-26T14:54:23.949Z" }, - { url = "https://files.pythonhosted.org/packages/e1/6b/99ed7ea0a94c7ae5520a21be77a82306aac9e4e715d4435076ead07d05c6/rpds_py-0.24.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:a18fc371e900a21d7392517c6f60fe859e802547309e94313cd8181ad9db004d", size = 564498, upload-time = "2025-03-26T14:54:25.573Z" }, - { url = "https://files.pythonhosted.org/packages/28/26/1cacfee6b800e6fb5f91acecc2e52f17dbf8b0796a7c984b4568b6d70e38/rpds_py-0.24.0-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:9168764133fd919f8dcca2ead66de0105f4ef5659cbb4fa044f7014bed9a1797", size = 590202, upload-time = "2025-03-26T14:54:27.569Z" }, - { url = "https://files.pythonhosted.org/packages/a9/9e/57bd2f9fba04a37cef673f9a66b11ca8c43ccdd50d386c455cd4380fe461/rpds_py-0.24.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:5f6e3cec44ba05ee5cbdebe92d052f69b63ae792e7d05f1020ac5e964394080c", size = 561771, upload-time = "2025-03-26T14:54:29.615Z" }, - { url = "https://files.pythonhosted.org/packages/9f/cf/b719120f375ab970d1c297dbf8de1e3c9edd26fe92c0ed7178dd94b45992/rpds_py-0.24.0-cp313-cp313t-win32.whl", hash = "sha256:8ebc7e65ca4b111d928b669713865f021b7773350eeac4a31d3e70144297baba", size = 221195, upload-time = "2025-03-26T14:54:31.581Z" }, - { url = "https://files.pythonhosted.org/packages/2d/e5/22865285789f3412ad0c3d7ec4dc0a3e86483b794be8a5d9ed5a19390900/rpds_py-0.24.0-cp313-cp313t-win_amd64.whl", hash = "sha256:675269d407a257b8c00a6b58205b72eec8231656506c56fd429d924ca00bb350", size = 237354, upload-time = "2025-03-26T14:54:33.199Z" }, - { url = "https://files.pythonhosted.org/packages/22/ef/a194eaef0d0f2cd3f4c893c5b809a7458aaa7c0a64e60a45a72a04835ed4/rpds_py-0.24.0-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:a36b452abbf29f68527cf52e181fced56685731c86b52e852053e38d8b60bc8d", size = 378126, upload-time = "2025-03-26T14:54:35.094Z" }, - { url = "https://files.pythonhosted.org/packages/c3/8d/9a07f69933204c098760c884f03835ab8fb66e28d2d5f3dd6741720cf29c/rpds_py-0.24.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:8b3b397eefecec8e8e39fa65c630ef70a24b09141a6f9fc17b3c3a50bed6b50e", size = 362887, upload-time = "2025-03-26T14:54:36.781Z" }, - { url = "https://files.pythonhosted.org/packages/29/74/315f42060f2e3cedd77d382a98484a68ef727bd3b5fd7b91825b859a3e85/rpds_py-0.24.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cdabcd3beb2a6dca7027007473d8ef1c3b053347c76f685f5f060a00327b8b65", size = 388661, upload-time = "2025-03-26T14:54:38.323Z" }, - { url = "https://files.pythonhosted.org/packages/29/22/7ee7bb2b25ecdfcf1265d5a51472814fe60b580f9e1e2746eed9c476310a/rpds_py-0.24.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5db385bacd0c43f24be92b60c857cf760b7f10d8234f4bd4be67b5b20a7c0b6b", size = 394993, upload-time = "2025-03-26T14:54:39.924Z" }, - { url = "https://files.pythonhosted.org/packages/46/7b/5f40e278d81cd23eea6b88bbac62bacc27ed19412051a1fc4229e8f9367a/rpds_py-0.24.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8097b3422d020ff1c44effc40ae58e67d93e60d540a65649d2cdaf9466030791", size = 448706, upload-time = "2025-03-26T14:54:41.673Z" }, - { url = "https://files.pythonhosted.org/packages/5a/7a/06aada7ecdb0d02fbc041daee998ae841882fcc8ed3c0f84e72d6832fef1/rpds_py-0.24.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:493fe54318bed7d124ce272fc36adbf59d46729659b2c792e87c3b95649cdee9", size = 447369, upload-time = "2025-03-26T14:54:43.308Z" }, - { url = "https://files.pythonhosted.org/packages/c6/f3/428a9367077268f852db9b3b68b6eda6ee4594ab7dc2d603a2c370619cc0/rpds_py-0.24.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8aa362811ccdc1f8dadcc916c6d47e554169ab79559319ae9fae7d7752d0d60c", size = 390012, upload-time = "2025-03-26T14:54:45.109Z" }, - { url = "https://files.pythonhosted.org/packages/55/66/24b61f14cd54e525583404afe6e3c221b309d1abd4b0b597a566dd8ee42d/rpds_py-0.24.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d8f9a6e7fd5434817526815f09ea27f2746c4a51ee11bb3439065f5fc754db58", size = 421576, upload-time = "2025-03-26T14:54:47.125Z" }, - { url = "https://files.pythonhosted.org/packages/22/56/18b81a4f0550e0d4be700cdcf1415ebf250fd21f9a5a775843dd3588dbf6/rpds_py-0.24.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:8205ee14463248d3349131bb8099efe15cd3ce83b8ef3ace63c7e976998e7124", size = 565562, upload-time = "2025-03-26T14:54:48.785Z" }, - { url = "https://files.pythonhosted.org/packages/42/80/82a935d78f74974f82d38e83fb02430f8e8cc09ad35e06d9a5d2e9b907a7/rpds_py-0.24.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:921ae54f9ecba3b6325df425cf72c074cd469dea843fb5743a26ca7fb2ccb149", size = 592924, upload-time = "2025-03-26T14:54:50.493Z" }, - { url = "https://files.pythonhosted.org/packages/0d/49/b717e7b93c2ca881d2dac8b23b3a87a4c30f7c762bfd3df0b3953e655f13/rpds_py-0.24.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:32bab0a56eac685828e00cc2f5d1200c548f8bc11f2e44abf311d6b548ce2e45", size = 560847, upload-time = "2025-03-26T14:54:52.238Z" }, - { url = "https://files.pythonhosted.org/packages/1e/26/ba630a291238e7f42d25bc5569d152623f18c21e9183e506585b23325c48/rpds_py-0.24.0-cp39-cp39-win32.whl", hash = "sha256:f5c0ed12926dec1dfe7d645333ea59cf93f4d07750986a586f511c0bc61fe103", size = 222570, upload-time = "2025-03-26T14:54:54.713Z" }, - { url = "https://files.pythonhosted.org/packages/2d/84/01126e25e21f2ed6e63ec4030f78793dfee1a21aff1842136353c9caaed9/rpds_py-0.24.0-cp39-cp39-win_amd64.whl", hash = "sha256:afc6e35f344490faa8276b5f2f7cbf71f88bc2cda4328e00553bd451728c571f", size = 234931, upload-time = "2025-03-26T14:54:56.754Z" }, - { url = "https://files.pythonhosted.org/packages/99/48/11dae46d0c7f7e156ca0971a83f89c510af0316cd5d42c771b7cef945f0c/rpds_py-0.24.0-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:619ca56a5468f933d940e1bf431c6f4e13bef8e688698b067ae68eb4f9b30e3a", size = 378224, upload-time = "2025-03-26T14:54:58.78Z" }, - { url = "https://files.pythonhosted.org/packages/33/18/e8398d255369e35d312942f3bb8ecaff013c44968904891be2ab63b3aa94/rpds_py-0.24.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:4b28e5122829181de1898c2c97f81c0b3246d49f585f22743a1246420bb8d399", size = 363252, upload-time = "2025-03-26T14:55:00.359Z" }, - { url = "https://files.pythonhosted.org/packages/17/39/dd73ba691f4df3e6834bf982de214086ac3359ab3ac035adfb30041570e3/rpds_py-0.24.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8e5ab32cf9eb3647450bc74eb201b27c185d3857276162c101c0f8c6374e098", size = 388871, upload-time = "2025-03-26T14:55:02.253Z" }, - { url = "https://files.pythonhosted.org/packages/2f/2e/da0530b25cabd0feca2a759b899d2df325069a94281eeea8ac44c6cfeff7/rpds_py-0.24.0-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:208b3a70a98cf3710e97cabdc308a51cd4f28aa6e7bb11de3d56cd8b74bab98d", size = 394766, upload-time = "2025-03-26T14:55:04.05Z" }, - { url = "https://files.pythonhosted.org/packages/4c/ee/dd1c5040a431beb40fad4a5d7868acf343444b0bc43e627c71df2506538b/rpds_py-0.24.0-pp310-pypy310_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bbc4362e06f950c62cad3d4abf1191021b2ffaf0b31ac230fbf0526453eee75e", size = 448712, upload-time = "2025-03-26T14:55:06.03Z" }, - { url = "https://files.pythonhosted.org/packages/f5/ec/6b93ffbb686be948e4d91ec76f4e6757f8551034b2a8176dd848103a1e34/rpds_py-0.24.0-pp310-pypy310_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ebea2821cdb5f9fef44933617be76185b80150632736f3d76e54829ab4a3b4d1", size = 447150, upload-time = "2025-03-26T14:55:08.098Z" }, - { url = "https://files.pythonhosted.org/packages/55/d5/a1c23760adad85b432df074ced6f910dd28f222b8c60aeace5aeb9a6654e/rpds_py-0.24.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b9a4df06c35465ef4d81799999bba810c68d29972bf1c31db61bfdb81dd9d5bb", size = 390662, upload-time = "2025-03-26T14:55:09.781Z" }, - { url = "https://files.pythonhosted.org/packages/a5/f3/419cb1f9bfbd3a48c256528c156e00f3349e3edce5ad50cbc141e71f66a5/rpds_py-0.24.0-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d3aa13bdf38630da298f2e0d77aca967b200b8cc1473ea05248f6c5e9c9bdb44", size = 421351, upload-time = "2025-03-26T14:55:11.477Z" }, - { url = "https://files.pythonhosted.org/packages/98/8e/62d1a55078e5ede0b3b09f35e751fa35924a34a0d44d7c760743383cd54a/rpds_py-0.24.0-pp310-pypy310_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:041f00419e1da7a03c46042453598479f45be3d787eb837af382bfc169c0db33", size = 566074, upload-time = "2025-03-26T14:55:13.386Z" }, - { url = "https://files.pythonhosted.org/packages/fc/69/b7d1003166d78685da032b3c4ff1599fa536a3cfe6e5ce2da87c9c431906/rpds_py-0.24.0-pp310-pypy310_pp73-musllinux_1_2_i686.whl", hash = "sha256:d8754d872a5dfc3c5bf9c0e059e8107451364a30d9fd50f1f1a85c4fb9481164", size = 592398, upload-time = "2025-03-26T14:55:15.202Z" }, - { url = "https://files.pythonhosted.org/packages/ea/a8/1c98bc99338c37faadd28dd667d336df7409d77b4da999506a0b6b1c0aa2/rpds_py-0.24.0-pp310-pypy310_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:896c41007931217a343eff197c34513c154267636c8056fb409eafd494c3dcdc", size = 561114, upload-time = "2025-03-26T14:55:17.072Z" }, - { url = "https://files.pythonhosted.org/packages/2b/41/65c91443685a4c7b5f1dd271beadc4a3e063d57c3269221548dd9416e15c/rpds_py-0.24.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:92558d37d872e808944c3c96d0423b8604879a3d1c86fdad508d7ed91ea547d5", size = 235548, upload-time = "2025-03-26T14:55:18.707Z" }, - { url = "https://files.pythonhosted.org/packages/65/53/40bcc246a8354530d51a26d2b5b9afd1deacfb0d79e67295cc74df362f52/rpds_py-0.24.0-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:f9e0057a509e096e47c87f753136c9b10d7a91842d8042c2ee6866899a717c0d", size = 378386, upload-time = "2025-03-26T14:55:20.381Z" }, - { url = "https://files.pythonhosted.org/packages/80/b0/5ea97dd2f53e3618560aa1f9674e896e63dff95a9b796879a201bc4c1f00/rpds_py-0.24.0-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:d6e109a454412ab82979c5b1b3aee0604eca4bbf9a02693bb9df027af2bfa91a", size = 363440, upload-time = "2025-03-26T14:55:22.121Z" }, - { url = "https://files.pythonhosted.org/packages/57/9d/259b6eada6f747cdd60c9a5eb3efab15f6704c182547149926c38e5bd0d5/rpds_py-0.24.0-pp311-pypy311_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fc1c892b1ec1f8cbd5da8de287577b455e388d9c328ad592eabbdcb6fc93bee5", size = 388816, upload-time = "2025-03-26T14:55:23.737Z" }, - { url = "https://files.pythonhosted.org/packages/94/c1/faafc7183712f89f4b7620c3c15979ada13df137d35ef3011ae83e93b005/rpds_py-0.24.0-pp311-pypy311_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9c39438c55983d48f4bb3487734d040e22dad200dab22c41e331cee145e7a50d", size = 395058, upload-time = "2025-03-26T14:55:25.468Z" }, - { url = "https://files.pythonhosted.org/packages/6c/96/d7fa9d2a7b7604a61da201cc0306a355006254942093779d7121c64700ce/rpds_py-0.24.0-pp311-pypy311_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9d7e8ce990ae17dda686f7e82fd41a055c668e13ddcf058e7fb5e9da20b57793", size = 448692, upload-time = "2025-03-26T14:55:27.535Z" }, - { url = "https://files.pythonhosted.org/packages/96/37/a3146c6eebc65d6d8c96cc5ffdcdb6af2987412c789004213227fbe52467/rpds_py-0.24.0-pp311-pypy311_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9ea7f4174d2e4194289cb0c4e172d83e79a6404297ff95f2875cf9ac9bced8ba", size = 446462, upload-time = "2025-03-26T14:55:29.299Z" }, - { url = "https://files.pythonhosted.org/packages/1f/13/6481dfd9ac7de43acdaaa416e3a7da40bc4bb8f5c6ca85e794100aa54596/rpds_py-0.24.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bb2954155bb8f63bb19d56d80e5e5320b61d71084617ed89efedb861a684baea", size = 390460, upload-time = "2025-03-26T14:55:31.017Z" }, - { url = "https://files.pythonhosted.org/packages/61/e1/37e36bce65e109543cc4ff8d23206908649023549604fa2e7fbeba5342f7/rpds_py-0.24.0-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:04f2b712a2206e13800a8136b07aaedc23af3facab84918e7aa89e4be0260032", size = 421609, upload-time = "2025-03-26T14:55:32.84Z" }, - { url = "https://files.pythonhosted.org/packages/20/dd/1f1a923d6cd798b8582176aca8a0784676f1a0449fb6f07fce6ac1cdbfb6/rpds_py-0.24.0-pp311-pypy311_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:eda5c1e2a715a4cbbca2d6d304988460942551e4e5e3b7457b50943cd741626d", size = 565818, upload-time = "2025-03-26T14:55:34.538Z" }, - { url = "https://files.pythonhosted.org/packages/56/ec/d8da6df6a1eb3a418944a17b1cb38dd430b9e5a2e972eafd2b06f10c7c46/rpds_py-0.24.0-pp311-pypy311_pp73-musllinux_1_2_i686.whl", hash = "sha256:9abc80fe8c1f87218db116016de575a7998ab1629078c90840e8d11ab423ee25", size = 592627, upload-time = "2025-03-26T14:55:36.26Z" }, - { url = "https://files.pythonhosted.org/packages/b3/14/c492b9c7d5dd133e13f211ddea6bb9870f99e4f73932f11aa00bc09a9be9/rpds_py-0.24.0-pp311-pypy311_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:6a727fd083009bc83eb83d6950f0c32b3c94c8b80a9b667c87f4bd1274ca30ba", size = 560885, upload-time = "2025-03-26T14:55:38Z" }, - { url = "https://files.pythonhosted.org/packages/ef/e2/16cbbd7aaa4deaaeef5c90fee8b485c8b3312094cdad31e8006f5a3e5e08/rpds_py-0.24.0-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:e0f3ef95795efcd3b2ec3fe0a5bcfb5dadf5e3996ea2117427e524d4fbf309c6", size = 378245, upload-time = "2025-03-26T14:55:39.699Z" }, - { url = "https://files.pythonhosted.org/packages/d4/8c/5024dd105bf0a515576b7df8aeeba6556ffdbe2d636dee172c1a30497dd1/rpds_py-0.24.0-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:2c13777ecdbbba2077670285dd1fe50828c8742f6a4119dbef6f83ea13ad10fb", size = 363461, upload-time = "2025-03-26T14:55:41.441Z" }, - { url = "https://files.pythonhosted.org/packages/a4/6f/3a4efcfa2f4391b69f5d0ed3e6be5d2c5468c24fd2d15b712d2dbefc1749/rpds_py-0.24.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:79e8d804c2ccd618417e96720ad5cd076a86fa3f8cb310ea386a3e6229bae7d1", size = 388839, upload-time = "2025-03-26T14:55:43.566Z" }, - { url = "https://files.pythonhosted.org/packages/6c/d2/b8e5f0a0e97d295a0ebceb5265ef2e44c3d55e0d0f938d64a5ecfffa715e/rpds_py-0.24.0-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fd822f019ccccd75c832deb7aa040bb02d70a92eb15a2f16c7987b7ad4ee8d83", size = 394860, upload-time = "2025-03-26T14:55:45.301Z" }, - { url = "https://files.pythonhosted.org/packages/90/e9/9f1f297bdbc5b871826ad790b6641fc40532d97917916e6bd9f87fdd128d/rpds_py-0.24.0-pp39-pypy39_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0047638c3aa0dbcd0ab99ed1e549bbf0e142c9ecc173b6492868432d8989a046", size = 449314, upload-time = "2025-03-26T14:55:47.043Z" }, - { url = "https://files.pythonhosted.org/packages/06/ad/62ddbbaead31a1a22f0332958d0ea7c7aeed1b2536c6a51dd66dfae321a2/rpds_py-0.24.0-pp39-pypy39_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a5b66d1b201cc71bc3081bc2f1fc36b0c1f268b773e03bbc39066651b9e18391", size = 446376, upload-time = "2025-03-26T14:55:48.757Z" }, - { url = "https://files.pythonhosted.org/packages/82/a7/05b660d2f3789506e98be69aaf2ccde94e0fc49cd26cd78d7069bc5ba1b8/rpds_py-0.24.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dbcbb6db5582ea33ce46a5d20a5793134b5365110d84df4e30b9d37c6fd40ad3", size = 390560, upload-time = "2025-03-26T14:55:50.489Z" }, - { url = "https://files.pythonhosted.org/packages/66/1b/79fa0abffb802ff817821a148ce752eaaab87ba3a6a5e6b9f244c00c73d0/rpds_py-0.24.0-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:63981feca3f110ed132fd217bf7768ee8ed738a55549883628ee3da75bb9cb78", size = 421225, upload-time = "2025-03-26T14:55:52.634Z" }, - { url = "https://files.pythonhosted.org/packages/6e/9b/368893ad2f7b2ece42cad87c7ec71309b5d93188db28b307eadb48cd28e5/rpds_py-0.24.0-pp39-pypy39_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:3a55fc10fdcbf1a4bd3c018eea422c52cf08700cf99c28b5cb10fe97ab77a0d3", size = 566071, upload-time = "2025-03-26T14:55:54.403Z" }, - { url = "https://files.pythonhosted.org/packages/41/75/1cd0a654d300449411e6fd0821f83c1cfc7223da2e8109f586b4d9b89054/rpds_py-0.24.0-pp39-pypy39_pp73-musllinux_1_2_i686.whl", hash = "sha256:c30ff468163a48535ee7e9bf21bd14c7a81147c0e58a36c1078289a8ca7af0bd", size = 592334, upload-time = "2025-03-26T14:55:56.547Z" }, - { url = "https://files.pythonhosted.org/packages/31/33/5905e2a2e7612218e25307a9255fc8671b977449d40d62fe317775fe4939/rpds_py-0.24.0-pp39-pypy39_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:369d9c6d4c714e36d4a03957b4783217a3ccd1e222cdd67d464a3a479fc17796", size = 561111, upload-time = "2025-03-26T14:55:58.309Z" }, - { url = "https://files.pythonhosted.org/packages/64/bd/f4cc34ac2261a7cb8a48bc90ce1e36dc05f1ec5ac3b4537def20be5df555/rpds_py-0.24.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:24795c099453e3721fda5d8ddd45f5dfcc8e5a547ce7b8e9da06fecc3832e26f", size = 235168, upload-time = "2025-03-26T14:56:00.035Z" }, +version = "0.27.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/1e/d9/991a0dee12d9fc53ed027e26a26a64b151d77252ac477e22666b9688bc16/rpds_py-0.27.0.tar.gz", hash = "sha256:8b23cf252f180cda89220b378d917180f29d313cd6a07b2431c0d3b776aae86f", size = 27420, upload-time = "2025-08-07T08:26:39.624Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/75/2d/ad2e37dee3f45580f7fa0066c412a521f9bee53d2718b0e9436d308a1ecd/rpds_py-0.27.0-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:130c1ffa5039a333f5926b09e346ab335f0d4ec393b030a18549a7c7e7c2cea4", size = 371511, upload-time = "2025-08-07T08:23:06.205Z" }, + { url = "https://files.pythonhosted.org/packages/f5/67/57b4b2479193fde9dd6983a13c2550b5f9c3bcdf8912dffac2068945eb14/rpds_py-0.27.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a4cf32a26fa744101b67bfd28c55d992cd19438aff611a46cac7f066afca8fd4", size = 354718, upload-time = "2025-08-07T08:23:08.222Z" }, + { url = "https://files.pythonhosted.org/packages/a3/be/c2b95ec4b813eb11f3a3c3d22f22bda8d3a48a074a0519cde968c4d102cf/rpds_py-0.27.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:64a0fe3f334a40b989812de70160de6b0ec7e3c9e4a04c0bbc48d97c5d3600ae", size = 381518, upload-time = "2025-08-07T08:23:09.696Z" }, + { url = "https://files.pythonhosted.org/packages/a5/d2/5a7279bc2b93b20bd50865a2269016238cee45f7dc3cc33402a7f41bd447/rpds_py-0.27.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9a0ff7ee28583ab30a52f371b40f54e7138c52ca67f8ca17ccb7ccf0b383cb5f", size = 396694, upload-time = "2025-08-07T08:23:11.105Z" }, + { url = "https://files.pythonhosted.org/packages/65/e9/bac8b3714bd853c5bcb466e04acfb9a5da030d77e0ddf1dfad9afb791c31/rpds_py-0.27.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:15ea4d2e182345dd1b4286593601d766411b43f868924afe297570658c31a62b", size = 514813, upload-time = "2025-08-07T08:23:12.215Z" }, + { url = "https://files.pythonhosted.org/packages/1d/aa/293115e956d7d13b7d2a9e9a4121f74989a427aa125f00ce4426ca8b7b28/rpds_py-0.27.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:36184b44bf60a480863e51021c26aca3dfe8dd2f5eeabb33622b132b9d8b8b54", size = 402246, upload-time = "2025-08-07T08:23:13.699Z" }, + { url = "https://files.pythonhosted.org/packages/88/59/2d6789bb898fb3e2f0f7b82b7bcf27f579ebcb6cc36c24f4e208f7f58a5b/rpds_py-0.27.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9b78430703cfcf5f5e86eb74027a1ed03a93509273d7c705babb547f03e60016", size = 383661, upload-time = "2025-08-07T08:23:15.231Z" }, + { url = "https://files.pythonhosted.org/packages/0c/55/add13a593a7a81243a9eed56d618d3d427be5dc1214931676e3f695dfdc1/rpds_py-0.27.0-cp310-cp310-manylinux_2_31_riscv64.whl", hash = "sha256:dbd749cff1defbde270ca346b69b3baf5f1297213ef322254bf2a28537f0b046", size = 401691, upload-time = "2025-08-07T08:23:16.681Z" }, + { url = "https://files.pythonhosted.org/packages/04/09/3e8b2aad494ffaca571e4e19611a12cc18fcfd756d9274f3871a2d822445/rpds_py-0.27.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6bde37765564cd22a676dd8101b657839a1854cfaa9c382c5abf6ff7accfd4ae", size = 416529, upload-time = "2025-08-07T08:23:17.863Z" }, + { url = "https://files.pythonhosted.org/packages/a4/6d/bd899234728f1d8f72c9610f50fdf1c140ecd0a141320e1f1d0f6b20595d/rpds_py-0.27.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:1d66f45b9399036e890fb9c04e9f70c33857fd8f58ac8db9f3278cfa835440c3", size = 558673, upload-time = "2025-08-07T08:23:18.99Z" }, + { url = "https://files.pythonhosted.org/packages/79/f4/f3e02def5193fb899d797c232f90d6f8f0f2b9eca2faef6f0d34cbc89b2e/rpds_py-0.27.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:d85d784c619370d9329bbd670f41ff5f2ae62ea4519761b679d0f57f0f0ee267", size = 588426, upload-time = "2025-08-07T08:23:20.541Z" }, + { url = "https://files.pythonhosted.org/packages/e3/0c/88e716cd8fd760e5308835fe298255830de4a1c905fd51760b9bb40aa965/rpds_py-0.27.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:5df559e9e7644d9042f626f2c3997b555f347d7a855a15f170b253f6c5bfe358", size = 554552, upload-time = "2025-08-07T08:23:21.714Z" }, + { url = "https://files.pythonhosted.org/packages/2b/a9/0a8243c182e7ac59b901083dff7e671feba6676a131bfff3f8d301cd2b36/rpds_py-0.27.0-cp310-cp310-win32.whl", hash = "sha256:b8a4131698b6992b2a56015f51646711ec5d893a0b314a4b985477868e240c87", size = 218081, upload-time = "2025-08-07T08:23:23.273Z" }, + { url = "https://files.pythonhosted.org/packages/0f/e7/202ff35852312760148be9e08fe2ba6900aa28e7a46940a313eae473c10c/rpds_py-0.27.0-cp310-cp310-win_amd64.whl", hash = "sha256:cbc619e84a5e3ab2d452de831c88bdcad824414e9c2d28cd101f94dbdf26329c", size = 230077, upload-time = "2025-08-07T08:23:24.308Z" }, + { url = "https://files.pythonhosted.org/packages/b4/c1/49d515434c1752e40f5e35b985260cf27af052593378580a2f139a5be6b8/rpds_py-0.27.0-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:dbc2ab5d10544eb485baa76c63c501303b716a5c405ff2469a1d8ceffaabf622", size = 371577, upload-time = "2025-08-07T08:23:25.379Z" }, + { url = "https://files.pythonhosted.org/packages/e1/6d/bf2715b2fee5087fa13b752b5fd573f1a93e4134c74d275f709e38e54fe7/rpds_py-0.27.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:7ec85994f96a58cf7ed288caa344b7fe31fd1d503bdf13d7331ead5f70ab60d5", size = 354959, upload-time = "2025-08-07T08:23:26.767Z" }, + { url = "https://files.pythonhosted.org/packages/a3/5c/e7762808c746dd19733a81373c10da43926f6a6adcf4920a21119697a60a/rpds_py-0.27.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:190d7285cd3bb6d31d37a0534d7359c1ee191eb194c511c301f32a4afa5a1dd4", size = 381485, upload-time = "2025-08-07T08:23:27.869Z" }, + { url = "https://files.pythonhosted.org/packages/40/51/0d308eb0b558309ca0598bcba4243f52c4cd20e15fe991b5bd75824f2e61/rpds_py-0.27.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c10d92fb6d7fd827e44055fcd932ad93dac6a11e832d51534d77b97d1d85400f", size = 396816, upload-time = "2025-08-07T08:23:29.424Z" }, + { url = "https://files.pythonhosted.org/packages/5c/aa/2d585ec911d78f66458b2c91252134ca0c7c70f687a72c87283173dc0c96/rpds_py-0.27.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:dd2c1d27ebfe6a015cfa2005b7fe8c52d5019f7bbdd801bc6f7499aab9ae739e", size = 514950, upload-time = "2025-08-07T08:23:30.576Z" }, + { url = "https://files.pythonhosted.org/packages/0b/ef/aced551cc1148179557aed84343073adadf252c91265263ee6203458a186/rpds_py-0.27.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4790c9d5dd565ddb3e9f656092f57268951398cef52e364c405ed3112dc7c7c1", size = 402132, upload-time = "2025-08-07T08:23:32.428Z" }, + { url = "https://files.pythonhosted.org/packages/4b/ac/cf644803d8d417653fe2b3604186861d62ea6afaef1b2284045741baef17/rpds_py-0.27.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4300e15e7d03660f04be84a125d1bdd0e6b2f674bc0723bc0fd0122f1a4585dc", size = 383660, upload-time = "2025-08-07T08:23:33.829Z" }, + { url = "https://files.pythonhosted.org/packages/c9/ec/caf47c55ce02b76cbaeeb2d3b36a73da9ca2e14324e3d75cf72b59dcdac5/rpds_py-0.27.0-cp311-cp311-manylinux_2_31_riscv64.whl", hash = "sha256:59195dc244fc183209cf8a93406889cadde47dfd2f0a6b137783aa9c56d67c85", size = 401730, upload-time = "2025-08-07T08:23:34.97Z" }, + { url = "https://files.pythonhosted.org/packages/0b/71/c1f355afdcd5b99ffc253422aa4bdcb04ccf1491dcd1bda3688a0c07fd61/rpds_py-0.27.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:fae4a01ef8c4cb2bbe92ef2063149596907dc4a881a8d26743b3f6b304713171", size = 416122, upload-time = "2025-08-07T08:23:36.062Z" }, + { url = "https://files.pythonhosted.org/packages/38/0f/f4b5b1eda724ed0e04d2b26d8911cdc131451a7ee4c4c020a1387e5c6ded/rpds_py-0.27.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:e3dc8d4ede2dbae6c0fc2b6c958bf51ce9fd7e9b40c0f5b8835c3fde44f5807d", size = 558771, upload-time = "2025-08-07T08:23:37.478Z" }, + { url = "https://files.pythonhosted.org/packages/93/c0/5f8b834db2289ab48d5cffbecbb75e35410103a77ac0b8da36bf9544ec1c/rpds_py-0.27.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:c3782fb753aa825b4ccabc04292e07897e2fd941448eabf666856c5530277626", size = 587876, upload-time = "2025-08-07T08:23:38.662Z" }, + { url = "https://files.pythonhosted.org/packages/d2/dd/1a1df02ab8eb970115cff2ae31a6f73916609b900dc86961dc382b8c2e5e/rpds_py-0.27.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:887ab1f12b0d227e9260558a4a2320024b20102207ada65c43e1ffc4546df72e", size = 554359, upload-time = "2025-08-07T08:23:39.897Z" }, + { url = "https://files.pythonhosted.org/packages/a1/e4/95a014ab0d51ab6e3bebbdb476a42d992d2bbf9c489d24cff9fda998e925/rpds_py-0.27.0-cp311-cp311-win32.whl", hash = "sha256:5d6790ff400254137b81b8053b34417e2c46921e302d655181d55ea46df58cf7", size = 218084, upload-time = "2025-08-07T08:23:41.086Z" }, + { url = "https://files.pythonhosted.org/packages/49/78/f8d5b71ec65a0376b0de31efcbb5528ce17a9b7fdd19c3763303ccfdedec/rpds_py-0.27.0-cp311-cp311-win_amd64.whl", hash = "sha256:e24d8031a2c62f34853756d9208eeafa6b940a1efcbfe36e8f57d99d52bb7261", size = 230085, upload-time = "2025-08-07T08:23:42.143Z" }, + { url = "https://files.pythonhosted.org/packages/e7/d3/84429745184091e06b4cc70f8597408e314c2d2f7f5e13249af9ffab9e3d/rpds_py-0.27.0-cp311-cp311-win_arm64.whl", hash = "sha256:08680820d23df1df0a0260f714d12966bc6c42d02e8055a91d61e03f0c47dda0", size = 222112, upload-time = "2025-08-07T08:23:43.233Z" }, + { url = "https://files.pythonhosted.org/packages/cd/17/e67309ca1ac993fa1888a0d9b2f5ccc1f67196ace32e76c9f8e1dbbbd50c/rpds_py-0.27.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:19c990fdf5acecbf0623e906ae2e09ce1c58947197f9bced6bbd7482662231c4", size = 362611, upload-time = "2025-08-07T08:23:44.773Z" }, + { url = "https://files.pythonhosted.org/packages/93/2e/28c2fb84aa7aa5d75933d1862d0f7de6198ea22dfd9a0cca06e8a4e7509e/rpds_py-0.27.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6c27a7054b5224710fcfb1a626ec3ff4f28bcb89b899148c72873b18210e446b", size = 347680, upload-time = "2025-08-07T08:23:46.014Z" }, + { url = "https://files.pythonhosted.org/packages/44/3e/9834b4c8f4f5fe936b479e623832468aa4bd6beb8d014fecaee9eac6cdb1/rpds_py-0.27.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:09965b314091829b378b60607022048953e25f0b396c2b70e7c4c81bcecf932e", size = 384600, upload-time = "2025-08-07T08:23:48Z" }, + { url = "https://files.pythonhosted.org/packages/19/78/744123c7b38865a965cd9e6f691fde7ef989a00a256fa8bf15b75240d12f/rpds_py-0.27.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:14f028eb47f59e9169bfdf9f7ceafd29dd64902141840633683d0bad5b04ff34", size = 400697, upload-time = "2025-08-07T08:23:49.407Z" }, + { url = "https://files.pythonhosted.org/packages/32/97/3c3d32fe7daee0a1f1a678b6d4dfb8c4dcf88197fa2441f9da7cb54a8466/rpds_py-0.27.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6168af0be75bba990a39f9431cdfae5f0ad501f4af32ae62e8856307200517b8", size = 517781, upload-time = "2025-08-07T08:23:50.557Z" }, + { url = "https://files.pythonhosted.org/packages/b2/be/28f0e3e733680aa13ecec1212fc0f585928a206292f14f89c0b8a684cad1/rpds_py-0.27.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ab47fe727c13c09d0e6f508e3a49e545008e23bf762a245b020391b621f5b726", size = 406449, upload-time = "2025-08-07T08:23:51.732Z" }, + { url = "https://files.pythonhosted.org/packages/95/ae/5d15c83e337c082d0367053baeb40bfba683f42459f6ebff63a2fd7e5518/rpds_py-0.27.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5fa01b3d5e3b7d97efab65bd3d88f164e289ec323a8c033c5c38e53ee25c007e", size = 386150, upload-time = "2025-08-07T08:23:52.822Z" }, + { url = "https://files.pythonhosted.org/packages/bf/65/944e95f95d5931112829e040912b25a77b2e7ed913ea5fe5746aa5c1ce75/rpds_py-0.27.0-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:6c135708e987f46053e0a1246a206f53717f9fadfba27174a9769ad4befba5c3", size = 406100, upload-time = "2025-08-07T08:23:54.339Z" }, + { url = "https://files.pythonhosted.org/packages/21/a4/1664b83fae02894533cd11dc0b9f91d673797c2185b7be0f7496107ed6c5/rpds_py-0.27.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:fc327f4497b7087d06204235199daf208fd01c82d80465dc5efa4ec9df1c5b4e", size = 421345, upload-time = "2025-08-07T08:23:55.832Z" }, + { url = "https://files.pythonhosted.org/packages/7c/26/b7303941c2b0823bfb34c71378249f8beedce57301f400acb04bb345d025/rpds_py-0.27.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:7e57906e38583a2cba67046a09c2637e23297618dc1f3caddbc493f2be97c93f", size = 561891, upload-time = "2025-08-07T08:23:56.951Z" }, + { url = "https://files.pythonhosted.org/packages/9b/c8/48623d64d4a5a028fa99576c768a6159db49ab907230edddc0b8468b998b/rpds_py-0.27.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:0f4f69d7a4300fbf91efb1fb4916421bd57804c01ab938ab50ac9c4aa2212f03", size = 591756, upload-time = "2025-08-07T08:23:58.146Z" }, + { url = "https://files.pythonhosted.org/packages/b3/51/18f62617e8e61cc66334c9fb44b1ad7baae3438662098efbc55fb3fda453/rpds_py-0.27.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b4c4fbbcff474e1e5f38be1bf04511c03d492d42eec0babda5d03af3b5589374", size = 557088, upload-time = "2025-08-07T08:23:59.6Z" }, + { url = "https://files.pythonhosted.org/packages/bd/4c/e84c3a276e2496a93d245516be6b49e20499aa8ca1c94d59fada0d79addc/rpds_py-0.27.0-cp312-cp312-win32.whl", hash = "sha256:27bac29bbbf39601b2aab474daf99dbc8e7176ca3389237a23944b17f8913d97", size = 221926, upload-time = "2025-08-07T08:24:00.695Z" }, + { url = "https://files.pythonhosted.org/packages/83/89/9d0fbcef64340db0605eb0a0044f258076f3ae0a3b108983b2c614d96212/rpds_py-0.27.0-cp312-cp312-win_amd64.whl", hash = "sha256:8a06aa1197ec0281eb1d7daf6073e199eb832fe591ffa329b88bae28f25f5fe5", size = 233235, upload-time = "2025-08-07T08:24:01.846Z" }, + { url = "https://files.pythonhosted.org/packages/c9/b0/e177aa9f39cbab060f96de4a09df77d494f0279604dc2f509263e21b05f9/rpds_py-0.27.0-cp312-cp312-win_arm64.whl", hash = "sha256:e14aab02258cb776a108107bd15f5b5e4a1bbaa61ef33b36693dfab6f89d54f9", size = 223315, upload-time = "2025-08-07T08:24:03.337Z" }, + { url = "https://files.pythonhosted.org/packages/81/d2/dfdfd42565a923b9e5a29f93501664f5b984a802967d48d49200ad71be36/rpds_py-0.27.0-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:443d239d02d9ae55b74015234f2cd8eb09e59fbba30bf60baeb3123ad4c6d5ff", size = 362133, upload-time = "2025-08-07T08:24:04.508Z" }, + { url = "https://files.pythonhosted.org/packages/ac/4a/0a2e2460c4b66021d349ce9f6331df1d6c75d7eea90df9785d333a49df04/rpds_py-0.27.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:b8a7acf04fda1f30f1007f3cc96d29d8cf0a53e626e4e1655fdf4eabc082d367", size = 347128, upload-time = "2025-08-07T08:24:05.695Z" }, + { url = "https://files.pythonhosted.org/packages/35/8d/7d1e4390dfe09d4213b3175a3f5a817514355cb3524593380733204f20b9/rpds_py-0.27.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9d0f92b78cfc3b74a42239fdd8c1266f4715b573204c234d2f9fc3fc7a24f185", size = 384027, upload-time = "2025-08-07T08:24:06.841Z" }, + { url = "https://files.pythonhosted.org/packages/c1/65/78499d1a62172891c8cd45de737b2a4b84a414b6ad8315ab3ac4945a5b61/rpds_py-0.27.0-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ce4ed8e0c7dbc5b19352b9c2c6131dd23b95fa8698b5cdd076307a33626b72dc", size = 399973, upload-time = "2025-08-07T08:24:08.143Z" }, + { url = "https://files.pythonhosted.org/packages/10/a1/1c67c1d8cc889107b19570bb01f75cf49852068e95e6aee80d22915406fc/rpds_py-0.27.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fde355b02934cc6b07200cc3b27ab0c15870a757d1a72fd401aa92e2ea3c6bfe", size = 515295, upload-time = "2025-08-07T08:24:09.711Z" }, + { url = "https://files.pythonhosted.org/packages/df/27/700ec88e748436b6c7c4a2262d66e80f8c21ab585d5e98c45e02f13f21c0/rpds_py-0.27.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:13bbc4846ae4c993f07c93feb21a24d8ec637573d567a924b1001e81c8ae80f9", size = 406737, upload-time = "2025-08-07T08:24:11.182Z" }, + { url = "https://files.pythonhosted.org/packages/33/cc/6b0ee8f0ba3f2df2daac1beda17fde5cf10897a7d466f252bd184ef20162/rpds_py-0.27.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:be0744661afbc4099fef7f4e604e7f1ea1be1dd7284f357924af12a705cc7d5c", size = 385898, upload-time = "2025-08-07T08:24:12.798Z" }, + { url = "https://files.pythonhosted.org/packages/e8/7e/c927b37d7d33c0a0ebf249cc268dc2fcec52864c1b6309ecb960497f2285/rpds_py-0.27.0-cp313-cp313-manylinux_2_31_riscv64.whl", hash = "sha256:069e0384a54f427bd65d7fda83b68a90606a3835901aaff42185fcd94f5a9295", size = 405785, upload-time = "2025-08-07T08:24:14.906Z" }, + { url = "https://files.pythonhosted.org/packages/5b/d2/8ed50746d909dcf402af3fa58b83d5a590ed43e07251d6b08fad1a535ba6/rpds_py-0.27.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4bc262ace5a1a7dc3e2eac2fa97b8257ae795389f688b5adf22c5db1e2431c43", size = 419760, upload-time = "2025-08-07T08:24:16.129Z" }, + { url = "https://files.pythonhosted.org/packages/d3/60/2b2071aee781cb3bd49f94d5d35686990b925e9b9f3e3d149235a6f5d5c1/rpds_py-0.27.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:2fe6e18e5c8581f0361b35ae575043c7029d0a92cb3429e6e596c2cdde251432", size = 561201, upload-time = "2025-08-07T08:24:17.645Z" }, + { url = "https://files.pythonhosted.org/packages/98/1f/27b67304272521aaea02be293fecedce13fa351a4e41cdb9290576fc6d81/rpds_py-0.27.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:d93ebdb82363d2e7bec64eecdc3632b59e84bd270d74fe5be1659f7787052f9b", size = 591021, upload-time = "2025-08-07T08:24:18.999Z" }, + { url = "https://files.pythonhosted.org/packages/db/9b/a2fadf823164dd085b1f894be6443b0762a54a7af6f36e98e8fcda69ee50/rpds_py-0.27.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:0954e3a92e1d62e83a54ea7b3fdc9efa5d61acef8488a8a3d31fdafbfb00460d", size = 556368, upload-time = "2025-08-07T08:24:20.54Z" }, + { url = "https://files.pythonhosted.org/packages/24/f3/6d135d46a129cda2e3e6d4c5e91e2cc26ea0428c6cf152763f3f10b6dd05/rpds_py-0.27.0-cp313-cp313-win32.whl", hash = "sha256:2cff9bdd6c7b906cc562a505c04a57d92e82d37200027e8d362518df427f96cd", size = 221236, upload-time = "2025-08-07T08:24:22.144Z" }, + { url = "https://files.pythonhosted.org/packages/c5/44/65d7494f5448ecc755b545d78b188440f81da98b50ea0447ab5ebfdf9bd6/rpds_py-0.27.0-cp313-cp313-win_amd64.whl", hash = "sha256:dc79d192fb76fc0c84f2c58672c17bbbc383fd26c3cdc29daae16ce3d927e8b2", size = 232634, upload-time = "2025-08-07T08:24:23.642Z" }, + { url = "https://files.pythonhosted.org/packages/70/d9/23852410fadab2abb611733933401de42a1964ce6600a3badae35fbd573e/rpds_py-0.27.0-cp313-cp313-win_arm64.whl", hash = "sha256:5b3a5c8089eed498a3af23ce87a80805ff98f6ef8f7bdb70bd1b7dae5105f6ac", size = 222783, upload-time = "2025-08-07T08:24:25.098Z" }, + { url = "https://files.pythonhosted.org/packages/15/75/03447917f78512b34463f4ef11066516067099a0c466545655503bed0c77/rpds_py-0.27.0-cp313-cp313t-macosx_10_12_x86_64.whl", hash = "sha256:90fb790138c1a89a2e58c9282fe1089638401f2f3b8dddd758499041bc6e0774", size = 359154, upload-time = "2025-08-07T08:24:26.249Z" }, + { url = "https://files.pythonhosted.org/packages/6b/fc/4dac4fa756451f2122ddaf136e2c6aeb758dc6fdbe9ccc4bc95c98451d50/rpds_py-0.27.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:010c4843a3b92b54373e3d2291a7447d6c3fc29f591772cc2ea0e9f5c1da434b", size = 343909, upload-time = "2025-08-07T08:24:27.405Z" }, + { url = "https://files.pythonhosted.org/packages/7b/81/723c1ed8e6f57ed9d8c0c07578747a2d3d554aaefc1ab89f4e42cfeefa07/rpds_py-0.27.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c9ce7a9e967afc0a2af7caa0d15a3e9c1054815f73d6a8cb9225b61921b419bd", size = 379340, upload-time = "2025-08-07T08:24:28.714Z" }, + { url = "https://files.pythonhosted.org/packages/98/16/7e3740413de71818ce1997df82ba5f94bae9fff90c0a578c0e24658e6201/rpds_py-0.27.0-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:aa0bf113d15e8abdfee92aa4db86761b709a09954083afcb5bf0f952d6065fdb", size = 391655, upload-time = "2025-08-07T08:24:30.223Z" }, + { url = "https://files.pythonhosted.org/packages/e0/63/2a9f510e124d80660f60ecce07953f3f2d5f0b96192c1365443859b9c87f/rpds_py-0.27.0-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:eb91d252b35004a84670dfeafadb042528b19842a0080d8b53e5ec1128e8f433", size = 513017, upload-time = "2025-08-07T08:24:31.446Z" }, + { url = "https://files.pythonhosted.org/packages/2c/4e/cf6ff311d09776c53ea1b4f2e6700b9d43bb4e99551006817ade4bbd6f78/rpds_py-0.27.0-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:db8a6313dbac934193fc17fe7610f70cd8181c542a91382531bef5ed785e5615", size = 402058, upload-time = "2025-08-07T08:24:32.613Z" }, + { url = "https://files.pythonhosted.org/packages/88/11/5e36096d474cb10f2a2d68b22af60a3bc4164fd8db15078769a568d9d3ac/rpds_py-0.27.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ce96ab0bdfcef1b8c371ada2100767ace6804ea35aacce0aef3aeb4f3f499ca8", size = 383474, upload-time = "2025-08-07T08:24:33.767Z" }, + { url = "https://files.pythonhosted.org/packages/db/a2/3dff02805b06058760b5eaa6d8cb8db3eb3e46c9e452453ad5fc5b5ad9fe/rpds_py-0.27.0-cp313-cp313t-manylinux_2_31_riscv64.whl", hash = "sha256:7451ede3560086abe1aa27dcdcf55cd15c96b56f543fb12e5826eee6f721f858", size = 400067, upload-time = "2025-08-07T08:24:35.021Z" }, + { url = "https://files.pythonhosted.org/packages/67/87/eed7369b0b265518e21ea836456a4ed4a6744c8c12422ce05bce760bb3cf/rpds_py-0.27.0-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:32196b5a99821476537b3f7732432d64d93a58d680a52c5e12a190ee0135d8b5", size = 412085, upload-time = "2025-08-07T08:24:36.267Z" }, + { url = "https://files.pythonhosted.org/packages/8b/48/f50b2ab2fbb422fbb389fe296e70b7a6b5ea31b263ada5c61377e710a924/rpds_py-0.27.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:a029be818059870664157194e46ce0e995082ac49926f1423c1f058534d2aaa9", size = 555928, upload-time = "2025-08-07T08:24:37.573Z" }, + { url = "https://files.pythonhosted.org/packages/98/41/b18eb51045d06887666c3560cd4bbb6819127b43d758f5adb82b5f56f7d1/rpds_py-0.27.0-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:3841f66c1ffdc6cebce8aed64e36db71466f1dc23c0d9a5592e2a782a3042c79", size = 585527, upload-time = "2025-08-07T08:24:39.391Z" }, + { url = "https://files.pythonhosted.org/packages/be/03/a3dd6470fc76499959b00ae56295b76b4bdf7c6ffc60d62006b1217567e1/rpds_py-0.27.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:42894616da0fc0dcb2ec08a77896c3f56e9cb2f4b66acd76fc8992c3557ceb1c", size = 554211, upload-time = "2025-08-07T08:24:40.6Z" }, + { url = "https://files.pythonhosted.org/packages/bf/d1/ee5fd1be395a07423ac4ca0bcc05280bf95db2b155d03adefeb47d5ebf7e/rpds_py-0.27.0-cp313-cp313t-win32.whl", hash = "sha256:b1fef1f13c842a39a03409e30ca0bf87b39a1e2a305a9924deadb75a43105d23", size = 216624, upload-time = "2025-08-07T08:24:42.204Z" }, + { url = "https://files.pythonhosted.org/packages/1c/94/4814c4c858833bf46706f87349c37ca45e154da7dbbec9ff09f1abeb08cc/rpds_py-0.27.0-cp313-cp313t-win_amd64.whl", hash = "sha256:183f5e221ba3e283cd36fdfbe311d95cd87699a083330b4f792543987167eff1", size = 230007, upload-time = "2025-08-07T08:24:43.329Z" }, + { url = "https://files.pythonhosted.org/packages/0e/a5/8fffe1c7dc7c055aa02df310f9fb71cfc693a4d5ccc5de2d3456ea5fb022/rpds_py-0.27.0-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:f3cd110e02c5bf17d8fb562f6c9df5c20e73029d587cf8602a2da6c5ef1e32cb", size = 362595, upload-time = "2025-08-07T08:24:44.478Z" }, + { url = "https://files.pythonhosted.org/packages/bc/c7/4e4253fd2d4bb0edbc0b0b10d9f280612ca4f0f990e3c04c599000fe7d71/rpds_py-0.27.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:8d0e09cf4863c74106b5265c2c310f36146e2b445ff7b3018a56799f28f39f6f", size = 347252, upload-time = "2025-08-07T08:24:45.678Z" }, + { url = "https://files.pythonhosted.org/packages/f3/c8/3d1a954d30f0174dd6baf18b57c215da03cf7846a9d6e0143304e784cddc/rpds_py-0.27.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:64f689ab822f9b5eb6dfc69893b4b9366db1d2420f7db1f6a2adf2a9ca15ad64", size = 384886, upload-time = "2025-08-07T08:24:46.86Z" }, + { url = "https://files.pythonhosted.org/packages/e0/52/3c5835f2df389832b28f9276dd5395b5a965cea34226e7c88c8fbec2093c/rpds_py-0.27.0-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e36c80c49853b3ffda7aa1831bf175c13356b210c73128c861f3aa93c3cc4015", size = 399716, upload-time = "2025-08-07T08:24:48.174Z" }, + { url = "https://files.pythonhosted.org/packages/40/73/176e46992461a1749686a2a441e24df51ff86b99c2d34bf39f2a5273b987/rpds_py-0.27.0-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6de6a7f622860af0146cb9ee148682ff4d0cea0b8fd3ad51ce4d40efb2f061d0", size = 517030, upload-time = "2025-08-07T08:24:49.52Z" }, + { url = "https://files.pythonhosted.org/packages/79/2a/7266c75840e8c6e70effeb0d38922a45720904f2cd695e68a0150e5407e2/rpds_py-0.27.0-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4045e2fc4b37ec4b48e8907a5819bdd3380708c139d7cc358f03a3653abedb89", size = 408448, upload-time = "2025-08-07T08:24:50.727Z" }, + { url = "https://files.pythonhosted.org/packages/e6/5f/a7efc572b8e235093dc6cf39f4dbc8a7f08e65fdbcec7ff4daeb3585eef1/rpds_py-0.27.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9da162b718b12c4219eeeeb68a5b7552fbc7aadedf2efee440f88b9c0e54b45d", size = 387320, upload-time = "2025-08-07T08:24:52.004Z" }, + { url = "https://files.pythonhosted.org/packages/a2/eb/9ff6bc92efe57cf5a2cb74dee20453ba444b6fdc85275d8c99e0d27239d1/rpds_py-0.27.0-cp314-cp314-manylinux_2_31_riscv64.whl", hash = "sha256:0665be515767dc727ffa5f74bd2ef60b0ff85dad6bb8f50d91eaa6b5fb226f51", size = 407414, upload-time = "2025-08-07T08:24:53.664Z" }, + { url = "https://files.pythonhosted.org/packages/fb/bd/3b9b19b00d5c6e1bd0f418c229ab0f8d3b110ddf7ec5d9d689ef783d0268/rpds_py-0.27.0-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:203f581accef67300a942e49a37d74c12ceeef4514874c7cede21b012613ca2c", size = 420766, upload-time = "2025-08-07T08:24:55.917Z" }, + { url = "https://files.pythonhosted.org/packages/17/6b/521a7b1079ce16258c70805166e3ac6ec4ee2139d023fe07954dc9b2d568/rpds_py-0.27.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:7873b65686a6471c0037139aa000d23fe94628e0daaa27b6e40607c90e3f5ec4", size = 562409, upload-time = "2025-08-07T08:24:57.17Z" }, + { url = "https://files.pythonhosted.org/packages/8b/bf/65db5bfb14ccc55e39de8419a659d05a2a9cd232f0a699a516bb0991da7b/rpds_py-0.27.0-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:249ab91ceaa6b41abc5f19513cb95b45c6f956f6b89f1fe3d99c81255a849f9e", size = 590793, upload-time = "2025-08-07T08:24:58.388Z" }, + { url = "https://files.pythonhosted.org/packages/db/b8/82d368b378325191ba7aae8f40f009b78057b598d4394d1f2cdabaf67b3f/rpds_py-0.27.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:d2f184336bc1d6abfaaa1262ed42739c3789b1e3a65a29916a615307d22ffd2e", size = 558178, upload-time = "2025-08-07T08:24:59.756Z" }, + { url = "https://files.pythonhosted.org/packages/f6/ff/f270bddbfbc3812500f8131b1ebbd97afd014cd554b604a3f73f03133a36/rpds_py-0.27.0-cp314-cp314-win32.whl", hash = "sha256:d3c622c39f04d5751408f5b801ecb527e6e0a471b367f420a877f7a660d583f6", size = 222355, upload-time = "2025-08-07T08:25:01.027Z" }, + { url = "https://files.pythonhosted.org/packages/bf/20/fdab055b1460c02ed356a0e0b0a78c1dd32dc64e82a544f7b31c9ac643dc/rpds_py-0.27.0-cp314-cp314-win_amd64.whl", hash = "sha256:cf824aceaeffff029ccfba0da637d432ca71ab21f13e7f6f5179cd88ebc77a8a", size = 234007, upload-time = "2025-08-07T08:25:02.268Z" }, + { url = "https://files.pythonhosted.org/packages/4d/a8/694c060005421797a3be4943dab8347c76c2b429a9bef68fb2c87c9e70c7/rpds_py-0.27.0-cp314-cp314-win_arm64.whl", hash = "sha256:86aca1616922b40d8ac1b3073a1ead4255a2f13405e5700c01f7c8d29a03972d", size = 223527, upload-time = "2025-08-07T08:25:03.45Z" }, + { url = "https://files.pythonhosted.org/packages/1e/f9/77f4c90f79d2c5ca8ce6ec6a76cb4734ee247de6b3a4f337e289e1f00372/rpds_py-0.27.0-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:341d8acb6724c0c17bdf714319c393bb27f6d23d39bc74f94221b3e59fc31828", size = 359469, upload-time = "2025-08-07T08:25:04.648Z" }, + { url = "https://files.pythonhosted.org/packages/c0/22/b97878d2f1284286fef4172069e84b0b42b546ea7d053e5fb7adb9ac6494/rpds_py-0.27.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:6b96b0b784fe5fd03beffff2b1533dc0d85e92bab8d1b2c24ef3a5dc8fac5669", size = 343960, upload-time = "2025-08-07T08:25:05.863Z" }, + { url = "https://files.pythonhosted.org/packages/b1/b0/dfd55b5bb480eda0578ae94ef256d3061d20b19a0f5e18c482f03e65464f/rpds_py-0.27.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0c431bfb91478d7cbe368d0a699978050d3b112d7f1d440a41e90faa325557fd", size = 380201, upload-time = "2025-08-07T08:25:07.513Z" }, + { url = "https://files.pythonhosted.org/packages/28/22/e1fa64e50d58ad2b2053077e3ec81a979147c43428de9e6de68ddf6aff4e/rpds_py-0.27.0-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:20e222a44ae9f507d0f2678ee3dd0c45ec1e930f6875d99b8459631c24058aec", size = 392111, upload-time = "2025-08-07T08:25:09.149Z" }, + { url = "https://files.pythonhosted.org/packages/49/f9/43ab7a43e97aedf6cea6af70fdcbe18abbbc41d4ae6cdec1bfc23bbad403/rpds_py-0.27.0-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:184f0d7b342967f6cda94a07d0e1fae177d11d0b8f17d73e06e36ac02889f303", size = 515863, upload-time = "2025-08-07T08:25:10.431Z" }, + { url = "https://files.pythonhosted.org/packages/38/9b/9bd59dcc636cd04d86a2d20ad967770bf348f5eb5922a8f29b547c074243/rpds_py-0.27.0-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a00c91104c173c9043bc46f7b30ee5e6d2f6b1149f11f545580f5d6fdff42c0b", size = 402398, upload-time = "2025-08-07T08:25:11.819Z" }, + { url = "https://files.pythonhosted.org/packages/71/bf/f099328c6c85667aba6b66fa5c35a8882db06dcd462ea214be72813a0dd2/rpds_py-0.27.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f7a37dd208f0d658e0487522078b1ed68cd6bce20ef4b5a915d2809b9094b410", size = 384665, upload-time = "2025-08-07T08:25:13.194Z" }, + { url = "https://files.pythonhosted.org/packages/a9/c5/9c1f03121ece6634818490bd3c8be2c82a70928a19de03467fb25a3ae2a8/rpds_py-0.27.0-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:92f3b3ec3e6008a1fe00b7c0946a170f161ac00645cde35e3c9a68c2475e8156", size = 400405, upload-time = "2025-08-07T08:25:14.417Z" }, + { url = "https://files.pythonhosted.org/packages/b5/b8/e25d54af3e63ac94f0c16d8fe143779fe71ff209445a0c00d0f6984b6b2c/rpds_py-0.27.0-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a1b3db5fae5cbce2131b7420a3f83553d4d89514c03d67804ced36161fe8b6b2", size = 413179, upload-time = "2025-08-07T08:25:15.664Z" }, + { url = "https://files.pythonhosted.org/packages/f9/d1/406b3316433fe49c3021546293a04bc33f1478e3ec7950215a7fce1a1208/rpds_py-0.27.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:5355527adaa713ab693cbce7c1e0ec71682f599f61b128cf19d07e5c13c9b1f1", size = 556895, upload-time = "2025-08-07T08:25:17.061Z" }, + { url = "https://files.pythonhosted.org/packages/5f/bc/3697c0c21fcb9a54d46ae3b735eb2365eea0c2be076b8f770f98e07998de/rpds_py-0.27.0-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:fcc01c57ce6e70b728af02b2401c5bc853a9e14eb07deda30624374f0aebfe42", size = 585464, upload-time = "2025-08-07T08:25:18.406Z" }, + { url = "https://files.pythonhosted.org/packages/63/09/ee1bb5536f99f42c839b177d552f6114aa3142d82f49cef49261ed28dbe0/rpds_py-0.27.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:3001013dae10f806380ba739d40dee11db1ecb91684febb8406a87c2ded23dae", size = 555090, upload-time = "2025-08-07T08:25:20.461Z" }, + { url = "https://files.pythonhosted.org/packages/7d/2c/363eada9e89f7059199d3724135a86c47082cbf72790d6ba2f336d146ddb/rpds_py-0.27.0-cp314-cp314t-win32.whl", hash = "sha256:0f401c369186a5743694dd9fc08cba66cf70908757552e1f714bfc5219c655b5", size = 218001, upload-time = "2025-08-07T08:25:21.761Z" }, + { url = "https://files.pythonhosted.org/packages/e2/3f/d6c216ed5199c9ef79e2a33955601f454ed1e7420a93b89670133bca5ace/rpds_py-0.27.0-cp314-cp314t-win_amd64.whl", hash = "sha256:8a1dca5507fa1337f75dcd5070218b20bc68cf8844271c923c1b79dfcbc20391", size = 230993, upload-time = "2025-08-07T08:25:23.34Z" }, + { url = "https://files.pythonhosted.org/packages/a3/2e/82fee0cb7142bc32a9ce586eadd24a945257c016902d575bb377ad5feb10/rpds_py-0.27.0-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:e0d7151a1bd5d0a203a5008fc4ae51a159a610cb82ab0a9b2c4d80241745582e", size = 371495, upload-time = "2025-08-07T08:25:24.577Z" }, + { url = "https://files.pythonhosted.org/packages/f9/b5/b421756c7e5cc1d2bb438a34b16f750363d0d87caf2bfa6f2326423c42e5/rpds_py-0.27.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:42ccc57ff99166a55a59d8c7d14f1a357b7749f9ed3584df74053fd098243451", size = 354823, upload-time = "2025-08-07T08:25:25.854Z" }, + { url = "https://files.pythonhosted.org/packages/f9/4a/63337bbabfa38d4094144d0e689758e8452372fd3e45359b806fc1b4c022/rpds_py-0.27.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e377e4cf8795cdbdff75b8f0223d7b6c68ff4fef36799d88ccf3a995a91c0112", size = 381538, upload-time = "2025-08-07T08:25:27.17Z" }, + { url = "https://files.pythonhosted.org/packages/33/8b/14eb61fb9a5bb830d28c548e3e67046fd04cae06c2ce6afe7f30aba7f7f0/rpds_py-0.27.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:79af163a4b40bbd8cfd7ca86ec8b54b81121d3b213b4435ea27d6568bcba3e9d", size = 396724, upload-time = "2025-08-07T08:25:28.409Z" }, + { url = "https://files.pythonhosted.org/packages/03/54/47faf6aa4040443b108b24ae08e9db6fe6daaa8140b696f905833f325293/rpds_py-0.27.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b2eff8ee57c5996b0d2a07c3601fb4ce5fbc37547344a26945dd9e5cbd1ed27a", size = 517084, upload-time = "2025-08-07T08:25:29.698Z" }, + { url = "https://files.pythonhosted.org/packages/0b/88/a78dbacc9a96e3ea7e83d9bed8f272754e618c629ed6a9f8e2a506c84419/rpds_py-0.27.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7cf9bc4508efb18d8dff6934b602324eb9f8c6644749627ce001d6f38a490889", size = 402397, upload-time = "2025-08-07T08:25:31.21Z" }, + { url = "https://files.pythonhosted.org/packages/6b/88/268c6422c0c3a0f01bf6e79086f6e4dbc6a2e60a6e95413ad17e3392ec0a/rpds_py-0.27.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:05284439ebe7d9f5f5a668d4d8a0a1d851d16f7d47c78e1fab968c8ad30cab04", size = 383570, upload-time = "2025-08-07T08:25:32.842Z" }, + { url = "https://files.pythonhosted.org/packages/9c/1a/34f5a2459b9752cc08e02c3845c8f570222f7dbd48c7baac4b827701a40e/rpds_py-0.27.0-cp39-cp39-manylinux_2_31_riscv64.whl", hash = "sha256:1321bce595ad70e80f97f998db37356b2e22cf98094eba6fe91782e626da2f71", size = 401771, upload-time = "2025-08-07T08:25:34.201Z" }, + { url = "https://files.pythonhosted.org/packages/4e/9b/16979115f2ec783ca06454a141a0f32f082763ef874675c5f756e6e76fcd/rpds_py-0.27.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:737005088449ddd3b3df5a95476ee1c2c5c669f5c30eed909548a92939c0e12d", size = 416215, upload-time = "2025-08-07T08:25:35.559Z" }, + { url = "https://files.pythonhosted.org/packages/81/0b/0305df88fb22db8efe81753ce4ec51b821555448fd94ec77ae4e5dfd57b7/rpds_py-0.27.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:9b2a4e17bfd68536c3b801800941c95a1d4a06e3cada11c146093ba939d9638d", size = 558573, upload-time = "2025-08-07T08:25:36.935Z" }, + { url = "https://files.pythonhosted.org/packages/84/9a/c48be4da43a556495cf66d6bf71a16e8e3e22ae8e724b678e430521d0702/rpds_py-0.27.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:dc6b0d5a1ea0318ef2def2b6a55dccf1dcaf77d605672347271ed7b829860765", size = 587956, upload-time = "2025-08-07T08:25:38.338Z" }, + { url = "https://files.pythonhosted.org/packages/76/95/deb1111abde461330c4dad22b14347d064161fb7cb249746a06accc07633/rpds_py-0.27.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:4c3f8a0d4802df34fcdbeb3dfe3a4d8c9a530baea8fafdf80816fcaac5379d83", size = 554493, upload-time = "2025-08-07T08:25:39.665Z" }, + { url = "https://files.pythonhosted.org/packages/cb/16/5342d91917f26da91fc193932d9fbf422e2903aaee9bd3c6ecb4875ef17f/rpds_py-0.27.0-cp39-cp39-win32.whl", hash = "sha256:699c346abc73993962cac7bb4f02f58e438840fa5458a048d3a178a7a670ba86", size = 218302, upload-time = "2025-08-07T08:25:41.401Z" }, + { url = "https://files.pythonhosted.org/packages/fb/a3/0346108a47efe41b50d8781688b7fb16b18d252053486c932d10b18977c9/rpds_py-0.27.0-cp39-cp39-win_amd64.whl", hash = "sha256:be806e2961cd390a89d6c3ce8c2ae34271cfcd05660f716257838bb560f1c3b6", size = 229977, upload-time = "2025-08-07T08:25:42.685Z" }, + { url = "https://files.pythonhosted.org/packages/47/55/287068956f9ba1cb40896d291213f09fdd4527630709058b45a592bc09dc/rpds_py-0.27.0-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:46f48482c1a4748ab2773f75fffbdd1951eb59794e32788834b945da857c47a8", size = 371566, upload-time = "2025-08-07T08:25:43.95Z" }, + { url = "https://files.pythonhosted.org/packages/a2/fb/443af59cbe552e89680bb0f1d1ba47f6387b92083e28a45b8c8863b86c5a/rpds_py-0.27.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:419dd9c98bcc9fb0242be89e0c6e922df333b975d4268faa90d58499fd9c9ebe", size = 355781, upload-time = "2025-08-07T08:25:45.256Z" }, + { url = "https://files.pythonhosted.org/packages/ad/f0/35f48bb073b5ca42b1dcc55cb148f4a3bd4411a3e584f6a18d26f0ea8832/rpds_py-0.27.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:55d42a0ef2bdf6bc81e1cc2d49d12460f63c6ae1423c4f4851b828e454ccf6f1", size = 382575, upload-time = "2025-08-07T08:25:46.524Z" }, + { url = "https://files.pythonhosted.org/packages/51/e1/5f5296a21d1189f0f116a938af2e346d83172bf814d373695e54004a936f/rpds_py-0.27.0-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2e39169ac6aae06dd79c07c8a69d9da867cef6a6d7883a0186b46bb46ccfb0c3", size = 397435, upload-time = "2025-08-07T08:25:48.204Z" }, + { url = "https://files.pythonhosted.org/packages/97/79/3af99b7852b2b55cad8a08863725cbe9dc14781bcf7dc6ecead0c3e1dc54/rpds_py-0.27.0-pp310-pypy310_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:935afcdea4751b0ac918047a2df3f720212892347767aea28f5b3bf7be4f27c0", size = 514861, upload-time = "2025-08-07T08:25:49.814Z" }, + { url = "https://files.pythonhosted.org/packages/df/3e/11fd6033708ed3ae0e6947bb94f762f56bb46bf59a1b16eef6944e8a62ee/rpds_py-0.27.0-pp310-pypy310_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8de567dec6d451649a781633d36f5c7501711adee329d76c095be2178855b042", size = 402776, upload-time = "2025-08-07T08:25:51.135Z" }, + { url = "https://files.pythonhosted.org/packages/b7/89/f9375ceaa996116de9cbc949874804c7874d42fb258c384c037a46d730b8/rpds_py-0.27.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:555ed147cbe8c8f76e72a4c6cd3b7b761cbf9987891b9448808148204aed74a5", size = 384665, upload-time = "2025-08-07T08:25:52.82Z" }, + { url = "https://files.pythonhosted.org/packages/48/bf/0061e55c6f1f573a63c0f82306b8984ed3b394adafc66854a936d5db3522/rpds_py-0.27.0-pp310-pypy310_pp73-manylinux_2_31_riscv64.whl", hash = "sha256:d2cc2b34f9e1d31ce255174da82902ad75bd7c0d88a33df54a77a22f2ef421ee", size = 402518, upload-time = "2025-08-07T08:25:54.073Z" }, + { url = "https://files.pythonhosted.org/packages/ae/dc/8d506676bfe87b3b683332ec8e6ab2b0be118a3d3595ed021e3274a63191/rpds_py-0.27.0-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:cb0702c12983be3b2fab98ead349ac63a98216d28dda6f518f52da5498a27a1b", size = 416247, upload-time = "2025-08-07T08:25:55.433Z" }, + { url = "https://files.pythonhosted.org/packages/2e/02/9a89eea1b75c69e81632de7963076e455b1e00e1cfb46dfdabb055fa03e3/rpds_py-0.27.0-pp310-pypy310_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:ba783541be46f27c8faea5a6645e193943c17ea2f0ffe593639d906a327a9bcc", size = 559456, upload-time = "2025-08-07T08:25:56.866Z" }, + { url = "https://files.pythonhosted.org/packages/38/4a/0f3ac4351957847c0d322be6ec72f916e43804a2c1d04e9672ea4a67c315/rpds_py-0.27.0-pp310-pypy310_pp73-musllinux_1_2_i686.whl", hash = "sha256:2406d034635d1497c596c40c85f86ecf2bf9611c1df73d14078af8444fe48031", size = 587778, upload-time = "2025-08-07T08:25:58.202Z" }, + { url = "https://files.pythonhosted.org/packages/c2/8e/39d0d7401095bed5a5ad5ef304fae96383f9bef40ca3f3a0807ff5b68d9d/rpds_py-0.27.0-pp310-pypy310_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:dea0808153f1fbbad772669d906cddd92100277533a03845de6893cadeffc8be", size = 555247, upload-time = "2025-08-07T08:25:59.707Z" }, + { url = "https://files.pythonhosted.org/packages/e0/04/6b8311e811e620b9eaca67cd80a118ff9159558a719201052a7b2abb88bf/rpds_py-0.27.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:d2a81bdcfde4245468f7030a75a37d50400ac2455c3a4819d9d550c937f90ab5", size = 230256, upload-time = "2025-08-07T08:26:01.07Z" }, + { url = "https://files.pythonhosted.org/packages/59/64/72ab5b911fdcc48058359b0e786e5363e3fde885156116026f1a2ba9a5b5/rpds_py-0.27.0-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:e6491658dd2569f05860bad645569145c8626ac231877b0fb2d5f9bcb7054089", size = 371658, upload-time = "2025-08-07T08:26:02.369Z" }, + { url = "https://files.pythonhosted.org/packages/6c/4b/90ff04b4da055db53d8fea57640d8d5d55456343a1ec9a866c0ecfe10fd1/rpds_py-0.27.0-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:bec77545d188f8bdd29d42bccb9191682a46fb2e655e3d1fb446d47c55ac3b8d", size = 355529, upload-time = "2025-08-07T08:26:03.83Z" }, + { url = "https://files.pythonhosted.org/packages/a4/be/527491fb1afcd86fc5ce5812eb37bc70428ee017d77fee20de18155c3937/rpds_py-0.27.0-pp311-pypy311_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:25a4aebf8ca02bbb90a9b3e7a463bbf3bee02ab1c446840ca07b1695a68ce424", size = 382822, upload-time = "2025-08-07T08:26:05.52Z" }, + { url = "https://files.pythonhosted.org/packages/e0/a5/dcdb8725ce11e6d0913e6fcf782a13f4b8a517e8acc70946031830b98441/rpds_py-0.27.0-pp311-pypy311_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:44524b96481a4c9b8e6c46d6afe43fa1fb485c261e359fbe32b63ff60e3884d8", size = 397233, upload-time = "2025-08-07T08:26:07.179Z" }, + { url = "https://files.pythonhosted.org/packages/33/f9/0947920d1927e9f144660590cc38cadb0795d78fe0d9aae0ef71c1513b7c/rpds_py-0.27.0-pp311-pypy311_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:45d04a73c54b6a5fd2bab91a4b5bc8b426949586e61340e212a8484919183859", size = 514892, upload-time = "2025-08-07T08:26:08.622Z" }, + { url = "https://files.pythonhosted.org/packages/1d/ed/d1343398c1417c68f8daa1afce56ef6ce5cc587daaf98e29347b00a80ff2/rpds_py-0.27.0-pp311-pypy311_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:343cf24de9ed6c728abefc5d5c851d5de06497caa7ac37e5e65dd572921ed1b5", size = 402733, upload-time = "2025-08-07T08:26:10.433Z" }, + { url = "https://files.pythonhosted.org/packages/1d/0b/646f55442cd14014fb64d143428f25667a100f82092c90087b9ea7101c74/rpds_py-0.27.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7aed8118ae20515974650d08eb724150dc2e20c2814bcc307089569995e88a14", size = 384447, upload-time = "2025-08-07T08:26:11.847Z" }, + { url = "https://files.pythonhosted.org/packages/4b/15/0596ef7529828e33a6c81ecf5013d1dd33a511a3e0be0561f83079cda227/rpds_py-0.27.0-pp311-pypy311_pp73-manylinux_2_31_riscv64.whl", hash = "sha256:af9d4fd79ee1cc8e7caf693ee02737daabfc0fcf2773ca0a4735b356c8ad6f7c", size = 402502, upload-time = "2025-08-07T08:26:13.537Z" }, + { url = "https://files.pythonhosted.org/packages/c3/8d/986af3c42f8454a6cafff8729d99fb178ae9b08a9816325ac7a8fa57c0c0/rpds_py-0.27.0-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f0396e894bd1e66c74ecbc08b4f6a03dc331140942c4b1d345dd131b68574a60", size = 416651, upload-time = "2025-08-07T08:26:14.923Z" }, + { url = "https://files.pythonhosted.org/packages/e9/9a/b4ec3629b7b447e896eec574469159b5b60b7781d3711c914748bf32de05/rpds_py-0.27.0-pp311-pypy311_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:59714ab0a5af25d723d8e9816638faf7f4254234decb7d212715c1aa71eee7be", size = 559460, upload-time = "2025-08-07T08:26:16.295Z" }, + { url = "https://files.pythonhosted.org/packages/61/63/d1e127b40c3e4733b3a6f26ae7a063cdf2bc1caa5272c89075425c7d397a/rpds_py-0.27.0-pp311-pypy311_pp73-musllinux_1_2_i686.whl", hash = "sha256:88051c3b7d5325409f433c5a40328fcb0685fc04e5db49ff936e910901d10114", size = 588072, upload-time = "2025-08-07T08:26:17.776Z" }, + { url = "https://files.pythonhosted.org/packages/04/7e/8ffc71a8f6833d9c9fb999f5b0ee736b8b159fd66968e05c7afc2dbcd57e/rpds_py-0.27.0-pp311-pypy311_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:181bc29e59e5e5e6e9d63b143ff4d5191224d355e246b5a48c88ce6b35c4e466", size = 555083, upload-time = "2025-08-07T08:26:19.301Z" }, + { url = "https://files.pythonhosted.org/packages/a8/fc/ef6386838e0e91d6ba79b741ccce6ca987e89619aa86f418fecf381eba23/rpds_py-0.27.0-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:9ad08547995a57e74fea6abaf5940d399447935faebbd2612b3b0ca6f987946b", size = 371849, upload-time = "2025-08-07T08:26:20.597Z" }, + { url = "https://files.pythonhosted.org/packages/2c/f8/f30394aff811bc0f13fab8d8e4b9f880fcb678234eb0af7d2c4b6232f44f/rpds_py-0.27.0-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:61490d57e82e23b45c66f96184237994bfafa914433b8cd1a9bb57fecfced59d", size = 356437, upload-time = "2025-08-07T08:26:21.899Z" }, + { url = "https://files.pythonhosted.org/packages/87/56/ed704fc668c9abc56d3686b723e4d6f2585597daf4b68b654ade7c97930d/rpds_py-0.27.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d7cf5e726b6fa977e428a61880fb108a62f28b6d0c7ef675b117eaff7076df49", size = 382247, upload-time = "2025-08-07T08:26:23.712Z" }, + { url = "https://files.pythonhosted.org/packages/48/55/6ef2c9b7caae3c1c360d9556a70979e16f21bfb1e94f50f481d224f3b8aa/rpds_py-0.27.0-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:dc662bc9375a6a394b62dfd331874c434819f10ee3902123200dbcf116963f89", size = 397223, upload-time = "2025-08-07T08:26:25.156Z" }, + { url = "https://files.pythonhosted.org/packages/63/04/8fc2059411daaca733155fc2613cc91dc728d7abe31fd0c0fa4c7ec5ff1a/rpds_py-0.27.0-pp39-pypy39_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:299a245537e697f28a7511d01038c310ac74e8ea213c0019e1fc65f52c0dcb23", size = 516308, upload-time = "2025-08-07T08:26:26.585Z" }, + { url = "https://files.pythonhosted.org/packages/a4/d0/b79d3fe07c47bfa989139e692f85371f5a0e1376696b173dabe7ac77b7d1/rpds_py-0.27.0-pp39-pypy39_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:be3964f7312ea05ed283b20f87cb533fdc555b2e428cc7be64612c0b2124f08c", size = 401967, upload-time = "2025-08-07T08:26:27.905Z" }, + { url = "https://files.pythonhosted.org/packages/cd/b1/55014f6da5ec8029d1d7d7d2a884b9d7ad7f217e05bb9cb782f06d8209c4/rpds_py-0.27.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:33ba649a6e55ae3808e4c39e01580dc9a9b0d5b02e77b66bb86ef117922b1264", size = 384584, upload-time = "2025-08-07T08:26:29.251Z" }, + { url = "https://files.pythonhosted.org/packages/86/34/5c5c1a8550ac172dd6cd53925c321363d94b2a1f0b3173743dbbfd87b8ec/rpds_py-0.27.0-pp39-pypy39_pp73-manylinux_2_31_riscv64.whl", hash = "sha256:81f81bbd7cdb4bdc418c09a73809abeda8f263a6bf8f9c7f93ed98b5597af39d", size = 401879, upload-time = "2025-08-07T08:26:30.598Z" }, + { url = "https://files.pythonhosted.org/packages/35/07/009bbc659388c4c5a256f05f56df207633cda2f5d61a8d54c50c427e435e/rpds_py-0.27.0-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:11e8e28c0ba0373d052818b600474cfee2fafa6c9f36c8587d217b13ee28ca7d", size = 416908, upload-time = "2025-08-07T08:26:32.074Z" }, + { url = "https://files.pythonhosted.org/packages/7a/cc/8949c13dc5a05d955cb88909bfac4004805974dec7b0d02543de55e43272/rpds_py-0.27.0-pp39-pypy39_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:e3acb9c16530362aeaef4e84d57db357002dc5cbfac9a23414c3e73c08301ab2", size = 559105, upload-time = "2025-08-07T08:26:33.53Z" }, + { url = "https://files.pythonhosted.org/packages/ea/40/574da2033b01d6e2e7fa3b021993321565c6634f9d0021707d210ce35b58/rpds_py-0.27.0-pp39-pypy39_pp73-musllinux_1_2_i686.whl", hash = "sha256:2e307cb5f66c59ede95c00e93cd84190a5b7f3533d7953690b2036780622ba81", size = 588335, upload-time = "2025-08-07T08:26:34.961Z" }, + { url = "https://files.pythonhosted.org/packages/1d/83/72ed1ce357d8c63bde0bba2458a502e7cc4e150e272139161e1d205a9d67/rpds_py-0.27.0-pp39-pypy39_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:f09c9d4c26fa79c1bad927efb05aca2391350b8e61c38cbc0d7d3c814e463124", size = 555094, upload-time = "2025-08-07T08:26:36.838Z" }, + { url = "https://files.pythonhosted.org/packages/6f/15/fc639de53b3798340233f37959d252311b30d1834b65a02741e3373407fa/rpds_py-0.27.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:af22763a0a1eff106426a6e1f13c4582e0d0ad89c1493ab6c058236174cd6c6a", size = 230031, upload-time = "2025-08-07T08:26:38.332Z" }, ] [[package]] @@ -2468,127 +2987,190 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2", size = 10235, upload-time = "2024-02-25T23:20:01.196Z" }, ] +[[package]] +name = "sortedcontainers" +version = "2.4.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e8/c4/ba2f8066cceb6f23394729afe52f3bf7adec04bf9ed2c820b39e19299111/sortedcontainers-2.4.0.tar.gz", hash = "sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88", size = 30594, upload-time = "2021-05-16T22:03:42.897Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/32/46/9cb0e58b2deb7f82b84065f37f3bffeb12413f947f9388e4cac22c4621ce/sortedcontainers-2.4.0-py2.py3-none-any.whl", hash = "sha256:a163dcaede0f1c021485e957a39245190e74249897e2ae4b2aa38595db237ee0", size = 29575, upload-time = "2021-05-16T22:03:41.177Z" }, +] + [[package]] name = "sounddevice" -version = "0.5.1" +version = "0.5.2" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "cffi" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/80/2d/b04ae180312b81dbb694504bee170eada5372242e186f6298139fd3a0513/sounddevice-0.5.1.tar.gz", hash = "sha256:09ca991daeda8ce4be9ac91e15a9a81c8f81efa6b695a348c9171ea0c16cb041", size = 52896, upload-time = "2024-10-12T09:40:12.24Z" } +sdist = { url = "https://files.pythonhosted.org/packages/91/a6/91e9f08ed37c7c9f56b5227c6aea7f2ae63ba2d59520eefb24e82cbdd589/sounddevice-0.5.2.tar.gz", hash = "sha256:c634d51bd4e922d6f0fa5e1a975cc897c947f61d31da9f79ba7ea34dff448b49", size = 53150, upload-time = "2025-05-16T18:12:27.339Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/06/d1/464b5fca3decdd0cfec8c47f7b4161a0b12972453201c1bf03811f367c5e/sounddevice-0.5.1-py3-none-any.whl", hash = "sha256:e2017f182888c3f3c280d9fbac92e5dbddac024a7e3442f6e6116bd79dab8a9c", size = 32276, upload-time = "2024-10-12T09:40:05.605Z" }, - { url = "https://files.pythonhosted.org/packages/6f/f6/6703fe7cf3d7b7279040c792aeec6334e7305956aba4a80f23e62c8fdc44/sounddevice-0.5.1-py3-none-macosx_10_6_x86_64.macosx_10_6_universal2.whl", hash = "sha256:d16cb23d92322526a86a9490c427bf8d49e273d9ccc0bd096feecd229cde6031", size = 107916, upload-time = "2024-10-12T09:40:07.436Z" }, - { url = "https://files.pythonhosted.org/packages/57/a5/78a5e71f5ec0faedc54f4053775d61407bfbd7d0c18228c7f3d4252fd276/sounddevice-0.5.1-py3-none-win32.whl", hash = "sha256:d84cc6231526e7a08e89beff229c37f762baefe5e0cc2747cbe8e3a565470055", size = 312494, upload-time = "2024-10-12T09:40:09.355Z" }, - { url = "https://files.pythonhosted.org/packages/af/9b/15217b04f3b36d30de55fef542389d722de63f1ad81f9c72d8afc98cb6ab/sounddevice-0.5.1-py3-none-win_amd64.whl", hash = "sha256:4313b63f2076552b23ac3e0abd3bcfc0c1c6a696fc356759a13bd113c9df90f1", size = 363634, upload-time = "2024-10-12T09:40:11.065Z" }, + { url = "https://files.pythonhosted.org/packages/75/2d/582738fc01352a5bc20acac9221e58538365cecb3bb264838f66419df219/sounddevice-0.5.2-py3-none-any.whl", hash = "sha256:82375859fac2e73295a4ab3fc60bd4782743157adc339561c1f1142af472f505", size = 32450, upload-time = "2025-05-16T18:12:21.919Z" }, + { url = "https://files.pythonhosted.org/packages/3f/6f/e3dd751face4fcb5be25e8abba22f25d8e6457ebd7e9ed79068b768dc0e5/sounddevice-0.5.2-py3-none-macosx_10_6_x86_64.macosx_10_6_universal2.whl", hash = "sha256:943f27e66037d41435bdd0293454072cdf657b594c9cde63cd01ee3daaac7ab3", size = 108088, upload-time = "2025-05-16T18:12:23.146Z" }, + { url = "https://files.pythonhosted.org/packages/45/0b/bfad79af0b380aa7c0bfe73e4b03e0af45354a48ad62549489bd7696c5b0/sounddevice-0.5.2-py3-none-win32.whl", hash = "sha256:3a113ce614a2c557f14737cb20123ae6298c91fc9301eb014ada0cba6d248c5f", size = 312665, upload-time = "2025-05-16T18:12:24.726Z" }, + { url = "https://files.pythonhosted.org/packages/e1/3e/61d88e6b0a7383127cdc779195cb9d83ebcf11d39bc961de5777e457075e/sounddevice-0.5.2-py3-none-win_amd64.whl", hash = "sha256:e18944b767d2dac3771a7771bdd7ff7d3acd7d334e72c4bedab17d1aed5dbc22", size = 363808, upload-time = "2025-05-16T18:12:26Z" }, +] + +[[package]] +name = "sqlalchemy" +version = "2.0.43" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "greenlet", marker = "(python_full_version < '3.14' and platform_machine == 'AMD64') or (python_full_version < '3.14' and platform_machine == 'WIN32') or (python_full_version < '3.14' and platform_machine == 'aarch64') or (python_full_version < '3.14' and platform_machine == 'amd64') or (python_full_version < '3.14' and platform_machine == 'ppc64le') or (python_full_version < '3.14' and platform_machine == 'win32') or (python_full_version < '3.14' and platform_machine == 'x86_64')" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/d7/bc/d59b5d97d27229b0e009bd9098cd81af71c2fa5549c580a0a67b9bed0496/sqlalchemy-2.0.43.tar.gz", hash = "sha256:788bfcef6787a7764169cfe9859fe425bf44559619e1d9f56f5bddf2ebf6f417", size = 9762949, upload-time = "2025-08-11T14:24:58.438Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/8f/4e/985f7da36f09592c5ade99321c72c15101d23c0bb7eecfd1daaca5714422/sqlalchemy-2.0.43-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:70322986c0c699dca241418fcf18e637a4369e0ec50540a2b907b184c8bca069", size = 2133162, upload-time = "2025-08-11T15:52:17.854Z" }, + { url = "https://files.pythonhosted.org/packages/37/34/798af8db3cae069461e3bc0898a1610dc469386a97048471d364dc8aae1c/sqlalchemy-2.0.43-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:87accdbba88f33efa7b592dc2e8b2a9c2cdbca73db2f9d5c510790428c09c154", size = 2123082, upload-time = "2025-08-11T15:52:19.181Z" }, + { url = "https://files.pythonhosted.org/packages/fb/0f/79cf4d9dad42f61ec5af1e022c92f66c2d110b93bb1dc9b033892971abfa/sqlalchemy-2.0.43-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c00e7845d2f692ebfc7d5e4ec1a3fd87698e4337d09e58d6749a16aedfdf8612", size = 3208871, upload-time = "2025-08-11T15:50:30.656Z" }, + { url = "https://files.pythonhosted.org/packages/56/b3/59befa58fb0e1a9802c87df02344548e6d007e77e87e6084e2131c29e033/sqlalchemy-2.0.43-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:022e436a1cb39b13756cf93b48ecce7aa95382b9cfacceb80a7d263129dfd019", size = 3209583, upload-time = "2025-08-11T15:57:47.697Z" }, + { url = "https://files.pythonhosted.org/packages/29/d2/124b50c0eb8146e8f0fe16d01026c1a073844f0b454436d8544fe9b33bd7/sqlalchemy-2.0.43-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:c5e73ba0d76eefc82ec0219d2301cb33bfe5205ed7a2602523111e2e56ccbd20", size = 3148177, upload-time = "2025-08-11T15:50:32.078Z" }, + { url = "https://files.pythonhosted.org/packages/83/f5/e369cd46aa84278107624617034a5825fedfc5c958b2836310ced4d2eadf/sqlalchemy-2.0.43-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:9c2e02f06c68092b875d5cbe4824238ab93a7fa35d9c38052c033f7ca45daa18", size = 3172276, upload-time = "2025-08-11T15:57:49.477Z" }, + { url = "https://files.pythonhosted.org/packages/de/2b/4602bf4c3477fa4c837c9774e6dd22e0389fc52310c4c4dfb7e7ba05e90d/sqlalchemy-2.0.43-cp310-cp310-win32.whl", hash = "sha256:e7a903b5b45b0d9fa03ac6a331e1c1d6b7e0ab41c63b6217b3d10357b83c8b00", size = 2101491, upload-time = "2025-08-11T15:54:59.191Z" }, + { url = "https://files.pythonhosted.org/packages/38/2d/bfc6b6143adef553a08295490ddc52607ee435b9c751c714620c1b3dd44d/sqlalchemy-2.0.43-cp310-cp310-win_amd64.whl", hash = "sha256:4bf0edb24c128b7be0c61cd17eef432e4bef507013292415f3fb7023f02b7d4b", size = 2125148, upload-time = "2025-08-11T15:55:00.593Z" }, + { url = "https://files.pythonhosted.org/packages/9d/77/fa7189fe44114658002566c6fe443d3ed0ec1fa782feb72af6ef7fbe98e7/sqlalchemy-2.0.43-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:52d9b73b8fb3e9da34c2b31e6d99d60f5f99fd8c1225c9dad24aeb74a91e1d29", size = 2136472, upload-time = "2025-08-11T15:52:21.789Z" }, + { url = "https://files.pythonhosted.org/packages/99/ea/92ac27f2fbc2e6c1766bb807084ca455265707e041ba027c09c17d697867/sqlalchemy-2.0.43-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f42f23e152e4545157fa367b2435a1ace7571cab016ca26038867eb7df2c3631", size = 2126535, upload-time = "2025-08-11T15:52:23.109Z" }, + { url = "https://files.pythonhosted.org/packages/94/12/536ede80163e295dc57fff69724caf68f91bb40578b6ac6583a293534849/sqlalchemy-2.0.43-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4fb1a8c5438e0c5ea51afe9c6564f951525795cf432bed0c028c1cb081276685", size = 3297521, upload-time = "2025-08-11T15:50:33.536Z" }, + { url = "https://files.pythonhosted.org/packages/03/b5/cacf432e6f1fc9d156eca0560ac61d4355d2181e751ba8c0cd9cb232c8c1/sqlalchemy-2.0.43-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db691fa174e8f7036afefe3061bc40ac2b770718be2862bfb03aabae09051aca", size = 3297343, upload-time = "2025-08-11T15:57:51.186Z" }, + { url = "https://files.pythonhosted.org/packages/ca/ba/d4c9b526f18457667de4c024ffbc3a0920c34237b9e9dd298e44c7c00ee5/sqlalchemy-2.0.43-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:fe2b3b4927d0bc03d02ad883f402d5de201dbc8894ac87d2e981e7d87430e60d", size = 3232113, upload-time = "2025-08-11T15:50:34.949Z" }, + { url = "https://files.pythonhosted.org/packages/aa/79/c0121b12b1b114e2c8a10ea297a8a6d5367bc59081b2be896815154b1163/sqlalchemy-2.0.43-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:4d3d9b904ad4a6b175a2de0738248822f5ac410f52c2fd389ada0b5262d6a1e3", size = 3258240, upload-time = "2025-08-11T15:57:52.983Z" }, + { url = "https://files.pythonhosted.org/packages/79/99/a2f9be96fb382f3ba027ad42f00dbe30fdb6ba28cda5f11412eee346bec5/sqlalchemy-2.0.43-cp311-cp311-win32.whl", hash = "sha256:5cda6b51faff2639296e276591808c1726c4a77929cfaa0f514f30a5f6156921", size = 2101248, upload-time = "2025-08-11T15:55:01.855Z" }, + { url = "https://files.pythonhosted.org/packages/ee/13/744a32ebe3b4a7a9c7ea4e57babae7aa22070d47acf330d8e5a1359607f1/sqlalchemy-2.0.43-cp311-cp311-win_amd64.whl", hash = "sha256:c5d1730b25d9a07727d20ad74bc1039bbbb0a6ca24e6769861c1aa5bf2c4c4a8", size = 2126109, upload-time = "2025-08-11T15:55:04.092Z" }, + { url = "https://files.pythonhosted.org/packages/61/db/20c78f1081446095450bdc6ee6cc10045fce67a8e003a5876b6eaafc5cc4/sqlalchemy-2.0.43-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:20d81fc2736509d7a2bd33292e489b056cbae543661bb7de7ce9f1c0cd6e7f24", size = 2134891, upload-time = "2025-08-11T15:51:13.019Z" }, + { url = "https://files.pythonhosted.org/packages/45/0a/3d89034ae62b200b4396f0f95319f7d86e9945ee64d2343dcad857150fa2/sqlalchemy-2.0.43-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:25b9fc27650ff5a2c9d490c13c14906b918b0de1f8fcbb4c992712d8caf40e83", size = 2123061, upload-time = "2025-08-11T15:51:14.319Z" }, + { url = "https://files.pythonhosted.org/packages/cb/10/2711f7ff1805919221ad5bee205971254845c069ee2e7036847103ca1e4c/sqlalchemy-2.0.43-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6772e3ca8a43a65a37c88e2f3e2adfd511b0b1da37ef11ed78dea16aeae85bd9", size = 3320384, upload-time = "2025-08-11T15:52:35.088Z" }, + { url = "https://files.pythonhosted.org/packages/6e/0e/3d155e264d2ed2778484006ef04647bc63f55b3e2d12e6a4f787747b5900/sqlalchemy-2.0.43-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1a113da919c25f7f641ffbd07fbc9077abd4b3b75097c888ab818f962707eb48", size = 3329648, upload-time = "2025-08-11T15:56:34.153Z" }, + { url = "https://files.pythonhosted.org/packages/5b/81/635100fb19725c931622c673900da5efb1595c96ff5b441e07e3dd61f2be/sqlalchemy-2.0.43-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:4286a1139f14b7d70141c67a8ae1582fc2b69105f1b09d9573494eb4bb4b2687", size = 3258030, upload-time = "2025-08-11T15:52:36.933Z" }, + { url = "https://files.pythonhosted.org/packages/0c/ed/a99302716d62b4965fded12520c1cbb189f99b17a6d8cf77611d21442e47/sqlalchemy-2.0.43-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:529064085be2f4d8a6e5fab12d36ad44f1909a18848fcfbdb59cc6d4bbe48efe", size = 3294469, upload-time = "2025-08-11T15:56:35.553Z" }, + { url = "https://files.pythonhosted.org/packages/5d/a2/3a11b06715149bf3310b55a98b5c1e84a42cfb949a7b800bc75cb4e33abc/sqlalchemy-2.0.43-cp312-cp312-win32.whl", hash = "sha256:b535d35dea8bbb8195e7e2b40059e2253acb2b7579b73c1b432a35363694641d", size = 2098906, upload-time = "2025-08-11T15:55:00.645Z" }, + { url = "https://files.pythonhosted.org/packages/bc/09/405c915a974814b90aa591280623adc6ad6b322f61fd5cff80aeaef216c9/sqlalchemy-2.0.43-cp312-cp312-win_amd64.whl", hash = "sha256:1c6d85327ca688dbae7e2b06d7d84cfe4f3fffa5b5f9e21bb6ce9d0e1a0e0e0a", size = 2126260, upload-time = "2025-08-11T15:55:02.965Z" }, + { url = "https://files.pythonhosted.org/packages/41/1c/a7260bd47a6fae7e03768bf66451437b36451143f36b285522b865987ced/sqlalchemy-2.0.43-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e7c08f57f75a2bb62d7ee80a89686a5e5669f199235c6d1dac75cd59374091c3", size = 2130598, upload-time = "2025-08-11T15:51:15.903Z" }, + { url = "https://files.pythonhosted.org/packages/8e/84/8a337454e82388283830b3586ad7847aa9c76fdd4f1df09cdd1f94591873/sqlalchemy-2.0.43-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:14111d22c29efad445cd5021a70a8b42f7d9152d8ba7f73304c4d82460946aaa", size = 2118415, upload-time = "2025-08-11T15:51:17.256Z" }, + { url = "https://files.pythonhosted.org/packages/cf/ff/22ab2328148492c4d71899d62a0e65370ea66c877aea017a244a35733685/sqlalchemy-2.0.43-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:21b27b56eb2f82653168cefe6cb8e970cdaf4f3a6cb2c5e3c3c1cf3158968ff9", size = 3248707, upload-time = "2025-08-11T15:52:38.444Z" }, + { url = "https://files.pythonhosted.org/packages/dc/29/11ae2c2b981de60187f7cbc84277d9d21f101093d1b2e945c63774477aba/sqlalchemy-2.0.43-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9c5a9da957c56e43d72126a3f5845603da00e0293720b03bde0aacffcf2dc04f", size = 3253602, upload-time = "2025-08-11T15:56:37.348Z" }, + { url = "https://files.pythonhosted.org/packages/b8/61/987b6c23b12c56d2be451bc70900f67dd7d989d52b1ee64f239cf19aec69/sqlalchemy-2.0.43-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:5d79f9fdc9584ec83d1b3c75e9f4595c49017f5594fee1a2217117647225d738", size = 3183248, upload-time = "2025-08-11T15:52:39.865Z" }, + { url = "https://files.pythonhosted.org/packages/86/85/29d216002d4593c2ce1c0ec2cec46dda77bfbcd221e24caa6e85eff53d89/sqlalchemy-2.0.43-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:9df7126fd9db49e3a5a3999442cc67e9ee8971f3cb9644250107d7296cb2a164", size = 3219363, upload-time = "2025-08-11T15:56:39.11Z" }, + { url = "https://files.pythonhosted.org/packages/b6/e4/bd78b01919c524f190b4905d47e7630bf4130b9f48fd971ae1c6225b6f6a/sqlalchemy-2.0.43-cp313-cp313-win32.whl", hash = "sha256:7f1ac7828857fcedb0361b48b9ac4821469f7694089d15550bbcf9ab22564a1d", size = 2096718, upload-time = "2025-08-11T15:55:05.349Z" }, + { url = "https://files.pythonhosted.org/packages/ac/a5/ca2f07a2a201f9497de1928f787926613db6307992fe5cda97624eb07c2f/sqlalchemy-2.0.43-cp313-cp313-win_amd64.whl", hash = "sha256:971ba928fcde01869361f504fcff3b7143b47d30de188b11c6357c0505824197", size = 2123200, upload-time = "2025-08-11T15:55:07.932Z" }, + { url = "https://files.pythonhosted.org/packages/92/95/ddb5acf74a71e0fa4f9410c7d8555f169204ae054a49693b3cd31d0bf504/sqlalchemy-2.0.43-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:ceb5c832cc30663aeaf5e39657712f4c4241ad1f638d487ef7216258f6d41fe7", size = 2136445, upload-time = "2025-08-12T17:29:06.145Z" }, + { url = "https://files.pythonhosted.org/packages/ea/d4/7d7ea7dfbc1ddb0aa54dd63a686cd43842192b8e1bfb5315bb052925f704/sqlalchemy-2.0.43-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:11f43c39b4b2ec755573952bbcc58d976779d482f6f832d7f33a8d869ae891bf", size = 2126411, upload-time = "2025-08-12T17:29:08.138Z" }, + { url = "https://files.pythonhosted.org/packages/07/bd/123ba09bec14112de10e49d8835e6561feb24fd34131099d98d28d34f106/sqlalchemy-2.0.43-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:413391b2239db55be14fa4223034d7e13325a1812c8396ecd4f2c08696d5ccad", size = 3221776, upload-time = "2025-08-11T16:00:30.938Z" }, + { url = "https://files.pythonhosted.org/packages/ae/35/553e45d5b91b15980c13e1dbcd7591f49047589843fff903c086d7985afb/sqlalchemy-2.0.43-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c379e37b08c6c527181a397212346be39319fb64323741d23e46abd97a400d34", size = 3221665, upload-time = "2025-08-12T17:29:11.307Z" }, + { url = "https://files.pythonhosted.org/packages/07/4d/ff03e516087251da99bd879b5fdb2c697ff20295c836318dda988e12ec19/sqlalchemy-2.0.43-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:03d73ab2a37d9e40dec4984d1813d7878e01dbdc742448d44a7341b7a9f408c7", size = 3160067, upload-time = "2025-08-11T16:00:33.148Z" }, + { url = "https://files.pythonhosted.org/packages/ae/88/cbc7caa186ecdc5dea013e9ccc00d78b93a6638dc39656a42369a9536458/sqlalchemy-2.0.43-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:8cee08f15d9e238ede42e9bbc1d6e7158d0ca4f176e4eab21f88ac819ae3bd7b", size = 3184462, upload-time = "2025-08-12T17:29:14.919Z" }, + { url = "https://files.pythonhosted.org/packages/ab/69/f8bbd43080b6fa75cb44ff3a1cc99aaae538dd0ade1a58206912b2565d72/sqlalchemy-2.0.43-cp39-cp39-win32.whl", hash = "sha256:b3edaec7e8b6dc5cd94523c6df4f294014df67097c8217a89929c99975811414", size = 2104031, upload-time = "2025-08-11T15:48:56.453Z" }, + { url = "https://files.pythonhosted.org/packages/36/39/2ec1b0e7a4f44d833d924e7bfca8054c72e37eb73f4d02795d16d8b0230a/sqlalchemy-2.0.43-cp39-cp39-win_amd64.whl", hash = "sha256:227119ce0a89e762ecd882dc661e0aa677a690c914e358f0dd8932a2e8b2765b", size = 2128007, upload-time = "2025-08-11T15:48:57.872Z" }, + { url = "https://files.pythonhosted.org/packages/b8/d9/13bdde6521f322861fab67473cec4b1cc8999f3871953531cf61945fad92/sqlalchemy-2.0.43-py3-none-any.whl", hash = "sha256:1681c21dd2ccee222c2fe0bef671d1aef7c504087c9c4e800371cfcc8ac966fc", size = 1924759, upload-time = "2025-08-11T15:39:53.024Z" }, ] [[package]] name = "sse-starlette" -version = "2.2.1" +version = "3.0.2" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "anyio", marker = "python_full_version >= '3.10'" }, - { name = "starlette", marker = "python_full_version >= '3.10'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/71/a4/80d2a11af59fe75b48230846989e93979c892d3a20016b42bb44edb9e398/sse_starlette-2.2.1.tar.gz", hash = "sha256:54470d5f19274aeed6b2d473430b08b4b379ea851d953b11d7f1c4a2c118b419", size = 17376, upload-time = "2024-12-25T09:09:30.616Z" } +sdist = { url = "https://files.pythonhosted.org/packages/42/6f/22ed6e33f8a9e76ca0a412405f31abb844b779d52c5f96660766edcd737c/sse_starlette-3.0.2.tar.gz", hash = "sha256:ccd60b5765ebb3584d0de2d7a6e4f745672581de4f5005ab31c3a25d10b52b3a", size = 20985, upload-time = "2025-07-27T09:07:44.565Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/d9/e0/5b8bd393f27f4a62461c5cf2479c75a2cc2ffa330976f9f00f5f6e4f50eb/sse_starlette-2.2.1-py3-none-any.whl", hash = "sha256:6410a3d3ba0c89e7675d4c273a301d64649c03a5ef1ca101f10b47f895fd0e99", size = 10120, upload-time = "2024-12-25T09:09:26.761Z" }, + { url = "https://files.pythonhosted.org/packages/ef/10/c78f463b4ef22eef8491f218f692be838282cd65480f6e423d7730dfd1fb/sse_starlette-3.0.2-py3-none-any.whl", hash = "sha256:16b7cbfddbcd4eaca11f7b586f3b8a080f1afe952c15813455b162edea619e5a", size = 11297, upload-time = "2025-07-27T09:07:43.268Z" }, ] [[package]] name = "starlette" -version = "0.46.2" +version = "0.47.2" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "anyio" }, - { name = "typing-extensions", marker = "python_full_version < '3.10'" }, + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/ce/20/08dfcd9c983f6a6f4a1000d934b9e6d626cff8d2eeb77a89a68eef20a2b7/starlette-0.46.2.tar.gz", hash = "sha256:7f7361f34eed179294600af672f565727419830b54b7b084efe44bb82d2fccd5", size = 2580846, upload-time = "2025-04-13T13:56:17.942Z" } +sdist = { url = "https://files.pythonhosted.org/packages/04/57/d062573f391d062710d4088fa1369428c38d51460ab6fedff920efef932e/starlette-0.47.2.tar.gz", hash = "sha256:6ae9aa5db235e4846decc1e7b79c4f346adf41e9777aebeb49dfd09bbd7023d8", size = 2583948, upload-time = "2025-07-20T17:31:58.522Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/8b/0c/9d30a4ebeb6db2b25a841afbb80f6ef9a854fc3b41be131d249a977b4959/starlette-0.46.2-py3-none-any.whl", hash = "sha256:595633ce89f8ffa71a015caed34a5b2dc1c0cdb3f0f1fbd1e69339cf2abeec35", size = 72037, upload-time = "2025-04-13T13:56:16.21Z" }, + { url = "https://files.pythonhosted.org/packages/f7/1f/b876b1f83aef204198a42dc101613fefccb32258e5428b5f9259677864b4/starlette-0.47.2-py3-none-any.whl", hash = "sha256:c5847e96134e5c5371ee9fac6fdf1a67336d5815e09eb2a01fdb57a351ef915b", size = 72984, upload-time = "2025-07-20T17:31:56.738Z" }, ] [[package]] name = "textual" -version = "3.1.0" +version = "5.3.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "markdown-it-py", extra = ["linkify", "plugins"] }, + { name = "markdown-it-py", version = "3.0.0", source = { registry = "https://pypi.org/simple" }, extra = ["linkify", "plugins"], marker = "python_full_version < '3.10'" }, + { name = "markdown-it-py", version = "4.0.0", source = { registry = "https://pypi.org/simple" }, extra = ["linkify", "plugins"], marker = "python_full_version >= '3.10'" }, { name = "platformdirs" }, + { name = "pygments" }, { name = "rich" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/dc/1f/df371f1455524a3d0079871e49e3850c82767904e9f4e2bdea6d30a866a7/textual-3.1.0.tar.gz", hash = "sha256:6bcab6581e9753d2a2043caf49f43c5818feb35f8049ed185bd38982bfb310ca", size = 1591879, upload-time = "2025-04-12T08:00:38.082Z" } +sdist = { url = "https://files.pythonhosted.org/packages/ba/ce/f0f938d33d9bebbf8629e0020be00c560ddfa90a23ebe727c2e5aa3f30cf/textual-5.3.0.tar.gz", hash = "sha256:1b6128b339adef2e298cc23ab4777180443240ece5c232f29b22960efd658d4d", size = 1557651, upload-time = "2025-08-07T12:36:50.342Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/32/6b/d6d37a5fd93c344a27c53cdc4910d8d52cedd3ae63eae3d645fb108bd591/textual-3.1.0-py3-none-any.whl", hash = "sha256:940a765b6fcd562cd88603780343dc98a4e66c1d8d42f09b6a16a474a89aca0c", size = 683799, upload-time = "2025-04-12T08:00:36.27Z" }, + { url = "https://files.pythonhosted.org/packages/00/2f/f7c8a533bee50fbf5bb37ffc1621e7b2cdd8c9a6301fc51faa35fa50b09d/textual-5.3.0-py3-none-any.whl", hash = "sha256:02a6abc065514c4e21f94e79aaecea1f78a28a85d11d7bfc64abf3392d399890", size = 702671, upload-time = "2025-08-07T12:36:48.272Z" }, ] [[package]] name = "tiktoken" -version = "0.9.0" +version = "0.11.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "regex" }, { name = "requests" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/ea/cf/756fedf6981e82897f2d570dd25fa597eb3f4459068ae0572d7e888cfd6f/tiktoken-0.9.0.tar.gz", hash = "sha256:d02a5ca6a938e0490e1ff957bc48c8b078c88cb83977be1625b1fd8aac792c5d", size = 35991, upload-time = "2025-02-14T06:03:01.003Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/64/f3/50ec5709fad61641e4411eb1b9ac55b99801d71f1993c29853f256c726c9/tiktoken-0.9.0-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:586c16358138b96ea804c034b8acf3f5d3f0258bd2bc3b0227af4af5d622e382", size = 1065770, upload-time = "2025-02-14T06:02:01.251Z" }, - { url = "https://files.pythonhosted.org/packages/d6/f8/5a9560a422cf1755b6e0a9a436e14090eeb878d8ec0f80e0cd3d45b78bf4/tiktoken-0.9.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:d9c59ccc528c6c5dd51820b3474402f69d9a9e1d656226848ad68a8d5b2e5108", size = 1009314, upload-time = "2025-02-14T06:02:02.869Z" }, - { url = "https://files.pythonhosted.org/packages/bc/20/3ed4cfff8f809cb902900ae686069e029db74567ee10d017cb254df1d598/tiktoken-0.9.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f0968d5beeafbca2a72c595e8385a1a1f8af58feaebb02b227229b69ca5357fd", size = 1143140, upload-time = "2025-02-14T06:02:04.165Z" }, - { url = "https://files.pythonhosted.org/packages/f1/95/cc2c6d79df8f113bdc6c99cdec985a878768120d87d839a34da4bd3ff90a/tiktoken-0.9.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:92a5fb085a6a3b7350b8fc838baf493317ca0e17bd95e8642f95fc69ecfed1de", size = 1197860, upload-time = "2025-02-14T06:02:06.268Z" }, - { url = "https://files.pythonhosted.org/packages/c7/6c/9c1a4cc51573e8867c9381db1814223c09ebb4716779c7f845d48688b9c8/tiktoken-0.9.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:15a2752dea63d93b0332fb0ddb05dd909371ededa145fe6a3242f46724fa7990", size = 1259661, upload-time = "2025-02-14T06:02:08.889Z" }, - { url = "https://files.pythonhosted.org/packages/cd/4c/22eb8e9856a2b1808d0a002d171e534eac03f96dbe1161978d7389a59498/tiktoken-0.9.0-cp310-cp310-win_amd64.whl", hash = "sha256:26113fec3bd7a352e4b33dbaf1bd8948de2507e30bd95a44e2b1156647bc01b4", size = 894026, upload-time = "2025-02-14T06:02:12.841Z" }, - { url = "https://files.pythonhosted.org/packages/4d/ae/4613a59a2a48e761c5161237fc850eb470b4bb93696db89da51b79a871f1/tiktoken-0.9.0-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:f32cc56168eac4851109e9b5d327637f15fd662aa30dd79f964b7c39fbadd26e", size = 1065987, upload-time = "2025-02-14T06:02:14.174Z" }, - { url = "https://files.pythonhosted.org/packages/3f/86/55d9d1f5b5a7e1164d0f1538a85529b5fcba2b105f92db3622e5d7de6522/tiktoken-0.9.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:45556bc41241e5294063508caf901bf92ba52d8ef9222023f83d2483a3055348", size = 1009155, upload-time = "2025-02-14T06:02:15.384Z" }, - { url = "https://files.pythonhosted.org/packages/03/58/01fb6240df083b7c1916d1dcb024e2b761213c95d576e9f780dfb5625a76/tiktoken-0.9.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:03935988a91d6d3216e2ec7c645afbb3d870b37bcb67ada1943ec48678e7ee33", size = 1142898, upload-time = "2025-02-14T06:02:16.666Z" }, - { url = "https://files.pythonhosted.org/packages/b1/73/41591c525680cd460a6becf56c9b17468d3711b1df242c53d2c7b2183d16/tiktoken-0.9.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8b3d80aad8d2c6b9238fc1a5524542087c52b860b10cbf952429ffb714bc1136", size = 1197535, upload-time = "2025-02-14T06:02:18.595Z" }, - { url = "https://files.pythonhosted.org/packages/7d/7c/1069f25521c8f01a1a182f362e5c8e0337907fae91b368b7da9c3e39b810/tiktoken-0.9.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:b2a21133be05dc116b1d0372af051cd2c6aa1d2188250c9b553f9fa49301b336", size = 1259548, upload-time = "2025-02-14T06:02:20.729Z" }, - { url = "https://files.pythonhosted.org/packages/6f/07/c67ad1724b8e14e2b4c8cca04b15da158733ac60136879131db05dda7c30/tiktoken-0.9.0-cp311-cp311-win_amd64.whl", hash = "sha256:11a20e67fdf58b0e2dea7b8654a288e481bb4fc0289d3ad21291f8d0849915fb", size = 893895, upload-time = "2025-02-14T06:02:22.67Z" }, - { url = "https://files.pythonhosted.org/packages/cf/e5/21ff33ecfa2101c1bb0f9b6df750553bd873b7fb532ce2cb276ff40b197f/tiktoken-0.9.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:e88f121c1c22b726649ce67c089b90ddda8b9662545a8aeb03cfef15967ddd03", size = 1065073, upload-time = "2025-02-14T06:02:24.768Z" }, - { url = "https://files.pythonhosted.org/packages/8e/03/a95e7b4863ee9ceec1c55983e4cc9558bcfd8f4f80e19c4f8a99642f697d/tiktoken-0.9.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a6600660f2f72369acb13a57fb3e212434ed38b045fd8cc6cdd74947b4b5d210", size = 1008075, upload-time = "2025-02-14T06:02:26.92Z" }, - { url = "https://files.pythonhosted.org/packages/40/10/1305bb02a561595088235a513ec73e50b32e74364fef4de519da69bc8010/tiktoken-0.9.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:95e811743b5dfa74f4b227927ed86cbc57cad4df859cb3b643be797914e41794", size = 1140754, upload-time = "2025-02-14T06:02:28.124Z" }, - { url = "https://files.pythonhosted.org/packages/1b/40/da42522018ca496432ffd02793c3a72a739ac04c3794a4914570c9bb2925/tiktoken-0.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:99376e1370d59bcf6935c933cb9ba64adc29033b7e73f5f7569f3aad86552b22", size = 1196678, upload-time = "2025-02-14T06:02:29.845Z" }, - { url = "https://files.pythonhosted.org/packages/5c/41/1e59dddaae270ba20187ceb8aa52c75b24ffc09f547233991d5fd822838b/tiktoken-0.9.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:badb947c32739fb6ddde173e14885fb3de4d32ab9d8c591cbd013c22b4c31dd2", size = 1259283, upload-time = "2025-02-14T06:02:33.838Z" }, - { url = "https://files.pythonhosted.org/packages/5b/64/b16003419a1d7728d0d8c0d56a4c24325e7b10a21a9dd1fc0f7115c02f0a/tiktoken-0.9.0-cp312-cp312-win_amd64.whl", hash = "sha256:5a62d7a25225bafed786a524c1b9f0910a1128f4232615bf3f8257a73aaa3b16", size = 894897, upload-time = "2025-02-14T06:02:36.265Z" }, - { url = "https://files.pythonhosted.org/packages/7a/11/09d936d37f49f4f494ffe660af44acd2d99eb2429d60a57c71318af214e0/tiktoken-0.9.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:2b0e8e05a26eda1249e824156d537015480af7ae222ccb798e5234ae0285dbdb", size = 1064919, upload-time = "2025-02-14T06:02:37.494Z" }, - { url = "https://files.pythonhosted.org/packages/80/0e/f38ba35713edb8d4197ae602e80837d574244ced7fb1b6070b31c29816e0/tiktoken-0.9.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:27d457f096f87685195eea0165a1807fae87b97b2161fe8c9b1df5bd74ca6f63", size = 1007877, upload-time = "2025-02-14T06:02:39.516Z" }, - { url = "https://files.pythonhosted.org/packages/fe/82/9197f77421e2a01373e27a79dd36efdd99e6b4115746ecc553318ecafbf0/tiktoken-0.9.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2cf8ded49cddf825390e36dd1ad35cd49589e8161fdcb52aa25f0583e90a3e01", size = 1140095, upload-time = "2025-02-14T06:02:41.791Z" }, - { url = "https://files.pythonhosted.org/packages/f2/bb/4513da71cac187383541facd0291c4572b03ec23c561de5811781bbd988f/tiktoken-0.9.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cc156cb314119a8bb9748257a2eaebd5cc0753b6cb491d26694ed42fc7cb3139", size = 1195649, upload-time = "2025-02-14T06:02:43Z" }, - { url = "https://files.pythonhosted.org/packages/fa/5c/74e4c137530dd8504e97e3a41729b1103a4ac29036cbfd3250b11fd29451/tiktoken-0.9.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:cd69372e8c9dd761f0ab873112aba55a0e3e506332dd9f7522ca466e817b1b7a", size = 1258465, upload-time = "2025-02-14T06:02:45.046Z" }, - { url = "https://files.pythonhosted.org/packages/de/a8/8f499c179ec900783ffe133e9aab10044481679bb9aad78436d239eee716/tiktoken-0.9.0-cp313-cp313-win_amd64.whl", hash = "sha256:5ea0edb6f83dc56d794723286215918c1cde03712cbbafa0348b33448faf5b95", size = 894669, upload-time = "2025-02-14T06:02:47.341Z" }, - { url = "https://files.pythonhosted.org/packages/c4/92/4d681b5c066d417b98f22a0176358d9e606e183c6b61c337d61fb54accb4/tiktoken-0.9.0-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:c6386ca815e7d96ef5b4ac61e0048cd32ca5a92d5781255e13b31381d28667dc", size = 1066217, upload-time = "2025-02-14T06:02:49.259Z" }, - { url = "https://files.pythonhosted.org/packages/12/dd/af27bbe186df481666de48cf0f2f4e0643ba9c78b472e7bf70144c663b22/tiktoken-0.9.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:75f6d5db5bc2c6274b674ceab1615c1778e6416b14705827d19b40e6355f03e0", size = 1009441, upload-time = "2025-02-14T06:02:51.347Z" }, - { url = "https://files.pythonhosted.org/packages/33/35/2792b7dcb8b150d2767322637513c73a3e80833c19212efea80b31087894/tiktoken-0.9.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e15b16f61e6f4625a57a36496d28dd182a8a60ec20a534c5343ba3cafa156ac7", size = 1144423, upload-time = "2025-02-14T06:02:52.547Z" }, - { url = "https://files.pythonhosted.org/packages/65/ae/4d1682510172ce3500bbed3b206ebc4efefe280f0bf1179cfb043f88cc16/tiktoken-0.9.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3ebcec91babf21297022882344c3f7d9eed855931466c3311b1ad6b64befb3df", size = 1199002, upload-time = "2025-02-14T06:02:55.72Z" }, - { url = "https://files.pythonhosted.org/packages/1c/2e/df2dc31dd161190f315829775a9652ea01d60f307af8f98e35bdd14a6a93/tiktoken-0.9.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:e5fd49e7799579240f03913447c0cdfa1129625ebd5ac440787afc4345990427", size = 1260610, upload-time = "2025-02-14T06:02:56.924Z" }, - { url = "https://files.pythonhosted.org/packages/70/22/e8fc1bf9cdecc439b7ddc28a45b976a8c699a38874c070749d855696368a/tiktoken-0.9.0-cp39-cp39-win_amd64.whl", hash = "sha256:26242ca9dc8b58e875ff4ca078b9a94d2f0813e6a535dcd2205df5d49d927cc7", size = 894215, upload-time = "2025-02-14T06:02:59.031Z" }, +sdist = { url = "https://files.pythonhosted.org/packages/a7/86/ad0155a37c4f310935d5ac0b1ccf9bdb635dcb906e0a9a26b616dd55825a/tiktoken-0.11.0.tar.gz", hash = "sha256:3c518641aee1c52247c2b97e74d8d07d780092af79d5911a6ab5e79359d9b06a", size = 37648, upload-time = "2025-08-08T23:58:08.495Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/8b/4d/c6a2e7dca2b4f2e9e0bfd62b3fe4f114322e2c028cfba905a72bc76ce479/tiktoken-0.11.0-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:8a9b517d6331d7103f8bef29ef93b3cca95fa766e293147fe7bacddf310d5917", size = 1059937, upload-time = "2025-08-08T23:57:28.57Z" }, + { url = "https://files.pythonhosted.org/packages/41/54/3739d35b9f94cb8dc7b0db2edca7192d5571606aa2369a664fa27e811804/tiktoken-0.11.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:b4ddb1849e6bf0afa6cc1c5d809fb980ca240a5fffe585a04e119519758788c0", size = 999230, upload-time = "2025-08-08T23:57:30.241Z" }, + { url = "https://files.pythonhosted.org/packages/dd/f4/ec8d43338d28d53513004ebf4cd83732a135d11011433c58bf045890cc10/tiktoken-0.11.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:10331d08b5ecf7a780b4fe4d0281328b23ab22cdb4ff65e68d56caeda9940ecc", size = 1130076, upload-time = "2025-08-08T23:57:31.706Z" }, + { url = "https://files.pythonhosted.org/packages/94/80/fb0ada0a882cb453caf519a4bf0d117c2a3ee2e852c88775abff5413c176/tiktoken-0.11.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b062c82300341dc87e0258c69f79bed725f87e753c21887aea90d272816be882", size = 1183942, upload-time = "2025-08-08T23:57:33.142Z" }, + { url = "https://files.pythonhosted.org/packages/2f/e9/6c104355b463601719582823f3ea658bc3aa7c73d1b3b7553ebdc48468ce/tiktoken-0.11.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:195d84bec46169af3b1349a1495c151d37a0ff4cba73fd08282736be7f92cc6c", size = 1244705, upload-time = "2025-08-08T23:57:34.594Z" }, + { url = "https://files.pythonhosted.org/packages/94/75/eaa6068f47e8b3f0aab9e05177cce2cf5aa2cc0ca93981792e620d4d4117/tiktoken-0.11.0-cp310-cp310-win_amd64.whl", hash = "sha256:fe91581b0ecdd8783ce8cb6e3178f2260a3912e8724d2f2d49552b98714641a1", size = 884152, upload-time = "2025-08-08T23:57:36.18Z" }, + { url = "https://files.pythonhosted.org/packages/8a/91/912b459799a025d2842566fe1e902f7f50d54a1ce8a0f236ab36b5bd5846/tiktoken-0.11.0-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:4ae374c46afadad0f501046db3da1b36cd4dfbfa52af23c998773682446097cf", size = 1059743, upload-time = "2025-08-08T23:57:37.516Z" }, + { url = "https://files.pythonhosted.org/packages/8c/e9/6faa6870489ce64f5f75dcf91512bf35af5864583aee8fcb0dcb593121f5/tiktoken-0.11.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:25a512ff25dc6c85b58f5dd4f3d8c674dc05f96b02d66cdacf628d26a4e4866b", size = 999334, upload-time = "2025-08-08T23:57:38.595Z" }, + { url = "https://files.pythonhosted.org/packages/a1/3e/a05d1547cf7db9dc75d1461cfa7b556a3b48e0516ec29dfc81d984a145f6/tiktoken-0.11.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2130127471e293d385179c1f3f9cd445070c0772be73cdafb7cec9a3684c0458", size = 1129402, upload-time = "2025-08-08T23:57:39.627Z" }, + { url = "https://files.pythonhosted.org/packages/34/9a/db7a86b829e05a01fd4daa492086f708e0a8b53952e1dbc9d380d2b03677/tiktoken-0.11.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:21e43022bf2c33f733ea9b54f6a3f6b4354b909f5a73388fb1b9347ca54a069c", size = 1184046, upload-time = "2025-08-08T23:57:40.689Z" }, + { url = "https://files.pythonhosted.org/packages/9d/bb/52edc8e078cf062ed749248f1454e9e5cfd09979baadb830b3940e522015/tiktoken-0.11.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:adb4e308eb64380dc70fa30493e21c93475eaa11669dea313b6bbf8210bfd013", size = 1244691, upload-time = "2025-08-08T23:57:42.251Z" }, + { url = "https://files.pythonhosted.org/packages/60/d9/884b6cd7ae2570ecdcaffa02b528522b18fef1cbbfdbcaa73799807d0d3b/tiktoken-0.11.0-cp311-cp311-win_amd64.whl", hash = "sha256:ece6b76bfeeb61a125c44bbefdfccc279b5288e6007fbedc0d32bfec602df2f2", size = 884392, upload-time = "2025-08-08T23:57:43.628Z" }, + { url = "https://files.pythonhosted.org/packages/e7/9e/eceddeffc169fc75fe0fd4f38471309f11cb1906f9b8aa39be4f5817df65/tiktoken-0.11.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:fd9e6b23e860973cf9526544e220b223c60badf5b62e80a33509d6d40e6c8f5d", size = 1055199, upload-time = "2025-08-08T23:57:45.076Z" }, + { url = "https://files.pythonhosted.org/packages/4f/cf/5f02bfefffdc6b54e5094d2897bc80efd43050e5b09b576fd85936ee54bf/tiktoken-0.11.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6a76d53cee2da71ee2731c9caa747398762bda19d7f92665e882fef229cb0b5b", size = 996655, upload-time = "2025-08-08T23:57:46.304Z" }, + { url = "https://files.pythonhosted.org/packages/65/8e/c769b45ef379bc360c9978c4f6914c79fd432400a6733a8afc7ed7b0726a/tiktoken-0.11.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6ef72aab3ea240646e642413cb363b73869fed4e604dcfd69eec63dc54d603e8", size = 1128867, upload-time = "2025-08-08T23:57:47.438Z" }, + { url = "https://files.pythonhosted.org/packages/d5/2d/4d77f6feb9292bfdd23d5813e442b3bba883f42d0ac78ef5fdc56873f756/tiktoken-0.11.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f929255c705efec7a28bf515e29dc74220b2f07544a8c81b8d69e8efc4578bd", size = 1183308, upload-time = "2025-08-08T23:57:48.566Z" }, + { url = "https://files.pythonhosted.org/packages/7a/65/7ff0a65d3bb0fc5a1fb6cc71b03e0f6e71a68c5eea230d1ff1ba3fd6df49/tiktoken-0.11.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:61f1d15822e4404953d499fd1dcc62817a12ae9fb1e4898033ec8fe3915fdf8e", size = 1244301, upload-time = "2025-08-08T23:57:49.642Z" }, + { url = "https://files.pythonhosted.org/packages/f5/6e/5b71578799b72e5bdcef206a214c3ce860d999d579a3b56e74a6c8989ee2/tiktoken-0.11.0-cp312-cp312-win_amd64.whl", hash = "sha256:45927a71ab6643dfd3ef57d515a5db3d199137adf551f66453be098502838b0f", size = 884282, upload-time = "2025-08-08T23:57:50.759Z" }, + { url = "https://files.pythonhosted.org/packages/cc/cd/a9034bcee638716d9310443818d73c6387a6a96db93cbcb0819b77f5b206/tiktoken-0.11.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a5f3f25ffb152ee7fec78e90a5e5ea5b03b4ea240beed03305615847f7a6ace2", size = 1055339, upload-time = "2025-08-08T23:57:51.802Z" }, + { url = "https://files.pythonhosted.org/packages/f1/91/9922b345f611b4e92581f234e64e9661e1c524875c8eadd513c4b2088472/tiktoken-0.11.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:7dc6e9ad16a2a75b4c4be7208055a1f707c9510541d94d9cc31f7fbdc8db41d8", size = 997080, upload-time = "2025-08-08T23:57:53.442Z" }, + { url = "https://files.pythonhosted.org/packages/d0/9d/49cd047c71336bc4b4af460ac213ec1c457da67712bde59b892e84f1859f/tiktoken-0.11.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5a0517634d67a8a48fd4a4ad73930c3022629a85a217d256a6e9b8b47439d1e4", size = 1128501, upload-time = "2025-08-08T23:57:54.808Z" }, + { url = "https://files.pythonhosted.org/packages/52/d5/a0dcdb40dd2ea357e83cb36258967f0ae96f5dd40c722d6e382ceee6bba9/tiktoken-0.11.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7fb4effe60574675118b73c6fbfd3b5868e5d7a1f570d6cc0d18724b09ecf318", size = 1182743, upload-time = "2025-08-08T23:57:56.307Z" }, + { url = "https://files.pythonhosted.org/packages/3b/17/a0fc51aefb66b7b5261ca1314afa83df0106b033f783f9a7bcbe8e741494/tiktoken-0.11.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:94f984c9831fd32688aef4348803b0905d4ae9c432303087bae370dc1381a2b8", size = 1244057, upload-time = "2025-08-08T23:57:57.628Z" }, + { url = "https://files.pythonhosted.org/packages/50/79/bcf350609f3a10f09fe4fc207f132085e497fdd3612f3925ab24d86a0ca0/tiktoken-0.11.0-cp313-cp313-win_amd64.whl", hash = "sha256:2177ffda31dec4023356a441793fed82f7af5291120751dee4d696414f54db0c", size = 883901, upload-time = "2025-08-08T23:57:59.359Z" }, + { url = "https://files.pythonhosted.org/packages/aa/b6/81c5799ab77a9580c6d840cf77d4717e929193a42190fd623a080c647aa6/tiktoken-0.11.0-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:13220f12c9e82e399377e768640ddfe28bea962739cc3a869cad98f42c419a89", size = 1061648, upload-time = "2025-08-08T23:58:00.753Z" }, + { url = "https://files.pythonhosted.org/packages/50/89/faa668066b2a4640534ef5797c09ecd0a48b43367502129b217339dfaa97/tiktoken-0.11.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7f2db627f5c74477c0404b4089fd8a28ae22fa982a6f7d9c7d4c305c375218f3", size = 1000950, upload-time = "2025-08-08T23:58:01.855Z" }, + { url = "https://files.pythonhosted.org/packages/aa/7f/5f950528b54cb3025af4bc3522c23dbfb691afe8ffb292aa1e8dc2e6bddf/tiktoken-0.11.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2302772f035dceb2bcf8e55a735e4604a0b51a6dd50f38218ff664d46ec43807", size = 1130777, upload-time = "2025-08-08T23:58:03.256Z" }, + { url = "https://files.pythonhosted.org/packages/27/a4/e82ddf0773835ba24536ac8c0dce561e697698ec020a93212a1e041d39b4/tiktoken-0.11.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:20b977989afe44c94bcc50db1f76971bb26dca44218bd203ba95925ef56f8e7a", size = 1185692, upload-time = "2025-08-08T23:58:04.476Z" }, + { url = "https://files.pythonhosted.org/packages/1b/c2/06361e41d176e62797ae65fa678111cdd30553321cf4d83e7b84107ea95f/tiktoken-0.11.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:669a1aa1ad6ebf1b3c26b45deb346f345da7680f845b5ea700bba45c20dea24c", size = 1246518, upload-time = "2025-08-08T23:58:06.126Z" }, + { url = "https://files.pythonhosted.org/packages/bb/ad/ca37e15c46741ebb3904d562d03194e845539a08f7751a6df0f391757312/tiktoken-0.11.0-cp39-cp39-win_amd64.whl", hash = "sha256:e363f33c720a055586f730c00e330df4c7ea0024bf1c83a8a9a9dbc054c4f304", size = 884702, upload-time = "2025-08-08T23:58:07.534Z" }, ] [[package]] name = "tokenizers" -version = "0.21.1" +version = "0.21.4" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "huggingface-hub" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/92/76/5ac0c97f1117b91b7eb7323dcd61af80d72f790b4df71249a7850c195f30/tokenizers-0.21.1.tar.gz", hash = "sha256:a1bb04dc5b448985f86ecd4b05407f5a8d97cb2c0532199b2a302a604a0165ab", size = 343256, upload-time = "2025-03-13T10:51:18.189Z" } +sdist = { url = "https://files.pythonhosted.org/packages/c2/2f/402986d0823f8d7ca139d969af2917fefaa9b947d1fb32f6168c509f2492/tokenizers-0.21.4.tar.gz", hash = "sha256:fa23f85fbc9a02ec5c6978da172cdcbac23498c3ca9f3645c5c68740ac007880", size = 351253, upload-time = "2025-07-28T15:48:54.325Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/a5/1f/328aee25f9115bf04262e8b4e5a2050b7b7cf44b59c74e982db7270c7f30/tokenizers-0.21.1-cp39-abi3-macosx_10_12_x86_64.whl", hash = "sha256:e78e413e9e668ad790a29456e677d9d3aa50a9ad311a40905d6861ba7692cf41", size = 2780767, upload-time = "2025-03-13T10:51:09.459Z" }, - { url = "https://files.pythonhosted.org/packages/ae/1a/4526797f3719b0287853f12c5ad563a9be09d446c44ac784cdd7c50f76ab/tokenizers-0.21.1-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:cd51cd0a91ecc801633829fcd1fda9cf8682ed3477c6243b9a095539de4aecf3", size = 2650555, upload-time = "2025-03-13T10:51:07.692Z" }, - { url = "https://files.pythonhosted.org/packages/4d/7a/a209b29f971a9fdc1da86f917fe4524564924db50d13f0724feed37b2a4d/tokenizers-0.21.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:28da6b72d4fb14ee200a1bd386ff74ade8992d7f725f2bde2c495a9a98cf4d9f", size = 2937541, upload-time = "2025-03-13T10:50:56.679Z" }, - { url = "https://files.pythonhosted.org/packages/3c/1e/b788b50ffc6191e0b1fc2b0d49df8cff16fe415302e5ceb89f619d12c5bc/tokenizers-0.21.1-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:34d8cfde551c9916cb92014e040806122295a6800914bab5865deb85623931cf", size = 2819058, upload-time = "2025-03-13T10:50:59.525Z" }, - { url = "https://files.pythonhosted.org/packages/36/aa/3626dfa09a0ecc5b57a8c58eeaeb7dd7ca9a37ad9dd681edab5acd55764c/tokenizers-0.21.1-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:aaa852d23e125b73d283c98f007e06d4595732104b65402f46e8ef24b588d9f8", size = 3133278, upload-time = "2025-03-13T10:51:04.678Z" }, - { url = "https://files.pythonhosted.org/packages/a4/4d/8fbc203838b3d26269f944a89459d94c858f5b3f9a9b6ee9728cdcf69161/tokenizers-0.21.1-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a21a15d5c8e603331b8a59548bbe113564136dc0f5ad8306dd5033459a226da0", size = 3144253, upload-time = "2025-03-13T10:51:01.261Z" }, - { url = "https://files.pythonhosted.org/packages/d8/1b/2bd062adeb7c7511b847b32e356024980c0ffcf35f28947792c2d8ad2288/tokenizers-0.21.1-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2fdbd4c067c60a0ac7eca14b6bd18a5bebace54eb757c706b47ea93204f7a37c", size = 3398225, upload-time = "2025-03-13T10:51:03.243Z" }, - { url = "https://files.pythonhosted.org/packages/8a/63/38be071b0c8e06840bc6046991636bcb30c27f6bb1e670f4f4bc87cf49cc/tokenizers-0.21.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2dd9a0061e403546f7377df940e866c3e678d7d4e9643d0461ea442b4f89e61a", size = 3038874, upload-time = "2025-03-13T10:51:06.235Z" }, - { url = "https://files.pythonhosted.org/packages/ec/83/afa94193c09246417c23a3c75a8a0a96bf44ab5630a3015538d0c316dd4b/tokenizers-0.21.1-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:db9484aeb2e200c43b915a1a0150ea885e35f357a5a8fabf7373af333dcc8dbf", size = 9014448, upload-time = "2025-03-13T10:51:10.927Z" }, - { url = "https://files.pythonhosted.org/packages/ae/b3/0e1a37d4f84c0f014d43701c11eb8072704f6efe8d8fc2dcdb79c47d76de/tokenizers-0.21.1-cp39-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:ed248ab5279e601a30a4d67bdb897ecbe955a50f1e7bb62bd99f07dd11c2f5b6", size = 8937877, upload-time = "2025-03-13T10:51:12.688Z" }, - { url = "https://files.pythonhosted.org/packages/ac/33/ff08f50e6d615eb180a4a328c65907feb6ded0b8f990ec923969759dc379/tokenizers-0.21.1-cp39-abi3-musllinux_1_2_i686.whl", hash = "sha256:9ac78b12e541d4ce67b4dfd970e44c060a2147b9b2a21f509566d556a509c67d", size = 9186645, upload-time = "2025-03-13T10:51:14.723Z" }, - { url = "https://files.pythonhosted.org/packages/5f/aa/8ae85f69a9f6012c6f8011c6f4aa1c96154c816e9eea2e1b758601157833/tokenizers-0.21.1-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:e5a69c1a4496b81a5ee5d2c1f3f7fbdf95e90a0196101b0ee89ed9956b8a168f", size = 9384380, upload-time = "2025-03-13T10:51:16.526Z" }, - { url = "https://files.pythonhosted.org/packages/e8/5b/a5d98c89f747455e8b7a9504910c865d5e51da55e825a7ae641fb5ff0a58/tokenizers-0.21.1-cp39-abi3-win32.whl", hash = "sha256:1039a3a5734944e09de1d48761ade94e00d0fa760c0e0551151d4dd851ba63e3", size = 2239506, upload-time = "2025-03-13T10:51:20.643Z" }, - { url = "https://files.pythonhosted.org/packages/e6/b6/072a8e053ae600dcc2ac0da81a23548e3b523301a442a6ca900e92ac35be/tokenizers-0.21.1-cp39-abi3-win_amd64.whl", hash = "sha256:0f0dcbcc9f6e13e675a66d7a5f2f225a736745ce484c1a4e07476a89ccdad382", size = 2435481, upload-time = "2025-03-13T10:51:19.243Z" }, + { url = "https://files.pythonhosted.org/packages/98/c6/fdb6f72bf6454f52eb4a2510be7fb0f614e541a2554d6210e370d85efff4/tokenizers-0.21.4-cp39-abi3-macosx_10_12_x86_64.whl", hash = "sha256:2ccc10a7c3bcefe0f242867dc914fc1226ee44321eb618cfe3019b5df3400133", size = 2863987, upload-time = "2025-07-28T15:48:44.877Z" }, + { url = "https://files.pythonhosted.org/packages/8d/a6/28975479e35ddc751dc1ddc97b9b69bf7fcf074db31548aab37f8116674c/tokenizers-0.21.4-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:5e2f601a8e0cd5be5cc7506b20a79112370b9b3e9cb5f13f68ab11acd6ca7d60", size = 2732457, upload-time = "2025-07-28T15:48:43.265Z" }, + { url = "https://files.pythonhosted.org/packages/aa/8f/24f39d7b5c726b7b0be95dca04f344df278a3fe3a4deb15a975d194cbb32/tokenizers-0.21.4-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:39b376f5a1aee67b4d29032ee85511bbd1b99007ec735f7f35c8a2eb104eade5", size = 3012624, upload-time = "2025-07-28T13:22:43.895Z" }, + { url = "https://files.pythonhosted.org/packages/58/47/26358925717687a58cb74d7a508de96649544fad5778f0cd9827398dc499/tokenizers-0.21.4-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2107ad649e2cda4488d41dfd031469e9da3fcbfd6183e74e4958fa729ffbf9c6", size = 2939681, upload-time = "2025-07-28T13:22:47.499Z" }, + { url = "https://files.pythonhosted.org/packages/99/6f/cc300fea5db2ab5ddc2c8aea5757a27b89c84469899710c3aeddc1d39801/tokenizers-0.21.4-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3c73012da95afafdf235ba80047699df4384fdc481527448a078ffd00e45a7d9", size = 3247445, upload-time = "2025-07-28T15:48:39.711Z" }, + { url = "https://files.pythonhosted.org/packages/be/bf/98cb4b9c3c4afd8be89cfa6423704337dc20b73eb4180397a6e0d456c334/tokenizers-0.21.4-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f23186c40395fc390d27f519679a58023f368a0aad234af145e0f39ad1212732", size = 3428014, upload-time = "2025-07-28T13:22:49.569Z" }, + { url = "https://files.pythonhosted.org/packages/75/c7/96c1cc780e6ca7f01a57c13235dd05b7bc1c0f3588512ebe9d1331b5f5ae/tokenizers-0.21.4-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cc88bb34e23a54cc42713d6d98af5f1bf79c07653d24fe984d2d695ba2c922a2", size = 3193197, upload-time = "2025-07-28T13:22:51.471Z" }, + { url = "https://files.pythonhosted.org/packages/f2/90/273b6c7ec78af547694eddeea9e05de771278bd20476525ab930cecaf7d8/tokenizers-0.21.4-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:51b7eabb104f46c1c50b486520555715457ae833d5aee9ff6ae853d1130506ff", size = 3115426, upload-time = "2025-07-28T15:48:41.439Z" }, + { url = "https://files.pythonhosted.org/packages/91/43/c640d5a07e95f1cf9d2c92501f20a25f179ac53a4f71e1489a3dcfcc67ee/tokenizers-0.21.4-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:714b05b2e1af1288bd1bc56ce496c4cebb64a20d158ee802887757791191e6e2", size = 9089127, upload-time = "2025-07-28T15:48:46.472Z" }, + { url = "https://files.pythonhosted.org/packages/44/a1/dd23edd6271d4dca788e5200a807b49ec3e6987815cd9d0a07ad9c96c7c2/tokenizers-0.21.4-cp39-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:1340ff877ceedfa937544b7d79f5b7becf33a4cfb58f89b3b49927004ef66f78", size = 9055243, upload-time = "2025-07-28T15:48:48.539Z" }, + { url = "https://files.pythonhosted.org/packages/21/2b/b410d6e9021c4b7ddb57248304dc817c4d4970b73b6ee343674914701197/tokenizers-0.21.4-cp39-abi3-musllinux_1_2_i686.whl", hash = "sha256:3c1f4317576e465ac9ef0d165b247825a2a4078bcd01cba6b54b867bdf9fdd8b", size = 9298237, upload-time = "2025-07-28T15:48:50.443Z" }, + { url = "https://files.pythonhosted.org/packages/b7/0a/42348c995c67e2e6e5c89ffb9cfd68507cbaeb84ff39c49ee6e0a6dd0fd2/tokenizers-0.21.4-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:c212aa4e45ec0bb5274b16b6f31dd3f1c41944025c2358faaa5782c754e84c24", size = 9461980, upload-time = "2025-07-28T15:48:52.325Z" }, + { url = "https://files.pythonhosted.org/packages/3d/d3/dacccd834404cd71b5c334882f3ba40331ad2120e69ded32cf5fda9a7436/tokenizers-0.21.4-cp39-abi3-win32.whl", hash = "sha256:6c42a930bc5f4c47f4ea775c91de47d27910881902b0f20e4990ebe045a415d0", size = 2329871, upload-time = "2025-07-28T15:48:56.841Z" }, + { url = "https://files.pythonhosted.org/packages/41/f2/fd673d979185f5dcbac4be7d09461cbb99751554ffb6718d0013af8604cb/tokenizers-0.21.4-cp39-abi3-win_amd64.whl", hash = "sha256:475d807a5c3eb72c59ad9b5fcdb254f6e17f53dfcbb9903233b0dfa9c943b597", size = 2507568, upload-time = "2025-07-28T15:48:55.456Z" }, ] [[package]] @@ -2644,44 +3226,44 @@ wheels = [ [[package]] name = "types-pynput" -version = "1.8.1.20250318" +version = "1.8.1.20250809" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/24/ae/92abffd8cc7b257e095bd87caa2e555d236811d9474b20b24dab0cb6b9e2/types_pynput-1.8.1.20250318.tar.gz", hash = "sha256:13d4df97843a7d1e7cddccbf9987aca7f0d463b214a8a35b4f53275d2c5a3576", size = 11694, upload-time = "2025-03-18T02:53:18.44Z" } +sdist = { url = "https://files.pythonhosted.org/packages/38/ae/9d630d3e164f7d7fc24dbb97a2d80cbd089c0c592cc93f698fe347428865/types_pynput-1.8.1.20250809.tar.gz", hash = "sha256:c315e4c3bae4c23a94a12b677f1e0bb5611c4a7b114ce09cc870d9b8335e95eb", size = 11683, upload-time = "2025-08-09T03:15:35.701Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/a7/50/7968a8040915d94c36c25b5ae4b3dcd7804a2ecd84ac537983b56201379a/types_pynput-1.8.1.20250318-py3-none-any.whl", hash = "sha256:0c1038aa1550941633114a2728ad85e392f67dfba970aebf755e369ab57aca70", size = 12280, upload-time = "2025-03-18T02:53:17.36Z" }, + { url = "https://files.pythonhosted.org/packages/d8/dd/f00d30ee7aa0d117e5d0595d728f775c16bb2f8f7525b2c800ef549fe38e/types_pynput-1.8.1.20250809-py3-none-any.whl", hash = "sha256:ca0103244c726353e0da97bc21fa081cefc5dfea206995f6369a87854eff07a1", size = 12211, upload-time = "2025-08-09T03:15:34.979Z" }, ] [[package]] name = "types-requests" -version = "2.32.0.20250328" +version = "2.32.4.20250809" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "urllib3" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/00/7d/eb174f74e3f5634eaacb38031bbe467dfe2e545bc255e5c90096ec46bc46/types_requests-2.32.0.20250328.tar.gz", hash = "sha256:c9e67228ea103bd811c96984fac36ed2ae8da87a36a633964a21f199d60baf32", size = 22995, upload-time = "2025-03-28T02:55:13.271Z" } +sdist = { url = "https://files.pythonhosted.org/packages/ed/b0/9355adb86ec84d057fea765e4c49cce592aaf3d5117ce5609a95a7fc3dac/types_requests-2.32.4.20250809.tar.gz", hash = "sha256:d8060de1c8ee599311f56ff58010fb4902f462a1470802cf9f6ed27bc46c4df3", size = 23027, upload-time = "2025-08-09T03:17:10.664Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/cc/15/3700282a9d4ea3b37044264d3e4d1b1f0095a4ebf860a99914fd544e3be3/types_requests-2.32.0.20250328-py3-none-any.whl", hash = "sha256:72ff80f84b15eb3aa7a8e2625fffb6a93f2ad5a0c20215fc1dcfa61117bcb2a2", size = 20663, upload-time = "2025-03-28T02:55:11.946Z" }, + { url = "https://files.pythonhosted.org/packages/2b/6f/ec0012be842b1d888d46884ac5558fd62aeae1f0ec4f7a581433d890d4b5/types_requests-2.32.4.20250809-py3-none-any.whl", hash = "sha256:f73d1832fb519ece02c85b1f09d5f0dd3108938e7d47e7f94bbfa18a6782b163", size = 20644, upload-time = "2025-08-09T03:17:09.716Z" }, ] [[package]] name = "typing-extensions" -version = "4.13.2" +version = "4.14.1" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/f6/37/23083fcd6e35492953e8d2aaaa68b860eb422b34627b13f2ce3eb6106061/typing_extensions-4.13.2.tar.gz", hash = "sha256:e6c81219bd689f51865d9e372991c540bda33a0379d5573cddb9a3a23f7caaef", size = 106967, upload-time = "2025-04-10T14:19:05.416Z" } +sdist = { url = "https://files.pythonhosted.org/packages/98/5a/da40306b885cc8c09109dc2e1abd358d5684b1425678151cdaed4731c822/typing_extensions-4.14.1.tar.gz", hash = "sha256:38b39f4aeeab64884ce9f74c94263ef78f3c22467c8724005483154c26648d36", size = 107673, upload-time = "2025-07-04T13:28:34.16Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/8b/54/b1ae86c0973cc6f0210b53d508ca3641fb6d0c56823f288d108bc7ab3cc8/typing_extensions-4.13.2-py3-none-any.whl", hash = "sha256:a439e7c04b49fec3e5d3e2beaa21755cadbbdc391694e28ccdd36ca4a1408f8c", size = 45806, upload-time = "2025-04-10T14:19:03.967Z" }, + { url = "https://files.pythonhosted.org/packages/b5/00/d631e67a838026495268c2f6884f3711a15a9a2a96cd244fdaea53b823fb/typing_extensions-4.14.1-py3-none-any.whl", hash = "sha256:d1e1e3b58374dc93031d6eda2420a48ea44a36c2b4766a4fdeb3710755731d76", size = 43906, upload-time = "2025-07-04T13:28:32.743Z" }, ] [[package]] name = "typing-inspection" -version = "0.4.0" +version = "0.4.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/82/5c/e6082df02e215b846b4b8c0b887a64d7d08ffaba30605502639d44c06b82/typing_inspection-0.4.0.tar.gz", hash = "sha256:9765c87de36671694a67904bf2c96e395be9c6439bb6c87b5142569dcdd65122", size = 76222, upload-time = "2025-02-25T17:27:59.638Z" } +sdist = { url = "https://files.pythonhosted.org/packages/f8/b1/0c11f5058406b3af7609f121aaa6b609744687f1d158b3c3a5bf4cc94238/typing_inspection-0.4.1.tar.gz", hash = "sha256:6ae134cc0203c33377d43188d4064e9b357dba58cff3185f22924610e70a9d28", size = 75726, upload-time = "2025-05-21T18:55:23.885Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/31/08/aa4fdfb71f7de5176385bd9e90852eaf6b5d622735020ad600f2bab54385/typing_inspection-0.4.0-py3-none-any.whl", hash = "sha256:50e72559fcd2a6367a19f7a7e610e6afcb9fac940c650290eed893d61386832f", size = 14125, upload-time = "2025-02-25T17:27:57.754Z" }, + { url = "https://files.pythonhosted.org/packages/17/69/cd203477f944c353c31bade965f880aa1061fd6bf05ded0726ca845b6ff7/typing_inspection-0.4.1-py3-none-any.whl", hash = "sha256:389055682238f53b04f7badcb49b989835495a96700ced5dab2d8feae4b26f51", size = 14552, upload-time = "2025-05-21T18:55:22.152Z" }, ] [[package]] @@ -2695,25 +3277,25 @@ wheels = [ [[package]] name = "urllib3" -version = "2.4.0" +version = "2.5.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/8a/78/16493d9c386d8e60e442a35feac5e00f0913c0f4b7c217c11e8ec2ff53e0/urllib3-2.4.0.tar.gz", hash = "sha256:414bc6535b787febd7567804cc015fee39daab8ad86268f1310a9250697de466", size = 390672, upload-time = "2025-04-10T15:23:39.232Z" } +sdist = { url = "https://files.pythonhosted.org/packages/15/22/9ee70a2574a4f4599c47dd506532914ce044817c7752a79b6a51286319bc/urllib3-2.5.0.tar.gz", hash = "sha256:3fc47733c7e419d4bc3f6b3dc2b4f890bb743906a30d56ba4a5bfa4bbff92760", size = 393185, upload-time = "2025-06-18T14:07:41.644Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/6b/11/cc635220681e93a0183390e26485430ca2c7b5f9d33b15c74c2861cb8091/urllib3-2.4.0-py3-none-any.whl", hash = "sha256:4e16665048960a0900c702d4a66415956a584919c03361cac9f1df5c5dd7e813", size = 128680, upload-time = "2025-04-10T15:23:37.377Z" }, + { url = "https://files.pythonhosted.org/packages/a7/c2/fe1e52489ae3122415c51f387e221dd0773709bad6c6cdaa599e8a2c5185/urllib3-2.5.0-py3-none-any.whl", hash = "sha256:e6b01673c0fa6a13e374b50871808eb3bf7046c4b125b216f6bf1cc604cff0dc", size = 129795, upload-time = "2025-06-18T14:07:40.39Z" }, ] [[package]] name = "uvicorn" -version = "0.34.1" +version = "0.35.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "click", marker = "python_full_version >= '3.10'" }, + { name = "click", version = "8.2.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10'" }, { name = "h11", marker = "python_full_version >= '3.10'" }, { name = "typing-extensions", marker = "python_full_version == '3.10.*'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/86/37/dd92f1f9cedb5eaf74d9999044306e06abe65344ff197864175dbbd91871/uvicorn-0.34.1.tar.gz", hash = "sha256:af981725fc4b7ffc5cb3b0e9eda6258a90c4b52cb2a83ce567ae0a7ae1757afc", size = 76755, upload-time = "2025-04-13T13:48:04.305Z" } +sdist = { url = "https://files.pythonhosted.org/packages/5e/42/e0e305207bb88c6b8d3061399c6a961ffe5fbb7e2aa63c9234df7259e9cd/uvicorn-0.35.0.tar.gz", hash = "sha256:bc662f087f7cf2ce11a1d7fd70b90c9f98ef2e2831556dd078d131b96cc94a01", size = 78473, upload-time = "2025-06-28T16:15:46.058Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/5f/38/a5801450940a858c102a7ad9e6150146a25406a119851c993148d56ab041/uvicorn-0.34.1-py3-none-any.whl", hash = "sha256:984c3a8c7ca18ebaad15995ee7401179212c59521e67bfc390c07fa2b8d2e065", size = 62404, upload-time = "2025-04-13T13:48:02.408Z" }, + { url = "https://files.pythonhosted.org/packages/d2/e2/dc81b1bd1dcfe91735810265e9d26bc8ec5da45b4c0f6237e286819194c3/uvicorn-0.35.0-py3-none-any.whl", hash = "sha256:197535216b25ff9b785e29a0b79199f55222193d47f820816e7da751e9bc8d4a", size = 66406, upload-time = "2025-06-28T16:15:44.816Z" }, ] [[package]] @@ -2831,108 +3413,125 @@ wheels = [ [[package]] name = "yarl" -version = "1.19.0" +version = "1.20.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "idna" }, { name = "multidict" }, { name = "propcache" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/fc/4d/8a8f57caccce49573e567744926f88c6ab3ca0b47a257806d1cf88584c5f/yarl-1.19.0.tar.gz", hash = "sha256:01e02bb80ae0dbed44273c304095295106e1d9470460e773268a27d11e594892", size = 184396, upload-time = "2025-04-06T02:36:26.161Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/96/0f/e5bd0d7d98bb194a30740dea2c4324f85dfc2f8daba9d7bc7e47b45d1034/yarl-1.19.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:0bae32f8ebd35c04d6528cedb4a26b8bf25339d3616b04613b97347f919b76d3", size = 144954, upload-time = "2025-04-06T02:33:31.943Z" }, - { url = "https://files.pythonhosted.org/packages/07/bf/2acc4b643dbdfc823d0d2058768197198a3d93b41fffb41b83359c520a4d/yarl-1.19.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:8015a076daf77823e7ebdcba474156587391dab4e70c732822960368c01251e6", size = 96613, upload-time = "2025-04-06T02:33:34.924Z" }, - { url = "https://files.pythonhosted.org/packages/ca/38/c60ccca9aad0bb939e665b63a4e1550fecc922971f1f246dd7ad709a1a72/yarl-1.19.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9973ac95327f5d699eb620286c39365990b240031672b5c436a4cd00539596c5", size = 94408, upload-time = "2025-04-06T02:33:37.58Z" }, - { url = "https://files.pythonhosted.org/packages/9a/43/2d5b49b4784743d88054e612a97aee2a9d2d463983c6a8e2fa4c872b294a/yarl-1.19.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fd4b5fbd7b9dde785cfeb486b8cca211a0b138d4f3a7da27db89a25b3c482e5c", size = 330774, upload-time = "2025-04-06T02:33:39.506Z" }, - { url = "https://files.pythonhosted.org/packages/3b/48/7decce219b6eedce321345f61461ee140ee6b3faf4875efe518f0e7b5817/yarl-1.19.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:75460740005de5a912b19f657848aef419387426a40f581b1dc9fac0eb9addb5", size = 323399, upload-time = "2025-04-06T02:33:41.467Z" }, - { url = "https://files.pythonhosted.org/packages/67/2f/d6253528e49ce1c6f5119ec5269314752b06dd670f5a81721648d98b1dc7/yarl-1.19.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:57abd66ca913f2cfbb51eb3dbbbac3648f1f6983f614a4446e0802e241441d2a", size = 343329, upload-time = "2025-04-06T02:33:43.416Z" }, - { url = "https://files.pythonhosted.org/packages/fc/6b/efeb1a088e8addbf5841a84b74dad2a06346b0e4a712eb269a0cd9ada8b7/yarl-1.19.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:46ade37911b7c99ce28a959147cb28bffbd14cea9e7dd91021e06a8d2359a5aa", size = 338275, upload-time = "2025-04-06T02:33:45.394Z" }, - { url = "https://files.pythonhosted.org/packages/a6/b6/31acc2efcaf6999fd256d11f26ccc95ea773bc790ad1973331d7294b25db/yarl-1.19.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8346ec72ada749a6b5d82bff7be72578eab056ad7ec38c04f668a685abde6af0", size = 334014, upload-time = "2025-04-06T02:33:47.037Z" }, - { url = "https://files.pythonhosted.org/packages/79/16/1deb54324842479e4d8b34841a383653587dfcc403c132f88b493f0c513e/yarl-1.19.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7e4cb14a6ee5b6649ccf1c6d648b4da9220e8277d4d4380593c03cc08d8fe937", size = 322007, upload-time = "2025-04-06T02:33:48.679Z" }, - { url = "https://files.pythonhosted.org/packages/80/77/4a073cec4f40ce84897510ee9d347bc10128f715be59b36e5c037463523b/yarl-1.19.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:66fc1c2926a73a2fb46e4b92e3a6c03904d9bc3a0b65e01cb7d2b84146a8bd3b", size = 336569, upload-time = "2025-04-06T02:33:50.341Z" }, - { url = "https://files.pythonhosted.org/packages/73/e1/2f0455379bbee5f4ece8bc0968106386ec4e74237e8d68ced00bbff0a1fc/yarl-1.19.0-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:5a70201dd1e0a4304849b6445a9891d7210604c27e67da59091d5412bc19e51c", size = 336384, upload-time = "2025-04-06T02:33:52.286Z" }, - { url = "https://files.pythonhosted.org/packages/74/e0/307aa8ae96bc0e72644855c76e8960019fc24c511a5dda73f05214da46f0/yarl-1.19.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:e4807aab1bdeab6ae6f296be46337a260ae4b1f3a8c2fcd373e236b4b2b46efd", size = 340454, upload-time = "2025-04-06T02:33:54.602Z" }, - { url = "https://files.pythonhosted.org/packages/af/19/2dcdb1e5eef26751c9e79369d1f80d6a1162dababb5070f62bc5b1a8f81e/yarl-1.19.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:ae584afe81a1de4c1bb06672481050f0d001cad13163e3c019477409f638f9b7", size = 355804, upload-time = "2025-04-06T02:33:56.201Z" }, - { url = "https://files.pythonhosted.org/packages/c1/af/8c1e102c6d61713ed31022ab8f8866d263b87cb8f466c37f20a99019d169/yarl-1.19.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:30eaf4459df6e91f21b2999d1ee18f891bcd51e3cbe1de301b4858c84385895b", size = 359877, upload-time = "2025-04-06T02:33:58.366Z" }, - { url = "https://files.pythonhosted.org/packages/1a/cf/c3c4bd85ecc7f189e14d21c3bea67ce389511d9178a302d97281868477aa/yarl-1.19.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:0e617d45d03c8dec0dfce6f51f3e1b8a31aa81aaf4a4d1442fdb232bcf0c6d8c", size = 351282, upload-time = "2025-04-06T02:34:00.384Z" }, - { url = "https://files.pythonhosted.org/packages/c6/85/0994f1c607b0520ef007717ff74f3317df3f7b7f32756ba2bf26c0c58ddf/yarl-1.19.0-cp310-cp310-win32.whl", hash = "sha256:32ba32d0fa23893fd8ea8d05bdb05de6eb19d7f2106787024fd969f4ba5466cb", size = 86529, upload-time = "2025-04-06T02:34:03.118Z" }, - { url = "https://files.pythonhosted.org/packages/59/00/39bc8da1f67614633a099a44a5f69d056bb4d65a8e52a4003460e3fa4cc7/yarl-1.19.0-cp310-cp310-win_amd64.whl", hash = "sha256:545575ecfcd465891b51546c2bcafdde0acd2c62c2097d8d71902050b20e4922", size = 92707, upload-time = "2025-04-06T02:34:05.08Z" }, - { url = "https://files.pythonhosted.org/packages/9b/df/5fa7cd75e46306e0f9baf38a7c8969ff6730ea503b86232e85cb740304cf/yarl-1.19.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:163ff326680de5f6d4966954cf9e3fe1bf980f5fee2255e46e89b8cf0f3418b5", size = 145126, upload-time = "2025-04-06T02:34:06.708Z" }, - { url = "https://files.pythonhosted.org/packages/2a/be/c1b52129cd2166ab7337f08e701a61baa7c260c7b03b534098cc8297aecc/yarl-1.19.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:a626c4d9cca298d1be8625cff4b17004a9066330ac82d132bbda64a4c17c18d3", size = 96691, upload-time = "2025-04-06T02:34:08.664Z" }, - { url = "https://files.pythonhosted.org/packages/8d/39/ad62139b45515f9bf129c805aeaaedf86fd93ae57ffe911f4caeabef3e74/yarl-1.19.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:961c3e401ea7f13d02b8bb7cb0c709152a632a6e14cdc8119e9c6ee5596cd45d", size = 94505, upload-time = "2025-04-06T02:34:10.175Z" }, - { url = "https://files.pythonhosted.org/packages/be/be/04e3202cdc9bb5f81761e327af7095cffb0d81e32421a6b87f926052d2ae/yarl-1.19.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a39d7b807ab58e633ed760f80195cbd145b58ba265436af35f9080f1810dfe64", size = 355485, upload-time = "2025-04-06T02:34:11.69Z" }, - { url = "https://files.pythonhosted.org/packages/00/7d/1463203663ca1ae62af8fb9ebc9601dd07f04dbced7edb1df3141a2cb2fe/yarl-1.19.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c4228978fb59c6b10f60124ba8e311c26151e176df364e996f3f8ff8b93971b5", size = 344569, upload-time = "2025-04-06T02:34:13.661Z" }, - { url = "https://files.pythonhosted.org/packages/b0/1b/5263203017348669e637bb73856fb9632110538e92d5e9f8214fcc764da9/yarl-1.19.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9ba536b17ecf3c74a94239ec1137a3ad3caea8c0e4deb8c8d2ffe847d870a8c5", size = 371426, upload-time = "2025-04-06T02:34:15.329Z" }, - { url = "https://files.pythonhosted.org/packages/78/59/90ca5f16d56b7741e5383951acc2e065fce41920eb5d8fda3065b5e288dc/yarl-1.19.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a251e00e445d2e9df7b827c9843c0b87f58a3254aaa3f162fb610747491fe00f", size = 368102, upload-time = "2025-04-06T02:34:18.16Z" }, - { url = "https://files.pythonhosted.org/packages/84/f2/5e33aa0251ffd2c2a9041bf887e163eeefdc1dca238fdabac444d9463c3f/yarl-1.19.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f9b92431d8b4d4ca5ccbfdbac95b05a3a6cd70cd73aa62f32f9627acfde7549c", size = 358740, upload-time = "2025-04-06T02:34:20.775Z" }, - { url = "https://files.pythonhosted.org/packages/22/9e/ba92d234c81cf94495fc01eaa0b6000175733f76bd63e60ff748bce22c81/yarl-1.19.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ec2f56edaf476f70b5831bbd59700b53d9dd011b1f77cd4846b5ab5c5eafdb3f", size = 346965, upload-time = "2025-04-06T02:34:22.706Z" }, - { url = "https://files.pythonhosted.org/packages/8d/0b/d4f53136ef12ddad540855a886d7503a6cc17cfabb9a03ce0c179f3b9e51/yarl-1.19.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:acf9b92c4245ac8b59bc7ec66a38d3dcb8d1f97fac934672529562bb824ecadb", size = 368547, upload-time = "2025-04-06T02:34:24.753Z" }, - { url = "https://files.pythonhosted.org/packages/31/4b/35ec8622908a728f378a8511f0ab2d47878b2c0b8cbe035f2d907914a5fc/yarl-1.19.0-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:57711f1465c06fee8825b95c0b83e82991e6d9425f9a042c3c19070a70ac92bf", size = 357610, upload-time = "2025-04-06T02:34:26.342Z" }, - { url = "https://files.pythonhosted.org/packages/c1/71/1f39f7c55b0684834d945a2bcfdfe59e6e02ca2483a3d33c2f77a0c3b177/yarl-1.19.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:528e86f5b1de0ad8dd758ddef4e0ed24f5d946d4a1cef80ffb2d4fca4e10f122", size = 365331, upload-time = "2025-04-06T02:34:28.43Z" }, - { url = "https://files.pythonhosted.org/packages/2e/13/57675964de5c8ccf6427df93ac97f9bb7328f3f8f7ebc31a5f5a286ab1c0/yarl-1.19.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:3b77173663e075d9e5a57e09d711e9da2f3266be729ecca0b8ae78190990d260", size = 378624, upload-time = "2025-04-06T02:34:30.467Z" }, - { url = "https://files.pythonhosted.org/packages/d4/c6/5868e40f8da041ed0c3b5fd8c08cece849d9f609e970e6043308767fbb60/yarl-1.19.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:d8717924cf0a825b62b1a96fc7d28aab7f55a81bf5338b8ef41d7a76ab9223e9", size = 383981, upload-time = "2025-04-06T02:34:32.585Z" }, - { url = "https://files.pythonhosted.org/packages/f4/3f/e40124c986d96741d3d341ffac35be42b6df82ef8c18b5984ca2e7d838dd/yarl-1.19.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:0df9f0221a78d858793f40cbea3915c29f969c11366646a92ca47e080a14f881", size = 378868, upload-time = "2025-04-06T02:34:34.727Z" }, - { url = "https://files.pythonhosted.org/packages/01/eb/caf2774c770288bd87a818b11f3a56ada6a855f1987d93421aae01a175bf/yarl-1.19.0-cp311-cp311-win32.whl", hash = "sha256:8b3ade62678ee2c7c10dcd6be19045135e9badad53108f7d2ed14896ee396045", size = 86446, upload-time = "2025-04-06T02:34:36.757Z" }, - { url = "https://files.pythonhosted.org/packages/4a/97/d4fe6168c1bb789507ffeb58c2e8c675a7e71de732dc02e12bda904c1362/yarl-1.19.0-cp311-cp311-win_amd64.whl", hash = "sha256:0626ee31edb23ac36bdffe607231de2cca055ad3a5e2dc5da587ef8bc6a321bc", size = 93121, upload-time = "2025-04-06T02:34:38.296Z" }, - { url = "https://files.pythonhosted.org/packages/b8/70/44ef8f69d61cb5123167a4dda87f6c739a833fbdb2ed52960b4e8409d65c/yarl-1.19.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:7b687c334da3ff8eab848c9620c47a253d005e78335e9ce0d6868ed7e8fd170b", size = 146855, upload-time = "2025-04-06T02:34:40.177Z" }, - { url = "https://files.pythonhosted.org/packages/c3/94/38c14d6c8217cc818647689f2dd647b976ced8fea08d0ac84e3c8168252b/yarl-1.19.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:b0fe766febcf523a2930b819c87bb92407ae1368662c1bc267234e79b20ff894", size = 97523, upload-time = "2025-04-06T02:34:41.817Z" }, - { url = "https://files.pythonhosted.org/packages/35/a5/43a613586a6255105c4655a911c307ef3420e49e540d6ae2c5829863fb25/yarl-1.19.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:742ceffd3c7beeb2b20d47cdb92c513eef83c9ef88c46829f88d5b06be6734ee", size = 95540, upload-time = "2025-04-06T02:34:43.4Z" }, - { url = "https://files.pythonhosted.org/packages/d4/60/ed26049f4a8b06ebfa6d5f3cb6a51b152fd57081aa818b6497474f65a631/yarl-1.19.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2af682a1e97437382ee0791eacbf540318bd487a942e068e7e0a6c571fadbbd3", size = 344386, upload-time = "2025-04-06T02:34:45.275Z" }, - { url = "https://files.pythonhosted.org/packages/49/a6/b84899cab411f49af5986cfb44b514040788d81c8084f5811e6a7c0f1ce6/yarl-1.19.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:63702f1a098d0eaaea755e9c9d63172be1acb9e2d4aeb28b187092bcc9ca2d17", size = 338889, upload-time = "2025-04-06T02:34:47.359Z" }, - { url = "https://files.pythonhosted.org/packages/cc/ce/0704f7166a781b1f81bdd45c4f49eadbae0230ebd35b9ec7cd7769d3a6ff/yarl-1.19.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3560dcba3c71ae7382975dc1e912ee76e50b4cd7c34b454ed620d55464f11876", size = 353107, upload-time = "2025-04-06T02:34:49.32Z" }, - { url = "https://files.pythonhosted.org/packages/75/e5/0ecd6f2a9cc4264c16d8dfb0d3d71ba8d03cb58f3bcd42b1df4358331189/yarl-1.19.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:68972df6a0cc47c8abaf77525a76ee5c5f6ea9bbdb79b9565b3234ded3c5e675", size = 353128, upload-time = "2025-04-06T02:34:51.312Z" }, - { url = "https://files.pythonhosted.org/packages/ad/c7/cd0fd1de581f1c2e8f996e704c9fd979e00106f18eebd91b0173cf1a13c6/yarl-1.19.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5684e7ff93ea74e47542232bd132f608df4d449f8968fde6b05aaf9e08a140f9", size = 349107, upload-time = "2025-04-06T02:34:53.022Z" }, - { url = "https://files.pythonhosted.org/packages/e6/34/ba3e5a20bd1d6a09034fc7985aaf1309976f2a7a5aefd093c9e56f6e1e0c/yarl-1.19.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8182ad422bfacdebd4759ce3adc6055c0c79d4740aea1104e05652a81cd868c6", size = 335144, upload-time = "2025-04-06T02:34:54.767Z" }, - { url = "https://files.pythonhosted.org/packages/1e/98/d9b7beb932fade015906efe0980aa7d522b8f93cf5ebf1082e74faa314b7/yarl-1.19.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:aee5b90a5a9b71ac57400a7bdd0feaa27c51e8f961decc8d412e720a004a1791", size = 360795, upload-time = "2025-04-06T02:34:57.08Z" }, - { url = "https://files.pythonhosted.org/packages/9a/11/70b8770039cc54af5948970591517a1e1d093df3f04f328c655c9a0fefb7/yarl-1.19.0-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:8c0b2371858d5a814b08542d5d548adb03ff2d7ab32f23160e54e92250961a72", size = 360140, upload-time = "2025-04-06T02:34:59.341Z" }, - { url = "https://files.pythonhosted.org/packages/d4/67/708e3e36fafc4d9d96b4eecc6c8b9f37c8ad50df8a16c7a1d5ba9df53050/yarl-1.19.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:cd430c2b7df4ae92498da09e9b12cad5bdbb140d22d138f9e507de1aa3edfea3", size = 364431, upload-time = "2025-04-06T02:35:01.126Z" }, - { url = "https://files.pythonhosted.org/packages/c3/8b/937fbbcc895553a7e16fcd86ae4e0724c6ac9468237ad8e7c29cc3b1c9d9/yarl-1.19.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:a93208282c0ccdf73065fd76c6c129bd428dba5ff65d338ae7d2ab27169861a0", size = 373832, upload-time = "2025-04-06T02:35:03.244Z" }, - { url = "https://files.pythonhosted.org/packages/f8/ca/288ddc2230c9b6647fe907504f1119adb41252ac533eb564d3fc73511215/yarl-1.19.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:b8179280cdeb4c36eb18d6534a328f9d40da60d2b96ac4a295c5f93e2799e9d9", size = 378122, upload-time = "2025-04-06T02:35:05.365Z" }, - { url = "https://files.pythonhosted.org/packages/4f/5a/79e1ef31d14968fbfc0ecec70a6683b574890d9c7550c376dd6d40de7754/yarl-1.19.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:eda3c2b42dc0c389b7cfda2c4df81c12eeb552019e0de28bde8f913fc3d1fcf3", size = 375178, upload-time = "2025-04-06T02:35:07.106Z" }, - { url = "https://files.pythonhosted.org/packages/95/38/9b0e56bf14026c3f550ad6425679f6d1a2f4821d70767f39d6f4c56a0820/yarl-1.19.0-cp312-cp312-win32.whl", hash = "sha256:57f3fed859af367b9ca316ecc05ce79ce327d6466342734305aa5cc380e4d8be", size = 86172, upload-time = "2025-04-06T02:35:09.224Z" }, - { url = "https://files.pythonhosted.org/packages/b3/96/5c2f3987c4bb4e5cdebea3caf99a45946b13a9516f849c02222203d99860/yarl-1.19.0-cp312-cp312-win_amd64.whl", hash = "sha256:5507c1f7dd3d41251b67eecba331c8b2157cfd324849879bebf74676ce76aff7", size = 92617, upload-time = "2025-04-06T02:35:11.283Z" }, - { url = "https://files.pythonhosted.org/packages/cd/a7/222144efa2f4a47363a5fee27d8a1d24851283b5a7f628890805fe7f7a66/yarl-1.19.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:59281b9ed27bc410e0793833bcbe7fc149739d56ffa071d1e0fe70536a4f7b61", size = 144789, upload-time = "2025-04-06T02:35:13.176Z" }, - { url = "https://files.pythonhosted.org/packages/72/4f/3ee8de3f94baa33c0716260b0048b1fd5306f104b3efc6e1713693e7063e/yarl-1.19.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:d27a6482ad5e05e8bafd47bf42866f8a1c0c3345abcb48d4511b3c29ecc197dc", size = 96685, upload-time = "2025-04-06T02:35:14.852Z" }, - { url = "https://files.pythonhosted.org/packages/3e/7c/fbeebf875c1ededd872d6fefabd8a8526ef8aba6e9e8bcdf230d895d487b/yarl-1.19.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:7a8e19fd5a6fdf19a91f2409665c7a089ffe7b9b5394ab33c0eec04cbecdd01f", size = 94307, upload-time = "2025-04-06T02:35:16.722Z" }, - { url = "https://files.pythonhosted.org/packages/f3/ff/b7a9c1d7df37e594b43b7a8030e228ccd4ce361eeff24a92b17fe210e57d/yarl-1.19.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cda34ab19099c3a1685ad48fe45172536610c312b993310b5f1ca3eb83453b36", size = 342811, upload-time = "2025-04-06T02:35:18.648Z" }, - { url = "https://files.pythonhosted.org/packages/79/e2/9e092876b2156c1d386e4864e85eba541ccabf2b9dcc47da64624bad0cc9/yarl-1.19.0-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:7908a25d33f94852b479910f9cae6cdb9e2a509894e8d5f416c8342c0253c397", size = 336928, upload-time = "2025-04-06T02:35:20.59Z" }, - { url = "https://files.pythonhosted.org/packages/71/24/648d99c134f2e14fc01ba790ad36ab56815e00069e60a12a4af893448b83/yarl-1.19.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e66c14d162bac94973e767b24de5d7e6c5153f7305a64ff4fcba701210bcd638", size = 351021, upload-time = "2025-04-06T02:35:22.614Z" }, - { url = "https://files.pythonhosted.org/packages/0c/ee/7278d475784d407d1990a5939722e66a0fef057046fb5f1721f0a6eb156c/yarl-1.19.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c03607bf932aa4cfae371e2dc9ca8b76faf031f106dac6a6ff1458418140c165", size = 354454, upload-time = "2025-04-06T02:35:24.72Z" }, - { url = "https://files.pythonhosted.org/packages/15/ae/242546114e052a7de21a75bd7d4860266439f90bbc21c5e4dd696866d91d/yarl-1.19.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9931343d1c1f4e77421687b6b94bbebd8a15a64ab8279adf6fbb047eff47e536", size = 347594, upload-time = "2025-04-06T02:35:26.665Z" }, - { url = "https://files.pythonhosted.org/packages/46/2c/35f4347f76ea4c986e9c1f774b085f489b3a1bf1503c67a4dfc5d8e68e92/yarl-1.19.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:262087a8a0d73e1d169d45c2baf968126f93c97cf403e1af23a7d5455d52721f", size = 334113, upload-time = "2025-04-06T02:35:28.4Z" }, - { url = "https://files.pythonhosted.org/packages/20/89/3086bc8ec8d7bd505531c51056452d7ae6af906d29c427374f1170ac1938/yarl-1.19.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:70f384921c24e703d249a6ccdabeb57dd6312b568b504c69e428a8dd3e8e68ca", size = 361037, upload-time = "2025-04-06T02:35:30.509Z" }, - { url = "https://files.pythonhosted.org/packages/a1/5b/2c9765524a70d1c51922b41c91caa30c8094a416734349166e1a3d8de055/yarl-1.19.0-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:756b9ea5292a2c180d1fe782a377bc4159b3cfefaca7e41b5b0a00328ef62fa9", size = 361025, upload-time = "2025-04-06T02:35:32.904Z" }, - { url = "https://files.pythonhosted.org/packages/ca/f8/c4a190bcc3cd98fb428d1dd31519e58004153dc7f2acd1236ecae54e3433/yarl-1.19.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:cbeb9c145d534c240a63b6ecc8a8dd451faeb67b3dc61d729ec197bb93e29497", size = 364397, upload-time = "2025-04-06T02:35:34.807Z" }, - { url = "https://files.pythonhosted.org/packages/6b/fb/f65b1347be8e12ac4e3e37a9bb880e6b9b604f252aaafd88e4879b1e9348/yarl-1.19.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:087ae8f8319848c18e0d114d0f56131a9c017f29200ab1413b0137ad7c83e2ae", size = 374065, upload-time = "2025-04-06T02:35:36.669Z" }, - { url = "https://files.pythonhosted.org/packages/1c/c5/102cc3b9baad1a76f9127453ad08e0f5bc9c996c18128b1e28fe03817d6c/yarl-1.19.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:362f5480ba527b6c26ff58cff1f229afe8b7fdd54ee5ffac2ab827c1a75fc71c", size = 381341, upload-time = "2025-04-06T02:35:38.912Z" }, - { url = "https://files.pythonhosted.org/packages/f7/ce/f5dc0439320dfe59fadab8cdd24ac324be19cf6ae4736422c7e2a510ddf3/yarl-1.19.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:f408d4b4315e814e5c3668094e33d885f13c7809cbe831cbdc5b1bb8c7a448f4", size = 376552, upload-time = "2025-04-06T02:35:40.846Z" }, - { url = "https://files.pythonhosted.org/packages/a9/4a/4833a134c76af987eff3ce8cb71e42932234120e6be061eb2555061e8844/yarl-1.19.0-cp313-cp313-win32.whl", hash = "sha256:24e4c367ad69988a2283dd45ea88172561ca24b2326b9781e164eb46eea68345", size = 85878, upload-time = "2025-04-06T02:35:43.517Z" }, - { url = "https://files.pythonhosted.org/packages/32/e9/59327daab3af8f79221638a8f0d11474d20f6a8fbc41e9da80c5ef69e688/yarl-1.19.0-cp313-cp313-win_amd64.whl", hash = "sha256:0110f91c57ab43d1538dfa92d61c45e33b84df9257bd08fcfcda90cce931cbc9", size = 92448, upload-time = "2025-04-06T02:35:45.694Z" }, - { url = "https://files.pythonhosted.org/packages/f0/77/38ee2b6ea52fa46efb3a68c17d066760a2e873c99837001922dad3c5d4e5/yarl-1.19.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:85ac908cd5a97bbd3048cca9f1bf37b932ea26c3885099444f34b0bf5d5e9fa6", size = 146440, upload-time = "2025-04-06T02:35:47.428Z" }, - { url = "https://files.pythonhosted.org/packages/08/14/4c2f8696bf09d851d299e4af62bf005e6087f162cd34b8c88c332d8580ea/yarl-1.19.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6ba0931b559f1345df48a78521c31cfe356585670e8be22af84a33a39f7b9221", size = 97490, upload-time = "2025-04-06T02:35:49.332Z" }, - { url = "https://files.pythonhosted.org/packages/8d/b9/a67586d46e9c68ecae6162164539c50fdeab3f4722decda4f6ea9f7bf4fd/yarl-1.19.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:5bc503e1c1fee1b86bcb58db67c032957a52cae39fe8ddd95441f414ffbab83e", size = 95236, upload-time = "2025-04-06T02:35:51.989Z" }, - { url = "https://files.pythonhosted.org/packages/76/01/2f3c33ef91f9292bb4bb59654fc5f6e0c24780de74cc993f583dec7c6adb/yarl-1.19.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d995122dcaf180fd4830a9aa425abddab7c0246107c21ecca2fa085611fa7ce9", size = 330624, upload-time = "2025-04-06T02:35:54.017Z" }, - { url = "https://files.pythonhosted.org/packages/43/fd/64e414ffba8f19e5d151c06e9402a0a0054f0c8f5d5e25519612d5d583ad/yarl-1.19.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:217f69e60a14da4eed454a030ea8283f8fbd01a7d6d81e57efb865856822489b", size = 325798, upload-time = "2025-04-06T02:35:55.919Z" }, - { url = "https://files.pythonhosted.org/packages/7a/84/813be2b6b8c4c5bdafa5e0c0e5b17213f45fd10efbfaaa1279a917201373/yarl-1.19.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:aad67c8f13a4b79990082f72ef09c078a77de2b39899aabf3960a48069704973", size = 348176, upload-time = "2025-04-06T02:35:58.256Z" }, - { url = "https://files.pythonhosted.org/packages/4f/06/81f9a80e243e043f0dc6a043d1a89dc004b06e3f71fb7c83f9013959bb5b/yarl-1.19.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dff065a1a8ed051d7e641369ba1ad030d5a707afac54cf4ede7069b959898835", size = 343497, upload-time = "2025-04-06T02:36:00.665Z" }, - { url = "https://files.pythonhosted.org/packages/ec/8a/abbed688dd85b5a29e91ed9a7f4cce9efe925083d7567f341ece0b36cc7e/yarl-1.19.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ada882e26b16ee651ab6544ce956f2f4beaed38261238f67c2a96db748e17741", size = 336969, upload-time = "2025-04-06T02:36:03.031Z" }, - { url = "https://files.pythonhosted.org/packages/33/1a/7a6316473afec0b57e1cbf2ccaa02df9f138c0e447b43e85e8b1a4e7a549/yarl-1.19.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:67a56b1acc7093451ea2de0687aa3bd4e58d6b4ef6cbeeaad137b45203deaade", size = 328910, upload-time = "2025-04-06T02:36:05.26Z" }, - { url = "https://files.pythonhosted.org/packages/29/07/ba204b362147a04a5e172af726887156ae4e098fab826aa9d7269fbdbf89/yarl-1.19.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:e97d2f0a06b39e231e59ebab0e6eec45c7683b339e8262299ac952707bdf7688", size = 342614, upload-time = "2025-04-06T02:36:07.215Z" }, - { url = "https://files.pythonhosted.org/packages/e1/43/555be0062c999a610ad2c7b5a78695f25a70890be8c3e9ae555386b20cd3/yarl-1.19.0-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:a5288adb7c59d0f54e4ad58d86fb06d4b26e08a59ed06d00a1aac978c0e32884", size = 340438, upload-time = "2025-04-06T02:36:09.749Z" }, - { url = "https://files.pythonhosted.org/packages/26/17/703f82dbac560b9a47cee7c83abad923ac98f062eda9430dab098c28a3c9/yarl-1.19.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:1efbf4d03e6eddf5da27752e0b67a8e70599053436e9344d0969532baa99df53", size = 343236, upload-time = "2025-04-06T02:36:11.92Z" }, - { url = "https://files.pythonhosted.org/packages/e7/2c/a73354c4cc84e39a1eb83c1fabce01a75640a7fcf4183e5d3e99b1e510bd/yarl-1.19.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:f228f42f29cc87db67020f7d71624102b2c837686e55317b16e1d3ef2747a993", size = 358432, upload-time = "2025-04-06T02:36:14.117Z" }, - { url = "https://files.pythonhosted.org/packages/f2/b5/5213af4695344281637d65005b781151008446bbd852a4b6a1b47b6952fa/yarl-1.19.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:c515f7dd60ca724e4c62b34aeaa603188964abed2eb66bb8e220f7f104d5a187", size = 359656, upload-time = "2025-04-06T02:36:16.429Z" }, - { url = "https://files.pythonhosted.org/packages/d0/7d/00c56abbb3bec635dbe1f0ffb11f04eefc9ec2e1af24f10b34ed5d4e154d/yarl-1.19.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:4815ec6d3d68a96557fa71bd36661b45ac773fb50e5cfa31a7e843edb098f060", size = 353732, upload-time = "2025-04-06T02:36:18.662Z" }, - { url = "https://files.pythonhosted.org/packages/84/4f/37e5c9162af1a494f9854683869c67be271c5e66f75b0c7010c78a025356/yarl-1.19.0-cp39-cp39-win32.whl", hash = "sha256:9fac2dd1c5ecb921359d9546bc23a6dcc18c6acd50c6d96f118188d68010f497", size = 87082, upload-time = "2025-04-06T02:36:20.853Z" }, - { url = "https://files.pythonhosted.org/packages/55/7f/ef6a2a6d95671430364ec801286ed748cc9808bd747f038639158b5f308d/yarl-1.19.0-cp39-cp39-win_amd64.whl", hash = "sha256:5864f539ce86b935053bfa18205fa08ce38e9a40ea4d51b19ce923345f0ed5db", size = 93180, upload-time = "2025-04-06T02:36:22.628Z" }, - { url = "https://files.pythonhosted.org/packages/a4/06/ae25a353e8f032322df6f30d6bb1fc329773ee48e1a80a2196ccb8d1206b/yarl-1.19.0-py3-none-any.whl", hash = "sha256:a727101eb27f66727576630d02985d8a065d09cd0b5fcbe38a5793f71b2a97ef", size = 45990, upload-time = "2025-04-06T02:36:24.343Z" }, +sdist = { url = "https://files.pythonhosted.org/packages/3c/fb/efaa23fa4e45537b827620f04cf8f3cd658b76642205162e072703a5b963/yarl-1.20.1.tar.gz", hash = "sha256:d017a4997ee50c91fd5466cef416231bb82177b93b029906cefc542ce14c35ac", size = 186428, upload-time = "2025-06-10T00:46:09.923Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cb/65/7fed0d774abf47487c64be14e9223749468922817b5e8792b8a64792a1bb/yarl-1.20.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:6032e6da6abd41e4acda34d75a816012717000fa6839f37124a47fcefc49bec4", size = 132910, upload-time = "2025-06-10T00:42:31.108Z" }, + { url = "https://files.pythonhosted.org/packages/8a/7b/988f55a52da99df9e56dc733b8e4e5a6ae2090081dc2754fc8fd34e60aa0/yarl-1.20.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:2c7b34d804b8cf9b214f05015c4fee2ebe7ed05cf581e7192c06555c71f4446a", size = 90644, upload-time = "2025-06-10T00:42:33.851Z" }, + { url = "https://files.pythonhosted.org/packages/f7/de/30d98f03e95d30c7e3cc093759982d038c8833ec2451001d45ef4854edc1/yarl-1.20.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0c869f2651cc77465f6cd01d938d91a11d9ea5d798738c1dc077f3de0b5e5fed", size = 89322, upload-time = "2025-06-10T00:42:35.688Z" }, + { url = "https://files.pythonhosted.org/packages/e0/7a/f2f314f5ebfe9200724b0b748de2186b927acb334cf964fd312eb86fc286/yarl-1.20.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:62915e6688eb4d180d93840cda4110995ad50c459bf931b8b3775b37c264af1e", size = 323786, upload-time = "2025-06-10T00:42:37.817Z" }, + { url = "https://files.pythonhosted.org/packages/15/3f/718d26f189db96d993d14b984ce91de52e76309d0fd1d4296f34039856aa/yarl-1.20.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:41ebd28167bc6af8abb97fec1a399f412eec5fd61a3ccbe2305a18b84fb4ca73", size = 319627, upload-time = "2025-06-10T00:42:39.937Z" }, + { url = "https://files.pythonhosted.org/packages/a5/76/8fcfbf5fa2369157b9898962a4a7d96764b287b085b5b3d9ffae69cdefd1/yarl-1.20.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:21242b4288a6d56f04ea193adde174b7e347ac46ce6bc84989ff7c1b1ecea84e", size = 339149, upload-time = "2025-06-10T00:42:42.627Z" }, + { url = "https://files.pythonhosted.org/packages/3c/95/d7fc301cc4661785967acc04f54a4a42d5124905e27db27bb578aac49b5c/yarl-1.20.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bea21cdae6c7eb02ba02a475f37463abfe0a01f5d7200121b03e605d6a0439f8", size = 333327, upload-time = "2025-06-10T00:42:44.842Z" }, + { url = "https://files.pythonhosted.org/packages/65/94/e21269718349582eee81efc5c1c08ee71c816bfc1585b77d0ec3f58089eb/yarl-1.20.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1f8a891e4a22a89f5dde7862994485e19db246b70bb288d3ce73a34422e55b23", size = 326054, upload-time = "2025-06-10T00:42:47.149Z" }, + { url = "https://files.pythonhosted.org/packages/32/ae/8616d1f07853704523519f6131d21f092e567c5af93de7e3e94b38d7f065/yarl-1.20.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dd803820d44c8853a109a34e3660e5a61beae12970da479cf44aa2954019bf70", size = 315035, upload-time = "2025-06-10T00:42:48.852Z" }, + { url = "https://files.pythonhosted.org/packages/48/aa/0ace06280861ef055855333707db5e49c6e3a08840a7ce62682259d0a6c0/yarl-1.20.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:b982fa7f74c80d5c0c7b5b38f908971e513380a10fecea528091405f519b9ebb", size = 338962, upload-time = "2025-06-10T00:42:51.024Z" }, + { url = "https://files.pythonhosted.org/packages/20/52/1e9d0e6916f45a8fb50e6844f01cb34692455f1acd548606cbda8134cd1e/yarl-1.20.1-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:33f29ecfe0330c570d997bcf1afd304377f2e48f61447f37e846a6058a4d33b2", size = 335399, upload-time = "2025-06-10T00:42:53.007Z" }, + { url = "https://files.pythonhosted.org/packages/f2/65/60452df742952c630e82f394cd409de10610481d9043aa14c61bf846b7b1/yarl-1.20.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:835ab2cfc74d5eb4a6a528c57f05688099da41cf4957cf08cad38647e4a83b30", size = 338649, upload-time = "2025-06-10T00:42:54.964Z" }, + { url = "https://files.pythonhosted.org/packages/7b/f5/6cd4ff38dcde57a70f23719a838665ee17079640c77087404c3d34da6727/yarl-1.20.1-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:46b5e0ccf1943a9a6e766b2c2b8c732c55b34e28be57d8daa2b3c1d1d4009309", size = 358563, upload-time = "2025-06-10T00:42:57.28Z" }, + { url = "https://files.pythonhosted.org/packages/d1/90/c42eefd79d0d8222cb3227bdd51b640c0c1d0aa33fe4cc86c36eccba77d3/yarl-1.20.1-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:df47c55f7d74127d1b11251fe6397d84afdde0d53b90bedb46a23c0e534f9d24", size = 357609, upload-time = "2025-06-10T00:42:59.055Z" }, + { url = "https://files.pythonhosted.org/packages/03/c8/cea6b232cb4617514232e0f8a718153a95b5d82b5290711b201545825532/yarl-1.20.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:76d12524d05841276b0e22573f28d5fbcb67589836772ae9244d90dd7d66aa13", size = 350224, upload-time = "2025-06-10T00:43:01.248Z" }, + { url = "https://files.pythonhosted.org/packages/ce/a3/eaa0ab9712f1f3d01faf43cf6f1f7210ce4ea4a7e9b28b489a2261ca8db9/yarl-1.20.1-cp310-cp310-win32.whl", hash = "sha256:6c4fbf6b02d70e512d7ade4b1f998f237137f1417ab07ec06358ea04f69134f8", size = 81753, upload-time = "2025-06-10T00:43:03.486Z" }, + { url = "https://files.pythonhosted.org/packages/8f/34/e4abde70a9256465fe31c88ed02c3f8502b7b5dead693a4f350a06413f28/yarl-1.20.1-cp310-cp310-win_amd64.whl", hash = "sha256:aef6c4d69554d44b7f9d923245f8ad9a707d971e6209d51279196d8e8fe1ae16", size = 86817, upload-time = "2025-06-10T00:43:05.231Z" }, + { url = "https://files.pythonhosted.org/packages/b1/18/893b50efc2350e47a874c5c2d67e55a0ea5df91186b2a6f5ac52eff887cd/yarl-1.20.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:47ee6188fea634bdfaeb2cc420f5b3b17332e6225ce88149a17c413c77ff269e", size = 133833, upload-time = "2025-06-10T00:43:07.393Z" }, + { url = "https://files.pythonhosted.org/packages/89/ed/b8773448030e6fc47fa797f099ab9eab151a43a25717f9ac043844ad5ea3/yarl-1.20.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:d0f6500f69e8402d513e5eedb77a4e1818691e8f45e6b687147963514d84b44b", size = 91070, upload-time = "2025-06-10T00:43:09.538Z" }, + { url = "https://files.pythonhosted.org/packages/e3/e3/409bd17b1e42619bf69f60e4f031ce1ccb29bd7380117a55529e76933464/yarl-1.20.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:7a8900a42fcdaad568de58887c7b2f602962356908eedb7628eaf6021a6e435b", size = 89818, upload-time = "2025-06-10T00:43:11.575Z" }, + { url = "https://files.pythonhosted.org/packages/f8/77/64d8431a4d77c856eb2d82aa3de2ad6741365245a29b3a9543cd598ed8c5/yarl-1.20.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bad6d131fda8ef508b36be3ece16d0902e80b88ea7200f030a0f6c11d9e508d4", size = 347003, upload-time = "2025-06-10T00:43:14.088Z" }, + { url = "https://files.pythonhosted.org/packages/8d/d2/0c7e4def093dcef0bd9fa22d4d24b023788b0a33b8d0088b51aa51e21e99/yarl-1.20.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:df018d92fe22aaebb679a7f89fe0c0f368ec497e3dda6cb81a567610f04501f1", size = 336537, upload-time = "2025-06-10T00:43:16.431Z" }, + { url = "https://files.pythonhosted.org/packages/f0/f3/fc514f4b2cf02cb59d10cbfe228691d25929ce8f72a38db07d3febc3f706/yarl-1.20.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8f969afbb0a9b63c18d0feecf0db09d164b7a44a053e78a7d05f5df163e43833", size = 362358, upload-time = "2025-06-10T00:43:18.704Z" }, + { url = "https://files.pythonhosted.org/packages/ea/6d/a313ac8d8391381ff9006ac05f1d4331cee3b1efaa833a53d12253733255/yarl-1.20.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:812303eb4aa98e302886ccda58d6b099e3576b1b9276161469c25803a8db277d", size = 357362, upload-time = "2025-06-10T00:43:20.888Z" }, + { url = "https://files.pythonhosted.org/packages/00/70/8f78a95d6935a70263d46caa3dd18e1f223cf2f2ff2037baa01a22bc5b22/yarl-1.20.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:98c4a7d166635147924aa0bf9bfe8d8abad6fffa6102de9c99ea04a1376f91e8", size = 348979, upload-time = "2025-06-10T00:43:23.169Z" }, + { url = "https://files.pythonhosted.org/packages/cb/05/42773027968968f4f15143553970ee36ead27038d627f457cc44bbbeecf3/yarl-1.20.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:12e768f966538e81e6e7550f9086a6236b16e26cd964cf4df35349970f3551cf", size = 337274, upload-time = "2025-06-10T00:43:27.111Z" }, + { url = "https://files.pythonhosted.org/packages/05/be/665634aa196954156741ea591d2f946f1b78ceee8bb8f28488bf28c0dd62/yarl-1.20.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:fe41919b9d899661c5c28a8b4b0acf704510b88f27f0934ac7a7bebdd8938d5e", size = 363294, upload-time = "2025-06-10T00:43:28.96Z" }, + { url = "https://files.pythonhosted.org/packages/eb/90/73448401d36fa4e210ece5579895731f190d5119c4b66b43b52182e88cd5/yarl-1.20.1-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:8601bc010d1d7780592f3fc1bdc6c72e2b6466ea34569778422943e1a1f3c389", size = 358169, upload-time = "2025-06-10T00:43:30.701Z" }, + { url = "https://files.pythonhosted.org/packages/c3/b0/fce922d46dc1eb43c811f1889f7daa6001b27a4005587e94878570300881/yarl-1.20.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:daadbdc1f2a9033a2399c42646fbd46da7992e868a5fe9513860122d7fe7a73f", size = 362776, upload-time = "2025-06-10T00:43:32.51Z" }, + { url = "https://files.pythonhosted.org/packages/f1/0d/b172628fce039dae8977fd22caeff3eeebffd52e86060413f5673767c427/yarl-1.20.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:03aa1e041727cb438ca762628109ef1333498b122e4c76dd858d186a37cec845", size = 381341, upload-time = "2025-06-10T00:43:34.543Z" }, + { url = "https://files.pythonhosted.org/packages/6b/9b/5b886d7671f4580209e855974fe1cecec409aa4a89ea58b8f0560dc529b1/yarl-1.20.1-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:642980ef5e0fa1de5fa96d905c7e00cb2c47cb468bfcac5a18c58e27dbf8d8d1", size = 379988, upload-time = "2025-06-10T00:43:36.489Z" }, + { url = "https://files.pythonhosted.org/packages/73/be/75ef5fd0fcd8f083a5d13f78fd3f009528132a1f2a1d7c925c39fa20aa79/yarl-1.20.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:86971e2795584fe8c002356d3b97ef6c61862720eeff03db2a7c86b678d85b3e", size = 371113, upload-time = "2025-06-10T00:43:38.592Z" }, + { url = "https://files.pythonhosted.org/packages/50/4f/62faab3b479dfdcb741fe9e3f0323e2a7d5cd1ab2edc73221d57ad4834b2/yarl-1.20.1-cp311-cp311-win32.whl", hash = "sha256:597f40615b8d25812f14562699e287f0dcc035d25eb74da72cae043bb884d773", size = 81485, upload-time = "2025-06-10T00:43:41.038Z" }, + { url = "https://files.pythonhosted.org/packages/f0/09/d9c7942f8f05c32ec72cd5c8e041c8b29b5807328b68b4801ff2511d4d5e/yarl-1.20.1-cp311-cp311-win_amd64.whl", hash = "sha256:26ef53a9e726e61e9cd1cda6b478f17e350fb5800b4bd1cd9fe81c4d91cfeb2e", size = 86686, upload-time = "2025-06-10T00:43:42.692Z" }, + { url = "https://files.pythonhosted.org/packages/5f/9a/cb7fad7d73c69f296eda6815e4a2c7ed53fc70c2f136479a91c8e5fbdb6d/yarl-1.20.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:bdcc4cd244e58593a4379fe60fdee5ac0331f8eb70320a24d591a3be197b94a9", size = 133667, upload-time = "2025-06-10T00:43:44.369Z" }, + { url = "https://files.pythonhosted.org/packages/67/38/688577a1cb1e656e3971fb66a3492501c5a5df56d99722e57c98249e5b8a/yarl-1.20.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:b29a2c385a5f5b9c7d9347e5812b6f7ab267193c62d282a540b4fc528c8a9d2a", size = 91025, upload-time = "2025-06-10T00:43:46.295Z" }, + { url = "https://files.pythonhosted.org/packages/50/ec/72991ae51febeb11a42813fc259f0d4c8e0507f2b74b5514618d8b640365/yarl-1.20.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1112ae8154186dfe2de4732197f59c05a83dc814849a5ced892b708033f40dc2", size = 89709, upload-time = "2025-06-10T00:43:48.22Z" }, + { url = "https://files.pythonhosted.org/packages/99/da/4d798025490e89426e9f976702e5f9482005c548c579bdae792a4c37769e/yarl-1.20.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:90bbd29c4fe234233f7fa2b9b121fb63c321830e5d05b45153a2ca68f7d310ee", size = 352287, upload-time = "2025-06-10T00:43:49.924Z" }, + { url = "https://files.pythonhosted.org/packages/1a/26/54a15c6a567aac1c61b18aa0f4b8aa2e285a52d547d1be8bf48abe2b3991/yarl-1.20.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:680e19c7ce3710ac4cd964e90dad99bf9b5029372ba0c7cbfcd55e54d90ea819", size = 345429, upload-time = "2025-06-10T00:43:51.7Z" }, + { url = "https://files.pythonhosted.org/packages/d6/95/9dcf2386cb875b234353b93ec43e40219e14900e046bf6ac118f94b1e353/yarl-1.20.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4a979218c1fdb4246a05efc2cc23859d47c89af463a90b99b7c56094daf25a16", size = 365429, upload-time = "2025-06-10T00:43:53.494Z" }, + { url = "https://files.pythonhosted.org/packages/91/b2/33a8750f6a4bc224242a635f5f2cff6d6ad5ba651f6edcccf721992c21a0/yarl-1.20.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:255b468adf57b4a7b65d8aad5b5138dce6a0752c139965711bdcb81bc370e1b6", size = 363862, upload-time = "2025-06-10T00:43:55.766Z" }, + { url = "https://files.pythonhosted.org/packages/98/28/3ab7acc5b51f4434b181b0cee8f1f4b77a65919700a355fb3617f9488874/yarl-1.20.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a97d67108e79cfe22e2b430d80d7571ae57d19f17cda8bb967057ca8a7bf5bfd", size = 355616, upload-time = "2025-06-10T00:43:58.056Z" }, + { url = "https://files.pythonhosted.org/packages/36/a3/f666894aa947a371724ec7cd2e5daa78ee8a777b21509b4252dd7bd15e29/yarl-1.20.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8570d998db4ddbfb9a590b185a0a33dbf8aafb831d07a5257b4ec9948df9cb0a", size = 339954, upload-time = "2025-06-10T00:43:59.773Z" }, + { url = "https://files.pythonhosted.org/packages/f1/81/5f466427e09773c04219d3450d7a1256138a010b6c9f0af2d48565e9ad13/yarl-1.20.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:97c75596019baae7c71ccf1d8cc4738bc08134060d0adfcbe5642f778d1dca38", size = 365575, upload-time = "2025-06-10T00:44:02.051Z" }, + { url = "https://files.pythonhosted.org/packages/2e/e3/e4b0ad8403e97e6c9972dd587388940a032f030ebec196ab81a3b8e94d31/yarl-1.20.1-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:1c48912653e63aef91ff988c5432832692ac5a1d8f0fb8a33091520b5bbe19ef", size = 365061, upload-time = "2025-06-10T00:44:04.196Z" }, + { url = "https://files.pythonhosted.org/packages/ac/99/b8a142e79eb86c926f9f06452eb13ecb1bb5713bd01dc0038faf5452e544/yarl-1.20.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:4c3ae28f3ae1563c50f3d37f064ddb1511ecc1d5584e88c6b7c63cf7702a6d5f", size = 364142, upload-time = "2025-06-10T00:44:06.527Z" }, + { url = "https://files.pythonhosted.org/packages/34/f2/08ed34a4a506d82a1a3e5bab99ccd930a040f9b6449e9fd050320e45845c/yarl-1.20.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:c5e9642f27036283550f5f57dc6156c51084b458570b9d0d96100c8bebb186a8", size = 381894, upload-time = "2025-06-10T00:44:08.379Z" }, + { url = "https://files.pythonhosted.org/packages/92/f8/9a3fbf0968eac704f681726eff595dce9b49c8a25cd92bf83df209668285/yarl-1.20.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:2c26b0c49220d5799f7b22c6838409ee9bc58ee5c95361a4d7831f03cc225b5a", size = 383378, upload-time = "2025-06-10T00:44:10.51Z" }, + { url = "https://files.pythonhosted.org/packages/af/85/9363f77bdfa1e4d690957cd39d192c4cacd1c58965df0470a4905253b54f/yarl-1.20.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:564ab3d517e3d01c408c67f2e5247aad4019dcf1969982aba3974b4093279004", size = 374069, upload-time = "2025-06-10T00:44:12.834Z" }, + { url = "https://files.pythonhosted.org/packages/35/99/9918c8739ba271dcd935400cff8b32e3cd319eaf02fcd023d5dcd487a7c8/yarl-1.20.1-cp312-cp312-win32.whl", hash = "sha256:daea0d313868da1cf2fac6b2d3a25c6e3a9e879483244be38c8e6a41f1d876a5", size = 81249, upload-time = "2025-06-10T00:44:14.731Z" }, + { url = "https://files.pythonhosted.org/packages/eb/83/5d9092950565481b413b31a23e75dd3418ff0a277d6e0abf3729d4d1ce25/yarl-1.20.1-cp312-cp312-win_amd64.whl", hash = "sha256:48ea7d7f9be0487339828a4de0360d7ce0efc06524a48e1810f945c45b813698", size = 86710, upload-time = "2025-06-10T00:44:16.716Z" }, + { url = "https://files.pythonhosted.org/packages/8a/e1/2411b6d7f769a07687acee88a062af5833cf1966b7266f3d8dfb3d3dc7d3/yarl-1.20.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:0b5ff0fbb7c9f1b1b5ab53330acbfc5247893069e7716840c8e7d5bb7355038a", size = 131811, upload-time = "2025-06-10T00:44:18.933Z" }, + { url = "https://files.pythonhosted.org/packages/b2/27/584394e1cb76fb771371770eccad35de400e7b434ce3142c2dd27392c968/yarl-1.20.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:14f326acd845c2b2e2eb38fb1346c94f7f3b01a4f5c788f8144f9b630bfff9a3", size = 90078, upload-time = "2025-06-10T00:44:20.635Z" }, + { url = "https://files.pythonhosted.org/packages/bf/9a/3246ae92d4049099f52d9b0fe3486e3b500e29b7ea872d0f152966fc209d/yarl-1.20.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f60e4ad5db23f0b96e49c018596707c3ae89f5d0bd97f0ad3684bcbad899f1e7", size = 88748, upload-time = "2025-06-10T00:44:22.34Z" }, + { url = "https://files.pythonhosted.org/packages/a3/25/35afe384e31115a1a801fbcf84012d7a066d89035befae7c5d4284df1e03/yarl-1.20.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:49bdd1b8e00ce57e68ba51916e4bb04461746e794e7c4d4bbc42ba2f18297691", size = 349595, upload-time = "2025-06-10T00:44:24.314Z" }, + { url = "https://files.pythonhosted.org/packages/28/2d/8aca6cb2cabc8f12efcb82749b9cefecbccfc7b0384e56cd71058ccee433/yarl-1.20.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:66252d780b45189975abfed839616e8fd2dbacbdc262105ad7742c6ae58f3e31", size = 342616, upload-time = "2025-06-10T00:44:26.167Z" }, + { url = "https://files.pythonhosted.org/packages/0b/e9/1312633d16b31acf0098d30440ca855e3492d66623dafb8e25b03d00c3da/yarl-1.20.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:59174e7332f5d153d8f7452a102b103e2e74035ad085f404df2e40e663a22b28", size = 361324, upload-time = "2025-06-10T00:44:27.915Z" }, + { url = "https://files.pythonhosted.org/packages/bc/a0/688cc99463f12f7669eec7c8acc71ef56a1521b99eab7cd3abb75af887b0/yarl-1.20.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e3968ec7d92a0c0f9ac34d5ecfd03869ec0cab0697c91a45db3fbbd95fe1b653", size = 359676, upload-time = "2025-06-10T00:44:30.041Z" }, + { url = "https://files.pythonhosted.org/packages/af/44/46407d7f7a56e9a85a4c207724c9f2c545c060380718eea9088f222ba697/yarl-1.20.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d1a4fbb50e14396ba3d375f68bfe02215d8e7bc3ec49da8341fe3157f59d2ff5", size = 352614, upload-time = "2025-06-10T00:44:32.171Z" }, + { url = "https://files.pythonhosted.org/packages/b1/91/31163295e82b8d5485d31d9cf7754d973d41915cadce070491778d9c9825/yarl-1.20.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:11a62c839c3a8eac2410e951301309426f368388ff2f33799052787035793b02", size = 336766, upload-time = "2025-06-10T00:44:34.494Z" }, + { url = "https://files.pythonhosted.org/packages/b4/8e/c41a5bc482121f51c083c4c2bcd16b9e01e1cf8729e380273a952513a21f/yarl-1.20.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:041eaa14f73ff5a8986b4388ac6bb43a77f2ea09bf1913df7a35d4646db69e53", size = 364615, upload-time = "2025-06-10T00:44:36.856Z" }, + { url = "https://files.pythonhosted.org/packages/e3/5b/61a3b054238d33d70ea06ebba7e58597891b71c699e247df35cc984ab393/yarl-1.20.1-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:377fae2fef158e8fd9d60b4c8751387b8d1fb121d3d0b8e9b0be07d1b41e83dc", size = 360982, upload-time = "2025-06-10T00:44:39.141Z" }, + { url = "https://files.pythonhosted.org/packages/df/a3/6a72fb83f8d478cb201d14927bc8040af901811a88e0ff2da7842dd0ed19/yarl-1.20.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:1c92f4390e407513f619d49319023664643d3339bd5e5a56a3bebe01bc67ec04", size = 369792, upload-time = "2025-06-10T00:44:40.934Z" }, + { url = "https://files.pythonhosted.org/packages/7c/af/4cc3c36dfc7c077f8dedb561eb21f69e1e9f2456b91b593882b0b18c19dc/yarl-1.20.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:d25ddcf954df1754ab0f86bb696af765c5bfaba39b74095f27eececa049ef9a4", size = 382049, upload-time = "2025-06-10T00:44:42.854Z" }, + { url = "https://files.pythonhosted.org/packages/19/3a/e54e2c4752160115183a66dc9ee75a153f81f3ab2ba4bf79c3c53b33de34/yarl-1.20.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:909313577e9619dcff8c31a0ea2aa0a2a828341d92673015456b3ae492e7317b", size = 384774, upload-time = "2025-06-10T00:44:45.275Z" }, + { url = "https://files.pythonhosted.org/packages/9c/20/200ae86dabfca89060ec6447649f219b4cbd94531e425e50d57e5f5ac330/yarl-1.20.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:793fd0580cb9664548c6b83c63b43c477212c0260891ddf86809e1c06c8b08f1", size = 374252, upload-time = "2025-06-10T00:44:47.31Z" }, + { url = "https://files.pythonhosted.org/packages/83/75/11ee332f2f516b3d094e89448da73d557687f7d137d5a0f48c40ff211487/yarl-1.20.1-cp313-cp313-win32.whl", hash = "sha256:468f6e40285de5a5b3c44981ca3a319a4b208ccc07d526b20b12aeedcfa654b7", size = 81198, upload-time = "2025-06-10T00:44:49.164Z" }, + { url = "https://files.pythonhosted.org/packages/ba/ba/39b1ecbf51620b40ab402b0fc817f0ff750f6d92712b44689c2c215be89d/yarl-1.20.1-cp313-cp313-win_amd64.whl", hash = "sha256:495b4ef2fea40596bfc0affe3837411d6aa3371abcf31aac0ccc4bdd64d4ef5c", size = 86346, upload-time = "2025-06-10T00:44:51.182Z" }, + { url = "https://files.pythonhosted.org/packages/43/c7/669c52519dca4c95153c8ad96dd123c79f354a376346b198f438e56ffeb4/yarl-1.20.1-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:f60233b98423aab21d249a30eb27c389c14929f47be8430efa7dbd91493a729d", size = 138826, upload-time = "2025-06-10T00:44:52.883Z" }, + { url = "https://files.pythonhosted.org/packages/6a/42/fc0053719b44f6ad04a75d7f05e0e9674d45ef62f2d9ad2c1163e5c05827/yarl-1.20.1-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:6f3eff4cc3f03d650d8755c6eefc844edde99d641d0dcf4da3ab27141a5f8ddf", size = 93217, upload-time = "2025-06-10T00:44:54.658Z" }, + { url = "https://files.pythonhosted.org/packages/4f/7f/fa59c4c27e2a076bba0d959386e26eba77eb52ea4a0aac48e3515c186b4c/yarl-1.20.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:69ff8439d8ba832d6bed88af2c2b3445977eba9a4588b787b32945871c2444e3", size = 92700, upload-time = "2025-06-10T00:44:56.784Z" }, + { url = "https://files.pythonhosted.org/packages/2f/d4/062b2f48e7c93481e88eff97a6312dca15ea200e959f23e96d8ab898c5b8/yarl-1.20.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3cf34efa60eb81dd2645a2e13e00bb98b76c35ab5061a3989c7a70f78c85006d", size = 347644, upload-time = "2025-06-10T00:44:59.071Z" }, + { url = "https://files.pythonhosted.org/packages/89/47/78b7f40d13c8f62b499cc702fdf69e090455518ae544c00a3bf4afc9fc77/yarl-1.20.1-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:8e0fe9364ad0fddab2688ce72cb7a8e61ea42eff3c7caeeb83874a5d479c896c", size = 323452, upload-time = "2025-06-10T00:45:01.605Z" }, + { url = "https://files.pythonhosted.org/packages/eb/2b/490d3b2dc66f52987d4ee0d3090a147ea67732ce6b4d61e362c1846d0d32/yarl-1.20.1-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8f64fbf81878ba914562c672024089e3401974a39767747691c65080a67b18c1", size = 346378, upload-time = "2025-06-10T00:45:03.946Z" }, + { url = "https://files.pythonhosted.org/packages/66/ad/775da9c8a94ce925d1537f939a4f17d782efef1f973039d821cbe4bcc211/yarl-1.20.1-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f6342d643bf9a1de97e512e45e4b9560a043347e779a173250824f8b254bd5ce", size = 353261, upload-time = "2025-06-10T00:45:05.992Z" }, + { url = "https://files.pythonhosted.org/packages/4b/23/0ed0922b47a4f5c6eb9065d5ff1e459747226ddce5c6a4c111e728c9f701/yarl-1.20.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:56dac5f452ed25eef0f6e3c6a066c6ab68971d96a9fb441791cad0efba6140d3", size = 335987, upload-time = "2025-06-10T00:45:08.227Z" }, + { url = "https://files.pythonhosted.org/packages/3e/49/bc728a7fe7d0e9336e2b78f0958a2d6b288ba89f25a1762407a222bf53c3/yarl-1.20.1-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c7d7f497126d65e2cad8dc5f97d34c27b19199b6414a40cb36b52f41b79014be", size = 329361, upload-time = "2025-06-10T00:45:10.11Z" }, + { url = "https://files.pythonhosted.org/packages/93/8f/b811b9d1f617c83c907e7082a76e2b92b655400e61730cd61a1f67178393/yarl-1.20.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:67e708dfb8e78d8a19169818eeb5c7a80717562de9051bf2413aca8e3696bf16", size = 346460, upload-time = "2025-06-10T00:45:12.055Z" }, + { url = "https://files.pythonhosted.org/packages/70/fd/af94f04f275f95da2c3b8b5e1d49e3e79f1ed8b6ceb0f1664cbd902773ff/yarl-1.20.1-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:595c07bc79af2494365cc96ddeb772f76272364ef7c80fb892ef9d0649586513", size = 334486, upload-time = "2025-06-10T00:45:13.995Z" }, + { url = "https://files.pythonhosted.org/packages/84/65/04c62e82704e7dd0a9b3f61dbaa8447f8507655fd16c51da0637b39b2910/yarl-1.20.1-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:7bdd2f80f4a7df852ab9ab49484a4dee8030023aa536df41f2d922fd57bf023f", size = 342219, upload-time = "2025-06-10T00:45:16.479Z" }, + { url = "https://files.pythonhosted.org/packages/91/95/459ca62eb958381b342d94ab9a4b6aec1ddec1f7057c487e926f03c06d30/yarl-1.20.1-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:c03bfebc4ae8d862f853a9757199677ab74ec25424d0ebd68a0027e9c639a390", size = 350693, upload-time = "2025-06-10T00:45:18.399Z" }, + { url = "https://files.pythonhosted.org/packages/a6/00/d393e82dd955ad20617abc546a8f1aee40534d599ff555ea053d0ec9bf03/yarl-1.20.1-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:344d1103e9c1523f32a5ed704d576172d2cabed3122ea90b1d4e11fe17c66458", size = 355803, upload-time = "2025-06-10T00:45:20.677Z" }, + { url = "https://files.pythonhosted.org/packages/9e/ed/c5fb04869b99b717985e244fd93029c7a8e8febdfcffa06093e32d7d44e7/yarl-1.20.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:88cab98aa4e13e1ade8c141daeedd300a4603b7132819c484841bb7af3edce9e", size = 341709, upload-time = "2025-06-10T00:45:23.221Z" }, + { url = "https://files.pythonhosted.org/packages/24/fd/725b8e73ac2a50e78a4534ac43c6addf5c1c2d65380dd48a9169cc6739a9/yarl-1.20.1-cp313-cp313t-win32.whl", hash = "sha256:b121ff6a7cbd4abc28985b6028235491941b9fe8fe226e6fdc539c977ea1739d", size = 86591, upload-time = "2025-06-10T00:45:25.793Z" }, + { url = "https://files.pythonhosted.org/packages/94/c3/b2e9f38bc3e11191981d57ea08cab2166e74ea770024a646617c9cddd9f6/yarl-1.20.1-cp313-cp313t-win_amd64.whl", hash = "sha256:541d050a355bbbc27e55d906bc91cb6fe42f96c01413dd0f4ed5a5240513874f", size = 93003, upload-time = "2025-06-10T00:45:27.752Z" }, + { url = "https://files.pythonhosted.org/packages/01/75/0d37402d208d025afa6b5b8eb80e466d267d3fd1927db8e317d29a94a4cb/yarl-1.20.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:e42ba79e2efb6845ebab49c7bf20306c4edf74a0b20fc6b2ccdd1a219d12fad3", size = 134259, upload-time = "2025-06-10T00:45:29.882Z" }, + { url = "https://files.pythonhosted.org/packages/73/84/1fb6c85ae0cf9901046f07d0ac9eb162f7ce6d95db541130aa542ed377e6/yarl-1.20.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:41493b9b7c312ac448b7f0a42a089dffe1d6e6e981a2d76205801a023ed26a2b", size = 91269, upload-time = "2025-06-10T00:45:32.917Z" }, + { url = "https://files.pythonhosted.org/packages/f3/9c/eae746b24c4ea29a5accba9a06c197a70fa38a49c7df244e0d3951108861/yarl-1.20.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f5a5928ff5eb13408c62a968ac90d43f8322fd56d87008b8f9dabf3c0f6ee983", size = 89995, upload-time = "2025-06-10T00:45:35.066Z" }, + { url = "https://files.pythonhosted.org/packages/fb/30/693e71003ec4bc1daf2e4cf7c478c417d0985e0a8e8f00b2230d517876fc/yarl-1.20.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:30c41ad5d717b3961b2dd785593b67d386b73feca30522048d37298fee981805", size = 325253, upload-time = "2025-06-10T00:45:37.052Z" }, + { url = "https://files.pythonhosted.org/packages/0f/a2/5264dbebf90763139aeb0b0b3154763239398400f754ae19a0518b654117/yarl-1.20.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:59febc3969b0781682b469d4aca1a5cab7505a4f7b85acf6db01fa500fa3f6ba", size = 320897, upload-time = "2025-06-10T00:45:39.962Z" }, + { url = "https://files.pythonhosted.org/packages/e7/17/77c7a89b3c05856489777e922f41db79ab4faf58621886df40d812c7facd/yarl-1.20.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d2b6fb3622b7e5bf7a6e5b679a69326b4279e805ed1699d749739a61d242449e", size = 340696, upload-time = "2025-06-10T00:45:41.915Z" }, + { url = "https://files.pythonhosted.org/packages/6d/55/28409330b8ef5f2f681f5b478150496ec9cf3309b149dab7ec8ab5cfa3f0/yarl-1.20.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:749d73611db8d26a6281086f859ea7ec08f9c4c56cec864e52028c8b328db723", size = 335064, upload-time = "2025-06-10T00:45:43.893Z" }, + { url = "https://files.pythonhosted.org/packages/85/58/cb0257cbd4002828ff735f44d3c5b6966c4fd1fc8cc1cd3cd8a143fbc513/yarl-1.20.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9427925776096e664c39e131447aa20ec738bdd77c049c48ea5200db2237e000", size = 327256, upload-time = "2025-06-10T00:45:46.393Z" }, + { url = "https://files.pythonhosted.org/packages/53/f6/c77960370cfa46f6fb3d6a5a79a49d3abfdb9ef92556badc2dcd2748bc2a/yarl-1.20.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ff70f32aa316393eaf8222d518ce9118148eddb8a53073c2403863b41033eed5", size = 316389, upload-time = "2025-06-10T00:45:48.358Z" }, + { url = "https://files.pythonhosted.org/packages/64/ab/be0b10b8e029553c10905b6b00c64ecad3ebc8ace44b02293a62579343f6/yarl-1.20.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:c7ddf7a09f38667aea38801da8b8d6bfe81df767d9dfc8c88eb45827b195cd1c", size = 340481, upload-time = "2025-06-10T00:45:50.663Z" }, + { url = "https://files.pythonhosted.org/packages/c5/c3/3f327bd3905a4916029bf5feb7f86dcf864c7704f099715f62155fb386b2/yarl-1.20.1-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:57edc88517d7fc62b174fcfb2e939fbc486a68315d648d7e74d07fac42cec240", size = 336941, upload-time = "2025-06-10T00:45:52.554Z" }, + { url = "https://files.pythonhosted.org/packages/d1/42/040bdd5d3b3bb02b4a6ace4ed4075e02f85df964d6e6cb321795d2a6496a/yarl-1.20.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:dab096ce479d5894d62c26ff4f699ec9072269d514b4edd630a393223f45a0ee", size = 339936, upload-time = "2025-06-10T00:45:54.919Z" }, + { url = "https://files.pythonhosted.org/packages/0d/1c/911867b8e8c7463b84dfdc275e0d99b04b66ad5132b503f184fe76be8ea4/yarl-1.20.1-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:14a85f3bd2d7bb255be7183e5d7d6e70add151a98edf56a770d6140f5d5f4010", size = 360163, upload-time = "2025-06-10T00:45:56.87Z" }, + { url = "https://files.pythonhosted.org/packages/e2/31/8c389f6c6ca0379b57b2da87f1f126c834777b4931c5ee8427dd65d0ff6b/yarl-1.20.1-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:2c89b5c792685dd9cd3fa9761c1b9f46fc240c2a3265483acc1565769996a3f8", size = 359108, upload-time = "2025-06-10T00:45:58.869Z" }, + { url = "https://files.pythonhosted.org/packages/7f/09/ae4a649fb3964324c70a3e2b61f45e566d9ffc0affd2b974cbf628957673/yarl-1.20.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:69e9b141de5511021942a6866990aea6d111c9042235de90e08f94cf972ca03d", size = 351875, upload-time = "2025-06-10T00:46:01.45Z" }, + { url = "https://files.pythonhosted.org/packages/8d/43/bbb4ed4c34d5bb62b48bf957f68cd43f736f79059d4f85225ab1ef80f4b9/yarl-1.20.1-cp39-cp39-win32.whl", hash = "sha256:b5f307337819cdfdbb40193cad84978a029f847b0a357fbe49f712063cfc4f06", size = 82293, upload-time = "2025-06-10T00:46:03.763Z" }, + { url = "https://files.pythonhosted.org/packages/d7/cd/ce185848a7dba68ea69e932674b5c1a42a1852123584bccc5443120f857c/yarl-1.20.1-cp39-cp39-win_amd64.whl", hash = "sha256:eae7bfe2069f9c1c5b05fc7fe5d612e5bbc089a39309904ee8b829e322dcad00", size = 87385, upload-time = "2025-06-10T00:46:05.655Z" }, + { url = "https://files.pythonhosted.org/packages/b4/2d/2345fce04cfd4bee161bf1e7d9cdc702e3e16109021035dbb24db654a622/yarl-1.20.1-py3-none-any.whl", hash = "sha256:83b8eb083fe4683c6115795d9fc1cfaf2cbbefb19b3a1cb68f6527460f483a77", size = 46542, upload-time = "2025-06-10T00:46:07.521Z" }, ] [[package]] name = "zipp" -version = "3.21.0" +version = "3.23.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/3f/50/bad581df71744867e9468ebd0bcd6505de3b275e06f202c2cb016e3ff56f/zipp-3.21.0.tar.gz", hash = "sha256:2c9958f6430a2040341a52eb608ed6dd93ef4392e02ffe219417c1b28b5dd1f4", size = 24545, upload-time = "2024-11-10T15:05:20.202Z" } +sdist = { url = "https://files.pythonhosted.org/packages/e3/02/0f2892c661036d50ede074e376733dca2ae7c6eb617489437771209d4180/zipp-3.23.0.tar.gz", hash = "sha256:a07157588a12518c9d4034df3fbbee09c814741a33ff63c05fa29d26a2404166", size = 25547, upload-time = "2025-06-08T17:06:39.4Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/b7/1a/7e4798e9339adc931158c9d69ecc34f5e6791489d469f5e50ec15e35f458/zipp-3.21.0-py3-none-any.whl", hash = "sha256:ac1bbe05fd2991f160ebce24ffbac5f6d11d83dc90891255885223d42b3cd931", size = 9630, upload-time = "2024-11-10T15:05:19.275Z" }, + { url = "https://files.pythonhosted.org/packages/2e/54/647ade08bf0db230bfea292f893923872fd20be6ac6f53b2b936ba839d75/zipp-3.23.0-py3-none-any.whl", hash = "sha256:071652d6115ed432f5ce1d34c336c0adfd6a884660d1e9712a256d3d3bd4b14e", size = 10276, upload-time = "2025-06-08T17:06:38.034Z" }, ]