chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 13:06:23 +08:00
commit ea5096c873
282 changed files with 55366 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
from litellm.types.utils import ChatCompletionMessageToolCall, Function, Message
from typing import List, Callable, Union, Optional, Tuple, Dict
# Third-party imports
from pydantic import BaseModel
AgentFunction = Callable[[], Union[str, "Agent", dict]]
class Agent(BaseModel):
name: str = "Agent"
model: str = "gpt-4o"
instructions: Union[str, Callable[[], str]] = "You are a helpful agent."
functions: List[AgentFunction] = []
tool_choice: str = None
parallel_tool_calls: bool = False
examples: Union[List[Tuple[dict, str]], Callable[[], str]] = []
handle_mm_func: Callable[[], str] = None
agent_teams: Dict[str, Callable] = {}
class Response(BaseModel):
messages: List = []
agent: Optional[Agent] = None
context_variables: dict = {}
class Result(BaseModel):
"""
Encapsulates the possible return values for an agent function.
Attributes:
value (str): The result value as a string.
agent (Agent): The agent instance, if applicable.
context_variables (dict): A dictionary of context variables.
"""
value: str = ""
agent: Optional[Agent] = None
context_variables: dict = {}
image: Optional[str] = None # base64 encoded image