ai

package
v1.19.0-beta2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UpstreamSpec_VertexAI_Publisher_name = map[int32]string{
		0: "GOOGLE",
	}
	UpstreamSpec_VertexAI_Publisher_value = map[string]int32{
		"GOOGLE": 0,
	}
)

Enum value maps for UpstreamSpec_VertexAI_Publisher.

View Source
var (
	RouteSettings_RouteType_name = map[int32]string{
		0: "CHAT",
		1: "CHAT_STREAMING",
	}
	RouteSettings_RouteType_value = map[string]int32{
		"CHAT":           0,
		"CHAT_STREAMING": 1,
	}
)

Enum value maps for RouteSettings_RouteType.

View Source
var (
	SemanticCache_Mode_name = map[int32]string{
		0: "READ_WRITE",
		1: "READ_ONLY",
	}
	SemanticCache_Mode_value = map[string]int32{
		"READ_WRITE": 0,
		"READ_ONLY":  1,
	}
)

Enum value maps for SemanticCache_Mode.

View Source
var (
	AIPromptGuard_Regex_BuiltIn_name = map[int32]string{
		0: "SSN",
		1: "CREDIT_CARD",
		2: "PHONE_NUMBER",
		3: "EMAIL",
	}
	AIPromptGuard_Regex_BuiltIn_value = map[string]int32{
		"SSN":          0,
		"CREDIT_CARD":  1,
		"PHONE_NUMBER": 2,
		"EMAIL":        3,
	}
)

Enum value maps for AIPromptGuard_Regex_BuiltIn.

View Source
var (
	AIPromptGuard_Regex_Action_name = map[int32]string{
		0: "MASK",
		1: "REJECT",
	}
	AIPromptGuard_Regex_Action_value = map[string]int32{
		"MASK":   0,
		"REJECT": 1,
	}
)

Enum value maps for AIPromptGuard_Regex_Action.

View Source
var (
	AIPromptGuard_Webhook_HeaderMatch_MatchType_name = map[int32]string{
		0: "EXACT",
		1: "PREFIX",
		2: "SUFFIX",
		3: "CONTAINS",
		4: "regex",
	}
	AIPromptGuard_Webhook_HeaderMatch_MatchType_value = map[string]int32{
		"EXACT":    0,
		"PREFIX":   1,
		"SUFFIX":   2,
		"CONTAINS": 3,
		"regex":    4,
	}
)

Enum value maps for AIPromptGuard_Webhook_HeaderMatch_MatchType.

View Source
var File_github_com_solo_io_gloo_projects_gloo_api_v1_enterprise_options_ai_ai_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type AIPromptEnrichment

type AIPromptEnrichment struct {

	// A list of messages to be prepended to the prompt sent by the client.
	Prepend []*AIPromptEnrichment_Message `protobuf:"bytes,2,rep,name=prepend,proto3" json:"prepend,omitempty"`
	// A list of messages to be appended to the prompt sent by the client.
	Append []*AIPromptEnrichment_Message `protobuf:"bytes,3,rep,name=append,proto3" json:"append,omitempty"`
	// contains filtered or unexported fields
}

Enrich requests sent to the LLM provider by appending and prepending system prompts. This can be configured only for LLM providers that use the CHAT API type.

Prompt enrichment allows you to add additional context to the prompt before sending it to the model. Unlike RAG or other dynamic context methods, prompt enrichment is static and is applied to every request.

**Note**: Some providers, including Anthropic, do not support SYSTEM role messages, and instead have a dedicated system field in the input JSON. In this case, use the [`defaults` setting](#fielddefault) to set the system field.

The following example prepends a system prompt of `Answer all questions in French.` and appends `Describe the painting as if you were a famous art critic from the 17th century.` to each request that is sent to the `openai` HTTPRoute. ```yaml apiVersion: gateway.solo.io/v1 kind: RouteOption metadata:

name: openai-opt
namespace: gloo-system

spec:

targetRefs:
- group: gateway.networking.k8s.io
  kind: HTTPRoute
  name: openai
options:
  ai:
    promptEnrichment:
      prepend:
      - role: SYSTEM
        content: "Answer all questions in French."
      append:
      - role: USER
        content: "Describe the painting as if you were a famous art critic from the 17th century."

```

func (*AIPromptEnrichment) Clone

func (m *AIPromptEnrichment) Clone() proto.Message

Clone function

func (*AIPromptEnrichment) Descriptor deprecated

func (*AIPromptEnrichment) Descriptor() ([]byte, []int)

Deprecated: Use AIPromptEnrichment.ProtoReflect.Descriptor instead.

func (*AIPromptEnrichment) Equal

func (m *AIPromptEnrichment) Equal(that interface{}) bool

Equal function

func (*AIPromptEnrichment) GetAppend

func (*AIPromptEnrichment) GetPrepend

func (*AIPromptEnrichment) Hash deprecated

func (m *AIPromptEnrichment) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*AIPromptEnrichment) HashUnique

func (m *AIPromptEnrichment) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*AIPromptEnrichment) ProtoMessage

func (*AIPromptEnrichment) ProtoMessage()

func (*AIPromptEnrichment) ProtoReflect

func (x *AIPromptEnrichment) ProtoReflect() protoreflect.Message

func (*AIPromptEnrichment) Reset

func (x *AIPromptEnrichment) Reset()

func (*AIPromptEnrichment) String

func (x *AIPromptEnrichment) String() string

type AIPromptEnrichment_Message

type AIPromptEnrichment_Message struct {

	// Role of the message. The available roles depend on the backend
	// LLM provider model, such as `SYSTEM` or `USER` in the OpenAI API.
	Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"`
	// String content of the message.
	Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
	// contains filtered or unexported fields
}

An entry for a message to prepend or append to each prompt.

func (*AIPromptEnrichment_Message) Clone

Clone function

func (*AIPromptEnrichment_Message) Descriptor deprecated

func (*AIPromptEnrichment_Message) Descriptor() ([]byte, []int)

Deprecated: Use AIPromptEnrichment_Message.ProtoReflect.Descriptor instead.

func (*AIPromptEnrichment_Message) Equal

func (m *AIPromptEnrichment_Message) Equal(that interface{}) bool

Equal function

func (*AIPromptEnrichment_Message) GetContent

func (x *AIPromptEnrichment_Message) GetContent() string

func (*AIPromptEnrichment_Message) GetRole

func (x *AIPromptEnrichment_Message) GetRole() string

func (*AIPromptEnrichment_Message) Hash deprecated

func (m *AIPromptEnrichment_Message) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*AIPromptEnrichment_Message) HashUnique

func (m *AIPromptEnrichment_Message) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*AIPromptEnrichment_Message) ProtoMessage

func (*AIPromptEnrichment_Message) ProtoMessage()

func (*AIPromptEnrichment_Message) ProtoReflect

func (*AIPromptEnrichment_Message) Reset

func (x *AIPromptEnrichment_Message) Reset()

func (*AIPromptEnrichment_Message) String

func (x *AIPromptEnrichment_Message) String() string

type AIPromptGuard

type AIPromptGuard struct {

	// Prompt guards to apply to requests sent by the client.
	Request *AIPromptGuard_Request `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"`
	// Prompt guards to apply to responses returned by the LLM provider.
	Response *AIPromptGuard_Response `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"`
	// contains filtered or unexported fields
}

Set up prompt guards to block unwanted requests to the LLM provider and mask sensitive data. Prompt guards can be used to reject requests based on the content of the prompt, as well as mask responses based on the content of the response.

This example rejects any request prompts that contain the string "credit card", and masks any credit card numbers in the response. ```yaml promptGuard:

request:
  customResponse:
    message: "Rejected due to inappropriate content"
  regex:
    action: REJECT
    matches:
    - pattern: "credit card"
      name: "CC"
response:
  regex:
    builtins:
    - CREDIT_CARD
    action: MASK

```

func (*AIPromptGuard) Clone

func (m *AIPromptGuard) Clone() proto.Message

Clone function

func (*AIPromptGuard) Descriptor deprecated

func (*AIPromptGuard) Descriptor() ([]byte, []int)

Deprecated: Use AIPromptGuard.ProtoReflect.Descriptor instead.

func (*AIPromptGuard) Equal

func (m *AIPromptGuard) Equal(that interface{}) bool

Equal function

func (*AIPromptGuard) GetRequest

func (x *AIPromptGuard) GetRequest() *AIPromptGuard_Request

func (*AIPromptGuard) GetResponse

func (x *AIPromptGuard) GetResponse() *AIPromptGuard_Response

func (*AIPromptGuard) Hash deprecated

func (m *AIPromptGuard) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*AIPromptGuard) HashUnique

func (m *AIPromptGuard) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*AIPromptGuard) ProtoMessage

func (*AIPromptGuard) ProtoMessage()

func (*AIPromptGuard) ProtoReflect

func (x *AIPromptGuard) ProtoReflect() protoreflect.Message

func (*AIPromptGuard) Reset

func (x *AIPromptGuard) Reset()

func (*AIPromptGuard) String

func (x *AIPromptGuard) String() string

type AIPromptGuard_Moderation

type AIPromptGuard_Moderation struct {

	// Pass prompt data through an external moderation model endpoint,
	// which compares the request prompt input to predefined content rules.
	//
	// Types that are assignable to Moderation:
	//
	//	*AIPromptGuard_Moderation_Openai
	Moderation isAIPromptGuard_Moderation_Moderation `protobuf_oneof:"moderation"`
	// contains filtered or unexported fields
}

Pass prompt data through an external moderation model endpoint, which compares the request prompt input to predefined content rules. Any requests that are routed through Gloo AI Gateway pass through the moderation model that you specify. If the content is identified as harmful according to the model's content rules, the request is automatically rejected.

You can configure an moderation endpoint either as a standalone prompt guard setting or in addition to other request and response guard settings.

func (*AIPromptGuard_Moderation) Clone

Clone function

func (*AIPromptGuard_Moderation) Descriptor deprecated

func (*AIPromptGuard_Moderation) Descriptor() ([]byte, []int)

Deprecated: Use AIPromptGuard_Moderation.ProtoReflect.Descriptor instead.

func (*AIPromptGuard_Moderation) Equal

func (m *AIPromptGuard_Moderation) Equal(that interface{}) bool

Equal function

func (*AIPromptGuard_Moderation) GetModeration

func (m *AIPromptGuard_Moderation) GetModeration() isAIPromptGuard_Moderation_Moderation

func (*AIPromptGuard_Moderation) GetOpenai

func (*AIPromptGuard_Moderation) Hash deprecated

func (m *AIPromptGuard_Moderation) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*AIPromptGuard_Moderation) HashUnique

func (m *AIPromptGuard_Moderation) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*AIPromptGuard_Moderation) ProtoMessage

func (*AIPromptGuard_Moderation) ProtoMessage()

func (*AIPromptGuard_Moderation) ProtoReflect

func (x *AIPromptGuard_Moderation) ProtoReflect() protoreflect.Message

func (*AIPromptGuard_Moderation) Reset

func (x *AIPromptGuard_Moderation) Reset()

func (*AIPromptGuard_Moderation) String

func (x *AIPromptGuard_Moderation) String() string

type AIPromptGuard_Moderation_OpenAI

type AIPromptGuard_Moderation_OpenAI struct {

	// The name of the OpenAI moderation model to use. Defaults to
	// [`omni-moderation-latest`](https://platform.openai.com/docs/guides/moderation).
	Model string `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"`
	// The authorization token that the AI gateway uses
	// to access the OpenAI moderation model.
	//
	// Types that are assignable to AuthTokenSource:
	//
	//	*AIPromptGuard_Moderation_OpenAI_AuthToken
	AuthTokenSource isAIPromptGuard_Moderation_OpenAI_AuthTokenSource `protobuf_oneof:"auth_token_source"`
	// contains filtered or unexported fields
}

Configure an OpenAI moderation endpoint.

func (*AIPromptGuard_Moderation_OpenAI) Clone

Clone function

func (*AIPromptGuard_Moderation_OpenAI) Descriptor deprecated

func (*AIPromptGuard_Moderation_OpenAI) Descriptor() ([]byte, []int)

Deprecated: Use AIPromptGuard_Moderation_OpenAI.ProtoReflect.Descriptor instead.

func (*AIPromptGuard_Moderation_OpenAI) Equal

func (m *AIPromptGuard_Moderation_OpenAI) Equal(that interface{}) bool

Equal function

func (*AIPromptGuard_Moderation_OpenAI) GetAuthToken

func (*AIPromptGuard_Moderation_OpenAI) GetAuthTokenSource

func (m *AIPromptGuard_Moderation_OpenAI) GetAuthTokenSource() isAIPromptGuard_Moderation_OpenAI_AuthTokenSource

func (*AIPromptGuard_Moderation_OpenAI) GetModel

func (*AIPromptGuard_Moderation_OpenAI) Hash deprecated

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*AIPromptGuard_Moderation_OpenAI) HashUnique

func (m *AIPromptGuard_Moderation_OpenAI) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*AIPromptGuard_Moderation_OpenAI) ProtoMessage

func (*AIPromptGuard_Moderation_OpenAI) ProtoMessage()

func (*AIPromptGuard_Moderation_OpenAI) ProtoReflect

func (*AIPromptGuard_Moderation_OpenAI) Reset

