Documentation
¶
Overview ¶
Package checks uses the GCP Checks API to check LLM inputs and outputs against policies.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Checker ¶
type Checker struct {
// contains filtered or unexported fields
}
A Checker is an implementation of llm.PolicyChecker that uses the GCP Checks API.
func New ¶
func New(ctx context.Context, lg *slog.Logger, gcpproject string, policies []*llm.PolicyConfig) (*Checker, error)
New returns a new Checker. gcpproject is the GCP project to use when connecting to the GCP Checks API. policies are the policies to apply in calls to Checker.CheckText.
func (*Checker) CheckText ¶
func (c *Checker) CheckText(ctx context.Context, text string, prompt ...llm.Part) ([]*llm.PolicyResult, error)
Implements llm.PolicyChecker.CheckText.
func (*Checker) Policies ¶
func (c *Checker) Policies() []*llm.PolicyConfig
Implements llm.PolicyChecker.Policies.
type ClassifyContentRequest ¶
type ClassifyContentRequest = gcpchecks.GoogleChecksAisafetyV1alphaClassifyContentRequest
Shorthands for gcpchecks types.
type ClassifyContentResponse ¶
type ClassifyContentResponse = gcpchecks.GoogleChecksAisafetyV1alphaClassifyContentResponse
Shorthands for gcpchecks types.
type InputContent ¶
type InputContent = gcpchecks.GoogleChecksAisafetyV1alphaClassifyContentRequestInputContent
Shorthands for gcpchecks types.
type PolicyConfig ¶
type PolicyConfig = gcpchecks.GoogleChecksAisafetyV1alphaClassifyContentRequestPolicyConfig
Shorthands for gcpchecks types.
type RequestContext ¶
type RequestContext = gcpchecks.GoogleChecksAisafetyV1alphaClassifyContentRequestContext
Shorthands for gcpchecks types.
type TextInput ¶
type TextInput = gcpchecks.GoogleChecksAisafetyV1alphaTextInput
Shorthands for gcpchecks types.
Click to show internal directories.
Click to hide internal directories.