Documentation
¶
Index ¶
- Constants
- type AiExecutionConfig
- type AiServiceMultiAnswer
- type AiServiceResult
- type AiServiceValue
- type AiServiceValueFile
- type AiServiceValueString
- type AuxDataClient
- func (c *AuxDataClient) ChatWithAllContainers(agentId int64, chat Chat) (ChatResult, error)
- func (c *AuxDataClient) ChatWithOneContainers(agentId int64, containerId int64, chat Chat) (ChatResult, error)
- func (c *AuxDataClient) ExecuteAiService(agentId int64, serviceId int64, parameters map[string]AiServiceValue) (ExecuteServiceResult, error)
- func (c *AuxDataClient) SearchOnAgent(agentId int64, search Search) (DetailSearchResult, error)
- func (c *AuxDataClient) SearchOnContainer(agentId int64, containerId int64, search Search) (DetailSearchResult, error)
- func (c *AuxDataClient) UploadFile(agentId int64, containerId int64, file FileData) ([]UploadedFilesResult, error)
- func (c *AuxDataClient) UploadFileFromDirectory(agentId int64, containerId int64, file FileDataToLoad) ([]UploadedFilesResult, error)
- type Chat
- type ChatCommunication
- type ChatResult
- type DetailSearchCommand
- type DetailSearchResult
- type ExecuteServiceCommand
- type ExecuteServiceResult
- type ExecuteServiceStepCommand
- type File
- type FileData
- type FileDataToLoad
- type PostProcessor
- type ProcessCallDefinition
- type Processor
- type ResultExample
- type Search
- type SearchChunkResult
- type UploadedFilesResult
- type User
- type UserConfig
Constants ¶
const ( DEFAULT_URL = "https://auxdata.ai" DEV_URL = "https://dev.auxdata.ai" DEBUG_URL = "http://localhost:8080" DEFAULT_MAX_RETRIES = 5 DEFAULT_TIMEOUT = 120 * time.Second BASE_ROUTE = "/api/v1" SEARCH_URL_ROUTE_AGENT = BASE_ROUTE + "/agent/${agentid}/document" SEARCH_URL_ROUTE_CONTAINER = BASE_ROUTE + "/agent/${agentid}/container/${containerid}/document" UPLOAD_URL_ROUTE = BASE_ROUTE + "/agent/${agentid}/container/${containerid}/document" CHAT_URL_ROUTE = BASE_ROUTE + "/agent/${agentid}/chat" CHAT_CONTAINER_URL_ROUTE = BASE_ROUTE + "/agent/${agentid}/container/${containerid}/chat" AISERVICE_URL_ROUTE = BASE_ROUTE + "/agent/${agentid}/executeservice/${serviceid}" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AiExecutionConfig ¶
type AiExecutionConfig struct {
Provider string `json:"provider"`
ChainOfThougtPrompting bool `json:"chainofthought"`
PalPrompting bool `json:"palprompting"`
ReflectionPrompting bool `json:"reflectionprompting"`
LogicRules bool `json:"logicrules"`
PromptDebugging bool `json:"promptdebugging"`
RollingChunks bool `json:"rollingchunks"`
MaxParameterSize int64 `json:"maxparametersize"` // 1000 - 100000
TopP int64 `json:"topp"` // 0 - 99
Temperature int64 `json:"temperature"` // 0 - 150
Language string `json:"language"`
Role string `json:"role"`
QualityGate float32 `json:"qualitygate"`
GptFallback bool `json:"gptfallback"`
ChunkLimit int64 `json:"chunklimit"`
DisableRAG bool `json:"disablerag"`
Containers []int64 `json:"containers"`
Customizing string `json:"customizing"`
HistoryDepth int64 `json:"historydepth"`
PresencePenalty float32 `json:"presencepenalty"` // openai specific
FrequencyPenalty float32 `json:"frequencypenalty"` // openai specific
Greeting string `json:"greeting"`
ImageSize string `json:"imagesize"`
Voice string `json:"voice"`
SaveInKnowledgeDb bool `json:"saveinknowledgedb"`
ContainerForSaveId int64 `json:"containerforsaveid"`
HierarchicalSearch bool `json:"hierarchicalsearch"`
HierarchicalSearchChunkLimit int64 `json:"hierarchicalsearchchunklimit"`
ChatbotMemory bool `json:"chatbotmemoryactive"`
ChatbotShowSourceInformation bool `json:"chatbotshowsourceinformation"`
ChatbotMaxServiceRecommandations int64 `json:"chatbotmaxservicerecommandations"`
ChatbotQualityGateRecommendation int64 `json:"chatbotqualitygaterecommendation"`
ChatbotQualityGateMemory int64 `json:"chatbotqualitygatememory"`
}
type AiServiceMultiAnswer ¶
type AiServiceMultiAnswer struct {
Prompt string `json:"questions"`
Results []AiServiceResult `json:"answers"`
}
type AiServiceResult ¶
type AiServiceResult struct {
Result string `json:"answer"`
NextQuestionResult AiServiceMultiAnswer `json:"nextQuestion"`
QuestionObject ExecuteServiceStepCommand `json:"questionObject"`
}
type AiServiceValue ¶
type AiServiceValue interface {
// contains filtered or unexported methods
}
type AiServiceValueFile ¶
type AiServiceValueFile struct {
Value File
}
type AiServiceValueString ¶
type AiServiceValueString struct {
Value string
}
type AuxDataClient ¶
type AuxDataClient struct {
// contains filtered or unexported fields
}
func NewAuxDataClient ¶
func NewAuxDataClient(apiKey string, url string, maxRetries int, timeout time.Duration) *AuxDataClient
NewAuxDataClient creates a new instance of AuxDataClient with the provided parameters. If the apiKey is an empty string, it attempts to retrieve the API key from the environment variable "AUXDTA_API_KEY". Parameters:
- apiKey: The API key for authentication. If empty, it will be fetched from the environment variable.
- url: The base URL for the API.
- maxRetries: The maximum number of retry attempts for failed requests.
- timeout: The timeout duration for the client.
Returns:
A pointer to an initialized AuxDataClient.
func NewAuxDataClientDefault ¶
func NewAuxDataClientDefault(apiKey string) *AuxDataClient
NewAuxDataClientDefault creates a new instance of AuxDataClient with default settings. It requires an API key as a parameter and uses default values for URL, maximum retries, and timeout.
Parameters:
- apiKey: A string representing the API key for authentication.
Returns:
- A pointer to an instance of AuxDataClient configured with default settings.
func (*AuxDataClient) ChatWithAllContainers ¶
func (c *AuxDataClient) ChatWithAllContainers(agentId int64, chat Chat) (ChatResult, error)
ChatWithAllContainers sends a chat message to all containers associated with the given agent ID. It constructs the appropriate URL route with the agent ID and sends the chat message.
Parameters:
- agentId: The ID of the agent to send the chat message to.
- chat: The chat message to be sent.
Returns:
- ChatResult: The result of the chat operation.
- error: An error if the chat operation fails.
func (*AuxDataClient) ChatWithOneContainers ¶
func (c *AuxDataClient) ChatWithOneContainers(agentId int64, containerId int64, chat Chat) (ChatResult, error)
ChatWithOneContainers sends a chat message to a specific container identified by the given agent and container IDs. It constructs the appropriate URL route with the provided parameters and sends the chat message.
Parameters:
- agentId: The ID of the agent initiating the chat.
- containerId: The ID of the container to which the chat message is sent.
- chat: The chat message to be sent.
Returns:
- ChatResult: The result of the chat operation.
- error: An error object if an error occurred during the chat operation.
func (*AuxDataClient) ExecuteAiService ¶
func (c *AuxDataClient) ExecuteAiService(agentId int64, serviceId int64, parameters map[string]AiServiceValue) (ExecuteServiceResult, error)
ExecuteAiService executes an AI service for a given agent and service ID with specified parameters.
Parameters:
- agentId: The ID of the agent for which the AI service is to be executed.
- serviceId: The ID of the AI service to be executed.
- parameters: A map of parameters to be passed to the AI service.
Returns:
- ExecuteServiceResult: The result of the AI service execution.
- error: An error object if there was an issue executing the service, otherwise nil.
func (*AuxDataClient) SearchOnAgent ¶
func (c *AuxDataClient) SearchOnAgent(agentId int64, search Search) (DetailSearchResult, error)
SearchOnAgent performs a search operation for a specific agent.
Parameters:
- agentId: The ID of the agent to search on.
- search: The search criteria to use.
Returns:
- DetailSearchResult: The result of the search operation.
- error: An error object if the search operation fails.
func (*AuxDataClient) SearchOnContainer ¶
func (c *AuxDataClient) SearchOnContainer(agentId int64, containerId int64, search Search) (DetailSearchResult, error)
SearchOnContainer performs a search operation within a specified container. It takes the following parameters: - agentId: The ID of the agent performing the search. - containerId: The ID of the container to search within. - search: The search criteria to be used.
It returns a DetailSearchResult containing the search results, or an error if the search fails.
func (*AuxDataClient) UploadFile ¶
func (c *AuxDataClient) UploadFile(agentId int64, containerId int64, file FileData) ([]UploadedFilesResult, error)
UploadFile uploads a file to a specified container for a given agent.
Parameters:
- agentId: The ID of the agent to which the file belongs.
- containerId: The ID of the container where the file will be uploaded.
- file: The file data to be uploaded.
Returns:
- UploadedFilesResult: The result of the file upload operation.
- error: An error object if the upload fails, otherwise nil.
func (*AuxDataClient) UploadFileFromDirectory ¶
func (c *AuxDataClient) UploadFileFromDirectory(agentId int64, containerId int64, file FileDataToLoad) ([]UploadedFilesResult, error)
UploadFileFromDirectory uploads a file from a specified directory to a container. It takes the agent ID, container ID, and file data to load as parameters. The function reads the file content from the provided file path and uploads it using the UploadFile method. It returns the result of the upload and an error if any occurs during the process.
Parameters:
- agentId: The ID of the agent performing the upload.
- containerId: The ID of the container to which the file is being uploaded.
- file: The file data to load, including the document ID, file path, and link.
Returns:
- UploadedFilesResult: The result of the file upload.
- error: An error if any occurs during the file reading or uploading process.
type ChatCommunication ¶
type ChatResult ¶
type ChatResult struct {
Command ExecuteServiceStepCommand `json:"command"`
Result string `json:"answer"`
Context string `json:"context"`
Error string `json:"error"`
ComUuid string `json:"comuuid"`
InformationSources []SearchChunkResult `json:"sources"`
}
type DetailSearchCommand ¶
type DetailSearchResult ¶
type DetailSearchResult struct {
Command DetailSearchCommand `json:"command"`
Results []SearchChunkResult `json:"results"`
Error string `json:"error"`
}
type ExecuteServiceCommand ¶
type ExecuteServiceResult ¶
type ExecuteServiceResult struct {
Command ExecuteServiceCommand `json:"command"`
MulitResults AiServiceMultiAnswer `json:"answer"`
Error string `json:"error"`
BackgroundMode bool `json:"background"`
}
type ExecuteServiceStepCommand ¶
type ExecuteServiceStepCommand struct {
Prompt string `json:"question"`
User User `json:"user"`
AgentId int64 `json:"botid"`
ResultType string `json:"answertype"`
Title string `json:"title"`
Displaytype string `json:"displaytype"`
ComUuid string `json:"comuuid"`
History []ChatCommunication `json:"history"`
Examples []ResultExample `json:"examples"`
OutputFormatDescription string `json:"outputformatdescription"`
CommandConfig AiExecutionConfig `json:"queryconfig"`
Preprocessing Processor `json:"prepocessing"`
Postprocessing PostProcessor `json:"postpocessing"`
}
type FileDataToLoad ¶
type PostProcessor ¶
type PostProcessor struct {
Type string `json:"type"`
Command string `json:"command"`
Call ProcessCallDefinition `json:"call"`
}
type ProcessCallDefinition ¶
type Processor ¶
type Processor struct {
Http []ProcessCallDefinition `json:"http"`
Function []ProcessCallDefinition `json:"function"`
}
type ResultExample ¶
type SearchChunkResult ¶
type SearchChunkResult struct {
Chunk string `json:"chunk"`
DocumentId string `json:"documentId"`
Score float32 `json:"score"`
Name string `json:"name"`
Link string `json:"link"`
ChunkId int64 `json:"chunkid"`
CreationDate string `json:"creationdate"`
LastModifiedDate string `json:"lastmodifieddate"`
AgentId int64 `json:"agentid"`
}