func (*AIPromptGuard_Moderation_OpenAI) String

type AIPromptGuard_Moderation_OpenAI_AuthToken

type AIPromptGuard_Moderation_OpenAI_AuthToken struct {
	// The authorization token that the AI gateway uses
	// to access the OpenAI moderation model.
	AuthToken *SingleAuthToken `protobuf:"bytes,2,opt,name=auth_token,json=authToken,proto3,oneof"`
}

type AIPromptGuard_Moderation_Openai

type AIPromptGuard_Moderation_Openai struct {
	// Configure an OpenAI moderation endpoint.
	Openai *AIPromptGuard_Moderation_OpenAI `protobuf:"bytes,1,opt,name=openai,proto3,oneof"`
}

type AIPromptGuard_Regex

type AIPromptGuard_Regex struct {

	// A list of regex patterns to match against the request or response.
	// Matches and built-ins are additive.
	Matches []*AIPromptGuard_Regex_RegexMatch `protobuf:"bytes,1,rep,name=matches,proto3" json:"matches,omitempty"`
	// A list of built-in regex patterns to match against the request or response.
	// Matches and built-ins are additive.
	Builtins []AIPromptGuard_Regex_BuiltIn `` /* 134-byte string literal not displayed */
	// The action to take if a regex pattern is matched in a request or response.
	// This setting applies only to request matches. Response matches are always masked by default.
	Action AIPromptGuard_Regex_Action `protobuf:"varint,3,opt,name=action,proto3,enum=ai.options.gloo.solo.io.AIPromptGuard_Regex_Action" json:"action,omitempty"`
	// contains filtered or unexported fields
}

Regular expression (regex) matching for prompt guards and data masking.

func (*AIPromptGuard_Regex) Clone

func (m *AIPromptGuard_Regex) Clone() proto.Message

Clone function

func (*AIPromptGuard_Regex) Descriptor deprecated

func (*AIPromptGuard_Regex) Descriptor() ([]byte, []int)

Deprecated: Use AIPromptGuard_Regex.ProtoReflect.Descriptor instead.

func (*AIPromptGuard_Regex) Equal

func (m *AIPromptGuard_Regex) Equal(that interface{}) bool

Equal function

func (*AIPromptGuard_Regex) GetAction

func (*AIPromptGuard_Regex) GetBuiltins

func (*AIPromptGuard_Regex) GetMatches

func (*AIPromptGuard_Regex) Hash deprecated

func (m *AIPromptGuard_Regex) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*AIPromptGuard_Regex) HashUnique

func (m *AIPromptGuard_Regex) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*AIPromptGuard_Regex) ProtoMessage

func (*AIPromptGuard_Regex) ProtoMessage()

func (*AIPromptGuard_Regex) ProtoReflect

func (x *AIPromptGuard_Regex) ProtoReflect() protoreflect.Message

func (*AIPromptGuard_Regex) Reset

func (x *AIPromptGuard_Regex) Reset()

func (*AIPromptGuard_Regex) String

func (x *AIPromptGuard_Regex) String() string

type AIPromptGuard_Regex_Action

type AIPromptGuard_Regex_Action int32

The action to take if a regex pattern is matched in a request or response. This setting applies only to request matches. Response matches are always masked by default.

const (
	// Mask the matched data in the request.
	AIPromptGuard_Regex_MASK AIPromptGuard_Regex_Action = 0
	// Reject the request if the regex matches content in the request.
	AIPromptGuard_Regex_REJECT AIPromptGuard_Regex_Action = 1
)

func (AIPromptGuard_Regex_Action) Descriptor

func (AIPromptGuard_Regex_Action) Enum

func (AIPromptGuard_Regex_Action) EnumDescriptor deprecated

func (AIPromptGuard_Regex_Action) EnumDescriptor() ([]byte, []int)

Deprecated: Use AIPromptGuard_Regex_Action.Descriptor instead.

func (AIPromptGuard_Regex_Action) Number

func (AIPromptGuard_Regex_Action) String

func (AIPromptGuard_Regex_Action) Type

type AIPromptGuard_Regex_BuiltIn

type AIPromptGuard_Regex_BuiltIn int32

Built-in regex patterns for specific types of strings in prompts. For example, if you specify `CREDIT_CARD`, any credit card numbers in the request or response are matched.

const (
	// Default regex matching for Social Security numbers.
	AIPromptGuard_Regex_SSN AIPromptGuard_Regex_BuiltIn = 0
	// Default regex matching for credit card numbers.
	AIPromptGuard_Regex_CREDIT_CARD AIPromptGuard_Regex_BuiltIn = 1
	// Default regex matching for phone numbers.
	AIPromptGuard_Regex_PHONE_NUMBER AIPromptGuard_Regex_BuiltIn = 2
	// Default regex matching for email addresses.
	AIPromptGuard_Regex_EMAIL AIPromptGuard_Regex_BuiltIn = 3
)

func (AIPromptGuard_Regex_BuiltIn) Descriptor

func (AIPromptGuard_Regex_BuiltIn) Enum

func (AIPromptGuard_Regex_BuiltIn) EnumDescriptor deprecated

func (AIPromptGuard_Regex_BuiltIn) EnumDescriptor() ([]byte, []int)

Deprecated: Use AIPromptGuard_Regex_BuiltIn.Descriptor instead.

func (AIPromptGuard_Regex_BuiltIn) Number

func (AIPromptGuard_Regex_BuiltIn) String

func (AIPromptGuard_Regex_BuiltIn) Type

type AIPromptGuard_Regex_RegexMatch

type AIPromptGuard_Regex_RegexMatch struct {

	// The regex pattern to match against the request or response.
	Pattern string `protobuf:"bytes,1,opt,name=pattern,proto3" json:"pattern,omitempty"`
	// An optional name for this match, which can be used for debugging purposes.
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

Regular expression (regex) matching for prompt guards and data masking.

func (*AIPromptGuard_Regex_RegexMatch) Clone

Clone function

func (*AIPromptGuard_Regex_RegexMatch) Descriptor deprecated

func (*AIPromptGuard_Regex_RegexMatch) Descriptor() ([]byte, []int)

Deprecated: Use AIPromptGuard_Regex_RegexMatch.ProtoReflect.Descriptor instead.

func (*AIPromptGuard_Regex_RegexMatch) Equal

func (m *AIPromptGuard_Regex_RegexMatch) Equal(that interface{}) bool

Equal function

func (*AIPromptGuard_Regex_RegexMatch) GetName

func (*AIPromptGuard_Regex_RegexMatch) GetPattern

func (x *AIPromptGuard_Regex_RegexMatch) GetPattern() string

func (*AIPromptGuard_Regex_RegexMatch) Hash deprecated

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*AIPromptGuard_Regex_RegexMatch) HashUnique

func (m *AIPromptGuard_Regex_RegexMatch) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*AIPromptGuard_Regex_RegexMatch) ProtoMessage

func (*AIPromptGuard_Regex_RegexMatch) ProtoMessage()

func (*AIPromptGuard_Regex_RegexMatch) ProtoReflect

func (*AIPromptGuard_Regex_RegexMatch) Reset

func (x *AIPromptGuard_Regex_RegexMatch) Reset()

func (*AIPromptGuard_Regex_RegexMatch) String

type AIPromptGuard_Request

type AIPromptGuard_Request struct {

	// A custom response message to return to the client. If not specified, defaults to
	// "The request was rejected due to inappropriate content".
	CustomResponse *AIPromptGuard_Request_CustomResponse `protobuf:"bytes,1,opt,name=custom_response,json=customResponse,proto3" json:"custom_response,omitempty"`
	// Regular expression (regex) matching for prompt guards and data masking.
	Regex *AIPromptGuard_Regex `protobuf:"bytes,2,opt,name=regex,proto3" json:"regex,omitempty"`
	// Configure a webhook to forward requests to for prompt guarding.
	Webhook *AIPromptGuard_Webhook `protobuf:"bytes,3,opt,name=webhook,proto3" json:"webhook,omitempty"`
	// Pass prompt data through an external moderation model endpoint,
	// which compares the request prompt input to predefined content rules.
	Moderation *AIPromptGuard_Moderation `protobuf:"bytes,4,opt,name=moderation,proto3" json:"moderation,omitempty"`
	// contains filtered or unexported fields
}

Prompt guards to apply to requests sent by the client.

func (*AIPromptGuard_Request) Clone

func (m *AIPromptGuard_Request) Clone() proto.Message

Clone function

func (*AIPromptGuard_Request) Descriptor deprecated

func (*AIPromptGuard_Request) Descriptor() ([]byte, []int)

Deprecated: Use AIPromptGuard_Request.ProtoReflect.Descriptor instead.

func (*AIPromptGuard_Request) Equal

func (m *AIPromptGuard_Request) Equal(that interface{}) bool

Equal function

func (*AIPromptGuard_Request) GetCustomResponse

func (*AIPromptGuard_Request) GetModeration

func (x *AIPromptGuard_Request) GetModeration() *AIPromptGuard_Moderation

func (*AIPromptGuard_Request) GetRegex

func (*AIPromptGuard_Request) GetWebhook

func (*AIPromptGuard_Request) Hash deprecated

func (m *AIPromptGuard_Request) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*AIPromptGuard_Request) HashUnique

func (m *AIPromptGuard_Request) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*AIPromptGuard_Request) ProtoMessage

func (*AIPromptGuard_Request) ProtoMessage()

func (*AIPromptGuard_Request) ProtoReflect

func (x *AIPromptGuard_Request) ProtoReflect() protoreflect.Message

func (*AIPromptGuard_Request) Reset

func (x *AIPromptGuard_Request) Reset()

func (*AIPromptGuard_Request) String

func (x *AIPromptGuard_Request) String() string

type AIPromptGuard_Request_CustomResponse

type AIPromptGuard_Request_CustomResponse struct {

	// A custom response message to return to the client. If not specified, defaults to
	// "The request was rejected due to inappropriate content".
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// The status code to return to the client.
	StatusCode uint32 `protobuf:"varint,2,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
	// contains filtered or unexported fields
}

A custom response to return to the client if request content is matched against a regex pattern and the action is `REJECT`.

func (*AIPromptGuard_Request_CustomResponse) Clone

Clone function

func (*AIPromptGuard_Request_CustomResponse) Descriptor deprecated

func (*AIPromptGuard_Request_CustomResponse) Descriptor() ([]byte, []int)

Deprecated: Use AIPromptGuard_Request_CustomResponse.ProtoReflect.Descriptor instead.

func (*AIPromptGuard_Request_CustomResponse) Equal

func (m *AIPromptGuard_Request_CustomResponse) Equal(that interface{}) bool

Equal function

func (*AIPromptGuard_Request_CustomResponse) GetMessage

func (*AIPromptGuard_Request_CustomResponse) GetStatusCode

func (x *AIPromptGuard_Request_CustomResponse) GetStatusCode() uint32

func (*AIPromptGuard_Request_CustomResponse) Hash deprecated

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*AIPromptGuard_Request_CustomResponse) HashUnique

func (m *AIPromptGuard_Request_CustomResponse) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*AIPromptGuard_Request_CustomResponse) ProtoMessage

func (*AIPromptGuard_Request_CustomResponse) ProtoMessage()

func (*AIPromptGuard_Request_CustomResponse) ProtoReflect

func (*AIPromptGuard_Request_CustomResponse) Reset

func (*AIPromptGuard_Request_CustomResponse) String

type AIPromptGuard_Response

type AIPromptGuard_Response struct {

	// Regular expression (regex) matching for prompt guards and data masking.
	Regex *AIPromptGuard_Regex `protobuf:"bytes,1,opt,name=regex,proto3" json:"regex,omitempty"`
	// Configure a webhook to forward responses to for prompt guarding.
	Webhook *AIPromptGuard_Webhook `protobuf:"bytes,2,opt,name=webhook,proto3" json:"webhook,omitempty"`
	// contains filtered or unexported fields
}

Prompt guards to apply to responses returned by the LLM provider.

func (*AIPromptGuard_Response) Clone

Clone function

func (*AIPromptGuard_Response) Descriptor deprecated

func (*AIPromptGuard_Response) Descriptor() ([]byte, []int)

Deprecated: Use AIPromptGuard_Response.ProtoReflect.Descriptor instead.

func (*AIPromptGuard_Response) Equal

func (m *AIPromptGuard_Response) Equal(that interface{}) bool

Equal function

func (*AIPromptGuard_Response) GetRegex

func (*AIPromptGuard_Response) GetWebhook

func (*AIPromptGuard_Response) Hash deprecated

func (m *AIPromptGuard_Response) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*AIPromptGuard_Response) HashUnique

func (m *AIPromptGuard_Response) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*AIPromptGuard_Response) ProtoMessage

func (*AIPromptGuard_Response) ProtoMessage()

func (*AIPromptGuard_Response) ProtoReflect

func (x *AIPromptGuard_Response) ProtoReflect() protoreflect.Message

func (*AIPromptGuard_Response) Reset

func (x *AIPromptGuard_Response) Reset()

func (*AIPromptGuard_Response) String

func (x *AIPromptGuard_Response) String() string

type AIPromptGuard_Webhook

type AIPromptGuard_Webhook struct {

	// Host to send the traffic to.
	Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"`
	// Port to send the traffic to
	Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"`
	// Headers to forward with the request to the webhook.
	ForwardHeaders []*AIPromptGuard_Webhook_HeaderMatch `protobuf:"bytes,3,rep,name=forwardHeaders,proto3" json:"forwardHeaders,omitempty"`
	// contains filtered or unexported fields
}

