PromptToolCall

PromptToolCall model for the prompt app.

class smarter.apps.prompt.models.prompt_tool_call.PromptToolCall(*args, **kwargs)[source]

Bases: TimestampedModel

Prompt tool call history model.

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

  • created_at (Unknown) – Created at

  • updated_at (Unknown) – Updated at

  • function_name (Unknown) – Function name

  • function_args (Unknown) – Function args

  • request (Unknown) – Request

  • response (Unknown) – Response

Relationship fields:

Parameters:
  • prompt (Unknown) – Prompt (related name: prompttoolcall)

  • plugin (Unknown) – Plugin (related name: prompttoolcall)

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

function_args

CharField

Function args

Type:

Type

function_name

CharField

Function name

Type:

Type

classmethod get_cached_object(*args, invalidate=False, pk=None, **kwargs)[source]

Get the PromptToolCall instance for the given primary key from the cache.

This method retrieves the PromptToolCall instance associated with the given primary key from the cache. If the instance is not found in the cache, it attempts to retrieve it from the database. If it still cannot be found, it returns None.

Parameters:
  • invalidate (Optional[bool]) – Whether to invalidate the cache before retrieving the object.

  • pk (Optional[int]) – The primary key of the PromptToolCall instance to retrieve.

Returns:

The PromptToolCall instance associated with the given primary key, or None if not found.

Return type:

Optional[PromptToolCall]

id

BigAutoField

Primary key: ID

Type:

Type

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

ForeignKey to PluginMeta

Plugin (related name: prompttoolcall)

Type:

Type

plugin_id

Internal field, use plugin instead.

prompt

ForeignKey to Prompt

Prompt (related name: prompttoolcall)

Type:

Type

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