Skip to content

Commit

Permalink
feat(agents-api,typespec): Update models for integration tools
Browse files Browse the repository at this point in the history
Signed-off-by: Diwank Singh Tomer <[email protected]>
  • Loading branch information
creatorrr committed Sep 24, 2024
1 parent a914e7c commit 6af879f
Show file tree
Hide file tree
Showing 9 changed files with 437 additions and 36 deletions.
10 changes: 10 additions & 0 deletions agents-api/agents_api/autogen/Common.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@
from pydantic import AwareDatetime, BaseModel, ConfigDict, Field, RootModel


class JinjaTemplate(RootModel[str]):
model_config = ConfigDict(
populate_by_name=True,
)
root: str
"""
A valid jinja template.
"""


class Limit(RootModel[int]):
model_config = ConfigDict(
populate_by_name=True,
Expand Down
50 changes: 50 additions & 0 deletions agents-api/agents_api/autogen/Sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ class CreateSessionRequest(BaseModel):
"""
Action to start on context window overflow
"""
forward_tool_results: Literal["auto"] | StrictBool = "auto"
"""
Whether to forward the tool results to the model when available.
"true" => always forward
"false" => never forward
"auto" => forward if applicable
If a tool call is made, the tool's output will be sent back to the model as the model's input.
If a tool call is not made, the model's output will be returned as is.
"""
metadata: dict[str, Any] | None = None


Expand Down Expand Up @@ -70,6 +80,16 @@ class PatchSessionRequest(BaseModel):
"""
Action to start on context window overflow
"""
forward_tool_results: Literal["auto"] | StrictBool = "auto"
"""
Whether to forward the tool results to the model when available.
"true" => always forward
"false" => never forward
"auto" => forward if applicable
If a tool call is made, the tool's output will be sent back to the model as the model's input.
If a tool call is not made, the model's output will be returned as is.
"""
metadata: dict[str, Any] | None = None


Expand Down Expand Up @@ -97,6 +117,16 @@ class Session(BaseModel):
"""
Action to start on context window overflow
"""
forward_tool_results: Literal["auto"] | StrictBool = "auto"
"""
Whether to forward the tool results to the model when available.
"true" => always forward
"false" => never forward
"auto" => forward if applicable
If a tool call is made, the tool's output will be sent back to the model as the model's input.
If a tool call is not made, the model's output will be returned as is.
"""
id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})]
metadata: dict[str, Any] | None = None
created_at: Annotated[AwareDatetime, Field(json_schema_extra={"readOnly": True})]
Expand Down Expand Up @@ -160,6 +190,16 @@ class UpdateSessionRequest(BaseModel):
"""
Action to start on context window overflow
"""
forward_tool_results: Literal["auto"] | StrictBool = "auto"
"""
Whether to forward the tool results to the model when available.
"true" => always forward
"false" => never forward
"auto" => forward if applicable
If a tool call is made, the tool's output will be sent back to the model as the model's input.
If a tool call is not made, the model's output will be returned as is.
"""
metadata: dict[str, Any] | None = None


Expand Down Expand Up @@ -194,6 +234,16 @@ class CreateOrUpdateSessionRequest(CreateSessionRequest):
"""
Action to start on context window overflow
"""
forward_tool_results: Literal["auto"] | StrictBool = "auto"
"""
Whether to forward the tool results to the model when available.
"true" => always forward
"false" => never forward
"auto" => forward if applicable
If a tool call is made, the tool's output will be sent back to the model as the model's input.
If a tool call is not made, the model's output will be returned as is.
"""
metadata: dict[str, Any] | None = None


Expand Down
Loading

0 comments on commit 6af879f

Please sign in to comment.