Configure a webhook to forward requests or responses to for prompt guarding.

func (*AIPromptGuard_Webhook) Clone

func (m *AIPromptGuard_Webhook) Clone() proto.Message

Clone function

func (*AIPromptGuard_Webhook) Descriptor deprecated

func (*AIPromptGuard_Webhook) Descriptor() ([]byte, []int)

Deprecated: Use AIPromptGuard_Webhook.ProtoReflect.Descriptor instead.

func (*AIPromptGuard_Webhook) Equal

func (m *AIPromptGuard_Webhook) Equal(that interface{}) bool

Equal function

func (*AIPromptGuard_Webhook) GetForwardHeaders

func (x *AIPromptGuard_Webhook) GetForwardHeaders() []*AIPromptGuard_Webhook_HeaderMatch

func (*AIPromptGuard_Webhook) GetHost

func (x *AIPromptGuard_Webhook) GetHost() string

func (*AIPromptGuard_Webhook) GetPort

func (x *AIPromptGuard_Webhook) GetPort() uint32

func (*AIPromptGuard_Webhook) Hash deprecated

func (m *AIPromptGuard_Webhook) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*AIPromptGuard_Webhook) HashUnique

func (m *AIPromptGuard_Webhook) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*AIPromptGuard_Webhook) ProtoMessage

func (*AIPromptGuard_Webhook) ProtoMessage()

func (*AIPromptGuard_Webhook) ProtoReflect

func (x *AIPromptGuard_Webhook) ProtoReflect() protoreflect.Message

func (*AIPromptGuard_Webhook) Reset

func (x *AIPromptGuard_Webhook) Reset()

func (*AIPromptGuard_Webhook) String

func (x *AIPromptGuard_Webhook) String() string

type AIPromptGuard_Webhook_HeaderMatch

type AIPromptGuard_Webhook_HeaderMatch struct {

	// The header key string to match against.
	Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// The type of match to use.
	MatchType AIPromptGuard_Webhook_HeaderMatch_MatchType `` /* 162-byte string literal not displayed */
	// contains filtered or unexported fields
}

Describes how to match a given string in HTTP headers. Match is case-sensitive.

func (*AIPromptGuard_Webhook_HeaderMatch) Clone

Clone function

func (*AIPromptGuard_Webhook_HeaderMatch) Descriptor deprecated

func (*AIPromptGuard_Webhook_HeaderMatch) Descriptor() ([]byte, []int)

Deprecated: Use AIPromptGuard_Webhook_HeaderMatch.ProtoReflect.Descriptor instead.

func (*AIPromptGuard_Webhook_HeaderMatch) Equal

func (m *AIPromptGuard_Webhook_HeaderMatch) Equal(that interface{}) bool

Equal function

func (*AIPromptGuard_Webhook_HeaderMatch) GetKey

func (*AIPromptGuard_Webhook_HeaderMatch) GetMatchType

func (*AIPromptGuard_Webhook_HeaderMatch) Hash deprecated

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*AIPromptGuard_Webhook_HeaderMatch) HashUnique

func (m *AIPromptGuard_Webhook_HeaderMatch) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*AIPromptGuard_Webhook_HeaderMatch) ProtoMessage

func (*AIPromptGuard_Webhook_HeaderMatch) ProtoMessage()

func (*AIPromptGuard_Webhook_HeaderMatch) ProtoReflect

func (*AIPromptGuard_Webhook_HeaderMatch) Reset

func (*AIPromptGuard_Webhook_HeaderMatch) String

type AIPromptGuard_Webhook_HeaderMatch_MatchType

type AIPromptGuard_Webhook_HeaderMatch_MatchType int32

The header string match type.

const (
	// The string must match exactly the specified string.
	AIPromptGuard_Webhook_HeaderMatch_EXACT AIPromptGuard_Webhook_HeaderMatch_MatchType = 0
	// The string must have the specified prefix.
	AIPromptGuard_Webhook_HeaderMatch_PREFIX AIPromptGuard_Webhook_HeaderMatch_MatchType = 1
	// The string must have the specified suffix.
	AIPromptGuard_Webhook_HeaderMatch_SUFFIX AIPromptGuard_Webhook_HeaderMatch_MatchType = 2
	// The header string must contain the specified string.
	AIPromptGuard_Webhook_HeaderMatch_CONTAINS AIPromptGuard_Webhook_HeaderMatch_MatchType = 3
	// The string must match the specified [RE2-style regular expression](https://github.com/google/re2/wiki/) pattern.
	AIPromptGuard_Webhook_HeaderMatch_regex AIPromptGuard_Webhook_HeaderMatch_MatchType = 4
)

func (AIPromptGuard_Webhook_HeaderMatch_MatchType) Descriptor

func (AIPromptGuard_Webhook_HeaderMatch_MatchType) Enum

func (AIPromptGuard_Webhook_HeaderMatch_MatchType) EnumDescriptor deprecated

func (AIPromptGuard_Webhook_HeaderMatch_MatchType) EnumDescriptor() ([]byte, []int)

Deprecated: Use AIPromptGuard_Webhook_HeaderMatch_MatchType.Descriptor instead.

func (AIPromptGuard_Webhook_HeaderMatch_MatchType) Number

func (AIPromptGuard_Webhook_HeaderMatch_MatchType) String

func (AIPromptGuard_Webhook_HeaderMatch_MatchType) Type

type Embedding

type Embedding struct {

	// Configuration for the backend LLM provider authentication token.
	//
	// Types that are assignable to Embedding:
	//
	//	*Embedding_Openai
	//	*Embedding_AzureOpenai
	Embedding isEmbedding_Embedding `protobuf_oneof:"embedding"`
	// contains filtered or unexported fields
}

Configuration of the API used to generate the embedding.

func (*Embedding) Clone

func (m *Embedding) Clone() proto.Message

Clone function

func (*Embedding) Descriptor deprecated

func (*Embedding) Descriptor() ([]byte, []int)

Deprecated: Use Embedding.ProtoReflect.Descriptor instead.

func (*Embedding) Equal

func (m *Embedding) Equal(that interface{}) bool

Equal function

func (*Embedding) GetAzureOpenai

func (x *Embedding) GetAzureOpenai() *Embedding_AzureOpenAI

func (*Embedding) GetEmbedding

func (m *Embedding) GetEmbedding() isEmbedding_Embedding

func (*Embedding) GetOpenai

func (x *Embedding) GetOpenai() *Embedding_OpenAI

func (*Embedding) Hash deprecated

func (m *Embedding) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*Embedding) HashUnique

func (m *Embedding) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*Embedding) ProtoMessage

func (*Embedding) ProtoMessage()

func (*Embedding) ProtoReflect

func (x *Embedding) ProtoReflect() protoreflect.Message

func (*Embedding) Reset

func (x *Embedding) Reset()

func (*Embedding) String

func (x *Embedding) String() string

type Embedding_AzureOpenAI

type Embedding_AzureOpenAI struct {

	// Types that are assignable to AuthTokenSource:
	//
	//	*Embedding_AzureOpenAI_AuthToken
	AuthTokenSource isEmbedding_AzureOpenAI_AuthTokenSource `protobuf_oneof:"auth_token_source"`
	// The version of the Azure OpenAI API to use.
	// For more information, see the [Azure OpenAI API version reference](https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#api-specs).
	ApiVersion string `protobuf:"bytes,2,opt,name=api_version,json=apiVersion,proto3" json:"api_version,omitempty"`
	// The endpoint for the Azure OpenAI API to use, such as `my-endpoint.openai.azure.com`.
	// If the scheme is not included, it is added.
	Endpoint string `protobuf:"bytes,3,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
	// The name of the Azure OpenAI model deployment to use.
	// For more information, see the [Azure OpenAI model docs](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models).
	DeploymentName string `protobuf:"bytes,4,opt,name=deployment_name,json=deploymentName,proto3" json:"deployment_name,omitempty"`
	// contains filtered or unexported fields
}

Embedding settings for the Azure OpenAI provider.

func (*Embedding_AzureOpenAI) Clone

func (m *Embedding_AzureOpenAI) Clone() proto.Message

Clone function

func (*Embedding_AzureOpenAI) Descriptor deprecated

func (*Embedding_AzureOpenAI) Descriptor() ([]byte, []int)

Deprecated: Use Embedding_AzureOpenAI.ProtoReflect.Descriptor instead.

func (*Embedding_AzureOpenAI) Equal

func (m *Embedding_AzureOpenAI) Equal(that interface{}) bool

Equal function

func (*Embedding_AzureOpenAI) GetApiVersion

func (x *Embedding_AzureOpenAI) GetApiVersion() string

func (*Embedding_AzureOpenAI) GetAuthToken

func (x *Embedding_AzureOpenAI) GetAuthToken() *SingleAuthToken

func (*Embedding_AzureOpenAI) GetAuthTokenSource

func (m *Embedding_AzureOpenAI) GetAuthTokenSource() isEmbedding_AzureOpenAI_AuthTokenSource

func (*Embedding_AzureOpenAI) GetDeploymentName

func (x *Embedding_AzureOpenAI) GetDeploymentName() string

func (*Embedding_AzureOpenAI) GetEndpoint

func (x *Embedding_AzureOpenAI) GetEndpoint() string

func (*Embedding_AzureOpenAI) Hash deprecated

func (m *Embedding_AzureOpenAI) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*Embedding_AzureOpenAI) HashUnique

func (m *Embedding_AzureOpenAI) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*Embedding_AzureOpenAI) ProtoMessage

func (*Embedding_AzureOpenAI) ProtoMessage()

func (*Embedding_AzureOpenAI) ProtoReflect

func (x *Embedding_AzureOpenAI) ProtoReflect() protoreflect.Message

func (*Embedding_AzureOpenAI) Reset

func (x *Embedding_AzureOpenAI) Reset()

func (*Embedding_AzureOpenAI) String

func (x *Embedding_AzureOpenAI) String() string

type Embedding_AzureOpenAI_AuthToken

type Embedding_AzureOpenAI_AuthToken struct {
	// The authorization token that the AI gateway uses to access the Azure OpenAI API.
	// This token is automatically sent in the `api-key` header of the request.
	AuthToken *SingleAuthToken `protobuf:"bytes,1,opt,name=auth_token,json=authToken,proto3,oneof"`
}

type Embedding_AzureOpenai

type Embedding_AzureOpenai struct {
	// Embedding settings for the Azure OpenAI provider.
	AzureOpenai *Embedding_AzureOpenAI `protobuf:"bytes,2,opt,name=azure_openai,json=azureOpenai,proto3,oneof"`
}

type Embedding_OpenAI

type Embedding_OpenAI struct {

	// Types that are assignable to AuthTokenSource:
	//
	//	*Embedding_OpenAI_AuthToken
	AuthTokenSource isEmbedding_OpenAI_AuthTokenSource `protobuf_oneof:"auth_token_source"`
	// contains filtered or unexported fields
}

Embedding settings for the OpenAI provider.

func (*Embedding_OpenAI) Clone

func (m *Embedding_OpenAI) Clone() proto.Message

Clone function

func (*Embedding_OpenAI) Descriptor deprecated

func (*Embedding_OpenAI) Descriptor() ([]byte, []int)

Deprecated: Use Embedding_OpenAI.ProtoReflect.Descriptor instead.

func (*Embedding_OpenAI) Equal

func (m *Embedding_OpenAI) Equal(that interface{}) bool

Equal function

func (*Embedding_OpenAI) GetAuthToken

func (x *Embedding_OpenAI) GetAuthToken() *SingleAuthToken

func (*Embedding_OpenAI) GetAuthTokenSource

func (m *Embedding_OpenAI) GetAuthTokenSource() isEmbedding_OpenAI_AuthTokenSource

func (*Embedding_OpenAI) Hash deprecated

func (m *Embedding_OpenAI) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*Embedding_OpenAI) HashUnique

func (m *Embedding_OpenAI) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*Embedding_OpenAI) ProtoMessage

func (*Embedding_OpenAI) ProtoMessage()

func (*Embedding_OpenAI) ProtoReflect

func (x *Embedding_OpenAI) ProtoReflect() protoreflect.Message

func (*Embedding_OpenAI) Reset

func (x *Embedding_OpenAI) Reset()

func (*Embedding_OpenAI) String

func (x *Embedding_OpenAI) String() string

type Embedding_OpenAI_AuthToken

type Embedding_OpenAI_AuthToken struct {
	// The authorization token that the AI gateway uses to access the OpenAI API.
	// This token is automatically sent in the `Authorization` header of the
	// request and prefixed with `Bearer`.
	AuthToken *SingleAuthToken `protobuf:"bytes,1,opt,name=auth_token,json=authToken,proto3,oneof"`
}

type Embedding_Openai

type Embedding_Openai struct {
	// Embedding settings for the OpenAI provider.
	Openai *Embedding_OpenAI `protobuf:"bytes,1,opt,name=openai,proto3,oneof"`
}

type FieldDefault

type FieldDefault struct {

	// The name of the field.
	Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"`
	// The field default value, which can be any JSON Data Type.
	Value *structpb.Value `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// Whether to override the field's value if it already exists.
	// Defaults to false.
	Override bool `protobuf:"varint,3,opt,name=override,proto3" json:"override,omitempty"`
	// contains filtered or unexported fields
}

Provide defaults to merge with user input fields. Defaults do _not_ override the user input fields, unless you explicitly set `override` to `true`.

Example overriding the system field for Anthropic: ```yaml # Anthropic doesn't support a system chat type defaults:

  • field: "system" value: "answer all questions in french"

```

Example setting the temperature and overriding `max_tokens`: ```yaml defaults:

  • field: "temperature" value: 0.5
  • field: "max_tokens" value: 100

```

func (*FieldDefault) Clone

func (m *FieldDefault) Clone() proto.Message

Clone function

func (*FieldDefault) Descriptor deprecated

func (*FieldDefault) Descriptor() ([]byte, []int)

Deprecated: Use FieldDefault.ProtoReflect.Descriptor instead.

func (*FieldDefault) Equal

func (m *FieldDefault) Equal(that interface{}) bool

Equal function

func (*FieldDefault) GetField

func (x *FieldDefault) GetField() string

func (*FieldDefault) GetOverride

func (x *FieldDefault) GetOverride() bool

func (*FieldDefault) GetValue

func (x *FieldDefault) GetValue() *structpb.Value

func (*FieldDefault) Hash deprecated

func (m *FieldDefault) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*FieldDefault) HashUnique

func (m *FieldDefault) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*FieldDefault) ProtoMessage

func (*FieldDefault) ProtoMessage()

func (*FieldDefault) ProtoReflect

func (x *FieldDefault) ProtoReflect() protoreflect.Message

func (*FieldDefault) Reset

func (x *FieldDefault) Reset()

func (*FieldDefault) String

func (x *FieldDefault) String() string

type Postgres

type Postgres struct {

	// Connection string to the Postgres database. For example, to use a vector database
	// deployed to your cluster, your connection string might look similar to
	// `postgresql+psycopg://gloo:gloo@vector-db.default.svc.cluster.local:5432/gloo`.
	ConnectionString string `protobuf:"bytes,1,opt,name=connection_string,json=connectionString,proto3" json:"connection_string,omitempty"`
	// Name of the collection table to use.
	CollectionName string `protobuf:"bytes,2,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"`
	// contains filtered or unexported fields
}

