PromptHistory

PromptHistory model for the prompt app.

class smarter.apps.prompt.models.prompt_history.PromptHistory(*args, **kwargs)[source]

Bases: TimestampedModel

Prompt history model.

Parameters:
  • id (Unknown) – Primary key: ID

  • created_at (Unknown) – Created at

  • updated_at (Unknown) – Updated at

  • request (Unknown) – Request

  • response (Unknown) – Response

  • messages (Unknown) – Messages

Relationship fields:

Parameters:

prompt (Unknown) – Prompt (related name: prompthistory)

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

exception NotUpdated

Bases: ObjectNotUpdated, DatabaseError

created_at

DateTimeField

Created at

Timestamp indicating when the model instance was created.

This field is automatically set to the current date and time when the instance is first created. It is indexed in the database for efficient querying.

Type:

Type

id

BigAutoField

Primary key: ID

Type:

Type

messages

JSONField

Messages

Type:

Type

objects = <django.db.models.Manager object>
prompt

ForeignKey to Prompt

Prompt (related name: prompthistory)

Type:

Type

property prompt_history: list[dict]

Used by the Reactapp (via PromptConfigView) to display the prompt history.

prompt_id

Internal field, use prompt instead.

request

JSONField

Request

Type:

Type

response

JSONField

Response

Type:

Type

updated_at

DateTimeField

Updated at

Timestamp indicating when the model instance was last updated.

This field is automatically updated to the current date and time whenever the instance is saved. It is indexed in the database for efficient querying.

Type:

Type