Documentation
¶
Index ¶
- type ACSSearchResponse
- type AnsysGPTCitation
- type AnsysGPTDefaultFields
- type CodeGenerationElement
- type CodeGenerationExample
- type CodeGenerationType
- type CodeGenerationUserGuideSection
- type DBListCollectionsOutput
- type DataExtractionDocumentData
- type DbAddDataInput
- type DbAddDataOutput
- type DbArrayFilter
- type DbCreateCollectionInput
- type DbCreateCollectionOutput
- type DbData
- type DbFilters
- type DbJsonFilter
- type DbResponse
- type EmbeddingOptions
- type ErrorResponse
- type ExecRequest
- type ExecResponse
- type ExecutionDetails
- type ExecutionInstruction
- type FileDetails
- type FilledInputOutput
- type FlowKitPythonFunction
- type FunctionDefinition
- type FunctionDefinitionShort
- type FunctionInput
- type FunctionOutput
- type GeneralNeo4jQueryInput
- type GeneralNeo4jQueryOutput
- type HandlerRequest
- type HandlerResponse
- type HistoricMessage
- type ModelOptions
- type Neo4jResponse
- type SessionContext
- type TransferDetails
- type XMLMemberExample
- type XMLMemberExampleCode
- type XMLMemberParam
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ACSSearchResponse ¶
type ACSSearchResponse struct { Physics string `json:"physics"` SourceTitleLvl3 string `json:"sourceTitle_lvl3"` SourceURLLvl3 string `json:"sourceURL_lvl3"` TokenSize int `json:"tokenSize"` SourceTitleLvl2 string `json:"sourceTitle_lvl2"` Weight float64 `json:"weight"` SourceURLLvl2 string `json:"sourceURL_lvl2"` Product string `json:"product"` Content string `json:"content"` TypeOFasset string `json:"typeOFasset"` Version string `json:"version"` SearchScore float64 `json:"@search.score"` SearchRerankerScore float64 `json:"@search.rerankerScore"` IndexName string `json:"indexName"` }
ACSSearchResponse represents the response from the ACS search.
type AnsysGPTCitation ¶
type AnsysGPTCitation struct { Title string `json:"Title"` URL string `json:"URL"` Relevance float64 `json:"Relevance"` }
AnsysGPTCitation represents the citation from the AnsysGPT.
type AnsysGPTDefaultFields ¶
DefaultFields represents the default fields for the user query.
type CodeGenerationElement ¶
type CodeGenerationElement struct { Guid string `json:"guid"` Type CodeGenerationType `json:"type"` NamePseudocode string `json:"name_pseudocode"` // Function name without dependencies NameFormatted string `json:"name_formatted"` // Name of the function with spaces and without parameters Description string `json:"description"` Name string `json:"name"` Dependencies []string `json:"dependencies"` Summary string `json:"summary"` ReturnType string `json:"return"` ReturnElementList []string `json:"return_element_list"` ReturnDescription string `json:"return_description"` // Return description Remarks string `json:"remarks"` // Only for type "function" or "method" Parameters []XMLMemberParam `json:"parameters"` Example XMLMemberExample `json:"example"` // Only for type "enum" EnumValues []string `json:"enum_values"` }
type CodeGenerationExample ¶
type CodeGenerationType ¶
type CodeGenerationType string
Enum values for CodeGenerationType
const ( Function CodeGenerationType = "Function" Method CodeGenerationType = "Method" Class CodeGenerationType = "Class" Parameter CodeGenerationType = "Parameter" Enum CodeGenerationType = "Enum" Module CodeGenerationType = "Module" )
type CodeGenerationUserGuideSection ¶
type CodeGenerationUserGuideSection struct { Name string `json:"name"` Title string `json:"title"` IsFirstChild bool `json:"is_first_child"` NextSibling string `json:"next_sibling"` NextParent string `json:"next_parent"` DocumentName string `json:"document_name"` Parent string `json:"parent"` Content string `json:"content"` Level int `json:"level"` Link string `json:"link"` ReferencedLinks []string `json:"referenced_links"` Chunks []string `json:"chunks"` }
type DBListCollectionsOutput ¶
type DBListCollectionsOutput struct { Success bool `json:"success" description:"Returns true if the collections were listed successfully. Returns false or an error if not."` Collections []string `json:"collections" description:"A list of collection names."` }
DBListCollectionsOutput represents the output of listing collections in the database.
type DataExtractionDocumentData ¶
type DataExtractionDocumentData struct { DocumentName string `json:"documentName"` DocumentId string `json:"documentId"` Guid string `json:"guid"` Level string `json:"level"` ChildIds []string `json:"childIds"` ParentId string `json:"parentId"` PreviousSiblingId string `json:"previousSiblingId"` NextSiblingId string `json:"nextSiblingId"` LastChildId string `json:"lastChildId"` FirstChildId string `json:"firstChildId"` Text string `json:"text"` Keywords []string `json:"keywords"` Summary string `json:"summary"` Embedding []float32 `json:"embedding"` }
DataExtractionDocumentData represents the data extracted from a document.
type DbAddDataInput ¶
type DbAddDataInput struct { CollectionName string `` /* 142-byte string literal not displayed */ Data []DbData `json:"data" description:"Data objects to be added to the DB." required:"true"` }
DbAddDataInput represents the input for adding data to the database.
type DbAddDataOutput ¶
type DbAddDataOutput struct { Success bool `json:"success" description:"Returns true if the data was added successfully. Returns false or an error if not."` IgnoredObjectsCount int `json:"ignored_objects_count" description:"Number of ignored documents."` Error string `json:"error" description:"Error message if the collection could not be created."` }
DbAddDataOutput represents the output of adding data to the database.
type DbArrayFilter ¶
DbArrayFilter represents the filter for an array field in the database.
type DbCreateCollectionInput ¶
type DbCreateCollectionInput struct {
CollectionName string `` /* 142-byte string literal not displayed */
}
DbCreateCollectionInput represents the input for creating a collection in the database.
type DbCreateCollectionOutput ¶
type DbCreateCollectionOutput struct { Success bool `json:"success" description:"Returns true if the collection was created successfully. Returns false or an error if not."` Error string `json:"error" description:"Error message if the collection could not be created."` }
DbCreateCollectionOutput represents the output of creating a collection in the database.
type DbData ¶
type DbData struct { Guid string `json:"guid"` DocumentId string `json:"document_id"` DocumentName string `json:"document_name"` Text string `json:"text"` Keywords []string `json:"keywords"` Summary string `json:"summary"` Embedding []float32 `json:"embeddings"` Tags []string `json:"tags"` Metadata map[string]interface{} `json:"metadata"` ParentId string `json:"parent_id"` ChildIds []string `json:"child_ids"` PreviousSiblingId string `json:"previous_sibling_id"` NextSiblingId string `json:"next_sibling_id"` LastChildId string `json:"last_child_id"` FirstChildId string `json:"first_child_id"` Level string `json:"level"` HasNeo4jEntry bool `json:"has_neo4j_entry"` }
DbData represents the data stored in the database.
type DbFilters ¶
type DbFilters struct { // Filters for string fields GuidFilter []string `json:"guid,omitempty"` DocumentIdFilter []string `json:"document_id,omitempty"` DocumentNameFilter []string `json:"document_name,omitempty"` LevelFilter []string `json:"level,omitempty"` // Filters for array fields TagsFilter DbArrayFilter `json:"tags,omitempty"` KeywordsFilter DbArrayFilter `json:"keywords,omitempty"` // Filters for JSON fields MetadataFilter []DbJsonFilter `json:"metadata,omitempty"` }
DbFilters represents the filters for the database.
type DbJsonFilter ¶
type DbJsonFilter struct { FieldName string `json:"fieldName"` FieldType string `json:"fieldType" description:"Can be either string or array."` // "string" or "array" FilterData []string `json:"filterData"` NeedAll bool `json:"needAll" description:"Only needed if the FieldType is array."` // only needed for array fields }
DbJsonFilter represents the filter for a JSON field in the database.
type DbResponse ¶
type DbResponse struct { Guid string `json:"guid"` DocumentId string `json:"document_id"` DocumentName string `json:"document_name"` Text string `json:"text"` Keywords []string `json:"keywords"` Summary string `json:"summary"` Embedding []float32 `json:"embeddings"` Tags []string `json:"tags"` Metadata map[string]interface{} `json:"metadata"` ParentId string `json:"parent_id"` ChildIds []string `json:"child_ids"` PreviousSiblingId string `json:"previous_sibling_id"` NextSiblingId string `json:"next_sibling_id"` LastChildId string `json:"last_child_id"` FirstChildId string `json:"first_child_id"` Distance float64 `json:"distance"` Level string `json:"level"` HasNeo4jEntry bool `json:"has_neo4j_entry"` // Siblings Parent *DbData `json:"parent,omitempty"` Children []DbData `json:"children,omitempty"` LeafNodes []DbData `json:"leaf_nodes,omitempty"` Siblings []DbData `json:"siblings,omitempty"` }
DbResponse represents the response from the database.
type EmbeddingOptions ¶
type EmbeddingOptions struct { ReturnDense *bool `json:"returnDense"` // defines if the response should include dense vectors; only for BAAI/bge-m3 ReturnSparse *bool `json:"returnSparse"` // defines if the response should include lexical weights; only for BAAI/bge-m3 ReturnColbert *bool `json:"returnColbert"` // defines if the response should include colbert vectors; only for BAAI/bge-m3 }
EmbeddingsOptions represents the options for an embeddings request.
type ErrorResponse ¶
ErrorResponse represents the error response sent to the client when something fails during the processing of the request.
type ExecRequest ¶
type ExecRequest struct { Type string `json:"type"` // "code", "flowkit" Action string `json:"action"` // type "code":"execute", "append", "cancel", "status"; for type "flowkit": "<functionName>" InstructionGuid string `json:"instructionGuid"` ExecutionInstruction *ExecutionInstruction `json:"executionInstruction"` // only for type "code" Inputs map[string]FilledInputOutput `json:"inputs"` // only for type "flowkit" }
ExecRequest represents the requests that can be sent to allie-exec
type ExecResponse ¶
type ExecResponse struct { Type string `json:"type"` // "status", "flowkit", "file", "error" InstructionGuid string `json:"instructionGuid"` Error *ErrorResponse `json:"error,omitempty"` ExecutionDetails *ExecutionDetails `json:"executionDetails,omitempty"` FileDetails *FileDetails `json:"fileDetails,omitempty"` Outputs map[string]FilledInputOutput `json:"outputs"` // only for type "flowkit" }
ExecResponse represents the response that allie-exec sends back
type ExecutionDetails ¶
type ExecutionDetails struct { InstructionGuid string `json:"instructionGuid"` ClientGuid string `json:"clientGuid"` StartTime time.Time `json:"startTime"` TimeoutAt time.Time `json:"timeoutAt"` Response string `json:"response"` Status string `json:"status"` // "started", "running", "completed", "failed" LastResponseDiff string `json:"lastResponseDiff"` InterruptionChannel chan bool `json:"-"` StdinChannel chan []string `json:"-"` Cancelled bool `json:"-"` }
ExecutionDetails represents the details of the execution
type ExecutionInstruction ¶
type ExecutionInstruction struct { CodeType string `json:"codeType"` // "python", "bash" Code []string `json:"code"` VenvExecutable string `json:"venvExecutable"` }
ExecutionInstruction contain an array of strings that represent the code to be executed in allie-exec
type FileDetails ¶
type FileDetails struct { FileName string `json:"fileName"` FileSize int64 `json:"fileSize"` FileChunkNumber int `json:"fileChunkNumber"` FileChunk []byte `json:"fileChunk"` IsLastChunk bool `json:"isLastChunk"` }
FileDetails contain parts of a file that is being sent
type FilledInputOutput ¶
type FilledInputOutput struct { Name string `json:"name" yaml:"name"` GoType string `json:"go_type" yaml:"go_type"` Value interface{} `json:"value" yaml:"value"` }
FilledInputOutput is a struct that contains the name, go type and value of a filled input/output
type FlowKitPythonFunction ¶
type FlowKitPythonFunction struct { Name string `json:"name"` Path string `json:"path"` Description string `json:"description"` Category string `json:"category"` DisplayName string `json:"display_name"` Inputs []FunctionInput `json:"inputs"` Outputs []FunctionOutput `json:"outputs"` Definitions interface{} `json:"definitions"` }
FlowKitPythonFunction is a struct that contains the name, path, description, inputs, outputs and definitions of a FlowKit-Python function
type FunctionDefinition ¶
type FunctionDefinition struct { Name string `json:"name" yaml:"name"` DisplayName string `json:"display_name" yaml:"display_name"` Description string `json:"description" yaml:"description"` Category string `json:"category" yaml:"category"` // "data_extraction", "generic", "knowledge_db", "llm_handler", "ansys_gpt" Type string `json:"type" yaml:"type"` // "go", "python" Path string `json:"path" yaml:"path"` // only for python functions Inputs []FunctionInput `json:"inputs" yaml:"inputs"` Outputs []FunctionOutput `json:"outputs" yaml:"outputs"` }
FunctionDefinition is a struct that contains the id, name, description, package, inputs and outputs of a function
type FunctionDefinitionShort ¶
type FunctionDefinitionShort struct { Id string `json:"id" yaml:"id"` // Unique identifier Name string `json:"name" yaml:"name"` Description string `json:"description" yaml:"description"` }
FunctionDefinitionShort is a struct that contains the id, name and description of a function
type FunctionInput ¶
type FunctionInput struct { Name string `json:"name" yaml:"name"` Type string `json:"type" yaml:"type"` // string, number, boolean, json GoType string `json:"go_type" yaml:"go_type"` Options []string `json:"options" yaml:"options"` // only applicable if not empty }
FunctionInput is a struct that contains the name, type, go type and options of a function input
type FunctionOutput ¶
type FunctionOutput struct { Name string `json:"name" yaml:"name"` Type string `json:"type" yaml:"type"` // string, number, boolean, json GoType string `json:"go_type" yaml:"go_type"` }
FunctionOutput is a struct that contains the name, type and go type of a function output
type GeneralNeo4jQueryInput ¶
type GeneralNeo4jQueryInput struct {
Query string `json:"query" description:"Neo4j query to be executed. Required for executing a query." required:"true"`
}
GeneralNeo4jQueryInput represents the input for executing a Neo4j query.
type GeneralNeo4jQueryOutput ¶
type GeneralNeo4jQueryOutput struct { Success bool `json:"success" description:"Returns true if the query was executed successfully. Returns false or an error if not."` Response Neo4jResponse `json:"response" description:"Summary and records of the query execution."` }
GeneralNeo4jQueryOutput represents the output of executing a Neo4j query.
type HandlerRequest ¶
type HandlerRequest struct { Adapter string `json:"adapter"` // "chat", "embeddings" InstructionGuid string `json:"instructionGuid"` ModelIds []string `json:"modelIds"` // optional model ids to define a set of specific models to be used for this request Data interface{} `json:"data"` // for embeddings, this can be a string or []string; for chat, only string is allowed Images []string `json:"images"` // List of images in base64 format ChatRequestType string `json:"chatRequestType"` // "summary", "code", "keywords", "general"; only relevant if "adapter" is "chat" DataStream bool `json:"dataStream"` // only relevant if "adapter" is "chat" MaxNumberOfKeywords uint32 `json:"maxNumberOfKeywords"` // only relevant if "chatRequestType" is "keywords" IsConversation bool `json:"isConversation"` // only relevant if "chatRequestType" is "code" ConversationHistory []HistoricMessage `json:"conversationHistory"` // only relevant if "isConversation" is true GeneralContext string `json:"generalContext"` // any added context you might need MsgContext string `json:"msgContext"` // any added context you might need SystemPrompt interface{} `json:"systemPrompt"` // only relevant if "chatRequestType" is "general" ModelOptions ModelOptions `json:"modelOptions,omitempty"` // only relevant if "adapter" is "chat" EmbeddingOptions EmbeddingOptions `json:"embeddingOptions,omitempty"` // only relevant if "adapter" is "embeddings" }
HandlerRequest represents the client request for a specific chat or embeddings operation.
type HandlerResponse ¶
type HandlerResponse struct { // Common properties InstructionGuid string `json:"instructionGuid"` Type string `json:"type"` // "info", "error", "chat", "embeddings" // Chat properties IsLast *bool `json:"isLast,omitempty"` Position *uint32 `json:"position,omitempty"` InputTokenCount *int `json:"inputTokenCount,omitempty"` OutputTokenCount *int `json:"outputTokenCount,omitempty"` ChatData *string `json:"chatData,omitempty"` // Embeddings properties EmbeddedData interface{} `json:"embeddedData,omitempty"` // []float32 or [][]float32; for BAAI/bge-m3 these are dense vectors LexicalWeights interface{} `json:"lexicalWeights,omitempty"` // map[uint]float32 or []map[uint]float32; only for BAAI/bge-m3 ColbertVecs interface{} `json:"colbertVecs,omitempty"` // [][]float32 or [][][]float32; only for BAAI/bge-m3 // Error properties Error *ErrorResponse `json:"error,omitempty"` // Info properties InfoMessage *string `json:"infoMessage,omitempty"` }
HandlerResponse represents the LLM Handler response for a specific request.
type HistoricMessage ¶
type HistoricMessage struct { Role string `json:"role"` Content string `json:"content"` Images []string `json:"images"` // image in base64 format }
HistoricMessage represents a past chat messages.
type ModelOptions ¶
type ModelOptions struct { FrequencyPenalty *float32 `json:"frequencyPenalty,omitempty"` MaxTokens *int32 `json:"maxTokens,omitempty"` PresencePenalty *float32 `json:"presencePenalty,omitempty"` Stop []string `json:"stop,omitempty"` Temperature *float32 `json:"temperature,omitempty"` TopP *float32 `json:"topP,omitempty"` }
OpenAIOption represents an option for an OpenAI API call.
type Neo4jResponse ¶
type Neo4jResponse struct { Record neo4jRecord `json:"record"` SummaryCounters summaryCounters `json:"summaryCounters"` }
neo4jResponse represents the response from the Neo4j query.
type SessionContext ¶
type SessionContext struct { SessionType string `json:"session_type"` // Type of session: "workflow", "exec" ApiKey string `json:"api_key"` // API key for authentication, only relevant if "session_type" is "exec" JwtToken string `json:"jwt_token"` // JWT token for authentication (optional) ExecId string `json:"exec_id,omitempty"` // Unique identifier of connecting Exec, only relevant if "session_type" is "exec" WorkflowId string `json:"workflow_id,omitempty"` // Workflow ID, only relevant if "workflow_endpoint" is "custom" Variables map[string]string `json:"variables,omitempty"` // Variables to be passed to the workflow // Snapshot logic SnapshotId string `json:"snapshot_id,omitempty"` // Snapshot ID, only relevant if "session_type" is "workflow"; if defined, the given snapshot will retrived from the database WorkflowRunId string `json:"workflow_run_id,omitempty"` // Workflow run ID, only relevant if "session_type" is "workflow"; if defined, mandatory if "snapshot_id" is defined in order to retrieve the snapshot from the database UserId string `json:"user_id,omitempty"` // User ID, only relevant if "session_type" is "workflow"; if defined, mandatory if "snapshot_id" is defined in order to retrieve the snapshot from the database StoreSnapshots bool `json:"store_snapshots,omitempty"` // Store snapshots, only relevant if "session_type" is "workflow"; if true, all taken snapshots will be stored in the database }
Message represents the JSON message you are expecting
func ExtractSessionContext ¶
func ExtractSessionContext(ctx *logging.ContextMap, msg []byte) (SessionContext, error)
SetSessionContext sets the SessionContext struct from the JSON payload
Parameters:
- msg: the JSON payload
Returns:
- SessionContext: the SessionContext struct
type TransferDetails ¶
type TransferDetails struct { ResponseChannel chan HandlerResponse RequestChannel chan HandlerRequest }
TransferDetails holds communication channels for the websocket listener and writer.
type XMLMemberExample ¶
type XMLMemberExample struct { Description string `xml:",chardata" json:"description"` // Text content of <example> Code XMLMemberExampleCode `xml:"code,omitempty" json:"code"` // Optional <code> element }