Configuration settings for a Postgres datastore.

func (*Postgres) Clone

func (m *Postgres) Clone() proto.Message

Clone function

func (*Postgres) Descriptor deprecated

func (*Postgres) Descriptor() ([]byte, []int)

Deprecated: Use Postgres.ProtoReflect.Descriptor instead.

func (*Postgres) Equal

func (m *Postgres) Equal(that interface{}) bool

Equal function

func (*Postgres) GetCollectionName

func (x *Postgres) GetCollectionName() string

func (*Postgres) GetConnectionString

func (x *Postgres) GetConnectionString() string

func (*Postgres) Hash deprecated

func (m *Postgres) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*Postgres) HashUnique

func (m *Postgres) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*Postgres) ProtoMessage

func (*Postgres) ProtoMessage()

func (*Postgres) ProtoReflect

func (x *Postgres) ProtoReflect() protoreflect.Message

func (*Postgres) Reset

func (x *Postgres) Reset()

func (*Postgres) String

func (x *Postgres) String() string

type RAG

type RAG struct {

	// Data store from which to fetch the context embeddings.
	Datastore *RAG_DataStore `protobuf:"bytes,1,opt,name=datastore,proto3" json:"datastore,omitempty"`
	// Model to use to retrieve the context embeddings.
	Embedding *Embedding `protobuf:"bytes,2,opt,name=embedding,proto3" json:"embedding,omitempty"`
	// Template to use to embed the returned context.
	PromptTemplate string `protobuf:"bytes,3,opt,name=prompt_template,json=promptTemplate,proto3" json:"prompt_template,omitempty"`
	// contains filtered or unexported fields
}

[Retrieval augmented generation (RAG)](https://research.ibm.com/blog/retrieval-augmented-generation-RAG) is a technique of providing relevant context by retrieving relevant data from one or more context datasets and augmenting the prompt with the retrieved information. This can be used to improve the quality of the generated text.

{{% notice note %}} The same embedding mechanism that was used for the initial creation of the context datasets must be used for the prompt. {{% /notice %}}

Example configuring a route to use a `postgres` datastore and OpenAI for RAG: ```yaml rag:

datastore:
  postgres:
    connectionString: postgresql+psycopg://gloo:gloo@172.17.0.1:6024/gloo
    collectionName: default
embedding:
  openai:
    authToken:
      secretRef:
        name: openai-secret
        namespace: gloo-system

```

{{% notice tip %}} For an extended example that includes deploying a vector database with a context dataset, check out the [Retrieval augmented generation (RAG) tutorial](https://docs.solo.io/gateway/main/ai/tutorials/rag/). {{% /notice %}}

func (*RAG) Clone

func (m *RAG) Clone() proto.Message

Clone function

func (*RAG) Descriptor deprecated

func (*RAG) Descriptor() ([]byte, []int)

Deprecated: Use RAG.ProtoReflect.Descriptor instead.

func (*RAG) Equal

func (m *RAG) Equal(that interface{}) bool

Equal function

func (*RAG) GetDatastore

func (x *RAG) GetDatastore() *RAG_DataStore

func (*RAG) GetEmbedding

func (x *RAG) GetEmbedding() *Embedding

func (*RAG) GetPromptTemplate

func (x *RAG) GetPromptTemplate() string

func (*RAG) Hash deprecated

func (m *RAG) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*RAG) HashUnique

func (m *RAG) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*RAG) ProtoMessage

func (*RAG) ProtoMessage()

func (*RAG) ProtoReflect

func (x *RAG) ProtoReflect() protoreflect.Message

func (*RAG) Reset

func (x *RAG) Reset()

func (*RAG) String

func (x *RAG) String() string

type RAG_DataStore

type RAG_DataStore struct {

	// Types that are assignable to Datastore:
	//
	//	*RAG_DataStore_Postgres
	Datastore isRAG_DataStore_Datastore `protobuf_oneof:"datastore"`
	// contains filtered or unexported fields
}

func (*RAG_DataStore) Clone

func (m *RAG_DataStore) Clone() proto.Message

Clone function

func (*RAG_DataStore) Descriptor deprecated

func (*RAG_DataStore) Descriptor() ([]byte, []int)

Deprecated: Use RAG_DataStore.ProtoReflect.Descriptor instead.

func (*RAG_DataStore) Equal

func (m *RAG_DataStore) Equal(that interface{}) bool

Equal function

func (*RAG_DataStore) GetDatastore

func (m *RAG_DataStore) GetDatastore() isRAG_DataStore_Datastore

func (*RAG_DataStore) GetPostgres

func (x *RAG_DataStore) GetPostgres() *Postgres

func (*RAG_DataStore) Hash deprecated

func (m *RAG_DataStore) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*RAG_DataStore) HashUnique

func (m *RAG_DataStore) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*RAG_DataStore) ProtoMessage

func (*RAG_DataStore) ProtoMessage()

func (*RAG_DataStore) ProtoReflect

func (x *RAG_DataStore) ProtoReflect() protoreflect.Message

func (*RAG_DataStore) Reset

func (x *RAG_DataStore) Reset()

func (*RAG_DataStore) String

func (x *RAG_DataStore) String() string

type RAG_DataStore_Postgres

type RAG_DataStore_Postgres struct {
	// Configuration settings for a Postgres datastore.
	Postgres *Postgres `protobuf:"bytes,1,opt,name=postgres,proto3,oneof"`
}

type RouteSettings

type RouteSettings struct {

	// Enrich requests sent to the LLM provider by appending and prepending system prompts.
	// This can be configured only for LLM providers that use the `CHAT` API route type.
	PromptEnrichment *AIPromptEnrichment `protobuf:"bytes,1,opt,name=prompt_enrichment,json=promptEnrichment,proto3" json:"prompt_enrichment,omitempty"`
	// Set up prompt guards to block unwanted requests to the LLM provider and mask sensitive data.
	// Prompt guards can be used to reject requests based on the content of the prompt, as well as
	// mask responses based on the content of the response.
	PromptGuard *AIPromptGuard `protobuf:"bytes,2,opt,name=prompt_guard,json=promptGuard,proto3" json:"prompt_guard,omitempty"`
	// [Retrieval augmented generation (RAG)](https://research.ibm.com/blog/retrieval-augmented-generation-RAG)
	// is a technique of providing relevant context by retrieving relevant data from one or more
	// context datasets and augmenting the prompt with the retrieved information.
	// This can be used to improve the quality of the generated text.
	Rag *RAG `protobuf:"bytes,3,opt,name=rag,proto3" json:"rag,omitempty"`
	// Cache previous model responses to provide faster responses to similar requests in the future.
	// Results might vary depending on the embedding mechanism used, as well
	// as the similarity threshold set.
	SemanticCache *SemanticCache `protobuf:"bytes,4,opt,name=semantic_cache,json=semanticCache,proto3" json:"semantic_cache,omitempty"`
	// Provide defaults to merge with user input fields.
	// Defaults do _not_ override the user input fields, unless you explicitly set `override` to `true`.
	Defaults []*FieldDefault `protobuf:"bytes,5,rep,name=defaults,proto3" json:"defaults,omitempty"`
	// The type of route to the LLM provider API. Currently, `CHAT` and `CHAT_STREAMING` are supported.
	RouteType RouteSettings_RouteType `` /* 142-byte string literal not displayed */
	// contains filtered or unexported fields
}

When you deploy the Gloo AI Gateway, you can use the `spec.options.ai` section of the RouteOptions resource to configure the behavior of the LLM provider on the level of individual routes. These route settings, such as prompt enrichment, retrieval augmented generation (RAG), and semantic caching, are applicable only for routes that send requests to an LLM provider backend.

For more information about the RouteOptions resource, see the [API reference]({{% versioned_link_path fromRoot="/reference/api/github.com/solo-io/gloo/projects/gloo/api/v1/route_options.proto.sk/" %}}).

func (*RouteSettings) Clone

func (m *RouteSettings) Clone() proto.Message

Clone function

func (*RouteSettings) Descriptor deprecated

func (*RouteSettings) Descriptor() ([]byte, []int)

Deprecated: Use RouteSettings.ProtoReflect.Descriptor instead.

func (*RouteSettings) Equal

func (m *RouteSettings) Equal(that interface{}) bool

Equal function

func (*RouteSettings) GetDefaults

func (x *RouteSettings) GetDefaults() []*FieldDefault

func (*RouteSettings) GetPromptEnrichment

func (x *RouteSettings) GetPromptEnrichment() *AIPromptEnrichment

func (*RouteSettings) GetPromptGuard

func (x *RouteSettings) GetPromptGuard() *AIPromptGuard

func (*RouteSettings) GetRag

func (x *RouteSettings) GetRag() *RAG

func (*RouteSettings) GetRouteType

func (x *RouteSettings) GetRouteType() RouteSettings_RouteType

func (*RouteSettings) GetSemanticCache

func (x *RouteSettings) GetSemanticCache() *SemanticCache

func (*RouteSettings) Hash deprecated

func (m *RouteSettings) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*RouteSettings) HashUnique

func (m *RouteSettings) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*RouteSettings) ProtoMessage

func (*RouteSettings) ProtoMessage()

func (*RouteSettings) ProtoReflect

func (x *RouteSettings) ProtoReflect() protoreflect.Message

func (*RouteSettings) Reset

func (x *RouteSettings) Reset()

func (*RouteSettings) String

func (x *RouteSettings) String() string

type RouteSettings_RouteType

type RouteSettings_RouteType int32

The type of route to the LLM provider API.

const (
	// The LLM generates the full response before responding to a client.
	RouteSettings_CHAT RouteSettings_RouteType = 0
	// Stream responses to a client, which allows the LLM to stream out tokens as they are generated.
	RouteSettings_CHAT_STREAMING RouteSettings_RouteType = 1
)

func (RouteSettings_RouteType) Descriptor

func (RouteSettings_RouteType) Enum

func (RouteSettings_RouteType) EnumDescriptor deprecated

func (RouteSettings_RouteType) EnumDescriptor() ([]byte, []int)

Deprecated: Use RouteSettings_RouteType.Descriptor instead.

func (RouteSettings_RouteType) Number

func (RouteSettings_RouteType) String

func (x RouteSettings_RouteType) String() string

func (RouteSettings_RouteType) Type

type SemanticCache

type SemanticCache struct {

	// Data store from which to cache the request and response pairs.
	Datastore *SemanticCache_DataStore `protobuf:"bytes,1,opt,name=datastore,proto3" json:"datastore,omitempty"`
	// Model to use to retrieve the embedding mechanism.
	Embedding *Embedding `protobuf:"bytes,2,opt,name=embedding,proto3" json:"embedding,omitempty"`
	// Time before data in the cache is considered expired.
	Ttl uint32 `protobuf:"varint,3,opt,name=ttl,proto3" json:"ttl,omitempty"`
	// The caching mode to use for the request and response lifecycle. Supported values include `READ_WRITE` or `READ_ONLY`.
	Mode SemanticCache_Mode `protobuf:"varint,4,opt,name=mode,proto3,enum=ai.options.gloo.solo.io.SemanticCache_Mode" json:"mode,omitempty"`
	// contains filtered or unexported fields
}

