Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions agents-api/agents_api/autogen/Agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ class Agent(BaseModel):
"""
Default settings for all sessions created by this agent
"""
default_system_template: str = '{%- if agent.name -%}\nYou are {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if agent.about -%}\nAbout you: {{agent.about}}.{{" "}}\n{%- endif -%}\n\n{%- if user -%}\nYou are talking to a user\n {%- if user.name -%}{{" "}} and their name is {{user.name}}\n {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%}\n {%- endif -%}\n{%- endif -%}\n\n{{NEWLINE}}\n\n{%- if session.situation -%}\nSituation: {{session.situation}}\n{%- endif -%}\n\n{{NEWLINE+NEWLINE}}\n\n{%- if agent.instructions -%}\nInstructions:{{NEWLINE}}\n {%- if agent.instructions is string -%}\n {{agent.instructions}}{{NEWLINE}}\n {%- else -%}\n {%- for instruction in agent.instructions -%}\n - {{instruction}}{{NEWLINE}}\n {%- endfor -%}\n {%- endif -%}\n {{NEWLINE}}\n{%- endif -%}\n\n{%- if docs -%}\nRelevant documents:{{NEWLINE}}\n {%- for doc in docs -%}\n {{doc.title}}{{NEWLINE}}\n {%- if doc.content is string -%}\n {{doc.content}}{{NEWLINE}}\n {%- else -%}\n {%- for snippet in doc.content -%}\n {{snippet}}{{NEWLINE}}\n {%- endfor -%}\n {%- endif -%}\n {{"---"}}\n {%- endfor -%}\n{%- endif -%}'
default_system_template: str = (
'{%- if agent.name -%}\nYou are {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if agent.about -%}\nAbout you: {{agent.about}}.{{" "}}\n{%- endif -%}\n\n{%- if user -%}\nYou are talking to a user\n {%- if user.name -%}{{" "}} and their name is {{user.name}}\n {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%}\n {%- endif -%}\n{%- endif -%}\n\n{{NEWLINE}}\n\n{%- if session.situation -%}\nSituation: {{session.situation}}\n{%- endif -%}\n\n{{NEWLINE+NEWLINE}}\n\n{%- if agent.instructions -%}\nInstructions:{{NEWLINE}}\n {%- if agent.instructions is string -%}\n {{agent.instructions}}{{NEWLINE}}\n {%- else -%}\n {%- for instruction in agent.instructions -%}\n - {{instruction}}{{NEWLINE}}\n {%- endfor -%}\n {%- endif -%}\n {{NEWLINE}}\n{%- endif -%}\n\n{%- if docs -%}\nRelevant documents:{{NEWLINE}}\n {%- for doc in docs -%}\n {{doc.title}}{{NEWLINE}}\n {%- if doc.content is string -%}\n {{doc.content}}{{NEWLINE}}\n {%- else -%}\n {%- for snippet in doc.content -%}\n {{snippet}}{{NEWLINE}}\n {%- endfor -%}\n {%- endif -%}\n {{"---"}}\n {%- endfor -%}\n{%- endif -%}'
)
"""
Default system template for all sessions created by this agent
"""
Expand Down Expand Up @@ -106,7 +108,9 @@ class CreateAgentRequest(BaseModel):
"""
Default settings for all sessions created by this agent
"""
default_system_template: str = '{%- if agent.name -%}\nYou are {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if agent.about -%}\nAbout you: {{agent.about}}.{{" "}}\n{%- endif -%}\n\n{%- if user -%}\nYou are talking to a user\n {%- if user.name -%}{{" "}} and their name is {{user.name}}\n {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%}\n {%- endif -%}\n{%- endif -%}\n\n{{NEWLINE}}\n\n{%- if session.situation -%}\nSituation: {{session.situation}}\n{%- endif -%}\n\n{{NEWLINE+NEWLINE}}\n\n{%- if agent.instructions -%}\nInstructions:{{NEWLINE}}\n {%- if agent.instructions is string -%}\n {{agent.instructions}}{{NEWLINE}}\n {%- else -%}\n {%- for instruction in agent.instructions -%}\n - {{instruction}}{{NEWLINE}}\n {%- endfor -%}\n {%- endif -%}\n {{NEWLINE}}\n{%- endif -%}\n\n{%- if docs -%}\nRelevant documents:{{NEWLINE}}\n {%- for doc in docs -%}\n {{doc.title}}{{NEWLINE}}\n {%- if doc.content is string -%}\n {{doc.content}}{{NEWLINE}}\n {%- else -%}\n {%- for snippet in doc.content -%}\n {{snippet}}{{NEWLINE}}\n {%- endfor -%}\n {%- endif -%}\n {{"---"}}\n {%- endfor -%}\n{%- endif -%}'
default_system_template: str = (
'{%- if agent.name -%}\nYou are {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if agent.about -%}\nAbout you: {{agent.about}}.{{" "}}\n{%- endif -%}\n\n{%- if user -%}\nYou are talking to a user\n {%- if user.name -%}{{" "}} and their name is {{user.name}}\n {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%}\n {%- endif -%}\n{%- endif -%}\n\n{{NEWLINE}}\n\n{%- if session.situation -%}\nSituation: {{session.situation}}\n{%- endif -%}\n\n{{NEWLINE+NEWLINE}}\n\n{%- if agent.instructions -%}\nInstructions:{{NEWLINE}}\n {%- if agent.instructions is string -%}\n {{agent.instructions}}{{NEWLINE}}\n {%- else -%}\n {%- for instruction in agent.instructions -%}\n - {{instruction}}{{NEWLINE}}\n {%- endfor -%}\n {%- endif -%}\n {{NEWLINE}}\n{%- endif -%}\n\n{%- if docs -%}\nRelevant documents:{{NEWLINE}}\n {%- for doc in docs -%}\n {{doc.title}}{{NEWLINE}}\n {%- if doc.content is string -%}\n {{doc.content}}{{NEWLINE}}\n {%- else -%}\n {%- for snippet in doc.content -%}\n {{snippet}}{{NEWLINE}}\n {%- endfor -%}\n {%- endif -%}\n {{"---"}}\n {%- endfor -%}\n{%- endif -%}'
)
"""
Default system template for all sessions created by this agent
"""
Expand Down Expand Up @@ -152,7 +156,9 @@ class CreateOrUpdateAgentRequest(CreateAgentRequest):
"""
Default settings for all sessions created by this agent
"""
default_system_template: str = '{%- if agent.name -%}\nYou are {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if agent.about -%}\nAbout you: {{agent.about}}.{{" "}}\n{%- endif -%}\n\n{%- if user -%}\nYou are talking to a user\n {%- if user.name -%}{{" "}} and their name is {{user.name}}\n {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%}\n {%- endif -%}\n{%- endif -%}\n\n{{NEWLINE}}\n\n{%- if session.situation -%}\nSituation: {{session.situation}}\n{%- endif -%}\n\n{{NEWLINE+NEWLINE}}\n\n{%- if agent.instructions -%}\nInstructions:{{NEWLINE}}\n {%- if agent.instructions is string -%}\n {{agent.instructions}}{{NEWLINE}}\n {%- else -%}\n {%- for instruction in agent.instructions -%}\n - {{instruction}}{{NEWLINE}}\n {%- endfor -%}\n {%- endif -%}\n {{NEWLINE}}\n{%- endif -%}\n\n{%- if docs -%}\nRelevant documents:{{NEWLINE}}\n {%- for doc in docs -%}\n {{doc.title}}{{NEWLINE}}\n {%- if doc.content is string -%}\n {{doc.content}}{{NEWLINE}}\n {%- else -%}\n {%- for snippet in doc.content -%}\n {{snippet}}{{NEWLINE}}\n {%- endfor -%}\n {%- endif -%}\n {{"---"}}\n {%- endfor -%}\n{%- endif -%}'
default_system_template: str = (
'{%- if agent.name -%}\nYou are {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if agent.about -%}\nAbout you: {{agent.about}}.{{" "}}\n{%- endif -%}\n\n{%- if user -%}\nYou are talking to a user\n {%- if user.name -%}{{" "}} and their name is {{user.name}}\n {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%}\n {%- endif -%}\n{%- endif -%}\n\n{{NEWLINE}}\n\n{%- if session.situation -%}\nSituation: {{session.situation}}\n{%- endif -%}\n\n{{NEWLINE+NEWLINE}}\n\n{%- if agent.instructions -%}\nInstructions:{{NEWLINE}}\n {%- if agent.instructions is string -%}\n {{agent.instructions}}{{NEWLINE}}\n {%- else -%}\n {%- for instruction in agent.instructions -%}\n - {{instruction}}{{NEWLINE}}\n {%- endfor -%}\n {%- endif -%}\n {{NEWLINE}}\n{%- endif -%}\n\n{%- if docs -%}\nRelevant documents:{{NEWLINE}}\n {%- for doc in docs -%}\n {{doc.title}}{{NEWLINE}}\n {%- if doc.content is string -%}\n {{doc.content}}{{NEWLINE}}\n {%- else -%}\n {%- for snippet in doc.content -%}\n {{snippet}}{{NEWLINE}}\n {%- endfor -%}\n {%- endif -%}\n {{"---"}}\n {%- endfor -%}\n{%- endif -%}'
)
"""
Default system template for all sessions created by this agent
"""
Expand Down Expand Up @@ -229,7 +235,9 @@ class PatchAgentRequest(BaseModel):
"""
Default settings for all sessions created by this agent
"""
default_system_template: str = '{%- if agent.name -%}\nYou are {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if agent.about -%}\nAbout you: {{agent.about}}.{{" "}}\n{%- endif -%}\n\n{%- if user -%}\nYou are talking to a user\n {%- if user.name -%}{{" "}} and their name is {{user.name}}\n {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%}\n {%- endif -%}\n{%- endif -%}\n\n{{NEWLINE}}\n\n{%- if session.situation -%}\nSituation: {{session.situation}}\n{%- endif -%}\n\n{{NEWLINE+NEWLINE}}\n\n{%- if agent.instructions -%}\nInstructions:{{NEWLINE}}\n {%- if agent.instructions is string -%}\n {{agent.instructions}}{{NEWLINE}}\n {%- else -%}\n {%- for instruction in agent.instructions -%}\n - {{instruction}}{{NEWLINE}}\n {%- endfor -%}\n {%- endif -%}\n {{NEWLINE}}\n{%- endif -%}\n\n{%- if docs -%}\nRelevant documents:{{NEWLINE}}\n {%- for doc in docs -%}\n {{doc.title}}{{NEWLINE}}\n {%- if doc.content is string -%}\n {{doc.content}}{{NEWLINE}}\n {%- else -%}\n {%- for snippet in doc.content -%}\n {{snippet}}{{NEWLINE}}\n {%- endfor -%}\n {%- endif -%}\n {{"---"}}\n {%- endfor -%}\n{%- endif -%}'
default_system_template: str = (
'{%- if agent.name -%}\nYou are {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if agent.about -%}\nAbout you: {{agent.about}}.{{" "}}\n{%- endif -%}\n\n{%- if user -%}\nYou are talking to a user\n {%- if user.name -%}{{" "}} and their name is {{user.name}}\n {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%}\n {%- endif -%}\n{%- endif -%}\n\n{{NEWLINE}}\n\n{%- if session.situation -%}\nSituation: {{session.situation}}\n{%- endif -%}\n\n{{NEWLINE+NEWLINE}}\n\n{%- if agent.instructions -%}\nInstructions:{{NEWLINE}}\n {%- if agent.instructions is string -%}\n {{agent.instructions}}{{NEWLINE}}\n {%- else -%}\n {%- for instruction in agent.instructions -%}\n - {{instruction}}{{NEWLINE}}\n {%- endfor -%}\n {%- endif -%}\n {{NEWLINE}}\n{%- endif -%}\n\n{%- if docs -%}\nRelevant documents:{{NEWLINE}}\n {%- for doc in docs -%}\n {{doc.title}}{{NEWLINE}}\n {%- if doc.content is string -%}\n {{doc.content}}{{NEWLINE}}\n {%- else -%}\n {%- for snippet in doc.content -%}\n {{snippet}}{{NEWLINE}}\n {%- endfor -%}\n {%- endif -%}\n {{"---"}}\n {%- endfor -%}\n{%- endif -%}'
)
"""
Default system template for all sessions created by this agent
"""
Expand Down Expand Up @@ -278,7 +286,9 @@ class UpdateAgentRequest(BaseModel):
"""
Default settings for all sessions created by this agent
"""
default_system_template: str = '{%- if agent.name -%}\nYou are {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if agent.about -%}\nAbout you: {{agent.about}}.{{" "}}\n{%- endif -%}\n\n{%- if user -%}\nYou are talking to a user\n {%- if user.name -%}{{" "}} and their name is {{user.name}}\n {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%}\n {%- endif -%}\n{%- endif -%}\n\n{{NEWLINE}}\n\n{%- if session.situation -%}\nSituation: {{session.situation}}\n{%- endif -%}\n\n{{NEWLINE+NEWLINE}}\n\n{%- if agent.instructions -%}\nInstructions:{{NEWLINE}}\n {%- if agent.instructions is string -%}\n {{agent.instructions}}{{NEWLINE}}\n {%- else -%}\n {%- for instruction in agent.instructions -%}\n - {{instruction}}{{NEWLINE}}\n {%- endfor -%}\n {%- endif -%}\n {{NEWLINE}}\n{%- endif -%}\n\n{%- if docs -%}\nRelevant documents:{{NEWLINE}}\n {%- for doc in docs -%}\n {{doc.title}}{{NEWLINE}}\n {%- if doc.content is string -%}\n {{doc.content}}{{NEWLINE}}\n {%- else -%}\n {%- for snippet in doc.content -%}\n {{snippet}}{{NEWLINE}}\n {%- endfor -%}\n {%- endif -%}\n {{"---"}}\n {%- endfor -%}\n{%- endif -%}'
default_system_template: str = (
'{%- if agent.name -%}\nYou are {{agent.name}}.{{" "}}\n{%- endif -%}\n\n{%- if agent.about -%}\nAbout you: {{agent.about}}.{{" "}}\n{%- endif -%}\n\n{%- if user -%}\nYou are talking to a user\n {%- if user.name -%}{{" "}} and their name is {{user.name}}\n {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%}\n {%- endif -%}\n{%- endif -%}\n\n{{NEWLINE}}\n\n{%- if session.situation -%}\nSituation: {{session.situation}}\n{%- endif -%}\n\n{{NEWLINE+NEWLINE}}\n\n{%- if agent.instructions -%}\nInstructions:{{NEWLINE}}\n {%- if agent.instructions is string -%}\n {{agent.instructions}}{{NEWLINE}}\n {%- else -%}\n {%- for instruction in agent.instructions -%}\n - {{instruction}}{{NEWLINE}}\n {%- endfor -%}\n {%- endif -%}\n {{NEWLINE}}\n{%- endif -%}\n\n{%- if docs -%}\nRelevant documents:{{NEWLINE}}\n {%- for doc in docs -%}\n {{doc.title}}{{NEWLINE}}\n {%- if doc.content is string -%}\n {{doc.content}}{{NEWLINE}}\n {%- else -%}\n {%- for snippet in doc.content -%}\n {{snippet}}{{NEWLINE}}\n {%- endfor -%}\n {%- endif -%}\n {{"---"}}\n {%- endfor -%}\n{%- endif -%}'
)
"""
Default system template for all sessions created by this agent
"""
32 changes: 21 additions & 11 deletions agents-api/agents_api/autogen/Chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ class BaseChatResponse(BaseModel):
"""
Background job IDs that may have been spawned from this interaction.
"""
docs: Annotated[list[DocReference], Field(json_schema_extra={"readOnly": True})] = []
docs: Annotated[list[DocReference], Field(json_schema_extra={"readOnly": True})] = (
[]
)
"""
Documents referenced for this request (for citation purposes).
"""
Expand Down Expand Up @@ -132,15 +134,21 @@ class CompletionUsage(BaseModel):
model_config = ConfigDict(
populate_by_name=True,
)
completion_tokens: Annotated[int | None, Field(json_schema_extra={"readOnly": True})] = None
completion_tokens: Annotated[
int | None, Field(json_schema_extra={"readOnly": True})
] = None
"""
Number of tokens in the generated completion
"""
prompt_tokens: Annotated[int | None, Field(json_schema_extra={"readOnly": True})] = None
prompt_tokens: Annotated[
int | None, Field(json_schema_extra={"readOnly": True})
] = None
"""
Number of tokens in the prompt
"""
total_tokens: Annotated[int | None, Field(json_schema_extra={"readOnly": True})] = None
total_tokens: Annotated[int | None, Field(json_schema_extra={"readOnly": True})] = (
None
)
"""
Total number of tokens used in the request (prompt + completion)
"""
Expand Down Expand Up @@ -421,9 +429,9 @@ class MessageModel(BaseModel):
"""
Tool calls generated by the model.
"""
created_at: Annotated[AwareDatetime | None, Field(json_schema_extra={"readOnly": True})] = (
None
)
created_at: Annotated[
AwareDatetime | None, Field(json_schema_extra={"readOnly": True})
] = None
"""
When this resource was created as UTC date-time
"""
Expand All @@ -447,7 +455,9 @@ class RenderResponse(ChatInputData):
model_config = ConfigDict(
populate_by_name=True,
)
docs: Annotated[list[DocReference], Field(json_schema_extra={"readOnly": True})] = []
docs: Annotated[list[DocReference], Field(json_schema_extra={"readOnly": True})] = (
[]
)
"""
Documents referenced for this request (for citation purposes).
"""
Expand Down Expand Up @@ -556,9 +566,9 @@ class ChatInput(ChatInputData):
"""
Modify the likelihood of specified tokens appearing in the completion
"""
response_format: SimpleCompletionResponseFormat | SchemaCompletionResponseFormat | None = (
None
)
response_format: (
SimpleCompletionResponseFormat | SchemaCompletionResponseFormat | None
) = None
"""
Response format (set to `json_object` to restrict output to JSON)
"""
Expand Down
10 changes: 6 additions & 4 deletions agents-api/agents_api/autogen/Docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,15 @@ class Doc(BaseModel):
"""
Language of the document
"""
embedding_model: Annotated[str | None, Field(json_schema_extra={"readOnly": True})] = None
embedding_model: Annotated[
str | None, Field(json_schema_extra={"readOnly": True})
] = None
"""
Embedding model used for the document
"""
embedding_dimensions: Annotated[int | None, Field(json_schema_extra={"readOnly": True})] = (
None
)
embedding_dimensions: Annotated[
int | None, Field(json_schema_extra={"readOnly": True})
] = None
"""
Dimensions of the embedding model
"""
Expand Down
4 changes: 3 additions & 1 deletion agents-api/agents_api/autogen/Executions.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@ class Transition(TransitionEvent):
)
execution_id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})]
current: Annotated[TransitionTarget, Field(json_schema_extra={"readOnly": True})]
next: Annotated[TransitionTarget | None, Field(json_schema_extra={"readOnly": True})]
next: Annotated[
TransitionTarget | None, Field(json_schema_extra={"readOnly": True})
]
step_label: Annotated[
str | None,
Field(
Expand Down
16 changes: 14 additions & 2 deletions agents-api/agents_api/autogen/Files.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ class CreateFileRequest(BaseModel):
"""
Description of the file
"""
mime_type: str | None = None
mime_type: Annotated[
str | None,
Field(
max_length=120,
pattern="^(application|audio|font|example|image|message|model|multipart|text|video|x-(?:[0-9A-Za-z!#$%&'*+.^_`|~-]+))\\/([0-9A-Za-z!#$%&'*+.^_`|~-]+)$",
),
] = None
"""
MIME type of the file
"""
Expand Down Expand Up @@ -71,7 +77,13 @@ class File(BaseModel):
"""
Description of the file
"""
mime_type: str | None = None
mime_type: Annotated[
str | None,
Field(
max_length=120,
pattern="^(application|audio|font|example|image|message|model|multipart|text|video|x-(?:[0-9A-Za-z!#$%&'*+.^_`|~-]+))\\/([0-9A-Za-z!#$%&'*+.^_`|~-]+)$",
),
] = None
"""
MIME type of the file
"""
Expand Down
14 changes: 10 additions & 4 deletions agents-api/agents_api/autogen/Responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ class ComputerToolCall(BaseModel):
"""
An identifier used when responding to the tool call with output.
"""
action: Click | DoubleClick | Drag | KeyPress | Move | Screenshot | Scroll | Type | Wait
action: (
Click | DoubleClick | Drag | KeyPress | Move | Screenshot | Scroll | Type | Wait
)
"""
The action to perform.
"""
Expand Down Expand Up @@ -226,7 +228,9 @@ class CreateResponse(BaseModel):
reasoning: Reasoning | None = None
text: Text | None = None
tool_choice: Literal["auto", "none"] | ToolChoice | None = None
tools: list[FunctionTool | WebSearchTool | FileSearchTool | ComputerTool] | None = None
tools: list[FunctionTool | WebSearchTool | FileSearchTool | ComputerTool] | None = (
None
)
truncation: Literal["disabled", "auto"] | None = None
metadata: dict[str, Any] | None = None

Expand Down Expand Up @@ -713,7 +717,9 @@ class Response(BaseModel):
store: StrictBool = True
temperature: float = 1
text: Text | None = None
tool_choice: ToolChoiceTypes | ToolChoiceFunction | Literal["auto", "none", "required"]
tool_choice: (
ToolChoiceTypes | ToolChoiceFunction | Literal["auto", "none", "required"]
)
tools: list[FunctionTool | WebSearchTool | FileSearchTool | ComputerTool]
top_p: float = 1
truncation: Literal["disabled", "auto"]
Expand Down Expand Up @@ -922,7 +928,7 @@ class ToolChoiceTypes(BaseModel):

Allowed values are:
- `file_search`
- `web_search_preview`
- `web_search_preview`
- `computer_use_preview`
"""

Expand Down
Loading
Loading