LLMClientGuardrails Model
- class smarter.apps.llmclient.models.LLMClientGuardrails(*args, **kwargs)[source]
Bases:
TimestampedModelThe Guardrails that protect a LLMClient’s prompts.
Each record links an LLMClient to a
Guardrail, as listed in the LLMClient manifest’sspec.guardrails. On each prompt, the linked, active guardrails run on the user’s message and the LLM’s reply, in order of their priority.Usage Example
LLMClientGuardrails.objects.create(llmclient=my_llmclient, guardrail=my_guardrail) guardrails = LLMClientGuardrails.guardrails_for(my_llmclient)
- Parameters:
id (Unknown) – Primary key: ID
created_at (Unknown) – Created at
updated_at (Unknown) – Updated at
Relationship fields:
- Parameters:
llmclient (Unknown) –
Llmclient (related name:
llmclientguardrails)The LLMClient that the guardrail protects.
guardrail (Unknown) – Guardrail. The Guardrail. (related name:
llmclient_guardrails)
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- exception NotUpdated
Bases:
ObjectNotUpdated,DatabaseError
- created_at
-
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
- guardrail
-
Guardrail. The Guardrail. (related name:
llmclient_guardrails)- Type:
Type
- classmethod guardrails_for(llmclient)[source]
Return the active Guardrails of a LLMClient, in order of priority and then id.
- id
-
Primary key: ID
- Type:
Type
- llmclient
-
Llmclient (related name:
llmclientguardrails)The LLMClient that the guardrail protects.
- Type:
Type
- objects = <django.db.models.Manager object>
- updated_at
-
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