Cache previous model responses to provide faster responses to similar requests in the future. Results might vary depending on the embedding mechanism used, as well as the similarity threshold set. Semantic caching reduces the number of requests to the LLM provider, improves the response time, and reduces costs.

Example configuring a route to use a `redis` datastore and OpenAI for RAG: ```yaml semanticCache:

datastore:
  redis:
    connectionString: redis://172.17.0.1:6379
embedding:
  openai:
    authToken:
      secretRef:
        name: openai-secret
        namespace: gloo-system

```

func (*SemanticCache) Clone

func (m *SemanticCache) Clone() proto.Message

Clone function

func (*SemanticCache) Descriptor deprecated

func (*SemanticCache) Descriptor() ([]byte, []int)

Deprecated: Use SemanticCache.ProtoReflect.Descriptor instead.

func (*SemanticCache) Equal

func (m *SemanticCache) Equal(that interface{}) bool

Equal function

func (*SemanticCache) GetDatastore

func (x *SemanticCache) GetDatastore() *SemanticCache_DataStore

func (*SemanticCache) GetEmbedding

func (x *SemanticCache) GetEmbedding() *Embedding

func (*SemanticCache) GetMode

func (x *SemanticCache) GetMode() SemanticCache_Mode

func (*SemanticCache) GetTtl

func (x *SemanticCache) GetTtl() uint32

func (*SemanticCache) Hash deprecated

func (m *SemanticCache) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*SemanticCache) HashUnique

func (m *SemanticCache) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*SemanticCache) ProtoMessage

func (*SemanticCache) ProtoMessage()

func (*SemanticCache) ProtoReflect

func (x *SemanticCache) ProtoReflect() protoreflect.Message

func (*SemanticCache) Reset

func (x *SemanticCache) Reset()

func (*SemanticCache) String

func (x *SemanticCache) String() string

type SemanticCache_DataStore

type SemanticCache_DataStore struct {

	// Types that are assignable to Datastore:
	//
	//	*SemanticCache_DataStore_Redis
	//	*SemanticCache_DataStore_Weaviate
	Datastore isSemanticCache_DataStore_Datastore `protobuf_oneof:"datastore"`
	// contains filtered or unexported fields
}

Data store from which to cache the request and response pairs.

func (*SemanticCache_DataStore) Clone

Clone function

func (*SemanticCache_DataStore) Descriptor deprecated

func (*SemanticCache_DataStore) Descriptor() ([]byte, []int)

Deprecated: Use SemanticCache_DataStore.ProtoReflect.Descriptor instead.

func (*SemanticCache_DataStore) Equal

func (m *SemanticCache_DataStore) Equal(that interface{}) bool

Equal function

func (*SemanticCache_DataStore) GetDatastore

func (m *SemanticCache_DataStore) GetDatastore() isSemanticCache_DataStore_Datastore

func (*SemanticCache_DataStore) GetRedis

func (*SemanticCache_DataStore) GetWeaviate

func (*SemanticCache_DataStore) Hash deprecated

func (m *SemanticCache_DataStore) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*SemanticCache_DataStore) HashUnique

func (m *SemanticCache_DataStore) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*SemanticCache_DataStore) ProtoMessage

func (*SemanticCache_DataStore) ProtoMessage()

func (*SemanticCache_DataStore) ProtoReflect

func (x *SemanticCache_DataStore) ProtoReflect() protoreflect.Message

func (*SemanticCache_DataStore) Reset

func (x *SemanticCache_DataStore) Reset()

func (*SemanticCache_DataStore) String

func (x *SemanticCache_DataStore) String() string

type SemanticCache_DataStore_Redis

type SemanticCache_DataStore_Redis struct {
	// Settings for a Redis database.
	Redis *SemanticCache_Redis `protobuf:"bytes,1,opt,name=redis,proto3,oneof"`
}

type SemanticCache_DataStore_Weaviate

type SemanticCache_DataStore_Weaviate struct {
	// Settings for a Weaviate database.
	Weaviate *SemanticCache_Weaviate `protobuf:"bytes,2,opt,name=weaviate,proto3,oneof"`
}

type SemanticCache_Mode

type SemanticCache_Mode int32

The caching mode to use for the request and response lifecycle.

const (
	// Read and write to the cache as a part of the request and response lifecycle.
	SemanticCache_READ_WRITE SemanticCache_Mode = 0
	// Only read from the cache, and do not write to it.
	// Data is written to the cache outside of the request and response cycle.
	SemanticCache_READ_ONLY SemanticCache_Mode = 1
)

func (SemanticCache_Mode) Descriptor

func (SemanticCache_Mode) Enum

func (SemanticCache_Mode) EnumDescriptor deprecated

func (SemanticCache_Mode) EnumDescriptor() ([]byte, []int)

Deprecated: Use SemanticCache_Mode.Descriptor instead.

func (SemanticCache_Mode) Number

func (SemanticCache_Mode) String

func (x SemanticCache_Mode) String() string

func (SemanticCache_Mode) Type

type SemanticCache_Redis

type SemanticCache_Redis struct {

	// Connection string to the Redis database, such as `redis://172.17.0.1:6379`.
	ConnectionString string `protobuf:"bytes,1,opt,name=connection_string,json=connectionString,proto3" json:"connection_string,omitempty"`
	// Similarity score threshold value between 0.0 and 1.0 that determines how similar
	// two queries must be in order to return a cached result.
	// The lower the number, the more similar the queries must be for a cache hit.
	//
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=1
	ScoreThreshold float32 `protobuf:"fixed32,2,opt,name=score_threshold,json=scoreThreshold,proto3" json:"score_threshold,omitempty"`
	// contains filtered or unexported fields
}

Settings for a Redis database.

func (*SemanticCache_Redis) Clone

func (m *SemanticCache_Redis) Clone() proto.Message

Clone function

func (*SemanticCache_Redis) Descriptor deprecated

func (*SemanticCache_Redis) Descriptor() ([]byte, []int)

Deprecated: Use SemanticCache_Redis.ProtoReflect.Descriptor instead.

func (*SemanticCache_Redis) Equal

func (m *SemanticCache_Redis) Equal(that interface{}) bool

Equal function

func (*SemanticCache_Redis) GetConnectionString

func (x *SemanticCache_Redis) GetConnectionString() string

func (*SemanticCache_Redis) GetScoreThreshold

func (x *SemanticCache_Redis) GetScoreThreshold() float32

func (*SemanticCache_Redis) Hash deprecated

func (m *SemanticCache_Redis) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*SemanticCache_Redis) HashUnique

func (m *SemanticCache_Redis) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*SemanticCache_Redis) ProtoMessage

func (*SemanticCache_Redis) ProtoMessage()

func (*SemanticCache_Redis) ProtoReflect

func (x *SemanticCache_Redis) ProtoReflect() protoreflect.Message

func (*SemanticCache_Redis) Reset

func (x *SemanticCache_Redis) Reset()

func (*SemanticCache_Redis) String

func (x *SemanticCache_Redis) String() string

type SemanticCache_Weaviate

type SemanticCache_Weaviate struct {

	// Connection string to the Weaviate database.
	// Do not include the scheme. For example, the format
	// `weaviate.my-ns.svc.cluster.local` is correct. The format
	// `http://weaviate.my-ns.svc.cluster.local`, which includes the scheme, is incorrect.
	Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"`
	// HTTP port to use. If unset, defaults to `8080`.
	HttpPort uint32 `protobuf:"varint,2,opt,name=http_port,json=httpPort,proto3" json:"http_port,omitempty"`
	// GRPC port to use. If unset, defaults to `50051`.
	GrpcPort uint32 `protobuf:"varint,3,opt,name=grpc_port,json=grpcPort,proto3" json:"grpc_port,omitempty"`
	// Whether to use a secure connection. Defaults to `true`.
	Insecure bool `protobuf:"varint,4,opt,name=insecure,proto3" json:"insecure,omitempty"`
	// contains filtered or unexported fields
}

Settings for a Weaviate database.

func (*SemanticCache_Weaviate) Clone

Clone function

func (*SemanticCache_Weaviate) Descriptor deprecated

func (*SemanticCache_Weaviate) Descriptor() ([]byte, []int)

Deprecated: Use SemanticCache_Weaviate.ProtoReflect.Descriptor instead.

func (*SemanticCache_Weaviate) Equal

func (m *SemanticCache_Weaviate) Equal(that interface{}) bool

Equal function

func (*SemanticCache_Weaviate) GetGrpcPort

func (x *SemanticCache_Weaviate) GetGrpcPort() uint32

func (*SemanticCache_Weaviate) GetHost

func (x *SemanticCache_Weaviate) GetHost() string

func (*SemanticCache_Weaviate) GetHttpPort

func (x *SemanticCache_Weaviate) GetHttpPort() uint32

func (*SemanticCache_Weaviate) GetInsecure

func (x *SemanticCache_Weaviate) GetInsecure() bool

func (*SemanticCache_Weaviate) Hash deprecated

func (m *SemanticCache_Weaviate) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*SemanticCache_Weaviate) HashUnique

func (m *SemanticCache_Weaviate) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*SemanticCache_Weaviate) ProtoMessage

func (*SemanticCache_Weaviate) ProtoMessage()

func (*SemanticCache_Weaviate) ProtoReflect

func (x *SemanticCache_Weaviate) ProtoReflect() protoreflect.Message

func (*SemanticCache_Weaviate) Reset

func (x *SemanticCache_Weaviate) Reset()

func (*SemanticCache_Weaviate) String

func (x *SemanticCache_Weaviate) String() string

type SingleAuthToken

type SingleAuthToken struct {

	// Types that are assignable to AuthTokenSource:
	//
	//	*SingleAuthToken_Inline
	//	*SingleAuthToken_SecretRef
	//	*SingleAuthToken_Passthrough_
	AuthTokenSource isSingleAuthToken_AuthTokenSource `protobuf_oneof:"auth_token_source"`
	// contains filtered or unexported fields
}

The authorization token that the AI gateway uses to access the LLM provider API. This token is automatically sent in a request header, depending on the LLM provider.

func (*SingleAuthToken) Clone

func (m *SingleAuthToken) Clone() proto.Message

Clone function

func (*SingleAuthToken) Descriptor deprecated

func (*SingleAuthToken) Descriptor() ([]byte, []int)

Deprecated: Use SingleAuthToken.ProtoReflect.Descriptor instead.

func (*SingleAuthToken) Equal

func (m *SingleAuthToken) Equal(that interface{}) bool

Equal function

func (*SingleAuthToken) GetAuthTokenSource

func (m *SingleAuthToken) GetAuthTokenSource() isSingleAuthToken_AuthTokenSource

func (*SingleAuthToken) GetInline

func (x *SingleAuthToken) GetInline() string

func (*SingleAuthToken) GetPassthrough

func (x *SingleAuthToken) GetPassthrough() *SingleAuthToken_Passthrough

func (*SingleAuthToken) GetSecretRef

func (x *SingleAuthToken) GetSecretRef() *core.ResourceRef

func (*SingleAuthToken) Hash deprecated

func (m *SingleAuthToken) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*SingleAuthToken) HashUnique

func (m *SingleAuthToken) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*SingleAuthToken) ProtoMessage

func (*SingleAuthToken) ProtoMessage()

func (*SingleAuthToken) ProtoReflect

func (x *SingleAuthToken) ProtoReflect() protoreflect.Message

func (*SingleAuthToken) Reset

func (x *SingleAuthToken) Reset()

func (*SingleAuthToken) String

func (x *SingleAuthToken) String() string

type SingleAuthToken_Inline

type SingleAuthToken_Inline struct {
	// Provide the token directly in the configuration for the Upstream.
	// This option is the least secure. Only use this option for quick tests such as trying out AI Gateway.
	Inline string `protobuf:"bytes,1,opt,name=inline,proto3,oneof"`
}

type SingleAuthToken_Passthrough

type SingleAuthToken_Passthrough struct {
	// contains filtered or unexported fields
}

Configuration for passthrough of the existing token. Currently, specifying an empty object (`passthrough: {}`) indicates that passthrough will be used for auth.

func (*SingleAuthToken_Passthrough) Clone

Clone function

func (*SingleAuthToken_Passthrough) Descriptor deprecated

func (*SingleAuthToken_Passthrough) Descriptor() ([]byte, []int)

Deprecated: Use SingleAuthToken_Passthrough.ProtoReflect.Descriptor instead.

func (*SingleAuthToken_Passthrough) Equal

func (m *SingleAuthToken_Passthrough) Equal(that interface{}) bool

Equal function

func (*SingleAuthToken_Passthrough) Hash deprecated

func (m *SingleAuthToken_Passthrough) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*SingleAuthToken_Passthrough) HashUnique

func (m *SingleAuthToken_Passthrough) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*SingleAuthToken_Passthrough) ProtoMessage

func (*SingleAuthToken_Passthrough) ProtoMessage()

