Documentation ¶
Index ¶
- func ComputeCacheKeyForChatCompletionRequest(path string, req *goopenai.ChatCompletionRequest) string
- func ComputeCacheKeyForEmbeddingsRequest(path string, req *goopenai.EmbeddingRequest) string
- func ConvertToArrayOfStrings(input []any) []string
- func ConvertToMapOfIntegers(input any) map[string]int
- func InitializeBackoff(strategy string, dur time.Duration) backoff.BackOff
- type CacheConfig
- type Request
- type Response
- type Route
- func (r *Route) RunSteps(req *Request, rec recorder, log *zap.Logger) (*Response, error)
- func (r *Route) RunStepsV2(req *Request, rec recorder, log *zap.Logger, kc *key.ResponseKey) (*Response, error)
- func (r *Route) ShouldRunEmbeddings() bool
- func (r *Route) ValidateSettings(settings []*provider.Setting) bool
- type Step
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeCacheKeyForChatCompletionRequest ¶ added in v1.7.1
func ComputeCacheKeyForChatCompletionRequest(path string, req *goopenai.ChatCompletionRequest) string
func ComputeCacheKeyForEmbeddingsRequest ¶ added in v1.7.1
func ComputeCacheKeyForEmbeddingsRequest(path string, req *goopenai.EmbeddingRequest) string
func ConvertToArrayOfStrings ¶ added in v1.25.0
func ConvertToMapOfIntegers ¶ added in v1.25.0
func InitializeBackoff ¶ added in v1.29.0
Types ¶
type CacheConfig ¶
type Request ¶
type Route ¶
type Route struct { Id string `json:"id"` RetryStrategy string `json:"retryStrategy"` RequestFormat string `json:"requestFormat"` CreatedAt int64 `json:"createdAt"` UpdatedAt int64 `json:"updatedAt"` Name string `json:"name"` Path string `json:"path"` KeyIds []string `json:"keyIds"` Steps []*Step `json:"steps"` CacheConfig *CacheConfig `json:"cacheConfig"` }
func (*Route) RunStepsV2 ¶ added in v1.29.0
func (*Route) ShouldRunEmbeddings ¶
type Step ¶
type Step struct { Retries int `json:"retries"` RetryInterval string `json:"retryInterval"` Provider string `json:"provider"` RequestParams map[string]any `json:"requestParams"` Params map[string]string `json:"params"` Model string `json:"model"` Timeout string `json:"timeout"` }
func (*Step) DecorateChatCompletionRequest ¶ added in v1.25.0
func (s *Step) DecorateChatCompletionRequest(req *goopenai.ChatCompletionRequest)
Click to show internal directories.
Click to hide internal directories.