handlers

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: LGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateChatHandler

func CreateChatHandler(options CreateChatHandlerOptions) egoTypes.FHRequestHandler

CreateChatHandler returns a fasthttp request handler that does a chat conversation using the given options.

func CreateDownloadHandler added in v0.8.0

func CreateDownloadHandler() egoTypes.FHRequestHandler

func CreateGetApiKeySettingsHandler

func CreateGetApiKeySettingsHandler() egoTypes.FHRequestHandler

CreateGetApiKeySettingsHandler returns a handler function for getting API key settings.

func CreateGetSettingsHandler

func CreateGetSettingsHandler() egoTypes.FHRequestHandler

CreateGetSettingsHandler returns a fasthttp request handler that retrieves the UI settings file.

func CreateUpdateSettingsHandler

func CreateUpdateSettingsHandler() egoTypes.FHRequestHandler

CreateUpdateSettingsHandler returns a fasthttp request handler that updates the UI settings file.

Types

type ChatRequest

type ChatRequest struct {
	Conversation []string `json:"conversation"`           // Conversation represents the conversation history of the chat request
	SystemPrompt string   `json:"systemPrompt,omitempty"` // system prompt
	Temperature  *float64 `json:"temperature"`            // Temperature represents the temperature to use for generating the response
}

ChatRequest represents a chat request data structure

type ChatResponse

type ChatResponse struct {
	Answer string `json:"answer"` // Answer represents the answer to the chat request
	Time   string `json:"time"`   // Time represents the time at which the chat response is generated
}

ChatResponse represents a chat response data structure

type CreateChatHandlerOptions

type CreateChatHandlerOptions struct {
	CustomSystemPrompt string  // CustomSystemPrompt represents the custom system prompt to use for generating the response
	DefaultTemperature float64 // DefaultTemperature represents the default temperature to use for generating the response
	NoAdditionalInfo   bool    // NoAdditionalInfo specifies whether to include additional information in the response
	NoSystemInfo       bool    // NoSystemInfo specifies whether to include system information in the response
	NoTime             bool    // NoTime specifies whether to include time in the response
}

CreateChatHandlerOptions represents options for creating a chat handler

type GetApiKeySettingsResponse

type GetApiKeySettingsResponse struct {
	AccessType string `json:"accessType"` // Access type
	Error      string `json:"error"`      // Error message, which detecting `AccessType`
}

Jump to

Keyboard shortcuts

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