func (*SingleAuthToken_Passthrough) ProtoReflect

func (*SingleAuthToken_Passthrough) Reset

func (x *SingleAuthToken_Passthrough) Reset()

func (*SingleAuthToken_Passthrough) String

func (x *SingleAuthToken_Passthrough) String() string

type SingleAuthToken_Passthrough_

type SingleAuthToken_Passthrough_ struct {
	// Passthrough the existing token. This token can either
	// come directly from the client, or be generated by an OIDC flow
	// early in the request lifecycle. This option is useful for
	// backends which have federated identity setup and can re-use
	// the token from the client.
	// Currently, this token must exist in the `Authorization` header.
	Passthrough *SingleAuthToken_Passthrough `protobuf:"bytes,3,opt,name=passthrough,proto3,oneof"`
}

type SingleAuthToken_SecretRef

type SingleAuthToken_SecretRef struct {
	// Store the API key in a Kubernetes secret in the same namespace as the Upstream.
	// Then, refer to the secret in the Upstream configuration. This option is more secure than an inline token,
	// because the API key is encoded and you can restrict access to secrets through RBAC rules.
	// You might use this option in proofs of concept, controlled development and staging environments,
	// or well-controlled prod environments that use secrets.
	SecretRef *core.ResourceRef `protobuf:"bytes,2,opt,name=secret_ref,json=secretRef,proto3,oneof"`
}

type UpstreamSpec

type UpstreamSpec struct {

	// Types that are assignable to Llm:
	//
	//	*UpstreamSpec_Openai
	//	*UpstreamSpec_Mistral_
	//	*UpstreamSpec_Anthropic_
	//	*UpstreamSpec_AzureOpenai
	//	*UpstreamSpec_Multi
	//	*UpstreamSpec_Gemini_
	//	*UpstreamSpec_VertexAi
	Llm isUpstreamSpec_Llm `protobuf_oneof:"llm"`
	// contains filtered or unexported fields
}

When you deploy the Gloo AI Gateway, you can use the `spec.ai` section of the Upstream resource to represent a backend for a logical Large Language Model (LLM) provider. This section configures the LLM provider that the AI Gateway routes requests to, and how the gateway should authenticate with the provider. Note that other Gloo AI Gateway LLM features, such as prompt guards and prompt enrichment, are configured at the route level in the [`spec.options.ai` section of the RouteOptions resource](#routesettings).

To get started, see [About Gloo AI Gateway]({{% versioned_link_path fromRoot="/ai/overview/" %}}). For more information about the Upstream resource, see the [API reference]({{% versioned_link_path fromRoot="/reference/api/github.com/solo-io/gloo/projects/gloo/api/v1/upstream.proto.sk/" %}}).

{{% notice note %}} AI Gateway is an Enterprise-only feature that requires a Gloo Gateway Enterprise license with an AI Gateway add-on. {{% /notice %}}

func (*UpstreamSpec) Clone

func (m *UpstreamSpec) Clone() proto.Message

Clone function

func (*UpstreamSpec) Descriptor deprecated

func (*UpstreamSpec) Descriptor() ([]byte, []int)

Deprecated: Use UpstreamSpec.ProtoReflect.Descriptor instead.

func (*UpstreamSpec) Equal

func (m *UpstreamSpec) Equal(that interface{}) bool

Equal function

func (*UpstreamSpec) GetAnthropic

func (x *UpstreamSpec) GetAnthropic() *UpstreamSpec_Anthropic

func (*UpstreamSpec) GetAzureOpenai

func (x *UpstreamSpec) GetAzureOpenai() *UpstreamSpec_AzureOpenAI

func (*UpstreamSpec) GetGemini

func (x *UpstreamSpec) GetGemini() *UpstreamSpec_Gemini

func (*UpstreamSpec) GetLlm

func (m *UpstreamSpec) GetLlm() isUpstreamSpec_Llm

func (*UpstreamSpec) GetMistral

func (x *UpstreamSpec) GetMistral() *UpstreamSpec_Mistral

func (*UpstreamSpec) GetMulti

func (x *UpstreamSpec) GetMulti() *UpstreamSpec_MultiPool

func (*UpstreamSpec) GetOpenai

func (x *UpstreamSpec) GetOpenai() *UpstreamSpec_OpenAI

func (*UpstreamSpec) GetVertexAi

func (x *UpstreamSpec) GetVertexAi() *UpstreamSpec_VertexAI

func (*UpstreamSpec) Hash deprecated

func (m *UpstreamSpec) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*UpstreamSpec) HashUnique

func (m *UpstreamSpec) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*UpstreamSpec) ProtoMessage

func (*UpstreamSpec) ProtoMessage()

func (*UpstreamSpec) ProtoReflect

func (x *UpstreamSpec) ProtoReflect() protoreflect.Message

func (*UpstreamSpec) Reset

func (x *UpstreamSpec) Reset()

func (*UpstreamSpec) String

func (x *UpstreamSpec) String() string

type UpstreamSpec_Anthropic

type UpstreamSpec_Anthropic struct {

	// The authorization token that the AI gateway uses to access the Anthropic API.
	// This token is automatically sent in the `x-api-key` header of the request.
	AuthToken *SingleAuthToken `protobuf:"bytes,1,opt,name=auth_token,json=authToken,proto3" json:"auth_token,omitempty"`
	// Optional: Send requests to a custom host and port, such as to proxy the request,
	// or to use a different backend that is API-compliant with the upstream version.
	CustomHost *UpstreamSpec_CustomHost `protobuf:"bytes,2,opt,name=custom_host,json=customHost,proto3" json:"custom_host,omitempty"`
	// Optional: A version header to pass to the Anthropic API.
	// For more information, see the [Anthropic API versioning docs](https://docs.anthropic.com/en/api/versioning).
	Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"`
	// Optional: Override the model name.
	// If unset, the model name is taken from the request.
	// This setting can be useful when testing model failover scenarios.
	Model string `protobuf:"bytes,4,opt,name=model,proto3" json:"model,omitempty"`
	// contains filtered or unexported fields
}

Settings for the [Anthropic](https://docs.anthropic.com/en/release-notes/api) LLM provider.

func (*UpstreamSpec_Anthropic) Clone

Clone function

func (*UpstreamSpec_Anthropic) Descriptor deprecated

func (*UpstreamSpec_Anthropic) Descriptor() ([]byte, []int)

Deprecated: Use UpstreamSpec_Anthropic.ProtoReflect.Descriptor instead.

func (*UpstreamSpec_Anthropic) Equal

func (m *UpstreamSpec_Anthropic) Equal(that interface{}) bool

Equal function

func (*UpstreamSpec_Anthropic) GetAuthToken

func (x *UpstreamSpec_Anthropic) GetAuthToken() *SingleAuthToken

func (*UpstreamSpec_Anthropic) GetCustomHost

func (x *UpstreamSpec_Anthropic) GetCustomHost() *UpstreamSpec_CustomHost

func (*UpstreamSpec_Anthropic) GetModel

func (x *UpstreamSpec_Anthropic) GetModel() string

func (*UpstreamSpec_Anthropic) GetVersion

func (x *UpstreamSpec_Anthropic) GetVersion() string

func (*UpstreamSpec_Anthropic) Hash deprecated

func (m *UpstreamSpec_Anthropic) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*UpstreamSpec_Anthropic) HashUnique

func (m *UpstreamSpec_Anthropic) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*UpstreamSpec_Anthropic) ProtoMessage

func (*UpstreamSpec_Anthropic) ProtoMessage()

func (*UpstreamSpec_Anthropic) ProtoReflect

func (x *UpstreamSpec_Anthropic) ProtoReflect() protoreflect.Message

func (*UpstreamSpec_Anthropic) Reset

func (x *UpstreamSpec_Anthropic) Reset()

func (*UpstreamSpec_Anthropic) String

func (x *UpstreamSpec_Anthropic) String() string

type UpstreamSpec_Anthropic_

type UpstreamSpec_Anthropic_ struct {
	// Configure an [Anthropic](https://docs.anthropic.com/en/release-notes/api) backend.
	Anthropic *UpstreamSpec_Anthropic `protobuf:"bytes,3,opt,name=anthropic,proto3,oneof"`
}

type UpstreamSpec_AzureOpenAI

type UpstreamSpec_AzureOpenAI struct {

	// The authorization token that the AI gateway uses to access the Azure OpenAI API.
	// This token is automatically sent in the `api-key` header of the request.
	//
	// Types that are assignable to AuthTokenSource:
	//
	//	*UpstreamSpec_AzureOpenAI_AuthToken
	AuthTokenSource isUpstreamSpec_AzureOpenAI_AuthTokenSource `protobuf_oneof:"auth_token_source"`
	// The endpoint for the Azure OpenAI API to use, such as `my-endpoint.openai.azure.com`.
	// If the scheme is included, it is stripped.
	Endpoint string `protobuf:"bytes,2,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
	// The name of the Azure OpenAI model deployment to use.
	// For more information, see the [Azure OpenAI model docs](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models).
	DeploymentName string `protobuf:"bytes,3,opt,name=deployment_name,json=deploymentName,proto3" json:"deployment_name,omitempty"`
	// The version of the Azure OpenAI API to use.
	// For more information, see the [Azure OpenAI API version reference](https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#api-specs).
	ApiVersion string `protobuf:"bytes,4,opt,name=api_version,json=apiVersion,proto3" json:"api_version,omitempty"`
	// contains filtered or unexported fields
}

Settings for the [Azure OpenAI](https://learn.microsoft.com/en-us/azure/ai-services/openai/) LLM provider. To find the values for the endpoint, deployment name, and API version, you can check the fields of an API request, such as `https://{endpoint}/openai/deployments/{deployment_name}/chat/completions?api-version={api_version}`.

func (*UpstreamSpec_AzureOpenAI) Clone

Clone function

func (*UpstreamSpec_AzureOpenAI) Descriptor deprecated

func (*UpstreamSpec_AzureOpenAI) Descriptor() ([]byte, []int)

Deprecated: Use UpstreamSpec_AzureOpenAI.ProtoReflect.Descriptor instead.

func (*UpstreamSpec_AzureOpenAI) Equal

func (m *UpstreamSpec_AzureOpenAI) Equal(that interface{}) bool

Equal function

func (*UpstreamSpec_AzureOpenAI) GetApiVersion

func (x *UpstreamSpec_AzureOpenAI) GetApiVersion() string

func (*UpstreamSpec_AzureOpenAI) GetAuthToken

func (x *UpstreamSpec_AzureOpenAI) GetAuthToken() *SingleAuthToken

func (*UpstreamSpec_AzureOpenAI) GetAuthTokenSource

func (m *UpstreamSpec_AzureOpenAI) GetAuthTokenSource() isUpstreamSpec_AzureOpenAI_AuthTokenSource

func (*UpstreamSpec_AzureOpenAI) GetDeploymentName

func (x *UpstreamSpec_AzureOpenAI) GetDeploymentName() string

func (*UpstreamSpec_AzureOpenAI) GetEndpoint

func (x *UpstreamSpec_AzureOpenAI) GetEndpoint() string

func (*UpstreamSpec_AzureOpenAI) Hash deprecated

func (m *UpstreamSpec_AzureOpenAI) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*UpstreamSpec_AzureOpenAI) HashUnique

func (m *UpstreamSpec_AzureOpenAI) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*UpstreamSpec_AzureOpenAI) ProtoMessage

func (*UpstreamSpec_AzureOpenAI) ProtoMessage()

func (*UpstreamSpec_AzureOpenAI) ProtoReflect

func (x *UpstreamSpec_AzureOpenAI) ProtoReflect() protoreflect.Message

func (*UpstreamSpec_AzureOpenAI) Reset

func (x *UpstreamSpec_AzureOpenAI) Reset()

func (*UpstreamSpec_AzureOpenAI) String

func (x *UpstreamSpec_AzureOpenAI) String() string

type UpstreamSpec_AzureOpenAI_AuthToken

type UpstreamSpec_AzureOpenAI_AuthToken struct {
	// The authorization token that the AI gateway uses to access the Azure OpenAI API.
	// This token is automatically sent in the `api-key` header of the request.
	AuthToken *SingleAuthToken `protobuf:"bytes,1,opt,name=auth_token,json=authToken,proto3,oneof"` // use AD or other workload identity mechanism
}

type UpstreamSpec_AzureOpenai

type UpstreamSpec_AzureOpenai struct {
	// Configure an [Azure OpenAI](https://learn.microsoft.com/en-us/azure/ai-services/openai/) backend.
	AzureOpenai *UpstreamSpec_AzureOpenAI `protobuf:"bytes,4,opt,name=azure_openai,json=azureOpenai,proto3,oneof"`
}

type UpstreamSpec_CustomHost

type UpstreamSpec_CustomHost struct {

	// Custom host to send the traffic requests to.
	Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"`
	// Custom port to send the traffic requests to.
	Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"`
	// contains filtered or unexported fields
}

Send requests to a custom host and port, such as to proxy the request, or to use a different backend that is API-compliant with the upstream version.

func (*UpstreamSpec_CustomHost) Clone

Clone function

func (*UpstreamSpec_CustomHost) Descriptor deprecated

func (*UpstreamSpec_CustomHost) Descriptor() ([]byte, []int)

