Assistance - applebiter/gnatwriter GitHub Wiki

The Assistance class represents an assistance request from the user to an Ollama language model.

Attributes

The attributes that are mapped to the assistances table in the database:

  • id: int The Assistance ID
  • user_id: int The User ID of the system user or the user currently logged in
  • session_uuid: str The UUID of the session to be used when making the request. If other messages in the database have the same session_uuid value, they will be loaded in order of their creation date, and the assistant will continue from the last message in the session.
  • assistant: str The assistant to be used when making the request
  • model: str The language model to be used when making the request
  • priming: str The priming to be used when making the request. "Priming" refers to preparing the model for the user input with a prefacing suggestion or instruction.
  • prompt: str The prompt to be used when making the request
  • temperature: float The temperature to be used when making the request. This is a value between 0 and 1. The lower the value, the more conservative the response. The higher the value, the more imaginative the response. A value of 0 can be used with a specific seed value to create reproducible results.
  • seed: int The seed to be used when making the request. This value is only useful when the temperature value is 0.
  • content: str The language model's response to the prompt
  • done: bool This value is always going to be True, unless I change the methods to save the request data even if the request fails.
  • total_duration: int The total duration of the assistance request, measured in nanoseconds
  • load_duration: int The duration of the load time of the language model, measured in nanoseconds
  • prompt_eval_count: int The number of prompt evaluations made by the language model during the request
  • prompt_eval_duration: int The duration of prompt evaluations, measured in nanoseconds
  • eval_count: int The number of all evaluations
  • eval_duration: int The duration of all of the evaluations by the language model, measured in nanoseconds
  • created: str The value is actually a Python Datetime object except during input or output

The complex attributes supplied by the ORM:

  • user: User The User class is associated with the users table in the database.

serialize()

serialize ( ) -> dict Only the attributes mapped to the assistances table will be present in the returned dictionary.