Skip to content

A programming framework for agentic AI

Move core samples to /python/samples (#4911)

Eric Zhuf113c9a959c3
diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml
index 982b04012..347e3f704 100644
--- a/.github/workflows/checks.yml
+++ b/.github/workflows/checks.yml
@@ -214,6 +214,24 @@ jobs:
poe --directory ${{ matrix.package }} docs-check-examples
working-directory: ./python
+ samples-code-check:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: astral-sh/setup-uv@v5
+ with:
+ enable-cache: true
+ - uses: actions/setup-python@v5
+ with:
+ python-version: "3.11"
+ - run: uv sync --locked --all-extras
+ working-directory: ./python
+ - name: Run task
+ run: |
+ source ${{ github.workspace }}/python/.venv/bin/activate
+ poe samples-code-check
+ working-directory: ./python
+
markdown-code-lint:
runs-on: ubuntu-latest
steps:
diff --git a/python/packages/autogen-core/docs/src/user-guide/core-user-guide/framework/tools.ipynb b/python/packages/autogen-core/docs/src/user-guide/core-user-guide/framework/tools.ipynb
index f2bf29425..23fe4dffb 100644
--- a/python/packages/autogen-core/docs/src/user-guide/core-user-guide/framework/tools.ipynb
+++ b/python/packages/autogen-core/docs/src/user-guide/core-user-guide/framework/tools.ipynb
@@ -59,13 +59,6 @@
"print(code_execution_tool.return_value_as_string(result))"
]
},
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
- },
{
"cell_type": "markdown",
"metadata": {},
@@ -106,7 +99,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "80.44429939059668\n"
+ "34.26925801998722\n"
]
}
],
@@ -148,7 +141,7 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
@@ -157,7 +150,6 @@
"\n",
"from autogen_core import (\n",
" AgentId,\n",
- " AgentInstantiationContext,\n",
" MessageContext,\n",
" RoutedAgent,\n",
" SingleThreadedAgentRuntime,\n",
@@ -281,7 +273,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "The stock price of NVDA (NVIDIA Corporation) on June 1, 2024, was approximately $179.46.\n"
+ "The stock price of NVDA (NVIDIA Corporation) on June 1, 2024, was approximately $27.41.\n"
]
}
],
@@ -299,7 +291,7 @@
],
"metadata": {
"kernelspec": {
- "display_name": "autogen_core",
+ "display_name": ".venv",
"language": "python",
"name": "python3"
},
diff --git a/python/packages/autogen-core/samples/common/__init__.py b/python/packages/autogen-core/samples/common/__init__.py
deleted file mode 100644
index e69de29bb..000000000
diff --git a/python/packages/autogen-core/samples/common/agents/__init__.py b/python/packages/autogen-core/samples/common/agents/__init__.py
deleted file mode 100644
index fb5dcdb8e..000000000
--- a/python/packages/autogen-core/samples/common/agents/__init__.py
+++ /dev/null
@@ -1,5 +0,0 @@
-from ._chat_completion_agent import ChatCompletionAgent
-
-__all__ = [
- "ChatCompletionAgent",
-]
diff --git a/python/packages/autogen-core/samples/common/agents/_chat_completion_agent.py b/python/packages/autogen-core/samples/common/agents/_chat_completion_agent.py
deleted file mode 100644
index 538175ef4..000000000
--- a/python/packages/autogen-core/samples/common/agents/_chat_completion_agent.py
+++ /dev/null
@@ -1,263 +0,0 @@
-import asyncio
-import json
-from typing import Any, Coroutine, Dict, List, Mapping, Sequence, Tuple
-
-from autogen_core import (
- AgentId,
- CancellationToken,
- DefaultTopicId,
- FunctionCall,
- MessageContext,
- RoutedAgent,
- message_handler,
-)
-from autogen_core.model_context import ChatCompletionContext
-from autogen_core.models import (
- AssistantMessage,
- ChatCompletionClient,
- FunctionExecutionResult,
- FunctionExecutionResultMessage,
- SystemMessage,
- UserMessage,
-)
-from autogen_core.tools import Tool
-
-from ..types import (
- FunctionCallMessage,
- Message,
- MultiModalMessage,
- PublishNow,
- Reset,
- RespondNow,
- ResponseFormat,
- TextMessage,
- ToolApprovalRequest,
- ToolApprovalResponse,
-)
-
-
-class ChatCompletionAgent(RoutedAgent):
- """An agent implementation that uses the ChatCompletion API to gnenerate
- responses and execute tools.
-
- Args:
- description (str): The description of the agent.
- system_messages (List[SystemMessage]): The system messages to use for
- the ChatCompletion API.
- model_context (ChatCompletionContext): The context manager for storing
- and retrieving ChatCompletion messages.
- model_client (ChatCompletionClient): The client to use for the
- ChatCompletion API.
- tools (Sequence[Tool], optional): The tools used by the agent. Defaults
- to []. If no tools are provided, the agent cannot handle tool calls.
- If tools are provided, and the response from the model is a list of
- tool calls, the agent will call itselfs with the tool calls until it
- gets a response that is not a list of tool calls, and then use that
- response as the final response.
- tool_approver (Agent | None, optional): The agent that approves tool
- calls. Defaults to None. If no tool approver is provided, the agent
- will execute the tools without approval. If a tool approver is
- provided, the agent will send a request to the tool approver before
- executing the tools.
- """
-
- def __init__(
- self,
- description: str,
- system_messages: List[SystemMessage],
- model_context: ChatCompletionContext,
- model_client: ChatCompletionClient,
- tools: Sequence[Tool] = [],
- tool_approver: AgentId | None = None,
- ) -> None:
- super().__init__(description)
- self._description = description
- self._system_messages = system_messages
- self._client = model_client
- self._model_context = model_context
- self._tools = tools
- self._tool_approver = tool_approver
-
- @message_handler()
- async def on_text_message(self, message: TextMessage, ctx: MessageContext) -> None:
- """Handle a text message. This method adds the message to the memory and
- does not generate any message."""
- # Add a user message.
- await self._model_context.add_message(UserMessage(content=message.content, source=message.source))
-
- @message_handler()
- async def on_multi_modal_message(self, message: MultiModalMessage, ctx: MessageContext) -> None:
- """Handle a multimodal message. This method adds the message to the memory
- and does not generate any message."""
- # Add a user message.
- await self._model_context.add_message(UserMessage(content=message.content, source=message.source))
-
- @message_handler()
- async def on_reset(self, message: Reset, ctx: MessageContext) -> None:
- """Handle a reset message. This method clears the memory."""
- # Reset the chat messages.
- await self._model_context.clear()
-
- @message_handler()
- async def on_respond_now(self, message: RespondNow, ctx: MessageContext) -> TextMessage | FunctionCallMessage:
- """Handle a respond now message. This method generates a response and
- returns it to the sender."""
- # Generate a response.
- response = await self._generate_response(message.response_format, ctx)
-
- # Return the response.
- return response
-
- @message_handler()
- async def on_publish_now(self, message: PublishNow, ctx: MessageContext) -> None:
- """Handle a publish now message. This method generates a response and
- publishes it."""
- # Generate a response.
- response = await self._generate_response(message.response_format, ctx)
-
- # Publish the response.
- await self.publish_message(response, topic_id=DefaultTopicId())
-
- @message_handler()
- async def on_tool_call_message(
- self, message: FunctionCallMessage, ctx: MessageContext
- ) -> FunctionExecutionResultMessage:
- """Handle a tool call message. This method executes the tools and
- returns the results."""
- if len(self._tools) == 0:
- raise ValueError("No tools available")
-
- # Execute the tool calls.
- results: List[FunctionExecutionResult] = []
- execution_futures: List[Coroutine[Any, Any, Tuple[str, str]]] = []
- for function_call in message.content:
- # Parse the arguments.
- try:
- arguments = json.loads(function_call.arguments)
- except json.JSONDecodeError:
- results.append(
- FunctionExecutionResult(
- content=f"Error: Could not parse arguments for function {function_call.name}.",
- call_id=function_call.id,
- )
- )
- continue
- # Execute the function.
- future = self._execute_function(
- function_call.name,
- arguments,
- function_call.id,
- cancellation_token=ctx.cancellation_token,
- )
- # Append the async result.
- execution_futures.append(future)
- if execution_futures:
- # Wait for all async results.
- execution_results = await asyncio.gather(*execution_futures)
- # Add the results.
- for execution_result, call_id in execution_results:
- results.append(FunctionExecutionResult(content=execution_result, call_id=call_id))
-
- # Create a tool call result message.
- tool_call_result_msg = FunctionExecutionResultMessage(content=results)
-
- # Return the results.
- return tool_call_result_msg
-
- async def _generate_response(
- self,
- response_format: ResponseFormat,
- ctx: MessageContext,
- ) -> TextMessage | FunctionCallMessage:
- # Get a response from the model.
- response = await self._client.create(
- self._system_messages + (await self._model_context.get_messages()),
- tools=self._tools,
- json_output=response_format == ResponseFormat.json_object,
- )
- # Add the response to the chat messages context.
- await self._model_context.add_message(AssistantMessage(content=response.content, source=self.metadata["type"]))
-
- # If the agent has function executor, and the response is a list of
- # tool calls, iterate with itself until we get a response that is not a
- # list of tool calls.
- while (
- len(self._tools) > 0
- and isinstance(response.content, list)
- and all(isinstance(x, FunctionCall) for x in response.content)
- ):
- # Send a function call message to itself.
- response = await self.send_message(
- message=FunctionCallMessage(content=response.content, source=self.metadata["type"]),
- recipient=self.id,
- cancellation_token=ctx.cancellation_token,
- )
- if not isinstance(response, FunctionExecutionResultMessage):
- raise RuntimeError(f"Expect FunctionExecutionResultMessage but got {response}.")
- await self._model_context.add_message(response)
- # Make an assistant message from the response.
- response = await self._client.create(
- self._system_messages + (await self._model_context.get_messages()),
- tools=self._tools,
- json_output=response_format == ResponseFormat.json_object,
- )
- await self._model_context.add_message(
- AssistantMessage(content=response.content, source=self.metadata["type"])
- )
-
- final_response: Message
- if isinstance(response.content, str):
- # If the response is a string, return a text message.
- final_response = TextMessage(content=response.content, source=self.metadata["type"])
- elif isinstance(response.content, list) and all(isinstance(x, FunctionCall) for x in response.content):
- # If the response is a list of function calls, return a function call message.
- final_response = FunctionCallMessage(content=response.content, source=self.metadata["type"])
- else:
- raise ValueError(f"Unexpected response: {response.content}")
-
- return final_response
-
- async def _execute_function(
- self,
- name: str,
- args: Dict[str, Any],
- call_id: str,
- cancellation_token: CancellationToken,
- ) -> Tuple[str, str]:
- # Find tool
- tool = next((t for t in self._tools if t.name == name), None)
- if tool is None:
- return (f"Error: tool {name} not found.", call_id)
-
- # Check if the tool needs approval
- if self._tool_approver is not None:
- # Send a tool approval request.
- approval_request = ToolApprovalRequest(
- tool_call=FunctionCall(id=call_id, arguments=json.dumps(args), name=name)
- )
- approval_response = await self.send_message(
- message=approval_request,
- recipient=self._tool_approver,
- cancellation_token=cancellation_token,
- )
- if not isinstance(approval_response, ToolApprovalResponse):
- raise ValueError(f"Expecting {ToolApprovalResponse.__name__}, received: {type(approval_response)}")
- if not approval_response.approved:
- return (f"Error: tool {name} approved, reason: {approval_response.reason}", call_id)
-
- try:
- result = await tool.run_json(args, cancellation_token)
- result_as_str = tool.return_value_as_string(result)
- except Exception as e:
- result_as_str = f"Error: {str(e)}"
- return (result_as_str, call_id)
-
- async def save_state(self) -> Mapping[str, Any]:
- return {
- "chat_history": await self._model_context.save_state(),
- "system_messages": self._system_messages,
- }
-
- async def load_state(self, state: Mapping[str, Any]) -> None:
- await self._model_context.load_state(state["chat_history"])
- self._system_messages = state["system_messages"]
diff --git a/python/packages/autogen-core/samples/common/patterns/__init__.py b/python/packages/autogen-core/samples/common/patterns/__init__.py
deleted file mode 100644
index a667bc89e..000000000
--- a/python/packages/autogen-core/samples/common/patterns/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-from ._group_chat_manager import GroupChatManager
-
-__all__ = ["GroupChatManager"]
diff --git a/python/packages/autogen-core/samples/common/patterns/_group_chat_manager.py b/python/packages/autogen-core/samples/common/patterns/_group_chat_manager.py
deleted file mode 100644
index f39e354c9..000000000
--- a/python/packages/autogen-core/samples/common/patterns/_group_chat_manager.py
+++ /dev/null
@@ -1,154 +0,0 @@
-import logging
-from typing import Any, Callable, List, Mapping
-
-from autogen_core import AgentId, AgentProxy, MessageContext, RoutedAgent, message_handler
-from autogen_core.model_context import ChatCompletionContext
-from autogen_core.models import ChatCompletionClient, UserMessage
-
-from ..types import (
- MultiModalMessage,
- PublishNow,
- Reset,
- TextMessage,
-)
-from ._group_chat_utils import select_speaker
-
-logger = logging.getLogger("autogen_core.events")
-
-
-class GroupChatManager(RoutedAgent):
- """An agent that manages a group chat through event-driven orchestration.
-
- Args:
- name (str): The name of the agent.
- description (str): The description of the agent.
- runtime (AgentRuntime): The runtime to register the agent.
- participants (List[AgentId]): The list of participants in the group chat.
- model_context (ChatCompletionContext): The context manager for storing
- and retrieving ChatCompletion messages.
- model_client (ChatCompletionClient, optional): The client to use for the model.
- If provided, the agent will use the model to select the next speaker.
- If not provided, the agent will select the next speaker from the list of participants
- according to the order given.
- termination_word (str, optional): The word that terminates the group chat. Defaults to "TERMINATE".
- transitions (Mapping[AgentId, List[AgentId]], optional): The transitions between agents.
- Keys are the agents, and values are the list of agents that can follow the key agent. Defaults to {}.
- If provided, the group chat manager will use the transitions to select the next speaker.
- If a transition is not provided for an agent, the choices fallback to all participants.
- If no model client is provided, a transition must have a single value.
- on_message_received (Callable[[TextMessage], None], optional): A custom handler to call when a message is received.
- Defaults to None.
- """
-
- def __init__(
- self,
- description: str,
- participants: List[AgentId],
- model_context: ChatCompletionContext,
- model_client: ChatCompletionClient | None = None,
- termination_word: str = "TERMINATE",
- transitions: Mapping[AgentId, List[AgentId]] = {},
- on_message_received: Callable[[TextMessage | MultiModalMessage], None] | None = None,
- ):
- super().__init__(description)
- self._model_context = model_context
- self._client = model_client
- self._participants = participants
- self._participant_proxies = dict((p, AgentProxy(p, self.runtime)) for p in participants)
- self._termination_word = termination_word
- for key, value in transitions.items():
- if not value:
- # Make sure no empty transitions are provided.
- raise ValueError(f"Empty transition list provided for {key.type}.")
- if key not in participants:
- # Make sure all keys are in the list of participants.
- raise ValueError(f"Transition key {key.type} not found in participants.")
- for v in value:
- if v not in participants:
- # Make sure all values are in the list of participants.
- raise ValueError(f"Transition value {v.type} not found in participants.")
- if self._client is None:
- # Make sure there is only one transition for each key if no model client is provided.
- if len(value) > 1:
- raise ValueError(f"Multiple transitions provided for {key.type} but no model client is provided.")
- self._tranistions = transitions
- self._on_message_received = on_message_received
-
- @message_handler()
- async def on_reset(self, message: Reset, ctx: MessageContext) -> None:
- """Handle a reset message. This method clears the memory."""
- await self._model_context.clear()
-
- @message_handler()
- async def on_new_message(self, message: TextMessage | MultiModalMessage, ctx: MessageContext) -> None:
- """Handle a message. This method adds the message to the memory, selects the next speaker,
- and sends a message to the selected speaker to publish a response."""
- # Call the custom on_message_received handler if provided.
- if self._on_message_received is not None:
- self._on_message_received(message)
-
- # Check if the message contains the termination word.
- if isinstance(message, TextMessage) and self._termination_word in message.content:
- # Terminate the group chat by not selecting the next speaker.
- return
-
- # Save the message to chat memory.
- await self._model_context.add_message(UserMessage(content=message.content, source=message.source))
-
- # Get the last speaker.
- last_speaker_name = message.source
- last_speaker_index = next((i for i, p in enumerate(self._participants) if p.type == last_speaker_name), None)
-
- # Get the candidates for the next speaker.
- if last_speaker_index is not None:
- logger.debug(f"Last speaker: {last_speaker_name}")
- last_speaker = self._participants[last_speaker_index]
- if self._tranistions.get(last_speaker) is not None:
- candidates = [c for c in self._participants if c in self._tranistions[last_speaker]]
- else:
- candidates = self._participants
- else:
- candidates = self._participants
- logger.debug(f"Group chat manager next speaker candidates: {[c.type for c in candidates]}")
-
- # Select speaker.
- if len(candidates) == 0:
- speaker = None
- elif len(candidates) == 1:
- speaker = candidates[0]
- else:
- # More than one candidate, select the next speaker.
- if self._client is None:
- # If no model client is provided, candidates must be the list of participants.
- assert candidates == self._participants
- # If no model client is provided, select the next speaker from the list of participants.
- if last_speaker_index is not None:
- next_speaker_index = (last_speaker_index + 1) % len(self._participants)
- speaker = self._participants[next_speaker_index]
- else:
- # If no last speaker, select the first speaker.
- speaker = candidates[0]
- else:
- # If a model client is provided, select the speaker based on the transitions and the model.
- speaker_index = await select_speaker(
- self._model_context, self._client, [self._participant_proxies[c] for c in candidates]
- )
- speaker = candidates[speaker_index]
-
- logger.debug(f"Group chat manager selected speaker: {speaker.type if speaker is not None else None}")
-
- if speaker is not None:
- # Send the message to the selected speaker to ask it to publish a response.
- await self.send_message(PublishNow(), speaker)
-
- async def save_state(self) -> Mapping[str, Any]:
- return {
- "chat_history": await self._model_context.save_state(),
- "termination_word": self._termination_word,
- }
-
- async def load_state(self, state: Mapping[str, Any]) -> None:
- # Load the chat history.
- await self._model_context.load_state(state["chat_history"])
- # Load the termination word.
- self._termination_word = state["termination_word"]
diff --git a/python/packages/autogen-core/samples/common/patterns/_group_chat_utils.py b/python/packages/autogen-core/samples/common/patterns/_group_chat_utils.py
deleted file mode 100644
index 813bc1747..000000000
--- a/python/packages/autogen-core/samples/common/patterns/_group_chat_utils.py
+++ /dev/null
@@ -1,88 +0,0 @@
-"""Credit to the original authors: https://github.com/microsoft/autogen/blob/main/autogen/agentchat/groupchat.py"""
-
-import re
-from typing import Dict, List
-
-from autogen_core import AgentProxy
-from autogen_core.model_context import ChatCompletionContext
-from autogen_core.models import ChatCompletionClient, SystemMessage, UserMessage
-
-
-async def select_speaker(context: ChatCompletionContext, client: ChatCompletionClient, agents: List[AgentProxy]) -> int:
- """Selects the next speaker in a group chat using a ChatCompletion client."""
- # TODO: Handle multi-modal messages.
-
- # Construct formated current message history.
- history_messages: List[str] = []
- for msg in await context.get_messages():
- assert isinstance(msg, UserMessage) and isinstance(msg.content, str)
- history_messages.append(f"{msg.source}: {msg.content}")
- history = "\n".join(history_messages)
-
- # Construct agent roles.
- roles = "\n".join(
- [f"{(await agent.metadata)['type']}: {(await agent.metadata)['description']}".strip() for agent in agents]
- )
-
- # Construct agent list.
- participants = str([(await agent.metadata)["type"] for agent in agents])
-
- # Select the next speaker.
- select_speaker_prompt = f"""You are in a role play game. The following roles are available:
-{roles}.
-Read the following conversation. Then select the next role from {participants} to play. Only return the role.
-
-{history}
-
-Read the above conversation. Then select the next role from {participants} to play. Only return the role.
-"""
- select_speaker_messages = [SystemMessage(content=select_speaker_prompt)]
- response = await client.create(messages=select_speaker_messages)
- assert isinstance(response.content, str)
- mentions = await mentioned_agents(response.content, agents)
- if len(mentions) != 1:
- raise ValueError(f"Expected exactly one agent to be mentioned, but got {mentions}")
- agent_name = list(mentions.keys())[0]
- # Get the index of the selected agent by name
- agent_index = 0
- for i, agent in enumerate(agents):
- if (await agent.metadata)["type"] == agent_name:
- agent_index = i
- break
-
- assert agent_index is not None
- return agent_index
-
-
-async def mentioned_agents(message_content: str, agents: List[AgentProxy]) -> Dict[str, int]:
- """Counts the number of times each agent is mentioned in the provided message content.
- Agent names will match under any of the following conditions (all case-sensitive):
- - Exact name match
- - If the agent name has underscores it will match with spaces instead (e.g. 'Story_writer' == 'Story writer')
- - If the agent name has underscores it will match with '\\_' instead of '_' (e.g. 'Story_writer' == 'Story\\_writer')
-
- Args:
- message_content (Union[str, List]): The content of the message, either as a single string or a list of strings.
- agents (List[Agent]): A list of Agent objects, each having a 'name' attribute to be searched in the message content.
-
- Returns:
- Dict: a counter for mentioned agents.
- """
- mentions: Dict[str, int] = dict()
- for agent in agents:
- # Finds agent mentions, taking word boundaries into account,
- # accommodates escaping underscores and underscores as spaces
- name = (await agent.metadata)["type"]
- regex = (
- r"(?<=\W)("
- + re.escape(name)
- + r"|"
- + re.escape(name.replace("_", " "))
- + r"|"
- + re.escape(name.replace("_", r"\_"))
- + r")(?=\W)"
- )
- count = len(re.findall(regex, f" {message_content} ")) # Pad the message to help with matching
- if count > 0:
- mentions[name] = count
- return mentions
diff --git a/python/packages/autogen-core/samples/common/types.py b/python/packages/autogen-core/samples/common/types.py
deleted file mode 100644
index 5ffe1ca44..000000000
--- a/python/packages/autogen-core/samples/common/types.py
+++ /dev/null
@@ -1,75 +0,0 @@
-from __future__ import annotations
-
-from dataclasses import dataclass, field
-from enum import Enum
-from typing import List, Union
-
-from autogen_core import FunctionCall, Image
-from autogen_core.models import FunctionExecutionResultMessage
-
-
-@dataclass(kw_only=True)
-class BaseMessage:
- # Name of the agent that sent this message
- source: str
-
-
-@dataclass
-class TextMessage(BaseMessage):
- content: str
-
-
-@dataclass
-class MultiModalMessage(BaseMessage):
- content: List[Union[str, Image]]
-
-
-@dataclass
-class FunctionCallMessage(BaseMessage):
- content: List[FunctionCall]
-
-
-Message = Union[TextMessage, MultiModalMessage, FunctionCallMessage, FunctionExecutionResultMessage]
-
-
-class ResponseFormat(Enum):
- text = "text"
- json_object = "json_object"
-
-
-@dataclass
-class RespondNow:
- """A message to request a response from the addressed agent. The sender
- expects a response upon sening and waits for it synchronously."""
-
- response_format: ResponseFormat = field(default=ResponseFormat.text)
-
-
-@dataclass
-class PublishNow:
- """A message to request an event to be published to the addressed agent.
- Unlike RespondNow, the sender does not expect a response upon sending."""
-
- response_format: ResponseFormat = field(default=ResponseFormat.text)
-
-
-@dataclass
-class Reset: ...
-
-
-@dataclass
-class ToolApprovalRequest:
- """A message to request approval for a tool call. The sender expects a
- response upon sending and waits for it synchronously."""
-
- tool_call: FunctionCall
-
-
-@dataclass
-class ToolApprovalResponse:
- """A message to respond to a tool approval request. The response is sent
- synchronously."""
-
- tool_call_id: str
- approved: bool
- reason: str
diff --git a/python/pyproject.toml b/python/pyproject.toml
index da8844840..f3b5c9453 100644
--- a/python/pyproject.toml
+++ b/python/pyproject.toml
@@ -18,7 +18,8 @@ dev = [
"cookiecutter",
"poethepoet",
"tomli",
- "tomli-w"
+ "tomli-w",
+ "chainlit",
]
[tool.uv.workspace]
@@ -70,6 +71,7 @@ disallow_any_unimported = true
[tool.pyright]
include = ["src", "tests", "samples"]
+exclude = ["samples/core_xlang_hello_python_agent/protos"]
typeCheckingMode = "strict"
reportUnnecessaryIsInstance = false
reportMissingTypeStubs = false
@@ -82,14 +84,14 @@ pyright = "python run_task_in_pkgs_if_exist.py pyright"
mypy = "python run_task_in_pkgs_if_exist.py mypy"
test = "python run_task_in_pkgs_if_exist.py test"
coverage = "python run_task_in_pkgs_if_exist.py coverage"
+markdown-code-lint = """python check_md_code_blocks.py ../README.md ./packages/autogen-core/docs/src/**/*.md"""
+samples-code-check = """pyright ./samples"""
-check = ["fmt", "lint", "pyright", "mypy", "coverage"]
+check = ["fmt", "lint", "pyright", "mypy", "coverage", "markdown-code-lint", "samples-code-check"]
gen-proto = "python -m grpc_tools.protoc --python_out=./packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos --grpc_python_out=./packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos --mypy_out=./packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos --mypy_grpc_out=./packages/autogen-ext/src/autogen_ext/runtimes/grpc/protos --proto_path ../protos/ agent_worker.proto --proto_path ../protos/ cloudevent.proto"
-gen-proto-samples = "python -m grpc_tools.protoc --python_out=./packages/autogen-core/samples/protos --grpc_python_out=./packages/autogen-core/samples/protos --mypy_out=./packages/autogen-core/samples/protos --mypy_grpc_out=./packages/autogen-core/samples/protos --proto_path ../protos/ agent_events.proto"
-
-markdown-code-lint = """python check_md_code_blocks.py ../README.md ./packages/autogen-core/docs/src/**/*.md"""
+gen-proto-samples = "python -m grpc_tools.protoc --python_out=./samples/core_xlang_hello_python_agent/protos --grpc_python_out=./samples/core_xlang_hello_python_agent/protos --mypy_out=./samples/core_xlang_hello_python_agent/protos --mypy_grpc_out=./samples/core_xlang_hello_python_agent/protos --proto_path ../protos/ agent_events.proto"
[[tool.poe.tasks.gen-test-proto.sequence]]
cmd = "python -m grpc_tools.protoc --python_out=./packages/autogen-core/tests/protos --grpc_python_out=./packages/autogen-core/tests/protos --mypy_out=./packages/autogen-core/tests/protos --mypy_grpc_out=./packages/autogen-core/tests/protos --proto_path ./packages/autogen-core/tests/protos serialization_test.proto"
diff --git a/python/samples/agentchat_chainlit/app.py b/python/samples/agentchat_chainlit/app.py
index 370b990b2..6d0bef38a 100644
--- a/python/samples/agentchat_chainlit/app.py
+++ b/python/samples/agentchat_chainlit/app.py
@@ -1,21 +1,18 @@
import chainlit as cl
from autogen_agentchat.agents import AssistantAgent
-from autogen_agentchat.conditions import TextMentionTermination, MaxMessageTermination
+from autogen_agentchat.base import TaskResult
+from autogen_agentchat.conditions import MaxMessageTermination, TextMentionTermination
from autogen_agentchat.teams import RoundRobinGroupChat
from autogen_ext.models.openai import OpenAIChatCompletionClient
-from autogen_agentchat.base import TaskResult
async def get_weather(city: str) -> str:
return f"The weather in {city} is 73 degrees and Sunny."
[email protected]_chat_start # type: ignore
async def start_chat():
- cl.user_session.set(
- "prompt_history",
- "",
- )
+ cl.user_session.set("prompt_history", "") # type: ignore
async def run_team(query: str):
@@ -29,13 +26,13 @@ async def run_team(query: str):
response_stream = team.run_stream(task=query)
async for msg in response_stream:
if hasattr(msg, "content"):
- msg = cl.Message(content=msg.content, author="Agent Team")
- await msg.send()
+ cl_msg = cl.Message(content=msg.content, author="Agent Team") # type: ignore
+ await cl_msg.send()
if isinstance(msg, TaskResult):
- msg = cl.Message(content="Termination condition met. Team and Agents are reset.", author="Agent Team")
- await msg.send()
+ cl_msg = cl.Message(content="Termination condition met. Team and Agents are reset.", author="Agent Team")
+ await cl_msg.send()
[email protected]_message # type: ignore
async def chat(message: cl.Message):
- await run_team(message.content)
+ await run_team(message.content) # type: ignore
diff --git a/python/samples/core_async_human_in_the_loop/.gitignore b/python/samples/core_async_human_in_the_loop/.gitignore
new file mode 100644
index 000000000..f228262f0
--- /dev/null
+++ b/python/samples/core_async_human_in_the_loop/.gitignore
@@ -0,0 +1 @@
+model_config.json
\ No newline at end of file
diff --git a/python/packages/autogen-core/samples/README.md b/python/samples/core_async_human_in_the_loop/README.md
similarity index 62%
rename from python/packages/autogen-core/samples/README.md
rename to python/samples/core_async_human_in_the_loop/README.md
index 77227169c..f1fca50c9 100644
--- a/python/packages/autogen-core/samples/README.md
+++ b/python/samples/core_async_human_in_the_loop/README.md
@@ -1,12 +1,6 @@
-# Samples
+# Async Human-in-the-Loop Example
-This directory contains sample apps that use AutoGen Core API.
-See [core user guide](../docs/src/user-guide/core-user-guide/) for notebook examples.
-
-See [Running the examples](#running-the-examples) for instructions on how to run the examples.
-
-- [`chess_game.py`](chess_game.py): an example with two chess player agents that executes its own tools to demonstrate tool use and reflection on tool use.
-- [`slow_human_in_loop.py`](slow_human_in_loop.py): an example showing human-in-the-loop which waits for human input before making the tool call.
+An example showing human-in-the-loop which waits for human input before making the tool call.
## Running the examples
@@ -14,6 +8,10 @@ See [Running the examples](#running-the-examples) for instructions on how to run
First, you need a shell with AutoGen core and required dependencies installed.
+```bash
+pip install "autogen-core==0.4.0.dev13" "autogen-ext[openai,azure]==0.4.0.dev13"
+```
+
### Using Azure OpenAI API
For Azure OpenAI API, you need to set the following environment variables:
diff --git a/python/packages/autogen-core/samples/slow_human_in_loop.py b/python/samples/core_async_human_in_the_loop/main.py
similarity index 95%
rename from python/packages/autogen-core/samples/slow_human_in_loop.py
rename to python/samples/core_async_human_in_the_loop/main.py
index 8762b588a..ccae231b2 100644
--- a/python/packages/autogen-core/samples/slow_human_in_loop.py
+++ b/python/samples/core_async_human_in_the_loop/main.py
@@ -28,7 +28,7 @@ import datetime
import json
from concurrent.futures import ThreadPoolExecutor
from dataclasses import dataclass
-from typing import Any, Mapping, Optional
+from typing import Any, Dict, Mapping, Optional
from autogen_core import (
CancellationToken,
@@ -49,11 +49,15 @@ from autogen_core.models import (
UserMessage,
)
from autogen_core.tools import BaseTool
-from common.types import TextMessage
-from common.utils import get_chat_completion_client_from_envs
from pydantic import BaseModel, Field
+@dataclass
+class TextMessage:
+ source: str
+ content: str
+
+
@dataclass
class UserTextMessage(TextMessage):
pass
@@ -108,7 +112,7 @@ class SlowUserProxyAgent(RoutedAgent):
async def save_state(self) -> Mapping[str, Any]:
state_to_save = {
- "memory": self._model_context.save_state(),
+ "memory": await self._model_context.save_state(),
}
return state_to_save
@@ -246,7 +250,7 @@ class TerminationHandler(DefaultInterventionHandler):
return self.terminateMessage.content
-async def main(latest_user_input: Optional[str] = None) -> None | str:
+async def main(model_config: Dict[str, Any], latest_user_input: Optional[str] = None) -> None | str:
"""
Asynchronous function that serves as the entry point of the program.
This function initializes the necessary components for the program and registers the user and scheduling assistant agents.
@@ -263,6 +267,8 @@ async def main(latest_user_input: Optional[str] = None) -> None | str:
"""
global state_persister
+ model_client = ChatCompletionClient.load_component(model_config)
+
termination_handler = TerminationHandler()
needs_user_input_handler = NeedsUserInputHandler()
runtime = SingleThreadedAgentRuntime(intervention_handlers=[needs_user_input_handler, termination_handler])
@@ -278,11 +284,12 @@ async def main(latest_user_input: Optional[str] = None) -> None | str:
lambda: SchedulingAssistantAgent(
"SchedulingAssistant",
description="AI that helps you schedule meetings",
- model_client=get_chat_completion_client_from_envs(model="gpt-4o-mini"),
+ model_client=model_client,
initial_message=initial_schedule_assistant_message,
),
)
+ runtime_initiation_message: UserTextMessage | AssistantTextMessage
if latest_user_input is not None:
runtime_initiation_message = UserTextMessage(content=latest_user_input, source="User")
else:
@@ -325,6 +332,9 @@ if __name__ == "__main__":
# if os.path.exists("state.json"):
# os.remove("state.json")
+ with open("model_config.json") as f:
+ model_config = json.load(f)
+
def get_user_input(question_for_user: str):
print("--------------------------QUESTION_FOR_USER--------------------------")
print(question_for_user)
@@ -337,7 +347,7 @@ if __name__ == "__main__":
user_input = get_user_input(question_for_user)
else:
user_input = None
- user_input_needed = await main(user_input)
+ user_input_needed = await main(model_config, user_input)
if user_input_needed:
await run_main(user_input_needed)
diff --git a/python/samples/core_async_human_in_the_loop/model_config_template.json b/python/samples/core_async_human_in_the_loop/model_config_template.json
new file mode 100644
index 000000000..bfa691390
--- /dev/null
+++ b/python/samples/core_async_human_in_the_loop/model_config_template.json
@@ -0,0 +1,38 @@
+// Use Azure OpenAI with AD token provider.
+// {
+// "provider": "AzureOpenAIChatCompletionClient",
+// "config": {
+// "model": "gpt-4o-2024-05-13",
+// "azure_endpoint": "https://{your-custom-endpoint}.openai.azure.com/",
+// "azure_deployment": "{your-azure-deployment}",
+// "api_version": "2024-06-01",
+// "azure_ad_token_provider": {
+// "provider": "autogen_ext.models.openai.AzureTokenProvider",
+// "config": {
+// "provider_kind": "DefaultAzureCredential",
+// "scopes": [
+// "https://cognitiveservices.azure.com/.default"
+// ]
+// }
+// }
+// }
+// }
+// Use Azure Open AI with key
+// {
+// "provider": "AzureOpenAIChatCompletionClient",
+// "config": {
+// "model": "gpt-4o-2024-05-13",
+// "azure_endpoint": "https://{your-custom-endpoint}.openai.azure.com/",
+// "azure_deployment": "{your-azure-deployment}",
+// "api_version": "2024-06-01",
+// "api_key": "REPLACE_WITH_YOUR_API_KEY"
+// }
+// }
+// Use Open AI with key
+{
+ "provider": "OpenAIChatCompletionClient",
+ "config": {
+ "model": "gpt-4o-2024-05-13",
+ "api_key": "REPLACE_WITH_YOUR_API_KEY"
+ }
+}
\ No newline at end of file
diff --git a/python/samples/core_async_human_in_the_loop/utils.py b/python/samples/core_async_human_in_the_loop/utils.py
new file mode 100644
index 000000000..ee412c5ee
--- /dev/null
+++ b/python/samples/core_async_human_in_the_loop/utils.py
@@ -0,0 +1,47 @@
+import os
+from typing import Any
+
+from autogen_core.models import (
+ ChatCompletionClient,
+)
+from autogen_ext.models.openai import AzureOpenAIChatCompletionClient, OpenAIChatCompletionClient
+from azure.identity import DefaultAzureCredential, get_bearer_token_provider
+
+
+def get_chat_completion_client_from_envs(**kwargs: Any) -> ChatCompletionClient:
+ # Check API type.
+ api_type = os.getenv("OPENAI_API_TYPE", "openai")
+ if api_type == "openai":
+ # Check API key.
+ api_key = os.getenv("OPENAI_API_KEY")
+ if api_key is None:
+ raise ValueError("OPENAI_API_KEY is not set")
+ kwargs["api_key"] = api_key
+ return OpenAIChatCompletionClient(**kwargs)
+ elif api_type == "azure":
+ # Check Azure API key.
+ azure_api_key = os.getenv("AZURE_OPENAI_API_KEY")
+ if azure_api_key is not None:
+ kwargs["api_key"] = azure_api_key
+ else:
+ # Try to use token from Azure CLI.
+ token_provider = get_bearer_token_provider(
+ DefaultAzureCredential(), "https://cognitiveservices.azure.com/.default"
+ )
+ kwargs["azure_ad_token_provider"] = token_provider
+ # Check Azure API endpoint.
+ azure_api_endpoint = os.getenv("AZURE_OPENAI_API_ENDPOINT")
+ if azure_api_endpoint is None:
+ raise ValueError("AZURE_OPENAI_API_ENDPOINT is not set")
+ kwargs["azure_endpoint"] = azure_api_endpoint
+ # Get Azure API version.
+ kwargs["api_version"] = os.getenv("AZURE_OPENAI_API_VERSION", "2024-06-01")
+ # Set model capabilities.
+ if "model_capabilities" not in kwargs or kwargs["model_capabilities"] is None:
+ kwargs["model_capabilities"] = {
+ "vision": True,
+ "function_calling": True,
+ "json_output": True,
+ }
+ return AzureOpenAIChatCompletionClient(**kwargs) # type: ignore
+ raise ValueError(f"Unknown API type: {api_type}")
diff --git a/python/samples/core_chess_game/.gitignore b/python/samples/core_chess_game/.gitignore
new file mode 100644
index 000000000..f228262f0
--- /dev/null
+++ b/python/samples/core_chess_game/.gitignore
@@ -0,0 +1 @@
+model_config.json
\ No newline at end of file
diff --git a/python/samples/core_chess_game/README.md b/python/samples/core_chess_game/README.md
new file mode 100644
index 000000000..b0f5a9194
--- /dev/null
+++ b/python/samples/core_chess_game/README.md
@@ -0,0 +1,23 @@
+# Chess Game Example
+
+An example with two chess player agents that executes its own tools to demonstrate tool use and reflection on tool use.
+
+## Running the example
+
+### Prerequisites
+
+First, you need a shell with AutoGen core and required dependencies installed.
+
+```bash
+pip install "autogen-core==0.4.0.dev13" "autogen-ext[openai,azure]==0.4.0.dev13" "chess"
+```
+### Model Configuration
+
+The model configuration should defined in a `model_config.json` file.
+Use `model_config_template.json` as a template.
+
+### Running the example
+
+```bash
+python main.py
+```
\ No newline at end of file
diff --git a/python/packages/autogen-core/samples/chess_game.py b/python/samples/core_chess_game/main.py
similarity index 59%
rename from python/packages/autogen-core/samples/chess_game.py
rename to python/samples/core_chess_game/main.py
index b359772aa..78b478775 100644
--- a/python/packages/autogen-core/samples/chess_game.py
+++ b/python/samples/core_chess_game/main.py
@@ -4,26 +4,70 @@ and make moves, and using a group chat manager to orchestrate the conversation."
import argparse
import asyncio
+import json
import logging
-from typing import Annotated, Literal
+from typing import Annotated, Any, Dict, List, Literal
from autogen_core import (
AgentId,
- AgentInstantiationContext,
AgentRuntime,
- DefaultSubscription,
DefaultTopicId,
+ MessageContext,
+ RoutedAgent,
SingleThreadedAgentRuntime,
+ default_subscription,
+ message_handler,
)
-from autogen_core.model_context import BufferedChatCompletionContext
-from autogen_core.models import SystemMessage
-from autogen_core.tools import FunctionTool
+from autogen_core.model_context import BufferedChatCompletionContext, ChatCompletionContext
+from autogen_core.models import AssistantMessage, ChatCompletionClient, LLMMessage, SystemMessage, UserMessage
+from autogen_core.tool_agent import ToolAgent, tool_agent_caller_loop
+from autogen_core.tools import FunctionTool, Tool, ToolSchema
from chess import BLACK, SQUARE_NAMES, WHITE, Board, Move
from chess import piece_name as get_piece_name
-from common.agents._chat_completion_agent import ChatCompletionAgent
-from common.patterns._group_chat_manager import GroupChatManager
-from common.types import TextMessage
-from common.utils import get_chat_completion_client_from_envs
+from pydantic import BaseModel
+
+
+class TextMessage(BaseModel):
+ source: str
+ content: str
+
+
+@default_subscription
+class ToolUseAgent(RoutedAgent):
+ def __init__(
+ self,
+ description: str,
+ instructions: str,
+ model_client: ChatCompletionClient,
+ model_context: ChatCompletionContext,
+ tool_schema: List[ToolSchema],
+ tool_agent_type: str,
+ ) -> None:
+ super().__init__(description=description)
+ self._system_messages: List[LLMMessage] = [SystemMessage(content=instructions)]
+ self._model_client = model_client
+ self._tool_schema = tool_schema
+ self._tool_agent_id = AgentId(tool_agent_type, self.id.key)
+ self._model_context = model_context
+
+ @message_handler
+ async def handle_message(self, message: TextMessage, ctx: MessageContext) -> None:
+ # Add the user message to the model context.
+ await self._model_context.add_message(UserMessage(content=message.content, source=message.source))
+ # Run the caller loop to handle tool calls.
+ messages = await tool_agent_caller_loop(
+ self,
+ tool_agent_id=self._tool_agent_id,
+ model_client=self._model_client,
+ input_messages=(await self._model_context.get_messages()),
+ tool_schema=self._tool_schema,
+ cancellation_token=ctx.cancellation_token,
+ )
+ assert isinstance(messages[-1].content, str)
+ # Add the assistant message to the model context.
+ await self._model_context.add_message(AssistantMessage(content=messages[-1].content, source=self.id.type))
+ # Publish the final response.
+ await self.publish_message(TextMessage(content=messages[-1].content, source=self.id.type), DefaultTopicId())
def validate_turn(board: Board, player: Literal["white", "black"]) -> None:
@@ -90,29 +134,25 @@ def make_move(
return f"Moved {piece_name} ({piece_symbol}) from {SQUARE_NAMES[new_move.from_square]} to {SQUARE_NAMES[new_move.to_square]}."
-async def chess_game(runtime: AgentRuntime) -> None: # type: ignore
+async def chess_game(runtime: AgentRuntime, model_config: Dict[str, Any]) -> None: # type: ignore
"""Create agents for a chess game and return the group chat."""
# Create the board.
board = Board()
# Create tools for each player.
- # @functools.wraps(get_legal_moves)
def get_legal_moves_black() -> str:
return get_legal_moves(board, "black")
- # @functools.wraps(get_legal_moves)
def get_legal_moves_white() -> str:
return get_legal_moves(board, "white")
- # @functools.wraps(make_move)
def make_move_black(
thinking: Annotated[str, "Thinking for the move"],
move: Annotated[str, "A move in UCI format"],
) -> str:
return make_move(board, "black", thinking, move)
- # @functools.wraps(make_move)
def make_move_white(
thinking: Annotated[str, "Thinking for the move"],
move: Annotated[str, "A move in UCI format"],
@@ -122,7 +162,7 @@ async def chess_game(runtime: AgentRuntime) -> None: # type: ignore
def get_board_text() -> Annotated[str, "The current board state"]:
return get_board(board)
- black_tools = [
+ black_tools: List[Tool] = [
FunctionTool(
get_legal_moves_black,
name="get_legal_moves",
@@ -140,7 +180,7 @@ async def chess_game(runtime: AgentRuntime) -> None: # type: ignore
),
]
- white_tools = [
+ white_tools: List[Tool] = [
FunctionTool(
get_legal_moves_white,
name="get_legal_moves",
@@ -158,73 +198,59 @@ async def chess_game(runtime: AgentRuntime) -> None: # type: ignore
),
]
- await ChatCompletionAgent.register(
+ model_client = ChatCompletionClient.load_component(model_config)
+
+ # Register the agents.
+ await ToolAgent.register(
+ runtime,
+ "ToolAgent",
+ lambda: ToolAgent(description="Tool agent for chess game.", tools=black_tools + white_tools),
+ )
+
+ await ToolUseAgent.register(
runtime,
"PlayerBlack",
- lambda: ChatCompletionAgent(
+ lambda: ToolUseAgent(
description="Player playing black.",
- system_messages=[
- SystemMessage(
- content="You are a chess player and you play as black. "
- "Use get_legal_moves() to get list of legal moves. "
- "Use get_board() to get the current board state. "
- "Think about your strategy and call make_move(thinking, move) to make a move."
- ),
- ],
+ instructions="You are a chess player and you play as black. "
+ "Use get_legal_moves() to get list of legal moves. "
+ "Use get_board() to get the current board state. "
+ "Think about your strategy and call make_move(thinking, move) to make a move.",
+ model_client=model_client,
model_context=BufferedChatCompletionContext(buffer_size=10),
- model_client=get_chat_completion_client_from_envs(model="gpt-4o"),
- tools=black_tools,
+ tool_schema=[tool.schema for tool in black_tools],
+ tool_agent_type="ToolAgent",
),
)
- await runtime.add_subscription(DefaultSubscription(agent_type="PlayerBlack"))
- await ChatCompletionAgent.register(
+ await ToolUseAgent.register(
runtime,
"PlayerWhite",
- lambda: ChatCompletionAgent(
+ lambda: ToolUseAgent(
description="Player playing white.",
- system_messages=[
- SystemMessage(
- content="You are a chess player and you play as white. "
- "Use get_legal_moves() to get list of legal moves. "
- "Use get_board() to get the current board state. "
- "Think about your strategy and call make_move(thinking, move) to make a move."
- ),
- ],
+ instructions="You are a chess player and you play as white. "
+ "Use get_legal_moves() to get list of legal moves. "
+ "Use get_board() to get the current board state. "
+ "Think about your strategy and call make_move(thinking, move) to make a move.",
+ model_client=model_client,
model_context=BufferedChatCompletionContext(buffer_size=10),
- model_client=get_chat_completion_client_from_envs(model="gpt-4o"),
- tools=white_tools,
+ tool_schema=[tool.schema for tool in white_tools],
+ tool_agent_type="ToolAgent",
),
)
- await runtime.add_subscription(DefaultSubscription(agent_type="PlayerWhite"))
-
- # Create a group chat manager for the chess game to orchestrate a turn-based
- # conversation between the two agents.
- await GroupChatManager.register(
- runtime,
- "ChessGame",
- lambda: GroupChatManager(
- description="A chess game between two agents.",
- model_context=BufferedChatCompletionContext(buffer_size=10),
- participants=[
- AgentId("PlayerWhite", AgentInstantiationContext.current_agent_id().key),
- AgentId("PlayerBlack", AgentInstantiationContext.current_agent_id().key),
- ], # white goes first
- ),
- )
- await runtime.add_subscription(DefaultSubscription(agent_type="ChessGame"))
-async def main() -> None:
+async def main(model_config: Dict[str, Any]) -> None:
"""Main Entrypoint."""
runtime = SingleThreadedAgentRuntime()
- await chess_game(runtime)
+ await chess_game(runtime, model_config)
runtime.start()
# Publish an initial message to trigger the group chat manager to start
# orchestration.
- await runtime.publish_message(
+ # Send an initial message to player white to start the game.
+ await runtime.send_message(
TextMessage(content="Game started.", source="System"),
- topic_id=DefaultTopicId(),
+ AgentId("PlayerWhite", "default"),
)
await runtime.stop_when_idle()
@@ -232,6 +258,9 @@ async def main() -> None:
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Run a chess game between two agents.")
parser.add_argument("--verbose", action="store_true", help="Enable verbose logging.")
+ parser.add_argument(
+ "--model-config", type=str, help="Path to the model configuration file.", default="model_config.json"
+ )
args = parser.parse_args()
if args.verbose:
logging.basicConfig(level=logging.WARNING)
@@ -239,4 +268,6 @@ if __name__ == "__main__":
handler = logging.FileHandler("chess_game.log")
logging.getLogger("autogen_core").addHandler(handler)
- asyncio.run(main())
+ with open(args.model_config, "r") as f:
+ model_config = json.load(f)
+ asyncio.run(main(model_config))
diff --git a/python/samples/core_chess_game/model_config_template.json b/python/samples/core_chess_game/model_config_template.json
new file mode 100644
index 000000000..bfa691390
--- /dev/null
+++ b/python/samples/core_chess_game/model_config_template.json
@@ -0,0 +1,38 @@
+// Use Azure OpenAI with AD token provider.
+// {
+// "provider": "AzureOpenAIChatCompletionClient",
+// "config": {
+// "model": "gpt-4o-2024-05-13",
+// "azure_endpoint": "https://{your-custom-endpoint}.openai.azure.com/",
+// "azure_deployment": "{your-azure-deployment}",
+// "api_version": "2024-06-01",
+// "azure_ad_token_provider": {
+// "provider": "autogen_ext.models.openai.AzureTokenProvider",
+// "config": {
+// "provider_kind": "DefaultAzureCredential",
+// "scopes": [
+// "https://cognitiveservices.azure.com/.default"
+// ]
+// }
+// }
+// }
+// }
+// Use Azure Open AI with key
+// {
+// "provider": "AzureOpenAIChatCompletionClient",
+// "config": {
+// "model": "gpt-4o-2024-05-13",
+// "azure_endpoint": "https://{your-custom-endpoint}.openai.azure.com/",
+// "azure_deployment": "{your-azure-deployment}",
+// "api_version": "2024-06-01",
+// "api_key": "REPLACE_WITH_YOUR_API_KEY"
+// }
+// }
+// Use Open AI with key
+{
+ "provider": "OpenAIChatCompletionClient",
+ "config": {
+ "model": "gpt-4o-2024-05-13",
+ "api_key": "REPLACE_WITH_YOUR_API_KEY"
+ }
+}
\ No newline at end of file
diff --git a/python/packages/autogen-core/samples/common/utils.py b/python/samples/core_chess_game/utils.py
similarity index 66%
rename from python/packages/autogen-core/samples/common/utils.py
rename to python/samples/core_chess_game/utils.py
index d43283ab7..5fc21dc20 100644
--- a/python/packages/autogen-core/samples/common/utils.py
+++ b/python/samples/core_chess_game/utils.py
@@ -1,19 +1,15 @@
-import os
-from typing import Any, List, Optional, Union
+from typing import List, Optional, Union
from autogen_core.models import (
AssistantMessage,
- ChatCompletionClient,
FunctionExecutionResult,
FunctionExecutionResultMessage,
LLMMessage,
UserMessage,
)
-from autogen_ext.models.openai import AzureOpenAIChatCompletionClient, OpenAIChatCompletionClient
-from azure.identity import DefaultAzureCredential, get_bearer_token_provider
from typing_extensions import Literal
-from .types import (
+from .messages import (
FunctionCallMessage,
Message,
MultiModalMessage,
@@ -100,42 +96,3 @@ def convert_messages_to_llm_messages(
raise AssertionError("unreachable")
return result
-
-
-def get_chat_completion_client_from_envs(**kwargs: Any) -> ChatCompletionClient:
- # Check API type.
- api_type = os.getenv("OPENAI_API_TYPE", "openai")
- if api_type == "openai":
- # Check API key.
- api_key = os.getenv("OPENAI_API_KEY")
- if api_key is None:
- raise ValueError("OPENAI_API_KEY is not set")
- kwargs["api_key"] = api_key
- return OpenAIChatCompletionClient(**kwargs)
- elif api_type == "azure":
- # Check Azure API key.
- azure_api_key = os.getenv("AZURE_OPENAI_API_KEY")
- if azure_api_key is not None:
- kwargs["api_key"] = azure_api_key
- else:
- # Try to use token from Azure CLI.
- token_provider = get_bearer_token_provider(
- DefaultAzureCredential(), "https://cognitiveservices.azure.com/.default"
- )
- kwargs["azure_ad_token_provider"] = token_provider
- # Check Azure API endpoint.
- azure_api_endpoint = os.getenv("AZURE_OPENAI_API_ENDPOINT")
- if azure_api_endpoint is None:
- raise ValueError("AZURE_OPENAI_API_ENDPOINT is not set")
- kwargs["azure_endpoint"] = azure_api_endpoint
- # Get Azure API version.
- kwargs["api_version"] = os.getenv("AZURE_OPENAI_API_VERSION", "2024-06-01")
- # Set model capabilities.
- if "model_capabilities" not in kwargs or kwargs["model_capabilities"] is None:
- kwargs["model_capabilities"] = {
- "vision": True,
- "function_calling": True,
- "json_output": True,
- }
- return AzureOpenAIChatCompletionClient(**kwargs) # type: ignore
- raise ValueError(f"Unknown API type: {api_type}")
diff --git a/python/packages/autogen-core/samples/distributed-group-chat/.gitignore b/python/samples/core_distributed-group-chat/.gitignore
similarity index 100%
rename from python/packages/autogen-core/samples/distributed-group-chat/.gitignore
rename to python/samples/core_distributed-group-chat/.gitignore
diff --git a/python/packages/autogen-core/samples/distributed-group-chat/README.md b/python/samples/core_distributed-group-chat/README.md
similarity index 100%
rename from python/packages/autogen-core/samples/distributed-group-chat/README.md
rename to python/samples/core_distributed-group-chat/README.md
diff --git a/python/packages/autogen-core/samples/distributed-group-chat/_agents.py b/python/samples/core_distributed-group-chat/_agents.py
similarity index 100%
rename from python/packages/autogen-core/samples/distributed-group-chat/_agents.py
rename to python/samples/core_distributed-group-chat/_agents.py
diff --git a/python/packages/autogen-core/samples/distributed-group-chat/_types.py b/python/samples/core_distributed-group-chat/_types.py
similarity index 100%
rename from python/packages/autogen-core/samples/distributed-group-chat/_types.py
rename to python/samples/core_distributed-group-chat/_types.py
diff --git a/python/packages/autogen-core/samples/distributed-group-chat/_utils.py b/python/samples/core_distributed-group-chat/_utils.py
similarity index 100%
rename from python/packages/autogen-core/samples/distributed-group-chat/_utils.py
rename to python/samples/core_distributed-group-chat/_utils.py
diff --git a/python/packages/autogen-core/samples/distributed-group-chat/config.yaml b/python/samples/core_distributed-group-chat/config.yaml
similarity index 100%
rename from python/packages/autogen-core/samples/distributed-group-chat/config.yaml
rename to python/samples/core_distributed-group-chat/config.yaml
diff --git a/python/packages/autogen-core/samples/distributed-group-chat/public/avatars/editor.png b/python/samples/core_distributed-group-chat/public/avatars/editor.png
similarity index 100%
rename from python/packages/autogen-core/samples/distributed-group-chat/public/avatars/editor.png
rename to python/samples/core_distributed-group-chat/public/avatars/editor.png
diff --git a/python/packages/autogen-core/samples/distributed-group-chat/public/avatars/group_chat_manager.png b/python/samples/core_distributed-group-chat/public/avatars/group_chat_manager.png
similarity index 100%
rename from python/packages/autogen-core/samples/distributed-group-chat/public/avatars/group_chat_manager.png
rename to python/samples/core_distributed-group-chat/public/avatars/group_chat_manager.png
diff --git a/python/packages/autogen-core/samples/distributed-group-chat/public/avatars/user.png b/python/samples/core_distributed-group-chat/public/avatars/user.png
similarity index 100%
rename from python/packages/autogen-core/samples/distributed-group-chat/public/avatars/user.png
rename to python/samples/core_distributed-group-chat/public/avatars/user.png
diff --git a/python/packages/autogen-core/samples/distributed-group-chat/public/avatars/writer.png b/python/samples/core_distributed-group-chat/public/avatars/writer.png
similarity index 100%
rename from python/packages/autogen-core/samples/distributed-group-chat/public/avatars/writer.png
rename to python/samples/core_distributed-group-chat/public/avatars/writer.png
diff --git a/python/packages/autogen-core/samples/distributed-group-chat/public/favicon.png b/python/samples/core_distributed-group-chat/public/favicon.png
similarity index 100%
rename from python/packages/autogen-core/samples/distributed-group-chat/public/favicon.png
rename to python/samples/core_distributed-group-chat/public/favicon.png
diff --git a/python/packages/autogen-core/samples/distributed-group-chat/public/logo.png b/python/samples/core_distributed-group-chat/public/logo.png
similarity index 100%
rename from python/packages/autogen-core/samples/distributed-group-chat/public/logo.png
rename to python/samples/core_distributed-group-chat/public/logo.png
diff --git a/python/packages/autogen-core/samples/distributed-group-chat/run.sh b/python/samples/core_distributed-group-chat/run.sh
similarity index 100%
rename from python/packages/autogen-core/samples/distributed-group-chat/run.sh
rename to python/samples/core_distributed-group-chat/run.sh
diff --git a/python/packages/autogen-core/samples/distributed-group-chat/run_editor_agent.py b/python/samples/core_distributed-group-chat/run_editor_agent.py
similarity index 100%
rename from python/packages/autogen-core/samples/distributed-group-chat/run_editor_agent.py
rename to python/samples/core_distributed-group-chat/run_editor_agent.py
diff --git a/python/packages/autogen-core/samples/distributed-group-chat/run_group_chat_manager.py b/python/samples/core_distributed-group-chat/run_group_chat_manager.py
similarity index 100%
rename from python/packages/autogen-core/samples/distributed-group-chat/run_group_chat_manager.py
rename to python/samples/core_distributed-group-chat/run_group_chat_manager.py
diff --git a/python/packages/autogen-core/samples/distributed-group-chat/run_host.py b/python/samples/core_distributed-group-chat/run_host.py
similarity index 100%
rename from python/packages/autogen-core/samples/distributed-group-chat/run_host.py
rename to python/samples/core_distributed-group-chat/run_host.py
diff --git a/python/packages/autogen-core/samples/distributed-group-chat/run_ui.py b/python/samples/core_distributed-group-chat/run_ui.py
similarity index 100%
rename from python/packages/autogen-core/samples/distributed-group-chat/run_ui.py
rename to python/samples/core_distributed-group-chat/run_ui.py
diff --git a/python/packages/autogen-core/samples/distributed-group-chat/run_writer_agent.py b/python/samples/core_distributed-group-chat/run_writer_agent.py
similarity index 100%
rename from python/packages/autogen-core/samples/distributed-group-chat/run_writer_agent.py
rename to python/samples/core_distributed-group-chat/run_writer_agent.py
diff --git a/python/packages/autogen-core/samples/worker/agents.py b/python/samples/core_grpc_worker_runtime/agents.py
similarity index 100%
rename from python/packages/autogen-core/samples/worker/agents.py
rename to python/samples/core_grpc_worker_runtime/agents.py
diff --git a/python/packages/autogen-core/samples/worker/run_cascading_publisher.py b/python/samples/core_grpc_worker_runtime/run_cascading_publisher.py
similarity index 100%
rename from python/packages/autogen-core/samples/worker/run_cascading_publisher.py
rename to python/samples/core_grpc_worker_runtime/run_cascading_publisher.py
diff --git a/python/packages/autogen-core/samples/worker/run_cascading_worker.py b/python/samples/core_grpc_worker_runtime/run_cascading_worker.py
similarity index 100%
rename from python/packages/autogen-core/samples/worker/run_cascading_worker.py
rename to python/samples/core_grpc_worker_runtime/run_cascading_worker.py
diff --git a/python/packages/autogen-core/samples/worker/run_host.py b/python/samples/core_grpc_worker_runtime/run_host.py
similarity index 100%
rename from python/packages/autogen-core/samples/worker/run_host.py
rename to python/samples/core_grpc_worker_runtime/run_host.py
diff --git a/python/packages/autogen-core/samples/worker/run_worker_pub_sub.py b/python/samples/core_grpc_worker_runtime/run_worker_pub_sub.py
similarity index 100%
rename from python/packages/autogen-core/samples/worker/run_worker_pub_sub.py
rename to python/samples/core_grpc_worker_runtime/run_worker_pub_sub.py
diff --git a/python/packages/autogen-core/samples/worker/run_worker_rpc.py b/python/samples/core_grpc_worker_runtime/run_worker_rpc.py
similarity index 100%
rename from python/packages/autogen-core/samples/worker/run_worker_rpc.py
rename to python/samples/core_grpc_worker_runtime/run_worker_rpc.py
diff --git a/python/packages/autogen-core/samples/semantic_router/README.md b/python/samples/core_semantic_router/README.md
similarity index 100%
rename from python/packages/autogen-core/samples/semantic_router/README.md
rename to python/samples/core_semantic_router/README.md
diff --git a/python/packages/autogen-core/samples/semantic_router/_agents.py b/python/samples/core_semantic_router/_agents.py
similarity index 100%
rename from python/packages/autogen-core/samples/semantic_router/_agents.py
rename to python/samples/core_semantic_router/_agents.py
diff --git a/python/packages/autogen-core/samples/semantic_router/_semantic_router_agent.py b/python/samples/core_semantic_router/_semantic_router_agent.py
similarity index 100%
rename from python/packages/autogen-core/samples/semantic_router/_semantic_router_agent.py
rename to python/samples/core_semantic_router/_semantic_router_agent.py
diff --git a/python/packages/autogen-core/samples/semantic_router/_semantic_router_components.py b/python/samples/core_semantic_router/_semantic_router_components.py
similarity index 100%
rename from python/packages/autogen-core/samples/semantic_router/_semantic_router_components.py
rename to python/samples/core_semantic_router/_semantic_router_components.py
diff --git a/python/packages/autogen-core/samples/semantic_router/run_host.py b/python/samples/core_semantic_router/run_host.py
similarity index 100%
rename from python/packages/autogen-core/samples/semantic_router/run_host.py
rename to python/samples/core_semantic_router/run_host.py
diff --git a/python/packages/autogen-core/samples/semantic_router/run_semantic_router.py b/python/samples/core_semantic_router/run_semantic_router.py
similarity index 100%
rename from python/packages/autogen-core/samples/semantic_router/run_semantic_router.py
rename to python/samples/core_semantic_router/run_semantic_router.py
diff --git a/python/packages/autogen-core/samples/xlang/hello_python_agent/README.md b/python/samples/core_xlang_hello_python_agent/README.md
similarity index 100%
rename from python/packages/autogen-core/samples/xlang/hello_python_agent/README.md
rename to python/samples/core_xlang_hello_python_agent/README.md
diff --git a/python/packages/autogen-core/samples/xlang/hello_python_agent/hello_python_agent.py b/python/samples/core_xlang_hello_python_agent/hello_python_agent.py
similarity index 100%
rename from python/packages/autogen-core/samples/xlang/hello_python_agent/hello_python_agent.py
rename to python/samples/core_xlang_hello_python_agent/hello_python_agent.py
diff --git a/python/packages/autogen-core/samples/protos/__init__.py b/python/samples/core_xlang_hello_python_agent/protos/__init__.py
similarity index 100%
rename from python/packages/autogen-core/samples/protos/__init__.py
rename to python/samples/core_xlang_hello_python_agent/protos/__init__.py
diff --git a/python/packages/autogen-core/samples/protos/agent_events_pb2.py b/python/samples/core_xlang_hello_python_agent/protos/agent_events_pb2.py
similarity index 100%
rename from python/packages/autogen-core/samples/protos/agent_events_pb2.py
rename to python/samples/core_xlang_hello_python_agent/protos/agent_events_pb2.py
diff --git a/python/packages/autogen-core/samples/protos/agent_events_pb2.pyi b/python/samples/core_xlang_hello_python_agent/protos/agent_events_pb2.pyi
similarity index 100%
rename from python/packages/autogen-core/samples/protos/agent_events_pb2.pyi
rename to python/samples/core_xlang_hello_python_agent/protos/agent_events_pb2.pyi
diff --git a/python/packages/autogen-core/samples/protos/agent_events_pb2_grpc.py b/python/samples/core_xlang_hello_python_agent/protos/agent_events_pb2_grpc.py
similarity index 100%
rename from python/packages/autogen-core/samples/protos/agent_events_pb2_grpc.py
rename to python/samples/core_xlang_hello_python_agent/protos/agent_events_pb2_grpc.py
diff --git a/python/packages/autogen-core/samples/protos/agent_events_pb2_grpc.pyi b/python/samples/core_xlang_hello_python_agent/protos/agent_events_pb2_grpc.pyi
similarity index 100%
rename from python/packages/autogen-core/samples/protos/agent_events_pb2_grpc.pyi
rename to python/samples/core_xlang_hello_python_agent/protos/agent_events_pb2_grpc.pyi
diff --git a/python/packages/autogen-core/samples/xlang/hello_python_agent/user_input.py b/python/samples/core_xlang_hello_python_agent/user_input.py
similarity index 100%
rename from python/packages/autogen-core/samples/xlang/hello_python_agent/user_input.py
rename to python/samples/core_xlang_hello_python_agent/user_input.py
diff --git a/python/uv.lock b/python/uv.lock
index 84913dfed..9f8ed0980 100644
--- a/python/uv.lock
+++ b/python/uv.lock
@@ -30,6 +30,7 @@ members = [
[manifest.dependency-groups]
dev = [
+ { name = "chainlit" },
{ name = "cookiecutter" },
{ name = "grpcio-tools", specifier = "~=1.62.0" },
{ name = "mypy", specifier = "==1.13.0" },
@@ -110,11 +111,11 @@ wheels = [
[[package]]
name = "aiofiles"
-version = "24.1.0"
+version = "23.2.1"
source = { registry = "https://pypi.org/simple" }
-sdist = { url = "https://files.pythonhosted.org/packages/0b/03/a88171e277e8caa88a4c77808c20ebb04ba74cc4681bf1e9416c862de237/aiofiles-24.1.0.tar.gz", hash = "sha256:22a075c9e5a3810f0c2e48f3008c94d68c65d763b9b03857924c99e57355166c", size = 30247 }
+sdist = { url = "https://files.pythonhosted.org/packages/af/41/cfed10bc64d774f497a86e5ede9248e1d062db675504b41c320954d99641/aiofiles-23.2.1.tar.gz", hash = "sha256:84ec2218d8419404abcb9f0c02df3f34c6e0a68ed41072acfb1cef5cbc29051a", size = 32072 }
wheels = [
- { url = "https://files.pythonhosted.org/packages/a5/45/30bb92d442636f570cb5651bc661f52b610e2eec3f891a5dc3a4c3667db0/aiofiles-24.1.0-py3-none-any.whl", hash = "sha256:b4ec55f4195e3eb5d7abd1bf7e061763e864dd4954231fb8539a0ef8bb8260e5", size = 15896 },
+ { url = "https://files.pythonhosted.org/packages/c5/19/5af6804c4cc0fed83f47bff6e413a98a36618e7d40185cd36e69737f3b0e/aiofiles-23.2.1-py3-none-any.whl", hash = "sha256:19297512c647d4b27a2cf7c34caa7e405c0d60b5560618a29a9fe027b18b0107", size = 15727 },
]
[[package]]
@@ -300,6 +301,18 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/a7/fa/e01228c2938de91d47b307831c62ab9e4001e747789d0b05baf779a6488c/async_timeout-4.0.3-py3-none-any.whl", hash = "sha256:7405140ff1230c310e51dc27b3145b9092d659ce68ff733fb0cefe3ee42be028", size = 5721 },
]
+[[package]]
+name = "asyncer"
+version = "0.0.7"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "anyio" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/39/29/245ba9fa5769a1e3226c1157aedb372fe9dab28c4e1dcf6911d84d3a5e04/asyncer-0.0.7.tar.gz", hash = "sha256:d5e563fb0f56eb87b97257984703658a4f5bbdb52ff851b3e8ed864cc200b1d2", size = 14437 }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/3e/4b/40a1dc52fc26695b1e80a9e67dfb0fe7e6ddc57bbc5b61348e40c0045abb/asyncer-0.0.7-py3-none-any.whl", hash = "sha256:f0d579d4f67c4ead52ede3a45c854f462cae569058a8a6a68a4ebccac1c335d8", size = 8476 },
+]
+
[[package]]
name = "asyncio-atexit"
version = "1.0.1"
@@ -755,6 +768,15 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/b1/fe/e8c672695b37eecc5cbf43e1d0638d88d66ba3a44c4d321c796f4e59167f/beautifulsoup4-4.12.3-py3-none-any.whl", hash = "sha256:b80878c9f40111313e55da8ba20bdba06d8fa3969fc68304167741bbf9e082ed", size = 147925 },
]
+[[package]]
+name = "bidict"
+version = "0.23.1"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/9a/6e/026678aa5a830e07cd9498a05d3e7e650a4f56a42f267a53d22bcda1bdc9/bidict-0.23.1.tar.gz", hash = "sha256:03069d763bc387bbd20e7d49914e75fc4132a41937fa3405417e1a5a2d006d71", size = 29093 }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/99/37/e8730c3587a65eb5645d4aba2d27aae48e8003614d6aaf15dda67f702f1f/bidict-0.23.1-py3-none-any.whl", hash = "sha256:5dae8d4d79b552a71cbabc7deb25dfe8ce710b17ff41711e13010ead2abfc3e5", size = 32764 },
+]
+
[[package]]
name = "binaryornot"
version = "0.4.4"
@@ -822,6 +844,40 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/50/b9/db34c4755a7bd1cb2d1603ac3863f22bcecbd1ba29e5ee841a4bc510b294/cffi-1.17.1-cp312-cp312-win_amd64.whl", hash = "sha256:51392eae71afec0d0c8fb1a53b204dbb3bcabcb3c9b807eedf3e1e6ccf2de903", size = 181976 },
]
+[[package]]
+name = "chainlit"
+version = "2.0.0"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "aiofiles" },
+ { name = "asyncer" },
+ { name = "click" },
+ { name = "dataclasses-json" },
+ { name = "fastapi" },
+ { name = "filetype" },
+ { name = "httpx" },
+ { name = "lazify" },
+ { name = "literalai" },
+ { name = "nest-asyncio" },
+ { name = "numpy" },
+ { name = "packaging" },
+ { name = "pydantic" },
+ { name = "pyjwt" },
+ { name = "python-dotenv" },
+ { name = "python-multipart" },
+ { name = "python-socketio" },
+ { name = "starlette" },
+ { name = "syncer" },
+ { name = "tomli" },
+ { name = "uptrace" },
+ { name = "uvicorn" },
+ { name = "watchfiles" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/45/24/424679b769664876093b3e42167911535d1739bc1bc88f3963c69affed9e/chainlit-2.0.0.tar.gz", hash = "sha256:47b3a274a20cefb443f356d69f1c6a48818d67eb4a11552c749bfa6f414423ed", size = 4637040 }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/87/2a/e2bbb86fc3a34c7bf798644edb95bf14fd79a8b3f6c99e4b27e5df1e24f0/chainlit-2.0.0-py3-none-any.whl", hash = "sha256:2b58ac6b513d94aef0380d1d68b73f74718c0c844586b050ce8d5e0a82eb8133", size = 4703622 },
+]
+
[[package]]
name = "chardet"
version = "5.2.0"
@@ -891,6 +947,15 @@ version = "1.11.1"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/74/16/53b895bb4fccede8e506de820fa94db03a2dc8bd2ca4bec0aac4a112fb65/chess-1.11.1.tar.gz", hash = "sha256:b7f66a32dc599ab260e2b688e6ac4e868dad840377a54b61357e2dec2a5fed00", size = 156529 }
+[[package]]
+name = "chevron"
+version = "0.14.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/15/1f/ca74b65b19798895d63a6e92874162f44233467c9e7c1ed8afd19016ebe9/chevron-0.14.0.tar.gz", hash = "sha256:87613aafdf6d77b6a90ff073165a61ae5086e21ad49057aa0e53681601800ebf", size = 11440 }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/52/93/342cc62a70ab727e093ed98e02a725d85b746345f05d2b5e5034649f4ec8/chevron-0.14.0-py3-none-any.whl", hash = "sha256:fbf996a709f8da2e745ef763f482ce2d311aa817d287593a5b990d6d6e4f0443", size = 11595 },
+]
+
[[package]]
name = "chromedriver-autoinstaller"
version = "0.6.4"
@@ -1345,6 +1410,18 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/da/71/ae30dadffc90b9006d77af76b393cb9dfbfc9629f339fc1574a1c52e6806/future-1.0.0-py3-none-any.whl", hash = "sha256:929292d34f5872e70396626ef385ec22355a1fae8ad29e1a734c3e43f9fbc216", size = 491326 },
]
+[[package]]
+name = "googleapis-common-protos"
+version = "1.66.0"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "protobuf" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/ff/a7/8e9cccdb1c49870de6faea2a2764fa23f627dd290633103540209f03524c/googleapis_common_protos-1.66.0.tar.gz", hash = "sha256:c3e7b33d15fdca5374cc0a7346dd92ffa847425cc4ea941d970f13680052ec8c", size = 114376 }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/a0/0f/c0713fb2b3d28af4b2fded3291df1c4d4f79a00d15c2374a9e010870016c/googleapis_common_protos-1.66.0-py2.py3-none-any.whl", hash = "sha256:d7abcd75fabb2e0ec9f74466401f6c119a0b498e27370e9be4c94cb7e382b8ed", size = 221682 },
+]
+
[[package]]
name = "greenlet"
version = "3.1.1"
@@ -1955,6 +2032,15 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/71/fd/7713b0e737f4e171112e44134790823ccec4aabe31f07d6e836fcbeb3b8a/langsmith-0.1.137-py3-none-any.whl", hash = "sha256:4256d5c61133749890f7b5c88321dbb133ce0f440c621ea28e76513285859b81", size = 296895 },
]
+[[package]]
+name = "lazify"
+version = "0.4.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/24/2c/b55c4a27a56dd9a00bb2812c404b57f8b7aec0cdbff9fdc61acdd73359bc/Lazify-0.4.0.tar.gz", hash = "sha256:7102bfe63e56de2ab62b3bc661a7190c4056771a8624f04a8b785275c3dd1f9b", size = 2968 }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/03/a5/866b44697cee47d1cae429ed370281d937ad4439f71af82a6baaa139d26a/Lazify-0.4.0-py2.py3-none-any.whl", hash = "sha256:c2c17a7a33e9406897e3f66fde4cd3f84716218d580330e5af10cfe5a0cd195a", size = 3107 },
+]
+
[[package]]
name = "linkify-it-py"
version = "2.0.3"
@@ -1967,6 +2053,18 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/04/1e/b832de447dee8b582cac175871d2f6c3d5077cc56d5575cadba1fd1cccfa/linkify_it_py-2.0.3-py3-none-any.whl", hash = "sha256:6bcbc417b0ac14323382aef5c5192c0075bf8a9d6b41820a2b66371eac6b6d79", size = 19820 },
]
+[[package]]
+name = "literalai"
+version = "0.0.623"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "chevron" },
+ { name = "httpx" },
+ { name = "packaging" },
+ { name = "pydantic" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/41/af/07d943e62a1297a7b44777297c0dca8f4bfcd6ae18b9df7d3cd9c1970e29/literalai-0.0.623.tar.gz", hash = "sha256:d65c04dde6b1e99d585e4112a607e5fd574d282b70f600c55a671018340dfb0f", size = 57081 }
+
[[package]]
name = "llama-cloud"
version = "0.1.7"
@@ -3128,6 +3226,93 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/fb/1f/737dcdbc9fea2fa96c1b392ae47275165a7c641663fbb08a8d252968eed2/opentelemetry_api-1.27.0-py3-none-any.whl", hash = "sha256:953d5871815e7c30c81b56d910c707588000fff7a3ca1c73e6531911d53065e7", size = 63970 },
]
+[[package]]
+name = "opentelemetry-exporter-otlp"
+version = "1.27.0"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "opentelemetry-exporter-otlp-proto-grpc" },
+ { name = "opentelemetry-exporter-otlp-proto-http" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/fc/d3/8156cc14e8f4573a3572ee7f30badc7aabd02961a09acc72ab5f2c789ef1/opentelemetry_exporter_otlp-1.27.0.tar.gz", hash = "sha256:4a599459e623868cc95d933c301199c2367e530f089750e115599fccd67cb2a1", size = 6166 }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/59/6d/95e1fc2c8d945a734db32e87a5aa7a804f847c1657a21351df9338bd1c9c/opentelemetry_exporter_otlp-1.27.0-py3-none-any.whl", hash = "sha256:7688791cbdd951d71eb6445951d1cfbb7b6b2d7ee5948fac805d404802931145", size = 7001 },
+]
+
+[[package]]
+name = "opentelemetry-exporter-otlp-proto-common"
+version = "1.27.0"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "opentelemetry-proto" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/cd/2e/7eaf4ba595fb5213cf639c9158dfb64aacb2e4c7d74bfa664af89fa111f4/opentelemetry_exporter_otlp_proto_common-1.27.0.tar.gz", hash = "sha256:159d27cf49f359e3798c4c3eb8da6ef4020e292571bd8c5604a2a573231dd5c8", size = 17860 }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/41/27/4610ab3d9bb3cde4309b6505f98b3aabca04a26aa480aa18cede23149837/opentelemetry_exporter_otlp_proto_common-1.27.0-py3-none-any.whl", hash = "sha256:675db7fffcb60946f3a5c43e17d1168a3307a94a930ecf8d2ea1f286f3d4f79a", size = 17848 },
+]
+
+[[package]]
+name = "opentelemetry-exporter-otlp-proto-grpc"
+version = "1.27.0"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "deprecated" },
+ { name = "googleapis-common-protos" },
+ { name = "grpcio" },
+ { name = "opentelemetry-api" },
+ { name = "opentelemetry-exporter-otlp-proto-common" },
+ { name = "opentelemetry-proto" },
+ { name = "opentelemetry-sdk" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/a1/d0/c1e375b292df26e0ffebf194e82cd197e4c26cc298582bda626ce3ce74c5/opentelemetry_exporter_otlp_proto_grpc-1.27.0.tar.gz", hash = "sha256:af6f72f76bcf425dfb5ad11c1a6d6eca2863b91e63575f89bb7b4b55099d968f", size = 26244 }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/8d/80/32217460c2c64c0568cea38410124ff680a9b65f6732867bbf857c4d8626/opentelemetry_exporter_otlp_proto_grpc-1.27.0-py3-none-any.whl", hash = "sha256:56b5bbd5d61aab05e300d9d62a6b3c134827bbd28d0b12f2649c2da368006c9e", size = 18541 },
+]
+
+[[package]]
+name = "opentelemetry-exporter-otlp-proto-http"
+version = "1.27.0"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "deprecated" },
+ { name = "googleapis-common-protos" },
+ { name = "opentelemetry-api" },
+ { name = "opentelemetry-exporter-otlp-proto-common" },
+ { name = "opentelemetry-proto" },
+ { name = "opentelemetry-sdk" },
+ { name = "requests" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/31/0a/f05c55e8913bf58a033583f2580a0ec31a5f4cf2beacc9e286dcb74d6979/opentelemetry_exporter_otlp_proto_http-1.27.0.tar.gz", hash = "sha256:2103479092d8eb18f61f3fbff084f67cc7f2d4a7d37e75304b8b56c1d09ebef5", size = 15059 }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/2d/8d/4755884afc0b1db6000527cac0ca17273063b6142c773ce4ecd307a82e72/opentelemetry_exporter_otlp_proto_http-1.27.0-py3-none-any.whl", hash = "sha256:688027575c9da42e179a69fe17e2d1eba9b14d81de8d13553a21d3114f3b4d75", size = 17203 },
+]
+
+[[package]]
+name = "opentelemetry-instrumentation"
+version = "0.48b0"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "opentelemetry-api" },
+ { name = "setuptools" },
+ { name = "wrapt" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/04/0e/d9394839af5d55c8feb3b22cd11138b953b49739b20678ca96289e30f904/opentelemetry_instrumentation-0.48b0.tar.gz", hash = "sha256:94929685d906380743a71c3970f76b5f07476eea1834abd5dd9d17abfe23cc35", size = 24724 }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/0a/7f/405c41d4f359121376c9d5117dcf68149b8122d3f6c718996d037bd4d800/opentelemetry_instrumentation-0.48b0-py3-none-any.whl", hash = "sha256:a69750dc4ba6a5c3eb67986a337185a25b739966d80479befe37b546fc870b44", size = 29449 },
+]
+
+[[package]]
+name = "opentelemetry-proto"
+version = "1.27.0"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "protobuf" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/9a/59/959f0beea798ae0ee9c979b90f220736fbec924eedbefc60ca581232e659/opentelemetry_proto-1.27.0.tar.gz", hash = "sha256:33c9345d91dafd8a74fc3d7576c5a38f18b7fdf8d02983ac67485386132aedd6", size = 34749 }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/94/56/3d2d826834209b19a5141eed717f7922150224d1a982385d19a9444cbf8d/opentelemetry_proto-1.27.0-py3-none-any.whl", hash = "sha256:b133873de5581a50063e1e4b29cdcf0c5e253a8c2d8dc1229add20a4c3830ace", size = 52464 },
+]
+
[[package]]
name = "opentelemetry-sdk"
version = "1.27.0"
@@ -3207,11 +3392,11 @@ wheels = [
[[package]]
name = "packaging"
-version = "24.1"
+version = "23.2"
source = { registry = "https://pypi.org/simple" }
-sdist = { url = "https://files.pythonhosted.org/packages/51/65/50db4dda066951078f0a96cf12f4b9ada6e4b811516bf0262c0f4f7064d4/packaging-24.1.tar.gz", hash = "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002", size = 148788 }
+sdist = { url = "https://files.pythonhosted.org/packages/fb/2b/9b9c33ffed44ee921d0967086d653047286054117d584f1b1a7c22ceaf7b/packaging-23.2.tar.gz", hash = "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5", size = 146714 }
wheels = [
- { url = "https://files.pythonhosted.org/packages/08/aa/cc0199a5f0ad350994d660967a8efb233fe0416e4639146c089643407ce6/packaging-24.1-py3-none-any.whl", hash = "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124", size = 53985 },
+ { url = "https://files.pythonhosted.org/packages/ec/1a/610693ac4ee14fcdf2d9bf3c493370e4f2ef7ae2e19217d7a237ff42367d/packaging-23.2-py3-none-any.whl", hash = "sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7", size = 53011 },
]
[[package]]
@@ -3872,6 +4057,27 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/6a/3e/b68c118422ec867fa7ab88444e1274aa40681c606d59ac27de5a5588f082/python_dotenv-1.0.1-py3-none-any.whl", hash = "sha256:f7b63ef50f1b690dddf550d03497b66d609393b40b564ed0d674909a68ebf16a", size = 19863 },
]
+[[package]]
+name = "python-engineio"
+version = "4.11.2"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "simple-websocket" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/52/e0/a9e0fe427ce7f1b7dbf9531fa00ffe4b557c4a7bc8e71891c115af123170/python_engineio-4.11.2.tar.gz", hash = "sha256:145bb0daceb904b4bb2d3eb2d93f7dbb7bb87a6a0c4f20a94cc8654dec977129", size = 91381 }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/07/8f/978a0b913e3f8ad33a9a2fe204d32efe3d1ee34ecb1f2829c1cfbdd92082/python_engineio-4.11.2-py3-none-any.whl", hash = "sha256:f0971ac4c65accc489154fe12efd88f53ca8caf04754c46a66e85f5102ef22ad", size = 59239 },
+]
+
+[[package]]
+name = "python-multipart"
+version = "0.0.18"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/b4/86/b6b38677dec2e2e7898fc5b6f7e42c2d011919a92d25339451892f27b89c/python_multipart-0.0.18.tar.gz", hash = "sha256:7a68db60c8bfb82e460637fa4750727b45af1d5e2ed215593f917f64694d34fe", size = 36622 }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/13/6b/b60f47101ba2cac66b4a83246630e68ae9bbe2e614cbae5f4465f46dee13/python_multipart-0.0.18-py3-none-any.whl", hash = "sha256:efe91480f485f6a361427a541db4796f9e1591afc0fb8e7a4ba06bfbc6708996", size = 24389 },
+]
+
[[package]]
name = "python-pptx"
version = "1.0.2"
@@ -3899,6 +4105,19 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/a4/62/02da182e544a51a5c3ccf4b03ab79df279f9c60c5e82d5e8bec7ca26ac11/python_slugify-8.0.4-py2.py3-none-any.whl", hash = "sha256:276540b79961052b66b7d116620b36518847f52d5fd9e3a70164fc8c50faa6b8", size = 10051 },
]
+[[package]]
+name = "python-socketio"
+version = "5.12.1"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "bidict" },
+ { name = "python-engineio" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/ce/d0/40ed38076e8aee94785d546d3e3a1cae393da5806a8530be877187e2875f/python_socketio-5.12.1.tar.gz", hash = "sha256:0299ff1f470b676c09c1bfab1dead25405077d227b2c13cf217a34dadc68ba9c", size = 119991 }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/8a/a3/c69806f30dd81df5a99d592e7db4c930c3a9b098555aa97b0eb866b20b11/python_socketio-5.12.1-py3-none-any.whl", hash = "sha256:24a0ea7cfff0e021eb28c68edbf7914ee4111bdf030b95e4d250c4dc9af7a386", size = 76947 },
+]
+
[[package]]
name = "pytz"
version = "2024.2"
@@ -4290,6 +4509,18 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/e0/f9/0595336914c5619e5f28a1fb793285925a8cd4b432c9da0a987836c7f822/shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686", size = 9755 },
]
+[[package]]
+name = "simple-websocket"
+version = "1.1.0"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "wsproto" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/b0/d4/bfa032f961103eba93de583b161f0e6a5b63cebb8f2c7d0c6e6efe1e3d2e/simple_websocket-1.1.0.tar.gz", hash = "sha256:7939234e7aa067c534abdab3a9ed933ec9ce4691b0713c78acb195560aa52ae4", size = 17300 }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/52/59/0782e51887ac6b07ffd1570e0364cf901ebc36345fea669969d2084baebb/simple_websocket-1.1.0-py3-none-any.whl", hash = "sha256:4af6069630a38ed6c561010f0e11a5bc0d4ca569b36306eb257cd9a192497c8c", size = 13842 },
+]
+
[[package]]
name = "six"
version = "1.16.0"
@@ -4576,14 +4807,14 @@ wheels = [
[[package]]
name = "starlette"
-version = "0.41.0"
+version = "0.41.3"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "anyio" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/78/53/c3a36690a923706e7ac841f649c64f5108889ab1ec44218dac45771f252a/starlette-0.41.0.tar.gz", hash = "sha256:39cbd8768b107d68bfe1ff1672b38a2c38b49777de46d2a592841d58e3bf7c2a", size = 2573755 }
+sdist = { url = "https://files.pythonhosted.org/packages/1a/4c/9b5764bd22eec91c4039ef4c55334e9187085da2d8a2df7bd570869aae18/starlette-0.41.3.tar.gz", hash = "sha256:0e4ab3d16522a255be6b28260b938eae2482f98ce5cc934cb08dce8dc3ba5835", size = 2574159 }
wheels = [
- { url = "https://files.pythonhosted.org/packages/35/c6/a4443bfabf5629129512ca0e07866c4c3c094079ba4e9b2551006927253c/starlette-0.41.0-py3-none-any.whl", hash = "sha256:a0193a3c413ebc9c78bff1c3546a45bb8c8bcb4a84cae8747d650a65bd37210a", size = 73216 },
+ { url = "https://files.pythonhosted.org/packages/96/00/2b325970b3060c7cecebab6d295afe763365822b1306a12eeab198f74323/starlette-0.41.3-py3-none-any.whl", hash = "sha256:44cedb2b7c77a9de33a8b74b2b90e9f50d11fcf25d8270ea525ad71a25374ff7", size = 73225 },
]
[[package]]
@@ -4607,6 +4838,12 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/b2/fe/81695a1aa331a842b582453b605175f419fe8540355886031328089d840a/sympy-1.13.1-py3-none-any.whl", hash = "sha256:db36cdc64bf61b9b24578b6f7bab1ecdd2452cf008f34faa33776680c26d66f8", size = 6189177 },
]
+[[package]]
+name = "syncer"
+version = "2.0.3"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/8d/dd/d4dd75843692690d81f0a4b929212a1614b25d4896aa7c72f4c3546c7e3d/syncer-2.0.3.tar.gz", hash = "sha256:4340eb54b54368724a78c5c0763824470201804fe9180129daf3635cb500550f", size = 11512 }
+
[[package]]
name = "tabulate"
version = "0.9.0"
@@ -5038,6 +5275,21 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/37/87/1f677586e8ac487e29672e4b17455758fce261de06a0d086167bb760361a/uc_micro_py-1.0.3-py3-none-any.whl", hash = "sha256:db1dffff340817673d7b466ec86114a9dc0e9d4d9b5ba229d9d60e5c12600cd5", size = 6229 },
]
+[[package]]
+name = "uptrace"
+version = "1.27.0"
+source = { registry = "https://pypi.org/simple" }
+dependencies = [
+ { name = "opentelemetry-api" },
+ { name = "opentelemetry-exporter-otlp" },
+ { name = "opentelemetry-instrumentation" },
+ { name = "opentelemetry-sdk" },
+]
+sdist = { url = "https://files.pythonhosted.org/packages/f3/89/ba1df9328e4bd4b440ac6979e20ec8c63a26f6400598e806cc9dfef764f4/uptrace-1.27.0.tar.gz", hash = "sha256:983f783b2f4303d1d2bdfaf6ace1b7a5f072af47f78a7815f82c51fcf5099cac", size = 7633 }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/77/00/054ac30e9e8312c3c79371c495dd570865eab2a05bfcd640f6242d460c8b/uptrace-1.27.0-py3-none-any.whl", hash = "sha256:d5473efa33c34e3d5738d32d19301dbf004d4e19598c658f2fa9f3f09458f630", size = 8627 },
+]
+
[[package]]
name = "urllib3"
version = "2.2.3"
@@ -5054,69 +5306,40 @@ socks = [
[[package]]
name = "uvicorn"
-version = "0.32.0"
+version = "0.25.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "click" },
{ name = "h11" },
{ name = "typing-extensions", marker = "python_full_version < '3.11'" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/e0/fc/1d785078eefd6945f3e5bab5c076e4230698046231eb0f3747bc5c8fa992/uvicorn-0.32.0.tar.gz", hash = "sha256:f78b36b143c16f54ccdb8190d0a26b5f1901fe5a3c777e1ab29f26391af8551e", size = 77564 }
+sdist = { url = "https://files.pythonhosted.org/packages/ec/54/0eb4441bf38c70f6ed1886dddb2e29d1650026041d19e49fc373e332fa60/uvicorn-0.25.0.tar.gz", hash = "sha256:6dddbad1d7ee0f5140aba5ec138ddc9612c5109399903828b4874c9937f009c2", size = 40724 }
wheels = [
- { url = "https://files.pythonhosted.org/packages/eb/14/78bd0e95dd2444b6caacbca2b730671d4295ccb628ef58b81bee903629df/uvicorn-0.32.0-py3-none-any.whl", hash = "sha256:60b8f3a5ac027dcd31448f411ced12b5ef452c646f76f02f8cc3f25d8d26fd82", size = 63723 },
+ { url = "https://files.pythonhosted.org/packages/26/59/fddd9df489fe27f492cc97626e03663fb3b9b6ef7ce8597a7cdc5f2cbbad/uvicorn-0.25.0-py3-none-any.whl", hash = "sha256:ce107f5d9bd02b4636001a77a4e74aab5e1e2b146868ebbad565237145af444c", size = 60303 },
]
[[package]]
name = "watchfiles"
-version = "1.0.3"
+version = "0.20.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "anyio" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/3c/7e/4569184ea04b501840771b8fcecee19b2233a8b72c196061263c0ef23c0b/watchfiles-1.0.3.tar.gz", hash = "sha256:f3ff7da165c99a5412fe5dd2304dd2dbaaaa5da718aad942dcb3a178eaa70c56", size = 38185 }
-wheels = [
- { url = "https://files.pythonhosted.org/packages/cd/6c/7be04641c81209ea281b83b1174aa9d5ba53bec2a896d75a6b10428b4063/watchfiles-1.0.3-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:1da46bb1eefb5a37a8fb6fd52ad5d14822d67c498d99bda8754222396164ae42", size = 395213 },
- { url = "https://files.pythonhosted.org/packages/bd/d6/99438baa225891bda882adefefc14c9023ef3cdaf9772cd47973bb566e96/watchfiles-1.0.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2b961b86cd3973f5822826017cad7f5a75795168cb645c3a6b30c349094e02e3", size = 384755 },
- { url = "https://files.pythonhosted.org/packages/88/93/b10295ce8696e5e37f480ba4ae89e387e88ba425d72808c87d30f4cdefb1/watchfiles-1.0.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:34e87c7b3464d02af87f1059fedda5484e43b153ef519e4085fe1a03dd94801e", size = 441701 },
- { url = "https://files.pythonhosted.org/packages/c5/3a/0359b7bddb1b7cbe6fb7096805b6e2f859f0de3d6130dcab9ac635db87e2/watchfiles-1.0.3-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d9dd2b89a16cf7ab9c1170b5863e68de6bf83db51544875b25a5f05a7269e678", size = 447540 },
- { url = "https://files.pythonhosted.org/packages/e2/a7/3400b4f105c68804495b76398165ffe6c00af93eab395279285f43cd0e42/watchfiles-1.0.3-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2b4691234d31686dca133c920f94e478b548a8e7c750f28dbbc2e4333e0d3da9", size = 472467 },
- { url = "https://files.pythonhosted.org/packages/c3/1a/8f928800d038d4fdb1e9df6e0c380c8cee17e6fb180e1faceb3f94de6df7/watchfiles-1.0.3-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:90b0fe1fcea9bd6e3084b44875e179b4adcc4057a3b81402658d0eb58c98edf8", size = 494467 },
- { url = "https://files.pythonhosted.org/packages/13/70/af75edf5b763f09e31a0f19ce045f3731db22599cb521807760b7d82b196/watchfiles-1.0.3-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0b90651b4cf9e158d01faa0833b073e2e37719264bcee3eac49fc3c74e7d304b", size = 492671 },
- { url = "https://files.pythonhosted.org/packages/4a/6e/8723f4b0967cc8d94f33fc531c33d66b596090b024f449983d3a8d97cfca/watchfiles-1.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c2e9fe695ff151b42ab06501820f40d01310fbd58ba24da8923ace79cf6d702d", size = 443811 },
- { url = "https://files.pythonhosted.org/packages/ee/5d/f3ca68a71d978d43168a65a1b4e1f72290c5350379aa148917e4ed0b2c46/watchfiles-1.0.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:62691f1c0894b001c7cde1195c03b7801aaa794a837bd6eef24da87d1542838d", size = 615477 },
- { url = "https://files.pythonhosted.org/packages/0d/d0/3d27a26f276ef07ca4cd3c6766684444317ddd147943e00bdb157cfdf3c3/watchfiles-1.0.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:275c1b0e942d335fccb6014d79267d1b9fa45b5ac0639c297f1e856f2f532552", size = 614237 },
- { url = "https://files.pythonhosted.org/packages/97/e9/ff30b210099d75cfa407924b3c265d3054f14b83ddf02072bd637394aab6/watchfiles-1.0.3-cp310-cp310-win32.whl", hash = "sha256:06ce08549e49ba69ccc36fc5659a3d0ff4e3a07d542b895b8a9013fcab46c2dc", size = 270798 },
- { url = "https://files.pythonhosted.org/packages/ed/86/694f07eb91d3e81a359661b48ff6984543e50be767c50c08196155d417bf/watchfiles-1.0.3-cp310-cp310-win_amd64.whl", hash = "sha256:f280b02827adc9d87f764972fbeb701cf5611f80b619c20568e1982a277d6146", size = 284192 },
- { url = "https://files.pythonhosted.org/packages/24/a8/06e2d5f840b285718a09be7c71ea19b7177b005cec87b8923dd7e8541b20/watchfiles-1.0.3-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:ffe709b1d0bc2e9921257569675674cafb3a5f8af689ab9f3f2b3f88775b960f", size = 394821 },
- { url = "https://files.pythonhosted.org/packages/57/9f/f98a57ada3d4b1fcd0e325aa6c307e2248ecb048f71c96fba34a602f02e7/watchfiles-1.0.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:418c5ce332f74939ff60691e5293e27c206c8164ce2b8ce0d9abf013003fb7fe", size = 384898 },
- { url = "https://files.pythonhosted.org/packages/a3/31/33ba914010cbfd01033ca3727aff6585b6b2ea2b051b6fbaecdf4e2160b9/watchfiles-1.0.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2f492d2907263d6d0d52f897a68647195bc093dafed14508a8d6817973586b6b", size = 441710 },
- { url = "https://files.pythonhosted.org/packages/d9/dd/e56b2ef07c2c34e4152950f0ce98a1081215ef027cf39e5dab61a0f8bd95/watchfiles-1.0.3-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:48c9f3bc90c556a854f4cab6a79c16974099ccfa3e3e150673d82d47a4bc92c9", size = 447681 },
- { url = "https://files.pythonhosted.org/packages/60/8f/3837df33f3d0cbef8ae59559891d688490bf2960373ea077ff11cbf79115/watchfiles-1.0.3-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:75d3bcfa90454dba8df12adc86b13b6d85fda97d90e708efc036c2760cc6ba44", size = 472312 },
- { url = "https://files.pythonhosted.org/packages/5a/b3/95d103e5bb609b20f175e8acdf8b32c4b091f96f781c066fd3bff2b17778/watchfiles-1.0.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5691340f259b8f76b45fb31b98e594d46c36d1dc8285efa7975f7f50230c9093", size = 494779 },
- { url = "https://files.pythonhosted.org/packages/4f/f0/9fdc60daf5abf7b0deb225c9b0a37fd72dc407fa33f071ae2f70e84e268c/watchfiles-1.0.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1e263cc718545b7f897baeac1f00299ab6fabe3e18caaacacb0edf6d5f35513c", size = 492090 },
- { url = "https://files.pythonhosted.org/packages/96/e5/a9967e77f173280ab1abbfd7ead90f2b94060574968baf5e6d7cbe9dd490/watchfiles-1.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1c6cf7709ed3e55704cc06f6e835bf43c03bc8e3cb8ff946bf69a2e0a78d9d77", size = 443713 },
- { url = "https://files.pythonhosted.org/packages/60/38/e5390d4633a558878113e45d32e39d30cf58eb94e0359f41737be209321b/watchfiles-1.0.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:703aa5e50e465be901e0e0f9d5739add15e696d8c26c53bc6fc00eb65d7b9469", size = 615306 },
- { url = "https://files.pythonhosted.org/packages/5c/27/8a1ee74544c93e3242ca073087b45c64367aeb6897b622e43c8172c2b421/watchfiles-1.0.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:bfcae6aecd9e0cb425f5145afee871465b98b75862e038d42fe91fd753ddd780", size = 614333 },
- { url = "https://files.pythonhosted.org/packages/fc/f8/25698f5b734907662b50acf3e81996053abdfe26fcf38804d028412876a8/watchfiles-1.0.3-cp311-cp311-win32.whl", hash = "sha256:6a76494d2c5311584f22416c5a87c1e2cb954ff9b5f0988027bc4ef2a8a67181", size = 270987 },
- { url = "https://files.pythonhosted.org/packages/39/78/f600dee7b387e6088c8d1f4c898a4340d07aecfe6406bd90ec4c1925ef08/watchfiles-1.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:cf745cbfad6389c0e331786e5fe9ae3f06e9d9c2ce2432378e1267954793975c", size = 284098 },
- { url = "https://files.pythonhosted.org/packages/ca/6f/27ba8aec0a4b45a6063454465eefb42777158081d9df18eab5f1d6a3bd8a/watchfiles-1.0.3-cp311-cp311-win_arm64.whl", hash = "sha256:2dcc3f60c445f8ce14156854a072ceb36b83807ed803d37fdea2a50e898635d6", size = 276804 },
- { url = "https://files.pythonhosted.org/packages/bf/a9/c8b5ab33444306e1a324cb2b51644f8458dd459e30c3841f925012893e6a/watchfiles-1.0.3-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:93436ed550e429da007fbafb723e0769f25bae178fbb287a94cb4ccdf42d3af3", size = 391395 },
- { url = "https://files.pythonhosted.org/packages/ad/d3/403af5f07359863c03951796ddab265ee8cce1a6147510203d0bf43950e7/watchfiles-1.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:c18f3502ad0737813c7dad70e3e1cc966cc147fbaeef47a09463bbffe70b0a00", size = 381432 },
- { url = "https://files.pythonhosted.org/packages/f6/5f/921f2f2beabaf24b1ad81ac22bb69df8dd5771fdb68d6f34a5912a420941/watchfiles-1.0.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6a5bc3ca468bb58a2ef50441f953e1f77b9a61bd1b8c347c8223403dc9b4ac9a", size = 441448 },
- { url = "https://files.pythonhosted.org/packages/63/d7/67d0d750b246f248ccdb400a85a253e93e419ea5b6cbe968fa48b97a5f30/watchfiles-1.0.3-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:0d1ec043f02ca04bf21b1b32cab155ce90c651aaf5540db8eb8ad7f7e645cba8", size = 446852 },
- { url = "https://files.pythonhosted.org/packages/53/7c/d7cd94c7d0905f1e2f1c2232ea9bc39b1a48affd007e09c547ead96edb8f/watchfiles-1.0.3-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f58d3bfafecf3d81c15d99fc0ecf4319e80ac712c77cf0ce2661c8cf8bf84066", size = 471662 },
- { url = "https://files.pythonhosted.org/packages/26/81/738f8e66f7525753996b8aa292f78dcec1ef77887d62e6cdfb04cc2f352f/watchfiles-1.0.3-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1df924ba82ae9e77340101c28d56cbaff2c991bd6fe8444a545d24075abb0a87", size = 493765 },
- { url = "https://files.pythonhosted.org/packages/d2/50/78e21f5da24ab39114e9b24f7b0945ea1c6fc7bc9ae86cd87f8eaeb47325/watchfiles-1.0.3-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:632a52dcaee44792d0965c17bdfe5dc0edad5b86d6a29e53d6ad4bf92dc0ff49", size = 490558 },
- { url = "https://files.pythonhosted.org/packages/a8/93/1873fea6354b2858eae8970991d64e9a449d87726d596490d46bf00af8ed/watchfiles-1.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:80bf4b459d94a0387617a1b499f314aa04d8a64b7a0747d15d425b8c8b151da0", size = 442808 },
- { url = "https://files.pythonhosted.org/packages/4f/b4/2fc4c92fb28b029f66d04a4d430fe929284e9ff717b04bb7a3bb8a7a5605/watchfiles-1.0.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:ca94c85911601b097d53caeeec30201736ad69a93f30d15672b967558df02885", size = 615287 },
- { url = "https://files.pythonhosted.org/packages/1e/d4/93da24db39257e440240d338b617c5153ad11d361c34108f5c0e1e0743eb/watchfiles-1.0.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:65ab1fb635476f6170b07e8e21db0424de94877e4b76b7feabfe11f9a5fc12b5", size = 612812 },
- { url = "https://files.pythonhosted.org/packages/c6/67/9fd3661c2dc0309abd6021876653d91e8b64fb279529e2cadaa3520ef3e3/watchfiles-1.0.3-cp312-cp312-win32.whl", hash = "sha256:49bc1bc26abf4f32e132652f4b3bfeec77d8f8f62f57652703ef127e85a3e38d", size = 271642 },
- { url = "https://files.pythonhosted.org/packages/ae/aa/8c887edb78cd67f5d4d6a35c3aeb46d748643ebf962163130fb1871e2ee0/watchfiles-1.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:48681c86f2cb08348631fed788a116c89c787fdf1e6381c5febafd782f6c3b44", size = 285505 },
- { url = "https://files.pythonhosted.org/packages/7b/31/d212fa6390f0e73a91913ada0b925b294a78d67794795371208baf73f0b5/watchfiles-1.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:9e080cf917b35b20c889225a13f290f2716748362f6071b859b60b8847a6aa43", size = 277263 },
- { url = "https://files.pythonhosted.org/packages/26/48/5a75b18ad40cc69ea6e0003bb748db162a3215bbe44a1293e073876d51bd/watchfiles-1.0.3-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:84fac88278f42d61c519a6c75fb5296fd56710b05bbdcc74bdf85db409a03780", size = 396233 },
- { url = "https://files.pythonhosted.org/packages/dc/b2/03ce3447a3271483b030b8bafc39be19739f9a4a23edec31c6688e8a066d/watchfiles-1.0.3-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:c68be72b1666d93b266714f2d4092d78dc53bd11cf91ed5a3c16527587a52e29", size = 386050 },
- { url = "https://files.pythonhosted.org/packages/ab/0c/38914f56a95aa6ec911bb7cee617762d93aaf5a11efecadbb698d6b0b9a2/watchfiles-1.0.3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:889a37e2acf43c377b5124166bece139b4c731b61492ab22e64d371cce0e6e80", size = 442404 },
- { url = "https://files.pythonhosted.org/packages/4d/8c/a95d3ba1ccfa33a43649668f699150cce1ea795e4300c33b4c3e974a444b/watchfiles-1.0.3-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7ca05cacf2e5c4a97d02a2878a24020daca21dbb8823b023b978210a75c79098", size = 444461 },
+sdist = { url = "https://files.pythonhosted.org/packages/ef/48/02d2d2cbf54e134810b2cb40ac79fdb8ce08476184536a4764717a7bc9f4/watchfiles-0.20.0.tar.gz", hash = "sha256:728575b6b94c90dd531514677201e8851708e6e4b5fe7028ac506a200b622019", size = 37041 }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/4d/db/899832e11fef2d468bf8b3c1c13289b1db4cb7c3410bb2a9612a52fc8b22/watchfiles-0.20.0-cp37-abi3-macosx_10_7_x86_64.whl", hash = "sha256:3796312bd3587e14926013612b23066912cf45a14af71cf2b20db1c12dadf4e9", size = 417357 },
+ { url = "https://files.pythonhosted.org/packages/9f/1a/85c914e4db62a3f8197daa98a271ea380a5d200a8d3058bd9f417752bc26/watchfiles-0.20.0-cp37-abi3-macosx_11_0_arm64.whl", hash = "sha256:d0002d81c89a662b595645fb684a371b98ff90a9c7d8f8630c82f0fde8310458", size = 407258 },
+ { url = "https://files.pythonhosted.org/packages/25/ae/b7bddad421af5e33079a2ce639aa58837b715a2da98df16e25ecd310af52/watchfiles-0.20.0-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:570848706440373b4cd8017f3e850ae17f76dbdf1e9045fc79023b11e1afe490", size = 1331327 },
+ { url = "https://files.pythonhosted.org/packages/21/e5/b080cec4e841b1cf338ccbd958cf3232ad1691a590653b2d124b5c79cf6b/watchfiles-0.20.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9a0351d20d03c6f7ad6b2e8a226a5efafb924c7755ee1e34f04c77c3682417fa", size = 1301371 },
+ { url = "https://files.pythonhosted.org/packages/05/a0/2fb2c36730995a6b3f060187195dc08ad9ceee67426bdca8a4296024071c/watchfiles-0.20.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:007dcc4a401093010b389c044e81172c8a2520dba257c88f8828b3d460c6bb38", size = 1302438 },
+ { url = "https://files.pythonhosted.org/packages/13/ea/d11971958ae703cfe443b21f672169cb8bc12dbec5781b910633fa2186ec/watchfiles-0.20.0-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0d82dbc1832da83e441d112069833eedd4cf583d983fb8dd666fbefbea9d99c0", size = 1410655 },
+ { url = "https://files.pythonhosted.org/packages/6b/81/3f922f3ede53ca9c0b4095f63688ffeea19a49592d0ac62db1eb9632b1e3/watchfiles-0.20.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:99f4c65fd2fce61a571b2a6fcf747d6868db0bef8a934e8ca235cc8533944d95", size = 1494222 },
+ { url = "https://files.pythonhosted.org/packages/e1/46/c9d5ee4871b187d291d62e61c41f9a4d67d4866a89704b0ad16b6949e9bd/watchfiles-0.20.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5392dd327a05f538c56edb1c6ebba6af91afc81b40822452342f6da54907bbdf", size = 1294171 },
+ { url = "https://files.pythonhosted.org/packages/59/5e/6b64e3bf9fd4422250f3c716d992dd76dbe55e6fa1e7ebaf2bf88f389707/watchfiles-0.20.0-cp37-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:08dc702529bb06a2b23859110c214db245455532da5eaea602921687cfcd23db", size = 1462256 },
+ { url = "https://files.pythonhosted.org/packages/11/c0/75f5a71ac24118ab11bd898e0114cedc72b25924ff2d960d473bddb4ec6e/watchfiles-0.20.0-cp37-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:7d4e66a857621584869cfbad87039e65dadd7119f0d9bb9dbc957e089e32c164", size = 1461725 },
+ { url = "https://files.pythonhosted.org/packages/91/d4/0c0fdcc4293ad1b73db54896fa0de4b37439ae4f25971b5eb1708dd04f9a/watchfiles-0.20.0-cp37-abi3-win32.whl", hash = "sha256:a03d1e6feb7966b417f43c3e3783188167fd69c2063e86bad31e62c4ea794cc5", size = 268193 },
+ { url = "https://files.pythonhosted.org/packages/87/79/098b1b1fcb6de16149d23283a2ab5dadce6a06b864e7a182d231f57a1f9e/watchfiles-0.20.0-cp37-abi3-win_amd64.whl", hash = "sha256:eccc8942bcdc7d638a01435d915b913255bbd66f018f1af051cd8afddb339ea3", size = 276723 },
+ { url = "https://files.pythonhosted.org/packages/3f/82/45dddf4f5bf8b73ba27382cebb2bb3c0ee922c7ef77d936b86276aa39dca/watchfiles-0.20.0-cp37-abi3-win_arm64.whl", hash = "sha256:b17d4176c49d207865630da5b59a91779468dd3e08692fe943064da260de2c7c", size = 265344 },
]
[[package]]