Skip to content

Add optional timestamp to SystemPromptPart #1145

Closed
@JohnUiterwyk

Description

@JohnUiterwyk

UserPromptPart, ToolReturnPart, RetryPromptPart all include a timestamp attribute.
As do TextPart, ToolCallPart.

SystemPromptPart is the only part type in the ModelRequestPart that does not have a timestamp.

There are times that we create a system prompt instance from a template, and this instantiation is done at particular point in time. There are also times when this happens in other systems, and that history is passed to our pydantic-ai service, and the timestamp is consider a required attribute as part of retaining an immutable timestamped sequence of entries related to a user/ai chat.

Can we please add

    timestamp: datetime = field(default_factory=_now_utc)

to SystemPromptPart to bring it in line with the other parts

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions