Skip to content

Commit

Permalink
feat(agents-api): Make session.render_templates true by default
Browse files Browse the repository at this point in the history
Signed-off-by: Diwank Tomer <[email protected]>
  • Loading branch information
Diwank Tomer committed Aug 10, 2024
1 parent 2d379b8 commit e4c7827
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion agents-api/agents_api/autogen/Chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import Annotated, Literal
from uuid import UUID

from pydantic import AwareDatetime, BaseModel, ConfigDict, Field
from pydantic import AwareDatetime, BaseModel, ConfigDict, Field, RootModel

from .Common import LogitBias
from .Docs import DocReference
Expand Down
2 changes: 1 addition & 1 deletion agents-api/agents_api/autogen/Entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import Annotated, Literal
from uuid import UUID

from pydantic import AnyUrl, AwareDatetime, BaseModel, ConfigDict, Field
from pydantic import AnyUrl, AwareDatetime, BaseModel, ConfigDict, Field, RootModel

from .Tools import ChosenToolCall, Tool, ToolResponse

Expand Down
8 changes: 4 additions & 4 deletions agents-api/agents_api/autogen/Sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class CreateSessionRequest(BaseModel):
"""
A specific situation that sets the background for this session
"""
render_templates: bool = False
render_templates: bool = True
"""
Render system and assistant message content as jinja templates
"""
Expand All @@ -58,7 +58,7 @@ class PatchSessionRequest(BaseModel):
"""
A specific situation that sets the background for this session
"""
render_templates: bool = False
render_templates: bool = True
"""
Render system and assistant message content as jinja templates
"""
Expand All @@ -85,7 +85,7 @@ class Session(BaseModel):
"""
Summary (null at the beginning) - generated automatically after every interaction
"""
render_templates: bool = False
render_templates: bool = True
"""
Render system and assistant message content as jinja templates
"""
Expand Down Expand Up @@ -148,7 +148,7 @@ class UpdateSessionRequest(BaseModel):
"""
A specific situation that sets the background for this session
"""
render_templates: bool = False
render_templates: bool = True
"""
Render system and assistant message content as jinja templates
"""
Expand Down
3 changes: 3 additions & 0 deletions agents-api/agents_api/routers/sessions/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@ async def chat(
session_id: UUID,
data: ChatInput,
) -> ChatResponse:
# First get the chat context
chat_context = prepare_chat_context(
developer_id=x_developer_id,
agent_id=data.agent_id,
session_id=session_id,
)

# Then, use the chat context to chat

print(chat_context)
2 changes: 1 addition & 1 deletion typespec/sessions/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ model Session {
summary: string | null = null;

/** Render system and assistant message content as jinja templates */
render_templates: boolean = false;
render_templates: boolean = true;

/** Threshold value for the adaptive context functionality */
token_budget: uint16 | null = null;
Expand Down

0 comments on commit e4c7827

Please sign in to comment.