Skip to content

Commit

Permalink
Merge pull request #1018 from julep-ai/x/fix-entries-timestamp
Browse files Browse the repository at this point in the history
fix(agents-api): Fix timestamp type in entries
  • Loading branch information
Ahmad-mtos authored Jan 5, 2025
2 parents 101e318 + ef99be1 commit e68ccf0
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
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 @@ -69,7 +69,7 @@ class BaseEntry(BaseModel):
"""
The tool call id of the tool call this message is a response to
"""
timestamp: Annotated[float, Field(ge=0.0)]
timestamp: AwareDatetime
"""
This is the time that this event refers to.
"""
Expand Down
2 changes: 1 addition & 1 deletion agents-api/agents_api/autogen/openapi_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ class CreateTransitionRequest(Transition):


class CreateEntryRequest(BaseEntry):
timestamp: Annotated[float, Field(ge=0.0, default_factory=lambda: utcnow().timestamp())]
timestamp: Annotated[AwareDatetime, Field(default_factory=lambda: utcnow())]

@classmethod
def from_model_input(
Expand Down
2 changes: 1 addition & 1 deletion agents-api/agents_api/queries/entries/create_entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ async def create_entries(
item.get("token_count"), # $11
select_tokenizer(item.get("model"))["type"], # $12
item.get("created_at") or utcnow(), # $13
utcnow().timestamp(), # $14
utcnow(), # $14
]
for item in data_dicts
]
Expand Down
2 changes: 1 addition & 1 deletion integrations-service/integrations/autogen/Entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class BaseEntry(BaseModel):
"""
The tool call id of the tool call this message is a response to
"""
timestamp: Annotated[float, Field(ge=0.0)]
timestamp: AwareDatetime
"""
This is the time that this event refers to.
"""
Expand Down
3 changes: 1 addition & 2 deletions typespec/entries/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ model BaseEntry {
tool_call_id?: string | null = null;

/** This is the time that this event refers to. */
@minValue(0)
timestamp: float;
timestamp: utcDateTime;
}

model Entry extends BaseEntry {
Expand Down
4 changes: 2 additions & 2 deletions typespec/tsp-output/@typespec/openapi3/openapi-1.0.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3350,8 +3350,8 @@ components:
description: The tool call id of the tool call this message is a response to
default: null
timestamp:
type: number
minimum: 0
type: string
format: date-time
description: This is the time that this event refers to.
Entries.ChatMLRole:
type: string
Expand Down

0 comments on commit e68ccf0

Please sign in to comment.