Deprecated: Use UpstreamSpec_CustomHost.ProtoReflect.Descriptor instead.

func (*UpstreamSpec_CustomHost) Equal

func (m *UpstreamSpec_CustomHost) Equal(that interface{}) bool

Equal function

func (*UpstreamSpec_CustomHost) GetHost

func (x *UpstreamSpec_CustomHost) GetHost() string

func (*UpstreamSpec_CustomHost) GetPort

func (x *UpstreamSpec_CustomHost) GetPort() uint32

func (*UpstreamSpec_CustomHost) Hash deprecated

func (m *UpstreamSpec_CustomHost) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*UpstreamSpec_CustomHost) HashUnique

func (m *UpstreamSpec_CustomHost) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*UpstreamSpec_CustomHost) ProtoMessage

func (*UpstreamSpec_CustomHost) ProtoMessage()

func (*UpstreamSpec_CustomHost) ProtoReflect

func (x *UpstreamSpec_CustomHost) ProtoReflect() protoreflect.Message

func (*UpstreamSpec_CustomHost) Reset

func (x *UpstreamSpec_CustomHost) Reset()

func (*UpstreamSpec_CustomHost) String

func (x *UpstreamSpec_CustomHost) String() string

type UpstreamSpec_Gemini

type UpstreamSpec_Gemini struct {

	// The authorization token that the AI gateway uses to access the Gemini API.
	// This token is automatically sent in the `key` query parameter of the request.
	//
	// Types that are assignable to AuthTokenSource:
	//
	//	*UpstreamSpec_Gemini_AuthToken
	AuthTokenSource isUpstreamSpec_Gemini_AuthTokenSource `protobuf_oneof:"auth_token_source"`
	// The Gemini model to use.
	// For more information, see the [Gemini models docs](https://ai.google.dev/gemini-api/docs/models/gemini).
	Model string `protobuf:"bytes,2,opt,name=model,proto3" json:"model,omitempty"`
	// The version of the Gemini API to use.
	// For more information, see the [Gemini API version docs](https://ai.google.dev/gemini-api/docs/api-versions).
	ApiVersion string `protobuf:"bytes,3,opt,name=api_version,json=apiVersion,proto3" json:"api_version,omitempty"`
	// contains filtered or unexported fields
}

Settings for the [Gemini](https://ai.google.dev/gemini-api/docs) LLM provider. To find the values for the model and API version, you can check the fields of an API request, such as `https://generativelanguage.googleapis.com/{version}/models/{model}:generateContent?key={api_key}`.

func (*UpstreamSpec_Gemini) Clone

func (m *UpstreamSpec_Gemini) Clone() proto.Message

Clone function

func (*UpstreamSpec_Gemini) Descriptor deprecated

func (*UpstreamSpec_Gemini) Descriptor() ([]byte, []int)

Deprecated: Use UpstreamSpec_Gemini.ProtoReflect.Descriptor instead.

func (*UpstreamSpec_Gemini) Equal

func (m *UpstreamSpec_Gemini) Equal(that interface{}) bool

Equal function

func (*UpstreamSpec_Gemini) GetApiVersion

func (x *UpstreamSpec_Gemini) GetApiVersion() string

func (*UpstreamSpec_Gemini) GetAuthToken

func (x *UpstreamSpec_Gemini) GetAuthToken() *SingleAuthToken

func (*UpstreamSpec_Gemini) GetAuthTokenSource

func (m *UpstreamSpec_Gemini) GetAuthTokenSource() isUpstreamSpec_Gemini_AuthTokenSource

func (*UpstreamSpec_Gemini) GetModel

func (x *UpstreamSpec_Gemini) GetModel() string

func (*UpstreamSpec_Gemini) Hash deprecated

func (m *UpstreamSpec_Gemini) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*UpstreamSpec_Gemini) HashUnique

func (m *UpstreamSpec_Gemini) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*UpstreamSpec_Gemini) ProtoMessage

func (*UpstreamSpec_Gemini) ProtoMessage()

func (*UpstreamSpec_Gemini) ProtoReflect

func (x *UpstreamSpec_Gemini) ProtoReflect() protoreflect.Message

func (*UpstreamSpec_Gemini) Reset

func (x *UpstreamSpec_Gemini) Reset()

func (*UpstreamSpec_Gemini) String

func (x *UpstreamSpec_Gemini) String() string

type UpstreamSpec_Gemini_

type UpstreamSpec_Gemini_ struct {
	// Configure a [Gemini](https://ai.google.dev/gemini-api/docs) backend.
	Gemini *UpstreamSpec_Gemini `protobuf:"bytes,6,opt,name=gemini,proto3,oneof"`
}

type UpstreamSpec_Gemini_AuthToken

type UpstreamSpec_Gemini_AuthToken struct {
	// The authorization token that the AI gateway uses to access the Gemini API.
	// This token is automatically sent in the `key` query parameter of the request.
	AuthToken *SingleAuthToken `protobuf:"bytes,1,opt,name=auth_token,json=authToken,proto3,oneof"` // TODO: use oauth
}

type UpstreamSpec_Mistral

type UpstreamSpec_Mistral struct {

	// The authorization token that the AI gateway uses to access the OpenAI API.
	// This token is automatically sent in the `Authorization` header of the
	// request and prefixed with `Bearer`.
	AuthToken *SingleAuthToken `protobuf:"bytes,1,opt,name=auth_token,json=authToken,proto3" json:"auth_token,omitempty"`
	// Optional: Send requests to a custom host and port, such as to proxy the request,
	// or to use a different backend that is API-compliant with the upstream version.
	CustomHost *UpstreamSpec_CustomHost `protobuf:"bytes,2,opt,name=custom_host,json=customHost,proto3" json:"custom_host,omitempty"`
	// Optional: Override the model name.
	// If unset, the model name is taken from the request.
	// This setting can be useful when testing model failover scenarios.
	Model string `protobuf:"bytes,3,opt,name=model,proto3" json:"model,omitempty"`
	// contains filtered or unexported fields
}

Settings for the [Mistral AI](https://docs.mistral.ai/getting-started/quickstart/) LLM provider.

func (*UpstreamSpec_Mistral) Clone

func (m *UpstreamSpec_Mistral) Clone() proto.Message

Clone function

func (*UpstreamSpec_Mistral) Descriptor deprecated

func (*UpstreamSpec_Mistral) Descriptor() ([]byte, []int)

Deprecated: Use UpstreamSpec_Mistral.ProtoReflect.Descriptor instead.

func (*UpstreamSpec_Mistral) Equal

func (m *UpstreamSpec_Mistral) Equal(that interface{}) bool

Equal function

func (*UpstreamSpec_Mistral) GetAuthToken

func (x *UpstreamSpec_Mistral) GetAuthToken() *SingleAuthToken

func (*UpstreamSpec_Mistral) GetCustomHost

func (x *UpstreamSpec_Mistral) GetCustomHost() *UpstreamSpec_CustomHost

func (*UpstreamSpec_Mistral) GetModel

func (x *UpstreamSpec_Mistral) GetModel() string

func (*UpstreamSpec_Mistral) Hash deprecated

func (m *UpstreamSpec_Mistral) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*UpstreamSpec_Mistral) HashUnique

func (m *UpstreamSpec_Mistral) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*UpstreamSpec_Mistral) ProtoMessage

func (*UpstreamSpec_Mistral) ProtoMessage()

func (*UpstreamSpec_Mistral) ProtoReflect

func (x *UpstreamSpec_Mistral) ProtoReflect() protoreflect.Message

func (*UpstreamSpec_Mistral) Reset

func (x *UpstreamSpec_Mistral) Reset()

func (*UpstreamSpec_Mistral) String

func (x *UpstreamSpec_Mistral) String() string

type UpstreamSpec_Mistral_

type UpstreamSpec_Mistral_ struct {
	// Configure a [Mistral AI](https://docs.mistral.ai/getting-started/quickstart/) backend.
	Mistral *UpstreamSpec_Mistral `protobuf:"bytes,2,opt,name=mistral,proto3,oneof"`
}

type UpstreamSpec_Multi

type UpstreamSpec_Multi struct {
	// Configure backends for multiple LLM providers in one logical endpoint.
	Multi *UpstreamSpec_MultiPool `protobuf:"bytes,5,opt,name=multi,proto3,oneof"`
}

type UpstreamSpec_MultiPool

type UpstreamSpec_MultiPool struct {

	// The order of `pool` entries within this section defines the priority of the backend endpoints.
	Priorities []*UpstreamSpec_MultiPool_Priority `protobuf:"bytes,1,rep,name=priorities,proto3" json:"priorities,omitempty"`
	// contains filtered or unexported fields
}

Configure backends for multiple hosts or models from the same provider in one Upstream resource. This method can be useful for creating one logical endpoint that is backed by multiple hosts or models.

In the `priorities` section, the order of `pool` entries defines the priority of the backend endpoints. The `pool` entries can either define a list of backends or a single backend. Note: Only two levels of nesting are permitted. Any nested entries after the second level are ignored.

```yaml multi:

priorities:
- pool:
  - azureOpenai:
      deploymentName: gpt-4o-mini
      apiVersion: 2024-02-15-preview
      endpoint: ai-gateway.openai.azure.com
      authToken:
        secretRef:
          name: azure-secret
          namespace: gloo-system
- pool:
  - azureOpenai:
      deploymentName: gpt-4o-mini-2
      apiVersion: 2024-02-15-preview
      endpoint: ai-gateway-2.openai.azure.com
      authToken:
        secretRef:
          name: azure-secret-2
          namespace: gloo-system

```

func (*UpstreamSpec_MultiPool) Clone

Clone function

func (*UpstreamSpec_MultiPool) Descriptor deprecated

func (*UpstreamSpec_MultiPool) Descriptor() ([]byte, []int)

Deprecated: Use UpstreamSpec_MultiPool.ProtoReflect.Descriptor instead.

func (*UpstreamSpec_MultiPool) Equal

func (m *UpstreamSpec_MultiPool) Equal(that interface{}) bool

Equal function

func (*UpstreamSpec_MultiPool) GetPriorities

func (*UpstreamSpec_MultiPool) Hash deprecated

func (m *UpstreamSpec_MultiPool) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*UpstreamSpec_MultiPool) HashUnique

func (m *UpstreamSpec_MultiPool) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*UpstreamSpec_MultiPool) ProtoMessage

func (*UpstreamSpec_MultiPool) ProtoMessage()

func (*UpstreamSpec_MultiPool) ProtoReflect

func (x *UpstreamSpec_MultiPool) ProtoReflect() protoreflect.Message

func (*UpstreamSpec_MultiPool) Reset

func (x *UpstreamSpec_MultiPool) Reset()

func (*UpstreamSpec_MultiPool) String

func (x *UpstreamSpec_MultiPool) String() string

type UpstreamSpec_MultiPool_Backend

type UpstreamSpec_MultiPool_Backend struct {

	// Types that are assignable to Llm:
	//
	//	*UpstreamSpec_MultiPool_Backend_Openai
	//	*UpstreamSpec_MultiPool_Backend_Mistral
	//	*UpstreamSpec_MultiPool_Backend_Anthropic
	//	*UpstreamSpec_MultiPool_Backend_AzureOpenai
	//	*UpstreamSpec_MultiPool_Backend_Gemini
	//	*UpstreamSpec_MultiPool_Backend_VertexAi
	Llm isUpstreamSpec_MultiPool_Backend_Llm `protobuf_oneof:"llm"`
	// contains filtered or unexported fields
}

An entry represeting an LLM provider backend that the AI Gateway routes requests to.

func (*UpstreamSpec_MultiPool_Backend) Clone

Clone function

func (*UpstreamSpec_MultiPool_Backend) Descriptor deprecated

func (*UpstreamSpec_MultiPool_Backend) Descriptor() ([]byte, []int)

Deprecated: Use UpstreamSpec_MultiPool_Backend.ProtoReflect.Descriptor instead.

func (*UpstreamSpec_MultiPool_Backend) Equal

func (m *UpstreamSpec_MultiPool_Backend) Equal(that interface{}) bool

Equal function

func (*UpstreamSpec_MultiPool_Backend) GetAnthropic

func (*UpstreamSpec_MultiPool_Backend) GetAzureOpenai

func (*UpstreamSpec_MultiPool_Backend) GetGemini

func (*UpstreamSpec_MultiPool_Backend) GetLlm

func (m *UpstreamSpec_MultiPool_Backend) GetLlm() isUpstreamSpec_MultiPool_Backend_Llm

func (*UpstreamSpec_MultiPool_Backend) GetMistral

func (*UpstreamSpec_MultiPool_Backend) GetOpenai

func (*UpstreamSpec_MultiPool_Backend) GetVertexAi

func (*UpstreamSpec_MultiPool_Backend) Hash deprecated

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*UpstreamSpec_MultiPool_Backend) HashUnique

func (m *UpstreamSpec_MultiPool_Backend) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*UpstreamSpec_MultiPool_Backend) ProtoMessage

func (*UpstreamSpec_MultiPool_Backend) ProtoMessage()

func (*UpstreamSpec_MultiPool_Backend) ProtoReflect

func (*UpstreamSpec_MultiPool_Backend) Reset

func (x *UpstreamSpec_MultiPool_Backend) Reset()

