sdk

package
v1.3.0-rc.0...-0a48220 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AIProxyClientAK = "AI_PROXY_CLIENT_AK"
)

Variables

This section is empty.

Functions

func GetUserInfo

func GetUserInfo(ctx context.Context) (apistructs.UserInfo, error)

func VerifyArguments

func VerifyArguments(parameters, data json.RawMessage) (err error)

VerifyArguments verifies that the given JSON conforms to the JSON Schema FunctionDefinition.Parameters

Types

type Client

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

func NewClient

func NewClient(api *url.URL, client *http.Client, options ...RequestOption) (*Client, error)

func (*Client) CreateCompletion

func (c *Client) CreateCompletion(ctx context.Context, req *openai.ChatCompletionRequest) (*openai.ChatCompletionResponse, error)

func (*Client) HttpClient

func (c *Client) HttpClient() *http.Client

func (*Client) URLV1ChatCompletion

func (c *Client) URLV1ChatCompletion() string

type PatchOption

type PatchOption func(option *openai.ChatCompletionRequest)

func PathOptionWithModel

func PathOptionWithModel(model string) PatchOption

func PathOptionWithTemperature

func PathOptionWithTemperature(temperature float32) PatchOption

type RequestOption

type RequestOption func(r *http.Request)

func RequestOptionWithResetAPIVersion

func RequestOptionWithResetAPIVersion(version string) RequestOption

Jump to

Keyboard shortcuts

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