func (*UpstreamSpec_MultiPool_Backend) String

type UpstreamSpec_MultiPool_Backend_Anthropic

type UpstreamSpec_MultiPool_Backend_Anthropic struct {
	// Configure an [Anthropic](https://docs.anthropic.com/en/release-notes/api) backend.
	Anthropic *UpstreamSpec_Anthropic `protobuf:"bytes,3,opt,name=anthropic,proto3,oneof"`
}

type UpstreamSpec_MultiPool_Backend_AzureOpenai

type UpstreamSpec_MultiPool_Backend_AzureOpenai struct {
	// Configure an [Azure OpenAI](https://learn.microsoft.com/en-us/azure/ai-services/openai/) backend.
	AzureOpenai *UpstreamSpec_AzureOpenAI `protobuf:"bytes,4,opt,name=azure_openai,json=azureOpenai,proto3,oneof"`
}

type UpstreamSpec_MultiPool_Backend_Gemini

type UpstreamSpec_MultiPool_Backend_Gemini struct {
	// Configure a [Gemini](https://ai.google.dev/gemini-api/docs) backend.
	Gemini *UpstreamSpec_Gemini `protobuf:"bytes,5,opt,name=gemini,proto3,oneof"`
}

type UpstreamSpec_MultiPool_Backend_Mistral

type UpstreamSpec_MultiPool_Backend_Mistral struct {
	// Configure a [Mistral AI](https://docs.mistral.ai/getting-started/quickstart/) backend.
	Mistral *UpstreamSpec_Mistral `protobuf:"bytes,2,opt,name=mistral,proto3,oneof"`
}

type UpstreamSpec_MultiPool_Backend_Openai

type UpstreamSpec_MultiPool_Backend_Openai struct {
	// Configure an [OpenAI](https://platform.openai.com/docs/overview) backend.
	Openai *UpstreamSpec_OpenAI `protobuf:"bytes,1,opt,name=openai,proto3,oneof"`
}

type UpstreamSpec_MultiPool_Backend_VertexAi

type UpstreamSpec_MultiPool_Backend_VertexAi struct {
	// Configure a [Vertex AI](https://cloud.google.com/vertex-ai/docs) backend.
	VertexAi *UpstreamSpec_VertexAI `protobuf:"bytes,6,opt,name=vertex_ai,json=vertexAi,proto3,oneof"`
}

type UpstreamSpec_MultiPool_Priority

type UpstreamSpec_MultiPool_Priority struct {

	// A list of LLM provider backends within a single endpoint pool entry.
	Pool []*UpstreamSpec_MultiPool_Backend `protobuf:"bytes,1,rep,name=pool,proto3" json:"pool,omitempty"`
	// contains filtered or unexported fields
}

The order of `pool` entries within this section defines the priority of the backend endpoints.

func (*UpstreamSpec_MultiPool_Priority) Clone

Clone function

func (*UpstreamSpec_MultiPool_Priority) Descriptor deprecated

func (*UpstreamSpec_MultiPool_Priority) Descriptor() ([]byte, []int)

Deprecated: Use UpstreamSpec_MultiPool_Priority.ProtoReflect.Descriptor instead.

func (*UpstreamSpec_MultiPool_Priority) Equal

func (m *UpstreamSpec_MultiPool_Priority) Equal(that interface{}) bool

Equal function

func (*UpstreamSpec_MultiPool_Priority) GetPool

func (*UpstreamSpec_MultiPool_Priority) Hash deprecated

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*UpstreamSpec_MultiPool_Priority) HashUnique

func (m *UpstreamSpec_MultiPool_Priority) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*UpstreamSpec_MultiPool_Priority) ProtoMessage

func (*UpstreamSpec_MultiPool_Priority) ProtoMessage()

func (*UpstreamSpec_MultiPool_Priority) ProtoReflect

func (*UpstreamSpec_MultiPool_Priority) Reset

func (*UpstreamSpec_MultiPool_Priority) String

type UpstreamSpec_OpenAI

type UpstreamSpec_OpenAI struct {

	// The authorization token that the AI gateway uses to access the OpenAI API.
	// This token is automatically sent in the `Authorization` header of the
	// request and prefixed with `Bearer`.
	AuthToken *SingleAuthToken `protobuf:"bytes,1,opt,name=auth_token,json=authToken,proto3" json:"auth_token,omitempty"`
	// Optional: Send requests to a custom host and port, such as to proxy the request,
	// or to use a different backend that is API-compliant with the upstream version.
	CustomHost *UpstreamSpec_CustomHost `protobuf:"bytes,2,opt,name=custom_host,json=customHost,proto3" json:"custom_host,omitempty"`
	// Optional: Override the model name, such as `gpt-4o-mini`.
	// If unset, the model name is taken from the request.
	// This setting can be useful when setting up model failover within the same LLM provider.
	Model string `protobuf:"bytes,3,opt,name=model,proto3" json:"model,omitempty"`
	// contains filtered or unexported fields
}

Settings for the [OpenAI](https://platform.openai.com/docs/overview) LLM provider.

func (*UpstreamSpec_OpenAI) Clone

func (m *UpstreamSpec_OpenAI) Clone() proto.Message

Clone function

func (*UpstreamSpec_OpenAI) Descriptor deprecated

func (*UpstreamSpec_OpenAI) Descriptor() ([]byte, []int)

Deprecated: Use UpstreamSpec_OpenAI.ProtoReflect.Descriptor instead.

func (*UpstreamSpec_OpenAI) Equal

func (m *UpstreamSpec_OpenAI) Equal(that interface{}) bool

Equal function

func (*UpstreamSpec_OpenAI) GetAuthToken

func (x *UpstreamSpec_OpenAI) GetAuthToken() *SingleAuthToken

func (*UpstreamSpec_OpenAI) GetCustomHost

func (x *UpstreamSpec_OpenAI) GetCustomHost() *UpstreamSpec_CustomHost

func (*UpstreamSpec_OpenAI) GetModel

func (x *UpstreamSpec_OpenAI) GetModel() string

func (*UpstreamSpec_OpenAI) Hash deprecated

func (m *UpstreamSpec_OpenAI) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*UpstreamSpec_OpenAI) HashUnique

func (m *UpstreamSpec_OpenAI) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*UpstreamSpec_OpenAI) ProtoMessage

func (*UpstreamSpec_OpenAI) ProtoMessage()

func (*UpstreamSpec_OpenAI) ProtoReflect

func (x *UpstreamSpec_OpenAI) ProtoReflect() protoreflect.Message

func (*UpstreamSpec_OpenAI) Reset

func (x *UpstreamSpec_OpenAI) Reset()

func (*UpstreamSpec_OpenAI) String

func (x *UpstreamSpec_OpenAI) String() string

type UpstreamSpec_Openai

type UpstreamSpec_Openai struct {
	// Configure an [OpenAI](https://platform.openai.com/docs/overview) backend.
	Openai *UpstreamSpec_OpenAI `protobuf:"bytes,1,opt,name=openai,proto3,oneof"`
}

type UpstreamSpec_VertexAI

type UpstreamSpec_VertexAI struct {

	// The authorization token that the AI gateway uses to access the Vertex AI API.
	// This token is automatically sent in the `key` header of the request.
	//
	// Types that are assignable to AuthTokenSource:
	//
	//	*UpstreamSpec_VertexAI_AuthToken
	AuthTokenSource isUpstreamSpec_VertexAI_AuthTokenSource `protobuf_oneof:"auth_token_source"`
	// The Vertex AI model to use.
	// For more information, see the [Vertex AI model docs](https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models).
	Model string `protobuf:"bytes,2,opt,name=model,proto3" json:"model,omitempty"`
	// The version of the Vertex AI API to use.
	// For more information, see the [Vertex AI API reference](https://cloud.google.com/vertex-ai/docs/reference#versions).
	ApiVersion string `protobuf:"bytes,3,opt,name=api_version,json=apiVersion,proto3" json:"api_version,omitempty"`
	// The ID of the Google Cloud Project that you use for the Vertex AI.
	ProjectId string `protobuf:"bytes,4,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"`
	// The location of the Google Cloud Project that you use for the Vertex AI.
	Location string `protobuf:"bytes,5,opt,name=location,proto3" json:"location,omitempty"`
	// Optional: The model path to route to. Defaults to the Gemini model path, `generateContent`.
	ModelPath string `protobuf:"bytes,6,opt,name=model_path,json=modelPath,proto3" json:"model_path,omitempty"`
	// The type of publisher model to use. Currently, only Google is supported.
	Publisher UpstreamSpec_VertexAI_Publisher `` /* 133-byte string literal not displayed */
	// contains filtered or unexported fields
}

Settings for the [Vertex AI](https://cloud.google.com/vertex-ai/docs) LLM provider. To find the values for the project ID, project location, and publisher, you can check the fields of an API request, such as `https://{LOCATION}-aiplatform.googleapis.com/{VERSION}/projects/{PROJECT_ID}/locations/{LOCATION}/publishers/{PROVIDER}/<model-path>`.

func (*UpstreamSpec_VertexAI) Clone

func (m *UpstreamSpec_VertexAI) Clone() proto.Message

Clone function

func (*UpstreamSpec_VertexAI) Descriptor deprecated

func (*UpstreamSpec_VertexAI) Descriptor() ([]byte, []int)

Deprecated: Use UpstreamSpec_VertexAI.ProtoReflect.Descriptor instead.

func (*UpstreamSpec_VertexAI) Equal

func (m *UpstreamSpec_VertexAI) Equal(that interface{}) bool

Equal function

func (*UpstreamSpec_VertexAI) GetApiVersion

func (x *UpstreamSpec_VertexAI) GetApiVersion() string

func (*UpstreamSpec_VertexAI) GetAuthToken

func (x *UpstreamSpec_VertexAI) GetAuthToken() *SingleAuthToken

func (*UpstreamSpec_VertexAI) GetAuthTokenSource

func (m *UpstreamSpec_VertexAI) GetAuthTokenSource() isUpstreamSpec_VertexAI_AuthTokenSource

func (*UpstreamSpec_VertexAI) GetLocation

func (x *UpstreamSpec_VertexAI) GetLocation() string

func (*UpstreamSpec_VertexAI) GetModel

func (x *UpstreamSpec_VertexAI) GetModel() string

func (*UpstreamSpec_VertexAI) GetModelPath

func (x *UpstreamSpec_VertexAI) GetModelPath() string

func (*UpstreamSpec_VertexAI) GetProjectId

func (x *UpstreamSpec_VertexAI) GetProjectId() string

func (*UpstreamSpec_VertexAI) GetPublisher

func (*UpstreamSpec_VertexAI) Hash deprecated

func (m *UpstreamSpec_VertexAI) Hash(hasher hash.Hash64) (uint64, error)

Hash function

Deprecated: due to hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions. Prefer the HashUnique function instead.

func (*UpstreamSpec_VertexAI) HashUnique

func (m *UpstreamSpec_VertexAI) HashUnique(hasher hash.Hash64) (uint64, error)

HashUnique function generates a hash of the object that is unique to the object by hashing field name and value pairs. Replaces Hash due to original hashing implemention only using field values. The omission of the field name in the hash calculation can lead to hash collisions.

func (*UpstreamSpec_VertexAI) ProtoMessage

func (*UpstreamSpec_VertexAI) ProtoMessage()

func (*UpstreamSpec_VertexAI) ProtoReflect

func (x *UpstreamSpec_VertexAI) ProtoReflect() protoreflect.Message

func (*UpstreamSpec_VertexAI) Reset

func (x *UpstreamSpec_VertexAI) Reset()

func (*UpstreamSpec_VertexAI) String

func (x *UpstreamSpec_VertexAI) String() string

type UpstreamSpec_VertexAI_AuthToken

type UpstreamSpec_VertexAI_AuthToken struct {
	// The authorization token that the AI gateway uses to access the Vertex AI API.
	// This token is automatically sent in the `key` header of the request.
	AuthToken *SingleAuthToken `protobuf:"bytes,1,opt,name=auth_token,json=authToken,proto3,oneof"` // TODO: use oauth
}

type UpstreamSpec_VertexAI_Publisher

type UpstreamSpec_VertexAI_Publisher int32

The type of publisher model to use. Currently, only Google is supported.

const (
	UpstreamSpec_VertexAI_GOOGLE UpstreamSpec_VertexAI_Publisher = 0
)

func (UpstreamSpec_VertexAI_Publisher) Descriptor

func (UpstreamSpec_VertexAI_Publisher) Enum

func (UpstreamSpec_VertexAI_Publisher) EnumDescriptor deprecated

func (UpstreamSpec_VertexAI_Publisher) EnumDescriptor() ([]byte, []int)

Deprecated: Use UpstreamSpec_VertexAI_Publisher.Descriptor instead.

func (UpstreamSpec_VertexAI_Publisher) Number

func (UpstreamSpec_VertexAI_Publisher) String

func (UpstreamSpec_VertexAI_Publisher) Type

type UpstreamSpec_VertexAi

type UpstreamSpec_VertexAi struct {
	// Configure a [Vertex AI](https://cloud.google.com/vertex-ai/docs) backend.
	VertexAi *UpstreamSpec_VertexAI `protobuf:"bytes,7,opt,name=vertex_ai,json=vertexAi,proto3,oneof"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL