Documentation
¶
Index ¶
- Variables
- func AddDataRequest(collectionName string, documentData []sharedtypes.DbData)
- func AddGraphDbParameter(parameters aali_graphdb.ParameterMap, name string, value string, ...) aali_graphdb.ParameterMap
- func AddGuidsToAttributes(criteriaSuggestions []sharedtypes.MaterialLlmCriterion, ...) (criteriaWithGuids []sharedtypes.MaterialCriterionWithGuid)
- func AecGetContextFromRetrieverModule(retrieverModuleEndpoint string, userQuery string, dataSources []string, ...) (context []sharedtypes.AnsysGPTRetrieverModuleChunk)
- func AecPerformLLMFinalRequest(systemTemplate string, userTemplate string, query string, ...) (message string, stream *chan string)
- func AisAcsSemanticHybridSearchs(acsEndpoint string, acsApiKey string, acsApiVersion string, query string, ...) []sharedtypes.ACSSearchResponse
- func AisChangeAcsResponsesByFactor(factors map[string]float64, ...) (changedSemanticSearchOutput []sharedtypes.ACSSearchResponse)
- func AisPerformLLMRephraseRequest(systemTemplate string, userTemplate string, query string, ...) (rephrasedQuery string, inputTokenCount int, outputTokenCount int)
- func AisReturnIndexList(accessPoint string, physics []string, version []string) (indexList []string)
- func AnsysGPTACSSemanticHybridSearchs(acsEndpoint string, acsApiKey string, acsApiVersion string, query string, ...) (output []sharedtypes.ACSSearchResponse)
- func AnsysGPTBuildFinalQuery(refrasedQuery string, context []sharedtypes.ACSSearchResponse) (finalQuery string, errorResponse string, displayFixedMessageToUser bool)
- func AnsysGPTCheckProhibitedWords(query string, prohibitedWords []string, errorResponseMessage string) (foundProhibited bool, responseMessage string)
- func AnsysGPTExtractFieldsFromQuery(query string, fieldValues map[string][]string, ...) (fields map[string]string)
- func AnsysGPTGetSystemPrompt(query string, prohibitedWords []string, template string) (systemPrompt string)
- func AnsysGPTPerformLLMRephraseRequest(userTemplate string, query string, history []sharedtypes.HistoricMessage, ...) (rephrasedQuery string)
- func AnsysGPTPerformLLMRephraseRequestNew(template string, query string, history []sharedtypes.HistoricMessage) (rephrasedQuery string)
- func AnsysGPTPerformLLMRequest(finalQuery string, history []sharedtypes.HistoricMessage, systemPrompt string, ...) (message string, stream *chan string)
- func AnsysGPTRemoveNoneCitationsFromSearchResponse(semanticSearchOutput []sharedtypes.ACSSearchResponse, ...) (reducedSemanticSearchOutput []sharedtypes.ACSSearchResponse)
- func AnsysGPTReorderSearchResponseAndReturnOnlyTopK(semanticSearchOutput []sharedtypes.ACSSearchResponse, topK int) (reorderedSemanticSearchOutput []sharedtypes.ACSSearchResponse)
- func AnsysGPTReturnIndexList(indexGroups []string) (indexList []string)
- func AppendMeshPilotHistory(history []map[string]string, role, content string) (updatedHistory []map[string]string)
- func AppendMessageHistory(newMessage string, role AppendMessageHistoryRole, ...) (updatedHistory []sharedtypes.HistoricMessage)
- func AppendStringSlices(slice1, slice2, slice3, slice4, slice5 []string) []string
- func AppendToolHistory(toolHistory []map[string]string, ...) (updatedToolHistory []map[string]string)
- func AssignStringToString(inputString string) (outputString string)
- func BuildFinalQueryForCodeLLMRequest(request string, knowledgedbResponse []sharedtypes.DbResponse) (finalQuery string)
- func BuildFinalQueryForGeneralLLMRequest(request string, knowledgedbResponse []sharedtypes.DbResponse) (finalQuery string)
- func BuildLibraryContext(message string, libraryContext string) (messageWithContext string)
- func CastAnyToBool(data any) bool
- func CastAnyToByte(data any) byte
- func CastAnyToComplex128(data any) complex128
- func CastAnyToComplex64(data any) complex64
- func CastAnyToFloat32(data any) float32
- func CastAnyToFloat64(data any) float64
- func CastAnyToInt(data any) int
- func CastAnyToInt16(data any) int16
- func CastAnyToInt32(data any) int32
- func CastAnyToInt64(data any) int64
- func CastAnyToInt8(data any) int8
- func CastAnyToInterface(data any) interface{}
- func CastAnyToRune(data any) rune
- func CastAnyToString(data any) string
- func CastAnyToUint(data any) uint
- func CastAnyToUint16(data any) uint16
- func CastAnyToUint32(data any) uint32
- func CastAnyToUint64(data any) uint64
- func CastAnyToUint8(data any) uint8
- func CastArrayMapStringAnyToAny(data []map[string]any) any
- func CastBoolToAny(data bool) any
- func CastByteToAny(data byte) any
- func CastComplex128ToAny(data complex128) any
- func CastComplex64ToAny(data complex64) any
- func CastFloat32ToAny(data float32) any
- func CastFloat64ToAny(data float64) any
- func CastInt16ToAny(data int16) any
- func CastInt32ToAny(data int32) any
- func CastInt64ToAny(data int64) any
- func CastInt8ToAny(data int8) any
- func CastIntToAny(data int) any
- func CastInterfaceToAny(data interface{}) any
- func CastRuneToAny(data rune) any
- func CastStringToAny(data string) any
- func CastUint16ToAny(data uint16) any
- func CastUint32ToAny(data uint32) any
- func CastUint64ToAny(data uint64) any
- func CastUint8ToAny(data uint8) any
- func CastUintToAny(data uint) any
- func CheckApiKeyAuthMongoDb(apiKey string, mongoDbUrl string, mongoDatabaseName string, ...) (isAuthenticated bool)
- func CheckCreateUserIdMongoDb(userId string, temporaryTokenLimit int, hoursUntilTokenLimitReset int, ...) (existingUser bool)
- func CheckTokenLimitReached(query string, tokenLimit int, modelName string, tokenLimitMessage string) (tokenLimitReached bool, responseMessage string)
- func CreateCollectionRequest(collectionName string, vectorSize uint64, vectorDistance string)
- func CreateDbFilter(guid []string, documentId []string, documentName []string, level []string, ...) (databaseFilter sharedtypes.DbFilters)
- func CreateEmbeddings(dense bool, sparse bool, colbert bool, isDocument bool, passages []string) (dense_vector [][]float32, lexical_weights []map[uint]float32, ...)
- func CreateGeneralDataExtractionDocumentObjects(documentName string, documentChunks []string, denseEmbeddings [][]float32, ...) (extractionData []interface{})
- func CreateKeywordsDbFilter(keywords []string, needAll bool) (databaseFilter sharedtypes.DbArrayFilter)
- func CreateMessageWithVariable(message string, variable string) (updatedMessage string)
- func CreateMetadataDbFilter(fieldName string, fieldType string, filterData []string, needAll bool) (databaseFilter sharedtypes.DbJsonFilter)
- func CreateTagsDbFilter(tags []string, needAll bool) (databaseFilter sharedtypes.DbArrayFilter)
- func DenyCustomerAccessAndSendWarningMongoDb(apiKey string, mongoDbUrl string, mongoDatabaseName string, ...) (customerName string, sendWarning bool)
- func DenyCustomerAccessAndSendWarningMongoDbUserId(userId string, mongoDbUrl string, mongoDatabaseName string, ...) (sendWarning bool)
- func DownloadGithubFileContent(githubRepoName string, githubRepoOwner string, githubRepoBranch string, ...) (checksum string, content []byte)
- func DownloadGithubFilesContent(githubRepoName string, githubRepoOwner string, githubRepoBranch string, ...) (filesMap map[string][]byte)
- func ExecuteTool(serverURL, toolName string, args map[string]interface{}) (map[string]interface{}, error)
- func ExtractCriteriaSuggestions(llmResponse string) (criteriaSuggestions []sharedtypes.MaterialLlmCriterion)
- func ExtractJSONStringField(jsonStr string, keyPath string) string
- func ExtractJson(text string) (json string)
- func FetchActionsPathFromPathDescription(db_name, description, nodeLabel string) (actions []map[string]string)
- func FetchNodeDescriptionsFromPathDescription(db_name, description string) (actionDescriptions string)
- func FetchPropertiesFromPathDescription(db_name, description string) (properties []string)
- func FilterOutDuplicateAttributes(criteriaSuggestions []sharedtypes.MaterialLlmCriterion) (filtered []sharedtypes.MaterialLlmCriterion)
- func FilterOutNonExistingAttributes(criteriaSuggestions []sharedtypes.MaterialLlmCriterion, ...) (filtered []sharedtypes.MaterialLlmCriterion)
- func FinalizeMessage(message string) (result string)
- func FinalizeResult(actions []map[string]string, toolName string) (result string)
- func FindRelevantPathDescription(descriptions []string, message string) (relevantDescription string)
- func GeneralGraphDbQuery(query string, parameters aali_graphdb.ParameterMap) []map[string]any
- func GeneralQuery(collectionName string, maxRetrievalCount int, outputFields []string, ...) (databaseResponse []sharedtypes.DbResponse)
- func GenerateActionsSubWorkflowPrompt(userInstruction string) (systemPrompt string, userPrompt string)
- func GenerateDocumentTree(documentName string, documentId string, documentChunks []string, ...) (returnedDocumentData []sharedtypes.DbData)
- func GenerateHelperSubWorkflowPrompt(userInstruction string) (systemPrompt string, userPrompt string)
- func GenerateUUID() string
- func GenerateUserPrompt(userInstruction string, userPromptTemplate string) (userPrompt string)
- func GenerateUserPromptWithContext(userInstruction string, context string, userPromptTemplate string) (userPrompt string)
- func GenerateUserPromptWithList(userInstruction string, userList []string, userPromptTemplate string) (userPrompt string)
- func GetActionsFromConfig(toolName string) (result string)
- func GetDocumentType(filePath string) (documentType string)
- func GetGithubFilesToExtract(githubRepoName string, githubRepoOwner string, githubRepoBranch string, ...) (githubFilesToExtract []string)
- func GetListCollections() (collectionsList []string)
- func GetLocalFileContent(localFilePath string) (checksum string, content []byte)
- func GetLocalFilesContent(localFilePaths []string) (filesMap map[string][]byte)
- func GetLocalFilesToExtract(localPath string, localFileExtensions []string, ...) (localFilesToExtract []string)
- func GetResource(serverURL, resourceName string) (map[string]interface{}, error)
- func GetSelectedSolution(arguments string) (solution string)
- func GetSolutionsToFixProblem(db_name, fmFailureCode, primeMeshFailureCode string) (solutions string)
- func GetSystemPrompt(serverURL, promptName string) (string, error)
- func JsonPath(pat string, data any, oneResult bool) any
- func LangchainSplitter(bytesContent []byte, documentType string, chunkSize int, chunkOverlap int) (output []string)
- func ListAll(serverURL string) (map[string][]string, error)
- func LoadAndCheckExampleDependencies(dependenciesContent []byte, elements []sharedtypes.CodeGenerationElement, ...) (checkedDependenciesMap map[string][]string, ...)
- func LoadCodeGenerationElements(content []byte, elementsFilePath string) (elements []sharedtypes.CodeGenerationElement)
- func LoadCodeGenerationExamples(source string, examplesToExtract []string, githubRepoName string, ...) (examples []sharedtypes.CodeGenerationExample)
- func LoadUserGuideSections(source string, sectionFilePaths []string, githubRepoName string, ...) (sections []sharedtypes.CodeGenerationUserGuideSection)
- func LogRequestFailed()
- func LogRequestFailedDebugWithMessage(msg1, msg2 string)
- func LogRequestSuccess()
- func MarkdownToHTML(markdown string) (html string)
- func ParseHistory(historyJson string) (history []map[string]string)
- func ParseHistoryToHistoricMessages(historyJson string) (history []sharedtypes.HistoricMessage)
- func PerformBatchEmbeddingRequest(input []string) (embeddedVectors [][]float32)
- func PerformBatchHybridEmbeddingRequest(input []string, maxBatchSize int) (denseEmbeddings [][]float32, sparseEmbeddings []map[uint]float32)
- func PerformCodeLLMRequest(input string, history []sharedtypes.HistoricMessage, isStream bool, ...) (message string, stream *chan string)
- func PerformGeneralModelSpecificationRequest(input string, history []sharedtypes.HistoricMessage, isStream bool, ...) (message string, stream *chan string)
- func PerformGeneralRequest(input string, history []sharedtypes.HistoricMessage, isStream bool, ...) (message string, stream *chan string)
- func PerformGeneralRequestNoStreaming(input string, history []sharedtypes.HistoricMessage, systemPrompt string) (message string)
- func PerformGeneralRequestSpecificModel(input string, history []sharedtypes.HistoricMessage, isStream bool, ...) (message string, stream *chan string)
- func PerformGeneralRequestSpecificModelAndModelOptions(input string, history []sharedtypes.HistoricMessage, isStream bool, ...) (message string, stream *chan string)
- func PerformGeneralRequestSpecificModelAndModelOptionsNoStreamWithOpenAiInputOutputTokenOutput(input string, history []sharedtypes.HistoricMessage, systemPrompt string, ...) (message string, inputTokenCount int, outputTokenCount int)
- func PerformGeneralRequestSpecificModelAndModelOptionsNoStreamWithOpenAiTokenOutput(input string, history []sharedtypes.HistoricMessage, systemPrompt string, ...) (message string, tokenCount int)
- func PerformGeneralRequestSpecificModelModelOptionsAndImages(input string, history []sharedtypes.HistoricMessage, isStream bool, ...) (message string, stream *chan string)
- func PerformGeneralRequestSpecificModelNoStreamWithOpenAiTokenOutput(input string, history []sharedtypes.HistoricMessage, systemPrompt string, ...) (message string, tokenCount int)
- func PerformGeneralRequestWithImages(input string, history []sharedtypes.HistoricMessage, isStream bool, ...) (message string, stream *chan string)
- func PerformKeywordExtractionRequest(input string, maxKeywordsSearch uint32) (keywords []string)
- func PerformMultipleGeneralRequestsAndExtractAttributesWithOpenAiTokenOutput(input string, history []sharedtypes.HistoricMessage, systemPrompt string, ...) (uniqueCriterion []sharedtypes.MaterialLlmCriterion, tokenCount int)
- func PerformSummaryRequest(input string) (summary string)
- func PerformVectorEmbeddingRequest(input string) (embeddedVector []float32)
- func PerformVectorEmbeddingRequestWithTokenLimitCatch(input string, tokenLimitMessage string) (embeddedVector []float32, tokenLimitReached bool, responseMessage string)
- func PrintFeedback(feedback sharedtypes.Feedback)
- func ProcessMainAgentOutput(llmOutput string) (messageTo string, message string)
- func ProcessSubworkflowIdentificationOutput(llmOutput string) (status string, workflowName string)
- func QdrantCreateCollection(collectionName string, vectorSize uint64, vectorDistance string)
- func QdrantCreateIndex(collectionName string, fieldName string, fieldType string, wait bool)
- func QdrantInsertData(collectionName string, data []interface{}, idFieldName string, ...)
- func RetrieveDependencies(relationshipName string, relationshipDirection string, sourceDocumentId string, ...) (dependenciesIds []string)
- func SelectedSolution(selectedSolution string) (solution string)
- func SendLogicAppNotificationEmail(logicAppEndpoint string, email string, subject string, content string)
- func SendRestAPICall(requestType string, endpoint string, header map[string]string, ...) (success bool, returnJsonBody string)
- func SendVectorsToKnowledgeDB(vector []float32, keywords []string, keywordsSearch bool, collection string, ...) (databaseResponse []sharedtypes.DbResponse)
- func SerializeResponse(criteriaSuggestions []sharedtypes.MaterialCriterionWithGuid, tokens int) (result string)
- func SetCopilotGenerateRequestJsonBody(query string, sessionID string, mode string, timeout int, priority int, ...) (jsonBody string)
- func ShortenMessageHistory(history []sharedtypes.HistoricMessage, maxLength int) (updatedHistory []sharedtypes.HistoricMessage)
- func SimilaritySearch(collectionName string, embeddedVector []float32, maxRetrievalCount int, ...) (databaseResponse []sharedtypes.DbResponse)
- func SimilartitySearchOnPathDescriptions(instruction string, toolName string) (descriptions []string)
- func SimilartitySearchOnPathDescriptionsQdrant(vector []float32, collection string, similaritySearchResults int, ...) (descriptions []string)
- func StoreElementsInGraphDatabase(elements []sharedtypes.CodeGenerationElement)
- func StoreElementsInVectorDatabase(elements []sharedtypes.CodeGenerationElement, elementsCollectionName string, ...)
- func StoreExamplesInGraphDatabase(examples []sharedtypes.CodeGenerationExample)
- func StoreExamplesInVectorDatabase(examples []sharedtypes.CodeGenerationExample, examplesCollectionName string, ...)
- func StoreUserGuideSectionsInGraphDatabase(sections []sharedtypes.CodeGenerationUserGuideSection)
- func StoreUserGuideSectionsInVectorDatabase(sections []sharedtypes.CodeGenerationUserGuideSection, ...)
- func StringConcat(a string, b string, separator string) string
- func StringFormat(data any, format string) string
- func SynthesizeActions(message string, properties []string, actions []map[string]string) (updatedActions []map[string]string)
- func SynthesizeActionsTool13(content string) (result string)
- func SynthesizeActionsTool14(content string) (result string)
- func SynthesizeActionsTool4(message string, actions []map[string]string) (updatedActions []map[string]string)
- func UpdateTotalTokenCountForCustomerMongoDb(apiKey string, mongoDbUrl string, mongoDatabaseName string, ...) (tokenLimitReached bool)
- func UpdateTotalTokenCountForUserIdMongoDb(userId string, mongoDbUrl string, mongoDatabaseName string, ...) (tokenLimitReached bool)
- type ACSSearchRequest
- type ACSSearchResponseALH
- type ACSSearchResponseCrtech
- type ACSSearchResponseLSdyna
- type ACSSearchResponseStruct
- type ACSSearchResponseStructALH
- type ACSSearchResponseStructCrtech
- type ACSSearchResponseStructLSdyna
- type ACSVectorQuery
- type AnsysGPTRetrieverModuleRequest
- type AppendMessageHistoryRole
- type DataExtractionBranch
- type DataExtractionLLMInputChannelItem
- type DataExtractionSplitterServiceRequest
- type DataExtractionSplitterServiceResponse
- type EmailRequest
- type GeneralDataExtractionDocument
- type LlmCriteria
- type MongoDbContext
- type MongoDbCustomerObject
- type MongoDbCustomerObjectDisco
- type Response
- type TokenCountUpdateRequest
Constants ¶
This section is empty.
Variables ¶
var ExternalFunctionsMap = map[string]interface{}{}/* 131 elements not displayed */
Functions ¶
func AddDataRequest ¶
func AddDataRequest(collectionName string, documentData []sharedtypes.DbData)
AddDataRequest sends a request to the add_data endpoint.
Tags:
- @displayName: Add Data
Parameters:
- collectionName: name of the collection the request is sent to.
- data: the data to add.
func AddGraphDbParameter ¶ added in v1.0.13
func AddGraphDbParameter(parameters aali_graphdb.ParameterMap, name string, value string, paramType string) aali_graphdb.ParameterMap
AddGraphDbParameter adds a new GraphDbParameter to a map[string]GraphDbParameter
Tags:
- @displayName: Add Graph DB Parameter
Parameters:
- parameters: the existing collection of parameters
- name: the name of the new parameter
- value: the value of the new parameter
- paramType: the type of the new parameter
Returns:
- The original parameters with the new one added
func AddGuidsToAttributes ¶ added in v1.0.8
func AddGuidsToAttributes(criteriaSuggestions []sharedtypes.MaterialLlmCriterion, availableAttributes []sharedtypes.MaterialAttribute) (criteriaWithGuids []sharedtypes.MaterialCriterionWithGuid)
AddGuidsToAttributes adds GUIDs to the attributes in the criteria
Tags:
- @displayName: Add GUIDs to criteria suggestions
Parameters:
- criteriaSuggestions: the list of criteria without identities
- availableAttributes: the list of available attributes with their identities
Returns:
- criteriaWithGuids: the list of criteria with their identities
func AecGetContextFromRetrieverModule ¶ added in v1.0.12
func AecGetContextFromRetrieverModule( retrieverModuleEndpoint string, userQuery string, dataSources []string, physics []string, topK int, plattform string, retrieverModuleKey string) (context []sharedtypes.AnsysGPTRetrieverModuleChunk)
AecGetContextFromRetrieverModule retrieves context from the Ansys GPT Retriever Module
Tags:
- @displayName: AEC Get Context from Retriever Module
Parameters:
- retrieverModuleEndpoint: the endpoint of the retriever module
- userQuery: the user query
- dataSources: the data sources
- physics: the physics
- topK: the number of results to be returned
- plattform: the platform
- retrieverModuleKey: the key for the retriever module
Returns:
- context: the context retrieved from the retriever module
func AecPerformLLMFinalRequest ¶ added in v1.0.12
func AecPerformLLMFinalRequest(systemTemplate string, userTemplate string, query string, history []sharedtypes.HistoricMessage, context []sharedtypes.AnsysGPTRetrieverModuleChunk, prohibitedWords []string, errorList1 []string, errorList2 []string, tokenCountEndpoint string, previousInputTokenCount int, previousOutputTokenCount int, tokenCountModelName string, isStream bool, userEmail string, jwtToken string) (message string, stream *chan string)
AecPerformLLMFinalRequest performs a final request to LLM
Tags:
- @displayName: AEC Final Request
Parameters:
- systemTemplate: the system template for the final request
- userTemplate: the user template for the final request
- query: the user query
- history: the conversation history
- prohibitedWords: the list of prohibited words
- errorList1: the list of error words
- errorList2: the list of error words
Returns:
- stream: the stream channel
func AisAcsSemanticHybridSearchs ¶
func AisAcsSemanticHybridSearchs( acsEndpoint string, acsApiKey string, acsApiVersion string, query string, embeddedQuery []float32, indexList []string, physics []string, topK int) []sharedtypes.ACSSearchResponse
AisAcsSemanticHybridSearchs performs a semantic hybrid search in ACS
Tags:
- @displayName: AIS ACS Semantic Hybrid Search
Parameters:
- query: the query string
- embeddedQuery: the embedded query
- indexList: the index list
- physics: the physics
- topK: the number of results to be returned
Returns:
- output: the search results
func AisChangeAcsResponsesByFactor ¶
func AisChangeAcsResponsesByFactor(factors map[string]float64, semanticSearchOutput []sharedtypes.ACSSearchResponse) (changedSemanticSearchOutput []sharedtypes.ACSSearchResponse)
AisChangeAcsResponsesByFactor changes the ACS responses by a factor
Tags:
- @displayName: Change ACS Responses By Factor
Parameters:
- factors: the factors
- semanticSearchOutput: the search response
Returns:
- changedSemanticSearchOutput: the changed search response
func AisPerformLLMRephraseRequest ¶
func AisPerformLLMRephraseRequest(systemTemplate string, userTemplate string, query string, history []sharedtypes.HistoricMessage, tokenCountModelName string) (rephrasedQuery string, inputTokenCount int, outputTokenCount int)
AisPerformLLMRephraseRequest performs a rephrase request to LLM
Tags:
- @displayName: AIS Rephrase Request
Parameters:
- systemTemplate: the system template for the rephrase request
- userTemplate: the user template for the rephrase request
- query: the user query
- history: the conversation history
Returns:
- rephrasedQuery: the rephrased query
func AisReturnIndexList ¶
func AisReturnIndexList(accessPoint string, physics []string, version []string) (indexList []string)
AisReturnIndexList returns the index list for AIS
Tags:
- @displayName: Get AIS Index List
Parameters:
- accessPoint: the access point
Returns:
- indexList: the index list
func AnsysGPTACSSemanticHybridSearchs ¶
func AnsysGPTACSSemanticHybridSearchs( acsEndpoint string, acsApiKey string, acsApiVersion string, query string, embeddedQuery []float32, indexList []string, filter map[string]string, topK int) (output []sharedtypes.ACSSearchResponse)
AnsysGPTACSSemanticHybridSearchs performs a semantic hybrid search in ACS
Tags:
- @displayName: ACS Semantic Hybrid Search
Parameters:
- query: the query string
- embeddedQuery: the embedded query
- indexList: the index list
- typeOfAsset: the type of asset
- physics: the physics
- product: the product
- productMain: the main product
- filter: the filter
- filterAfterVectorSearch: the flag to define the filter order
- returnedProperties: the properties to be returned
- topK: the number of results to be returned from vector search
- searchedEmbeddedFields: the ACS fields to be searched
Returns:
- output: the search results
func AnsysGPTBuildFinalQuery ¶
func AnsysGPTBuildFinalQuery(refrasedQuery string, context []sharedtypes.ACSSearchResponse) (finalQuery string, errorResponse string, displayFixedMessageToUser bool)
AnsysGPTBuildFinalQuery builds the final query for Ansys GPT
Tags:
- @displayName: Build Final Query
Parameters:
- refrasedQuery: the refrased query
- context: the context
Returns:
- finalQuery: the final query
func AnsysGPTCheckProhibitedWords ¶
func AnsysGPTCheckProhibitedWords(query string, prohibitedWords []string, errorResponseMessage string) (foundProhibited bool, responseMessage string)
AnsysGPTCheckProhibitedWords checks the user query for prohibited words
Tags:
- @displayName: Check Prohibited Words
Parameters:
- query: the user query
- prohibitedWords: the list of prohibited words
- errorResponseMessage: the error response message
Returns:
- foundProhibited: the flag indicating whether prohibited words were found
- responseMessage: the response message
func AnsysGPTExtractFieldsFromQuery ¶
func AnsysGPTExtractFieldsFromQuery(query string, fieldValues map[string][]string, defaultFields []sharedtypes.AnsysGPTDefaultFields) (fields map[string]string)
AnsysGPTExtractFieldsFromQuery extracts the fields from the user query
Tags:
- @displayName: Extract Fields
Parameters:
- query: the user query
- fieldValues: the field values that the user query can contain
- defaultFields: the default fields that the user query can contain
Returns:
- fields: the extracted fields
func AnsysGPTGetSystemPrompt ¶
func AnsysGPTGetSystemPrompt(query string, prohibitedWords []string, template string) (systemPrompt string)
AnsysGPTGetSystemPrompt returns the system prompt for Ansys GPT
Tags:
- @displayName: Get System Prompt
Parameters:
- rephrasedQuery: the rephrased query
Returns:
- systemPrompt: the system prompt
func AnsysGPTPerformLLMRephraseRequest ¶
func AnsysGPTPerformLLMRephraseRequest(userTemplate string, query string, history []sharedtypes.HistoricMessage, systemPrompt string) (rephrasedQuery string)
AnsysGPTPerformLLMRephraseRequest performs a rephrase request to LLM
Tags:
- @displayName: Rephrase Request
Parameters:
- template: the template for the rephrase request
- query: the user query
- history: the conversation history
Returns:
- rephrasedQuery: the rephrased query
func AnsysGPTPerformLLMRephraseRequestNew ¶
func AnsysGPTPerformLLMRephraseRequestNew(template string, query string, history []sharedtypes.HistoricMessage) (rephrasedQuery string)
AnsysGPTPerformLLMRephraseRequestNew performs a rephrase request to LLM
Tags:
- @displayName: Rephrase Request New
Parameters:
- template: the template for the rephrase request
- query: the user query
- history: the conversation history
Returns:
- rephrasedQuery: the rephrased query
func AnsysGPTPerformLLMRequest ¶
func AnsysGPTPerformLLMRequest(finalQuery string, history []sharedtypes.HistoricMessage, systemPrompt string, isStream bool) (message string, stream *chan string)
AnsysGPTPerformLLMRequest performs a request to Ansys GPT
Tags:
- @displayName: LLM Request
Parameters:
- finalQuery: the final query
- history: the conversation history
- systemPrompt: the system prompt
Returns:
- stream: the stream channel
func AnsysGPTRemoveNoneCitationsFromSearchResponse ¶
func AnsysGPTRemoveNoneCitationsFromSearchResponse(semanticSearchOutput []sharedtypes.ACSSearchResponse, citations []sharedtypes.AnsysGPTCitation) (reducedSemanticSearchOutput []sharedtypes.ACSSearchResponse)
AnsysGPTRemoveNoneCitationsFromSearchResponse removes none citations from search response
Tags:
- @displayName: Remove None Citations
Parameters:
- semanticSearchOutput: the search response
- citations: the citations
Returns:
- reducedSemanticSearchOutput: the reduced search response
func AnsysGPTReorderSearchResponseAndReturnOnlyTopK ¶
func AnsysGPTReorderSearchResponseAndReturnOnlyTopK(semanticSearchOutput []sharedtypes.ACSSearchResponse, topK int) (reorderedSemanticSearchOutput []sharedtypes.ACSSearchResponse)
AnsysGPTReorderSearchResponseAndReturnOnlyTopK reorders the search response
Tags:
- @displayName: Reorder Search Response
Parameters:
- semanticSearchOutput: the search response
- topK: the number of results to be returned
Returns:
- reorderedSemanticSearchOutput: the reordered search response
func AnsysGPTReturnIndexList ¶
AnsysGPTReturnIndexList returns the index list for Ansys GPT
Tags:
- @displayName: List Indexes
Parameters:
- indexGroups: the index groups
Returns:
- indexList: the index list
func AppendMeshPilotHistory ¶
func AppendMeshPilotHistory(history []map[string]string, role, content string) (updatedHistory []map[string]string)
AppendMeshPilotHistory this function append mesh pilot history
Tags:
- @displayName: AppendMeshPilotHistory
Parameters:
- history: the tool history
- role: the tool id
- content: the tool name
Returns:
- updatedHistory: the updated mesh pilot history
func AppendMessageHistory ¶
func AppendMessageHistory(newMessage string, role AppendMessageHistoryRole, history []sharedtypes.HistoricMessage) (updatedHistory []sharedtypes.HistoricMessage)
AppendMessageHistory appends a new message to the conversation history
Tags:
- @displayName: Append Message History
Parameters:
- newMessage: the new message
- role: the role of the message
- history: the conversation history
Returns:
- updatedHistory: the updated conversation history
func AppendStringSlices ¶
AppendStringSlices creates a new slice by appending all elements of the provided slices.
Tags:
- @displayName: Append String Slices
Parameters:
- slice1, slice2, slice3, slice4, slice5: slices to append.
Returns:
- result: a new slice with all elements appended.
func AppendToolHistory ¶
func AppendToolHistory(toolHistory []map[string]string, toolId, toolName, toolArguments, toolResponse string) (updatedToolHistory []map[string]string)
AppendToolHistory this function append tool history
Tags:
- @displayName: AppendToolHistory
Parameters:
- toolHistory: the tool history
- toolId: the tool id
- toolName: the tool name
- toolArguments: the tool arguments
- toolResponse: the tool response
Returns:
- updatedToolHistory: the updated tool history
func AssignStringToString ¶
AssignStringToString assigns a string to another string
Tags:
- @displayName: Assign String to String
Parameters:
- inputString: the input string
Returns:
- outputString: the output string
func BuildFinalQueryForCodeLLMRequest ¶
func BuildFinalQueryForCodeLLMRequest(request string, knowledgedbResponse []sharedtypes.DbResponse) (finalQuery string)
BuildFinalQueryForCodeLLMRequest builds the final query for a code generation request to LLM. The final query is a markdown string that contains the original request and the code examples from the KnowledgeDB.
Tags:
- @displayName: Final Query (Code LLM Request)
Parameters:
- request: the original request
- knowledgedbResponse: the KnowledgeDB response
Returns:
- finalQuery: the final query
func BuildFinalQueryForGeneralLLMRequest ¶
func BuildFinalQueryForGeneralLLMRequest(request string, knowledgedbResponse []sharedtypes.DbResponse) (finalQuery string)
BuildFinalQueryForGeneralLLMRequest builds the final query for a general request to LLM. The final query is a markdown string that contains the original request and the examples from the KnowledgeDB.
Tags:
- @displayName: Final Query (General LLM Request)
Parameters:
- request: the original request
- knowledgedbResponse: the KnowledgeDB response
Returns:
- finalQuery: the final query
func BuildLibraryContext ¶
BuildLibraryContext builds the context string for the query
Tags:
- @displayName: Library Context
Parameters:
- message: the message string
- libraryContext: the library context string
Returns:
- messageWithContext: the message with context
func CastAnyToBool ¶ added in v1.0.13
CastAnyToBool casts data of type any to bool
This is done via a type assertion. Will panic if assertion fails.
Tags:
- @displayName: Cast Any to Bool
Parameters:
- data (any)
Returns
- bool
func CastAnyToByte ¶ added in v1.0.13
CastAnyToByte casts data of type any to byte
This is done via a type assertion. Will panic if assertion fails.
Tags:
- @displayName: Cast Any to Byte
Parameters:
- data (any)
Returns
- byte
func CastAnyToComplex128 ¶ added in v1.0.13
func CastAnyToComplex128(data any) complex128
CastAnyToComplex128 casts data of type any to complex128
This is done via a type assertion. Will panic if assertion fails.
Tags:
- @displayName: Cast Any to Complex128
Parameters:
- data (any)
Returns
- complex128
func CastAnyToComplex64 ¶ added in v1.0.13
CastAnyToComplex64 casts data of type any to complex64
This is done via a type assertion. Will panic if assertion fails.
Tags:
- @displayName: Cast Any to Complex64
Parameters:
- data (any)
Returns
- complex64
func CastAnyToFloat32 ¶ added in v1.0.13
CastAnyToFloat32 casts data of type any to float32
This is done via a type assertion. Will panic if assertion fails.
Tags:
- @displayName: Cast Any to Float32
Parameters:
- data (any)
Returns
- float32
func CastAnyToFloat64 ¶ added in v1.0.13
CastAnyToFloat64 casts data of type any to float64
This is done via a type assertion. Will panic if assertion fails.
Tags:
- @displayName: Cast Any to Float64
Parameters:
- data (any)
Returns
- float64
func CastAnyToInt ¶ added in v1.0.13
CastAnyToInt casts data of type any to int
This is done via a type assertion. Will panic if assertion fails.
Tags:
- @displayName: Cast Any to Int
Parameters:
- data (any)
Returns
- int
func CastAnyToInt16 ¶ added in v1.0.13
CastAnyToInt16 casts data of type any to int16
This is done via a type assertion. Will panic if assertion fails.
Tags:
- @displayName: Cast Any to Int16
Parameters:
- data (any)
Returns
- int16
func CastAnyToInt32 ¶ added in v1.0.13
CastAnyToInt32 casts data of type any to int32
This is done via a type assertion. Will panic if assertion fails.
Tags:
- @displayName: Cast Any to Int32
Parameters:
- data (any)
Returns
- int32
func CastAnyToInt64 ¶ added in v1.0.13
CastAnyToInt64 casts data of type any to int64
This is done via a type assertion. Will panic if assertion fails.
Tags:
- @displayName: Cast Any to Int64
Parameters:
- data (any)
Returns
- int64
func CastAnyToInt8 ¶ added in v1.0.13
CastAnyToInt8 casts data of type any to int8
This is done via a type assertion. Will panic if assertion fails.
Tags:
- @displayName: Cast Any to Int8
Parameters:
- data (any)
Returns
- int8
func CastAnyToInterface ¶ added in v1.0.13
func CastAnyToInterface(data any) interface{}
CastAnyToInterface casts data of type any to interface {}
Tags:
- @displayName: Cast any to interface{}
Parameters:
- data (any)
Returns
- interface {}
func CastAnyToRune ¶ added in v1.0.13
CastAnyToRune casts data of type any to rune
This is done via a type assertion. Will panic if assertion fails.
Tags:
- @displayName: Cast Any to Rune
Parameters:
- data (any)
Returns
- rune
func CastAnyToString ¶ added in v1.0.13
CastAnyToString casts data of type any to string
This is done via a type assertion. Will panic if assertion fails.
Tags:
- @displayName: Cast Any to String
Parameters:
- data (any)
Returns
- string
func CastAnyToUint ¶ added in v1.0.13
CastAnyToUint casts data of type any to uint
This is done via a type assertion. Will panic if assertion fails.
Tags:
- @displayName: Cast Any to Uint
Parameters:
- data (any)
Returns
- uint
func CastAnyToUint16 ¶ added in v1.0.13
CastAnyToUint16 casts data of type any to uint16
This is done via a type assertion. Will panic if assertion fails.
Tags:
- @displayName: Cast Any to Uint16
Parameters:
- data (any)
Returns
- uint16
func CastAnyToUint32 ¶ added in v1.0.13
CastAnyToUint32 casts data of type any to uint32
This is done via a type assertion. Will panic if assertion fails.
Tags:
- @displayName: Cast Any to Uint32
Parameters:
- data (any)
Returns
- uint32
func CastAnyToUint64 ¶ added in v1.0.13
CastAnyToUint64 casts data of type any to uint64
This is done via a type assertion. Will panic if assertion fails.
Tags:
- @displayName: Cast Any to Uint64
Parameters:
- data (any)
Returns
- uint64
func CastAnyToUint8 ¶ added in v1.0.13
CastAnyToUint8 casts data of type any to uint8
This is done via a type assertion. Will panic if assertion fails.
Tags:
- @displayName: Cast Any to Uint8
Parameters:
- data (any)
Returns
- uint8
func CastArrayMapStringAnyToAny ¶ added in v1.0.13
CastArrayMapStringAnyToAny casts data of type []map[string]any to any
Tags:
- @displayName: Cast []map[string]any to any
Parameters:
- data ([]map[string]any)
Returns
- any
func CastBoolToAny ¶ added in v1.0.13
CastBoolToAny casts data of type bool to any
Tags:
- @displayName: Cast Bool to Any
Parameters:
- data (bool)
Returns
- any
func CastByteToAny ¶ added in v1.0.13
CastByteToAny casts data of type byte to any
Tags:
- @displayName: Cast Byte to Any
Parameters:
- data (byte)
Returns
- any
func CastComplex128ToAny ¶ added in v1.0.13
func CastComplex128ToAny(data complex128) any
CastComplex128ToAny casts data of type complex128 to any
Tags:
- @displayName: Cast Complex128 to Any
Parameters:
- data (complex128)
Returns
- any
func CastComplex64ToAny ¶ added in v1.0.13
CastComplex64ToAny casts data of type complex64 to any
Tags:
- @displayName: Cast Complex64 to Any
Parameters:
- data (complex64)
Returns
- any
func CastFloat32ToAny ¶ added in v1.0.13
CastFloat32ToAny casts data of type float32 to any
Tags:
- @displayName: Cast Float32 to Any
Parameters:
- data (float32)
Returns
- any
func CastFloat64ToAny ¶ added in v1.0.13
CastFloat64ToAny casts data of type float64 to any
Tags:
- @displayName: Cast Float64 to Any
Parameters:
- data (float64)
Returns
- any
func CastInt16ToAny ¶ added in v1.0.13
CastInt16ToAny casts data of type int16 to any
Tags:
- @displayName: Cast Int16 to Any
Parameters:
- data (int16)
Returns
- any
func CastInt32ToAny ¶ added in v1.0.13
CastInt32ToAny casts data of type int32 to any
Tags:
- @displayName: Cast Int32 to Any
Parameters:
- data (int32)
Returns
- any
func CastInt64ToAny ¶ added in v1.0.13
CastInt64ToAny casts data of type int64 to any
Tags:
- @displayName: Cast Int64 to Any
Parameters:
- data (int64)
Returns
- any
func CastInt8ToAny ¶ added in v1.0.13
CastInt8ToAny casts data of type int8 to any
Tags:
- @displayName: Cast Int8 to Any
Parameters:
- data (int8)
Returns
- any
func CastIntToAny ¶ added in v1.0.13
CastIntToAny casts data of type int to any
Tags:
- @displayName: Cast Int to Any
Parameters:
- data (int)
Returns
- any
func CastInterfaceToAny ¶ added in v1.0.13
func CastInterfaceToAny(data interface{}) any
CastInterfaceToAny casts data of type interface {} to any
Tags:
- @displayName: Cast interface{} to any
Parameters:
- data (interface {})
Returns
- any
func CastRuneToAny ¶ added in v1.0.13
CastRuneToAny casts data of type rune to any
Tags:
- @displayName: Cast Rune to Any
Parameters:
- data (rune)
Returns
- any
func CastStringToAny ¶ added in v1.0.13
CastStringToAny casts data of type string to any
Tags:
- @displayName: Cast String to Any
Parameters:
- data (string)
Returns
- any
func CastUint16ToAny ¶ added in v1.0.13
CastUint16ToAny casts data of type uint16 to any
Tags:
- @displayName: Cast Uint16 to Any
Parameters:
- data (uint16)
Returns
- any
func CastUint32ToAny ¶ added in v1.0.13
CastUint32ToAny casts data of type uint32 to any
Tags:
- @displayName: Cast Uint32 to Any
Parameters:
- data (uint32)
Returns
- any
func CastUint64ToAny ¶ added in v1.0.13
CastUint64ToAny casts data of type uint64 to any
Tags:
- @displayName: Cast Uint64 to Any
Parameters:
- data (uint64)
Returns
- any
func CastUint8ToAny ¶ added in v1.0.13
CastUint8ToAny casts data of type uint8 to any
Tags:
- @displayName: Cast Uint8 to Any
Parameters:
- data (uint8)
Returns
- any
func CastUintToAny ¶ added in v1.0.13
CastUintToAny casts data of type uint to any
Tags:
- @displayName: Cast Uint to Any
Parameters:
- data (uint)
Returns
- any
func CheckApiKeyAuthMongoDb ¶
func CheckApiKeyAuthMongoDb(apiKey string, mongoDbUrl string, mongoDatabaseName string, mongoDbCollectionName string) (isAuthenticated bool)
CheckApiKeyAuthMongoDb checks if the given API key is valid and has access to the service.
Tags:
- @displayName: Verify API Key
Parameters:
- apiKey: The API key to check.
- mongoDbUrl: The URL of the MongoDB database.
- mongoDatabaseName: The name of the MongoDB database.
- mongoDbCollectionName: The name of the MongoDB collection.
Returns:
- isAuthenticated: A boolean indicating whether the API key is authenticated.
func CheckCreateUserIdMongoDb ¶
func CheckCreateUserIdMongoDb(userId string, temporaryTokenLimit int, hoursUntilTokenLimitReset int, modelId []string, mongoDbUrl string, mongoDatabaseName string, mongoDbCollectionName string) (existingUser bool)
CheckCreateUserIdMongoDb checks if a user ID exists in the MongoDB database and creates it if it doesn't.
Tags:
- @displayName: Check and Create User ID
Parameters:
- userId: The user ID to check.
- tokenLimitForNewUsers: The token limit for new users.
- mongoDbUrl: The URL of the MongoDB database.
- mongoDatabaseName: The name of the MongoDB database.
- mongoDbCollectionName: The name of the MongoDB collection.
Returns:
- existingUser: A boolean indicating whether the user ID already exists.
func CheckTokenLimitReached ¶ added in v1.0.12
func CheckTokenLimitReached(query string, tokenLimit int, modelName string, tokenLimitMessage string) (tokenLimitReached bool, responseMessage string)
CheckTokenLimitReached checks if the query exceeds the token limit for the specified model
Tags:
- @displayName: Check Token Limit Reached
Parameters:
- query: the query string
- tokenLimit: the token limit
- modelName: the name of the model to check against
Returns:
- tokenLimitReached: true if the token limit is reached, false otherwise
func CreateCollectionRequest ¶
CreateCollectionRequest sends a request to the collection endpoint.
Tags:
- @displayName: Create Collection
Parameters:
- collectionName: the name of the collection to create.
- vectorSize: the length of the vector embeddings
- vectorDistance: the vector similarity distance algorithm to use for the vector index (cosine, dot, euclid, manhattan)
func CreateDbFilter ¶
func CreateDbFilter( guid []string, documentId []string, documentName []string, level []string, tags sharedtypes.DbArrayFilter, keywords sharedtypes.DbArrayFilter, metadata []sharedtypes.DbJsonFilter) (databaseFilter sharedtypes.DbFilters)
CreateDbFilter creates a filter for the KnowledgeDB.
The function returns the filter.
Tags:
- @displayName: Create Filter
Parameters:
- guid: the guid filter
- documentId: the document ID filter
- documentName: the document name filter
- level: the level filter
- tags: the tags filter
- keywords: the keywords filter
- metadata: the metadata filter
Returns:
- databaseFilter: the filter
func CreateEmbeddings ¶
func CreateGeneralDataExtractionDocumentObjects ¶
func CreateGeneralDataExtractionDocumentObjects(documentName string, documentChunks []string, denseEmbeddings [][]float32, sparseEmbeddings []map[uint]float32, ) (extractionData []interface{})
CreateGeneralDataExtractionDocumentObjects creates general data extraction document objects from the provided document chunks, dense embeddings, and sparse embeddings.
Tags:
- @displayName: Create General Data Extraction Document Objects
Parameters:
- documentName: name of the document.
- documentChunks: chunks of the document.
- denseEmbeddings: dense embeddings of the document.
- sparseEmbeddings: sparse embeddings of the document.
Returns:
- extractionData: general data extraction document objects in interface format.
func CreateKeywordsDbFilter ¶
func CreateKeywordsDbFilter(keywords []string, needAll bool) (databaseFilter sharedtypes.DbArrayFilter)
CreateKeywordsDbFilter creates a keywords filter for the KnowledgeDB.
The function returns the keywords filter.
Tags:
- @displayName: Keywords Filter
Parameters:
- keywords: the keywords to be used for the filter
- needAll: flag to indicate whether all keywords are needed
Returns:
- databaseFilter: the keywords filter
func CreateMessageWithVariable ¶
CreateMessageWithVariable creates a message with a variable.
Tags:
- @displayName: Create Message with Variable
Parameters:
- message: The message to create.
- variable: The variable to insert into the message.
Returns:
- updatedMessage: The updated message with the variable inserted.
func CreateMetadataDbFilter ¶
func CreateMetadataDbFilter(fieldName string, fieldType string, filterData []string, needAll bool) (databaseFilter sharedtypes.DbJsonFilter)
CreateMetadataDbFilter creates a metadata filter for the KnowledgeDB.
The function returns the metadata filter.
Tags:
- @displayName: Metadata Filter
Parameters:
- fieldName: the name of the field
- fieldType: the type of the field
- filterData: the filter data
- needAll: flag to indicate whether all data is needed
Returns:
- databaseFilter: the metadata filter
func CreateTagsDbFilter ¶
func CreateTagsDbFilter(tags []string, needAll bool) (databaseFilter sharedtypes.DbArrayFilter)
CreateTagsDbFilter creates a tags filter for the KnowledgeDB.
The function returns the tags filter.
Tags:
- @displayName: Tags Filter
Parameters:
- tags: the tags to be used for the filter
- needAll: flag to indicate whether all tags are needed
Returns:
- databaseFilter: the tags filter
func DenyCustomerAccessAndSendWarningMongoDb ¶
func DenyCustomerAccessAndSendWarningMongoDb(apiKey string, mongoDbUrl string, mongoDatabaseName string, mongoDbCollectionName string) (customerName string, sendWarning bool)
DenyCustomerAccessAndSendWarningMongoDb denies access to the customer and sends a warning if necessary.
Tags:
- @displayName: Deny Customer Access
Parameters:
- apiKey: The API key of the customer.
- mongoDbUrl: The URL of the MongoDB database.
- mongoDatabaseName: The name of the MongoDB database.
- mongoDbCollectionName: The name of the MongoDB collection.
Returns:
- customerName: The name of the customer.
- sendWarning: A boolean indicating whether a warning should be sent to the customer.
func DenyCustomerAccessAndSendWarningMongoDbUserId ¶
func DenyCustomerAccessAndSendWarningMongoDbUserId(userId string, mongoDbUrl string, mongoDatabaseName string, mongoDbCollectionName string) (sendWarning bool)
DenyCustomerAccessAndSendWarningMongoDbUserId denies access to the customer by user ID and sends a warning if necessary.
Tags:
- @displayName: Deny Customer Access by User ID
Parameters:
- userId: The user ID of the customer.
- mongoDbUrl: The URL of the MongoDB database.
- mongoDatabaseName: The name of the MongoDB database.
- mongoDbCollectionName: The name of the MongoDB collection.
Returns:
- sendWarning: A boolean indicating whether a warning should be sent to the customer.
func DownloadGithubFileContent ¶
func DownloadGithubFileContent(githubRepoName string, githubRepoOwner string, githubRepoBranch string, gihubFilePath string, githubAccessToken string) (checksum string, content []byte)
DownloadGithubFileContent downloads file content from github and returns checksum and content.
Tags:
- @displayName: Download Github File Content
Parameters:
- githubRepoName: name of the github repository.
- githubRepoOwner: owner of the github repository.
- githubRepoBranch: branch of the github repository.
- gihubFilePath: path to file in the github repository.
- githubAccessToken: access token for github.
Returns:
- checksum: checksum of file.
- content: content of file.
func DownloadGithubFilesContent ¶
func DownloadGithubFilesContent(githubRepoName string, githubRepoOwner string, githubRepoBranch string, gihubFilePaths []string, githubAccessToken string) (filesMap map[string][]byte)
DownloadGithubFilesContent downloads file content from github and returns checksum and content.
Tags:
- @displayName: Download Github Files Content
Parameters:
- githubRepoName: name of the github repository.
- githubRepoOwner: owner of the github repository.
- githubRepoBranch: branch of the github repository.
- gihubFilePath: path to file in the github repository.
- githubAccessToken: access token for github.
Returns:
- filesMap: map of file paths to file content.
func ExecuteTool ¶ added in v1.0.7
func ExecuteTool(serverURL, toolName string, args map[string]interface{}) (map[string]interface{}, error)
ExecuteTool executes a specific tool via the MCP server with provided arguments.
Tags:
- @displayName: Execute MCP Tool
Parameters:
- serverURL: the WebSocket URL of the MCP server
- toolName: the name of the tool to execute
- args: a map of arguments to pass to the tool
Returns:
- result: the response from the tool execution
- error: any error that occurred during execution
func ExtractCriteriaSuggestions ¶ added in v1.0.8
func ExtractCriteriaSuggestions(llmResponse string) (criteriaSuggestions []sharedtypes.MaterialLlmCriterion)
ExtractCriteriaSuggestions extracts criteria suggestions from the LLM response text
Tags:
- @displayName: Extract criteria suggestions from LLM response
Parameters:
- llmResponse: the text response from the LLM containing JSON with criteria suggestions
Returns:
- criteriaSuggestions: the list of criteria suggestions extracted from the LLM response
func ExtractJSONStringField ¶ added in v1.0.10
ExtractJSONStringField extracts a string field from a JSON string using a key path. The key path is a dot-separated string that specifies the path to the field in the JSON object.
Tags:
- @displayName: Extract JSON String Field
Parameters:
- jsonStr: the JSON string to extract the field from
- keyPath: the dot-separated path to the field in the JSON object
Returns:
- the value of the field as a string
func ExtractJson ¶ added in v1.0.8
func FetchActionsPathFromPathDescription ¶
func FetchActionsPathFromPathDescription(db_name, description, nodeLabel string) (actions []map[string]string)
FetchActionsPathFromPathDescription fetch actions from path description
Tags:
- @displayName: FetchActionsPathFromPathDescription
Parameters:
- description: the desctiption of path
- nodeLabel: the label of the node
Returns:
- actions: the list of actions to execute
func FetchNodeDescriptionsFromPathDescription ¶
func FetchNodeDescriptionsFromPathDescription(db_name, description string) (actionDescriptions string)
FetchNodeDescriptionsFromPathDescription get node descriptions from path description
Tags:
- @displayName: FetchNodeDescriptionsFromPathDescription
Parameters:
- description: the desctiption of path
Returns:
- actionDescriptions: action descriptions
func FetchPropertiesFromPathDescription ¶
FetchPropertiesFromPathDescription get properties from path description
Tags:
- @displayName: FetchPropertiesFromPathDescription
Parameters:
- description: the desctiption of path
Returns:
- properties: the list of descriptions
func FilterOutDuplicateAttributes ¶ added in v1.0.8
func FilterOutDuplicateAttributes(criteriaSuggestions []sharedtypes.MaterialLlmCriterion) (filtered []sharedtypes.MaterialLlmCriterion)
FilterOutDuplicateAttributes filters out duplicate attributes from the criteria suggestions based on their names
Tags:
- @displayName: Filter out duplicate attributes
Parameters:
- criteriaSuggestions: current list of criteria suggestions
Returns:
- filtered: the list of criteria suggestions excluding duplicates based on attribute names
func FilterOutNonExistingAttributes ¶ added in v1.0.8
func FilterOutNonExistingAttributes(criteriaSuggestions []sharedtypes.MaterialLlmCriterion, availableAttributes []sharedtypes.MaterialAttribute) (filtered []sharedtypes.MaterialLlmCriterion)
FilterOutNonExistingAttributes filters out criteria suggestions that do not match any of the available attributes based on their names
Tags:
- @displayName: Filter out non-existing attributes
Parameters:
- criteriaSuggestions: current list of criteria suggestions
- availableAttributes: the list of available attributes
Returns:
- filtered: the list of criteria suggestions excluding those that do not match any of the available attributes
func FinalizeMessage ¶ added in v1.0.9
FinalizeMessage this function takes message and generate response schema
Tags:
- @displayName: FinalizeMessage
Parameters:
- message: final message
Returns:
- result: response schema sent to chat interface
func FinalizeResult ¶
FinalizeResult converts actions to json string to send back data
Tags:
- @displayName: FinalizeResult
Parameters:
- actions: the executable actions
- toolName: tool name to create customize messages
Returns:
- result: the actions in json format
func FindRelevantPathDescription ¶ added in v1.0.13
func FindRelevantPathDescription(descriptions []string, message string) (relevantDescription string)
FindRelevantPathDescription finds the relevant description by prompting
Tags:
- @displayName: FindRelevantPathDescription
Parameters:
- descriptions: the list of descriptions
- message: the message from llm
Returns:
- relevantDescription: the relevant desctiption
func GeneralGraphDbQuery ¶
func GeneralGraphDbQuery(query string, parameters aali_graphdb.ParameterMap) []map[string]any
GeneralGraphDbQuery executes the given Cypher query and returns the response.
The function returns the graph db response.
Tags:
- @displayName: General Graph DB Query
Parameters:
- query: the Cypher query to be executed.
- parameters: parameters to pass to the query during execution
Returns:
- databaseResponse: the graph db response
func GeneralQuery ¶
func GeneralQuery(collectionName string, maxRetrievalCount int, outputFields []string, filters sharedtypes.DbFilters) (databaseResponse []sharedtypes.DbResponse)
GeneralQuery performs a general query in the KnowledgeDB.
The function returns the query results.
Tags:
- @displayName: Query
Parameters:
- collectionName: the name of the collection to which the data objects will be added.
- maxRetrievalCount: the maximum number of results to be retrieved.
- outputFields: the fields to be included in the output.
- filters: the filter for the query.
Returns:
- databaseResponse: the query results
func GenerateActionsSubWorkflowPrompt ¶ added in v1.0.13
func GenerateActionsSubWorkflowPrompt(userInstruction string) (systemPrompt string, userPrompt string)
GenerateActionsSubWorkflowPrompt generates system and user prompts for subworkflow identification.
Tags:
- @displayName: GenerateActionsSubWorkflowPrompt
Parameters:
- userInstruction: user instruction
Returns:
- systemPrompt: the system prompt
- userPrompt: the user prompt
func GenerateDocumentTree ¶
func GenerateDocumentTree(documentName string, documentId string, documentChunks []string, embeddingsDimensions int, getSummary bool, getKeywords bool, numKeywords int, chunkSize int, numLlmWorkers int) (returnedDocumentData []sharedtypes.DbData)
GenerateDocumentTree generates a tree structure from the document chunks.
Tags:
- @displayName: Document Tree
Parameters:
- documentName: name of the document.
- documentId: id of the document.
- documentChunks: chunks of the document.
- embeddingsDimensions: dimensions of the embeddings.
- getSummary: whether to get summary.
- getKeywords: whether to get keywords.
- numKeywords: number of keywords.
- chunkSize: size of the chunks.
- numLlmWorkers: number of llm workers.
Returns:
- documentData: tree structure of the document.
func GenerateHelperSubWorkflowPrompt ¶ added in v1.0.13
func GenerateHelperSubWorkflowPrompt(userInstruction string) (systemPrompt string, userPrompt string)
GenerateHelperSubWorkflowPrompt generates system and user prompts for helper subworkflow identification.
Tags:
- @displayName: GenerateHelperSubWorkflowPrompt
Parameters:
- userInstruction: user instruction
Returns:
- systemPrompt: the system prompt
- userPrompt: the user prompt
func GenerateUUID ¶ added in v1.0.10
func GenerateUUID() string
GenerateUUID generates a new UUID (Universally Unique Identifier).
Tags:
- @displayName: Generate UUID
Returns:
- a string representation of the generated UUID
func GenerateUserPrompt ¶ added in v1.0.9
GenerateUserPrompt generates user instruction prompt based on the provided template.
Tags:
- @displayName: GenerateUserPrompt
Parameters:
- userInstruction: user instruction
- userPromptTemplate: user prompt template
Returns:
- userPrompt: the user prompt
func GenerateUserPromptWithContext ¶ added in v1.0.13
func GenerateUserPromptWithContext(userInstruction string, context string, userPromptTemplate string) (userPrompt string)
GenerateUserPromptWithContext generates user instruction prompt based on the provided template with instruction and context.
Tags:
- @displayName: GenerateUserPromptWithContext
Parameters:
- userInstruction: user instruction
- context: user context
- userPromptTemplate: user prompt template
Returns:
- userPrompt: the user prompt
func GenerateUserPromptWithList ¶ added in v1.0.9
func GenerateUserPromptWithList(userInstruction string, userList []string, userPromptTemplate string) (userPrompt string)
GenerateUserPromptWithList generates user instruction prompt based on the provided template, instruction, list.
Tags:
- @displayName: GenerateUserPromptWithList
Parameters:
- userInstruction: user instruction
- userList: list of items to include in the prompt
- userPromptTemplate: user prompt template
Returns:
- userPrompt: the user prompt
func GetActionsFromConfig ¶
FinalizeResult converts actions to json string to send back data
Tags:
- @displayName: GetActionsFromConfig
Parameters:
- toolName: tool name to create customize messages
Returns:
- result: the actions in json format
func GetDocumentType ¶
GetDocumentType returns the document type of a file.
Tags:
- @displayName: Get Document Type
Parameters:
- filePath: path to file.
Returns:
- documentType: file extension.
func GetGithubFilesToExtract ¶
func GetGithubFilesToExtract(githubRepoName string, githubRepoOwner string, githubRepoBranch string, githubAccessToken string, githubFileExtensions []string, githubFilteredDirectories []string, githubExcludedDirectories []string) (githubFilesToExtract []string)
GetGithubFilesToExtract gets all files from github that need to be extracted.
Tags:
- @displayName: List Github Files
Parameters:
- githubRepoName: name of the github repository.
- githubRepoOwner: owner of the github repository.
- githubRepoBranch: branch of the github repository.
- githubAccessToken: access token for github.
- githubFileExtensions: github file extensions.
- githubFilteredDirectories: github filtered directories.
- githubExcludedDirectories: github excluded directories.
Returns:
- githubFilesToExtract: github files to extract.
func GetListCollections ¶
func GetListCollections() (collectionsList []string)
GetListCollections retrieves the list of collections from the KnowledgeDB.
Tags:
- @displayName: List Collections
The function returns the list of collections.
Parameters:
- knowledgeDbEndpoint: the KnowledgeDB endpoint
Returns:
- collectionsList: the list of collections
func GetLocalFileContent ¶
GetLocalFileContent reads local file and returns checksum and content.
Tags:
- @displayName: Get Local File Content
Parameters:
- localFilePath: path to file.
Returns:
- checksum: checksum of file.
- content: content of file.
func GetLocalFilesContent ¶
GetLocalFilesContent reads local files and returns content.
Tags:
- @displayName: Get Local Files Content
Parameters:
- localFilePaths: paths to files.
Returns:
- filesMap: map of file paths to file content.
func GetLocalFilesToExtract ¶
func GetLocalFilesToExtract(localPath string, localFileExtensions []string, localFilteredDirectories []string, localExcludedDirectories []string) (localFilesToExtract []string)
GetLocalFilesToExtract gets all files from local that need to be extracted.
Tags:
- @displayName: List Local Files
Parameters:
- localPath: path to the local directory.
- localFileExtensions: local file extensions.
- localFilteredDirectories: local filtered directories.
- localExcludedDirectories: local excluded directories.
Returns:
- localFilesToExtract: local files to extract.
func GetResource ¶ added in v1.0.7
GetResource retrieves a named resource from the MCP server.
Tags:
- @displayName: Get MCP Resource
Parameters:
- serverURL: the WebSocket URL of the MCP server
- resourceName: the name of the resource to retrieve
Returns:
- result: the retrieved resource as a map
- error: any error that occurred during the request
func GetSelectedSolution ¶
GetSelectedSolution get user selected solutions from the options provided
Tags:
- @displayName: GetSelectedSolution
Parameters:
- arguments: these are the arguments ReAct found based on user choice
Returns:
- solution: the selected solution
func GetSolutionsToFixProblem ¶
func GetSolutionsToFixProblem(db_name, fmFailureCode, primeMeshFailureCode string) (solutions string)
GetSolutionsToFixProblem do similarity search on path description
Tags:
- @displayName: GetSolutionsToFixProblem
Parameters:
- fmFailureCode: FM failure Code
- primeMeshFailureCode: Prime Mesh Failure Code
Returns:
- solutions: the list of solutions in json
func GetSystemPrompt ¶ added in v1.0.7
GetSystemPrompt retrieves a system prompt by name from the MCP server.
Tags:
- @displayName: Get MCP Prompt
Parameters:
- serverURL: the WebSocket URL of the MCP server
- promptName: the name of the system prompt to retrieve
Returns:
- promptStr: the text of the retrieved prompt
- error: any error that occurred during the request
func JsonPath ¶ added in v1.0.13
JsonPath extracts some data from an arbitrary data structure using a JSONPath pattern
Tags:
- @displayName: JSON Path
Parameters:
- pat (string): The JSON Path pattern
- data (any): The data to extract from
- oneResult (bool): Whether you are expecting to extract 1 result or an array of results If you set oneResult=true but there are not exactle 1 result in the output, you will receive an error. This should only be set if the result is guaranteed to have length 1.
Returns
- The extracted data. If oneResult=false, this will be an array of any.
func LangchainSplitter ¶
func LangchainSplitter(bytesContent []byte, documentType string, chunkSize int, chunkOverlap int) (output []string)
LangchainSplitter splits content into chunks using langchain.
Tags:
- @displayName: Split Content
Parameters:
- content: content to split.
- documentType: type of document.
- chunkSize: size of the chunks.
- chunkOverlap: overlap of the chunks.
Returns:
- output: chunks as an slice of strings.
func ListAll ¶ added in v1.0.7
ListAll retrieves all tools, resources, and prompts from the MCP server.
Tags:
- @displayName: List MCP Items
Parameters:
- serverURL: the WebSocket URL of the MCP server
Returns:
- result: a map with lists of tool/resource/prompt names categorized by type
- error: any error that occurred during the process
func LoadAndCheckExampleDependencies ¶
func LoadAndCheckExampleDependencies( dependenciesContent []byte, elements []sharedtypes.CodeGenerationElement, instancesReplacementDict map[string]string, InstancesReplacementPriorityList []string, ) (checkedDependenciesMap map[string][]string, equivalencesMap map[string]map[string]string)
LoadAndCheckExampleDependencies loads and checks the dependencies of the examples.
Tags:
- @displayName: Load and Check Example Dependencies
Parameters:
- dependenciesContent: content of the dependencies file in []byte format.
- elements: code generation elements.
- instancesReplacementDict: dictionary of instances replacements.
- InstancesReplacementPriorityList: list of instances replacement priority.
Returns:
- checkedDependenciesMap: checked dependencies.
- equivalencesMap: equivalences.
func LoadCodeGenerationElements ¶
func LoadCodeGenerationElements(content []byte, elementsFilePath string) (elements []sharedtypes.CodeGenerationElement)
LoadCodeGenerationElements loads code generation elements from an xml or json file.
Tags:
- @displayName: Load Code Generation Elements
Parameters:
- content: content of the file in []byte format.
- elementsFilePath: path to the file.
Returns:
- elements: code generation elements.
func LoadCodeGenerationExamples ¶
func LoadCodeGenerationExamples( source string, examplesToExtract []string, githubRepoName string, githubRepoOwner string, githubRepoBranch string, githubAccessToken string, dependencies map[string][]string, equivalencesMap map[string]map[string]string, chunkSize int, chunkOverlap int) (examples []sharedtypes.CodeGenerationExample)
LoadCodeGenerationExamples loads code generation examples from the provided paths.
Tags:
- @displayName: Load Code Generation Examples
Parameters:
- source: source of the examples (local or github).
- examplesToExtract: paths to the examples.
- githubRepoName: name of the github repository.
- githubRepoOwner: owner of the github repository.
- githubRepoBranch: branch of the github repository.
- githubAccessToken: access token for the github repository.
- dependencies: dependencies of the examples.
- equivalencesMap: equivalences of the examples.
- chunkSize: size of the chunks.
- chunkOverlap: overlap of the chunks.
Returns:
- examples: code generation examples.
func LoadUserGuideSections ¶
func LoadUserGuideSections(source string, sectionFilePaths []string, githubRepoName string, githubRepoOwner string, githubRepoBranch string, githubAccessToken string) (sections []sharedtypes.CodeGenerationUserGuideSection)
LoadUserGuideSections loads user guide sections from the provided paths.
Tags:
- @displayName: Load User Guide Sections
Parameters:
- source: source of the sections (local or github).
- sectionFilePaths: paths to the sections.
- githubRepoName: name of the github repository.
- githubRepoOwner: owner of the github repository.
- githubRepoBranch: branch of the github repository.
- githubAccessToken: access token for the github repository.
Returns:
- sections: user guide sections.
func LogRequestFailed ¶ added in v1.0.11
func LogRequestFailed()
LogRequestFailed writes a .Info log entry indicating that a request was not completed successfully.
Tags:
- @displayName: Log request failed
Parameters:
- none
Returns:
- none
func LogRequestFailedDebugWithMessage ¶ added in v1.0.11
func LogRequestFailedDebugWithMessage(msg1, msg2 string)
LogRequestFailedDebugWithMessage writes a .Debug log entry indicating that a request was not completed successfully with additional message.
Tags:
- @displayName: Log request failed with message
Parameters:
- msg1: the first part of the debug message
- msg2: the second part of the debug message
Returns:
- none
func LogRequestSuccess ¶ added in v1.0.11
func LogRequestSuccess()
LogRequestSuccess writes a .Info log entry indicating that a request was completed successfully.
Tags:
- @displayName: Log request success
Parameters:
- none
Returns:
- none
func MarkdownToHTML ¶ added in v1.0.9
MarkdownToHTML this function converts markdown to html
Tags:
- @displayName: MarkdownToHTML
Parameters:
- markdown: content in markdown format
Returns:
- html: content in html format
func ParseHistory ¶
ParseHistory this function parses history from json to map
Tags:
- @displayName: ParseHistory
Parameters:
- historyJson: history in json format
Returns:
- history: the parsed history
func ParseHistoryToHistoricMessages ¶ added in v1.0.9
func ParseHistoryToHistoricMessages(historyJson string) (history []sharedtypes.HistoricMessage)
ParseHistoryToHistoricMessages this function to convert chat history to historic messages
Tags:
- @displayName: ParseHistoryToHistoricMessages
Parameters:
- historyJson: chat history in json format
Returns:
- history: the history in sharedtypes.HistoricMessage format
func PerformBatchEmbeddingRequest ¶
PerformBatchEmbeddingRequest performs a batch vector embedding request to LLM
Tags:
- @displayName: Batch Embeddings
Parameters:
- input: the input strings
Returns:
- embeddedVectors: the embedded vectors in float32 format
func PerformBatchHybridEmbeddingRequest ¶
func PerformBatchHybridEmbeddingRequest(input []string, maxBatchSize int) (denseEmbeddings [][]float32, sparseEmbeddings []map[uint]float32)
PerformBatchHybridEmbeddingRequest performs a batch hybrid embedding request to LLM returning the sparse and dense embeddings
Tags:
- @displayName: Batch Hybrid Embeddings
Parameters:
- input: the input strings
Returns:
- denseEmbeddings: the dense embeddings in float32 format
- sparseEmbeddings: the sparse embeddings in map format
func PerformCodeLLMRequest ¶
func PerformCodeLLMRequest(input string, history []sharedtypes.HistoricMessage, isStream bool, validateCode bool) (message string, stream *chan string)
PerformCodeLLMRequest performs a code generation request to LLM
Tags:
- @displayName: Code LLM Request
Parameters:
- input: the input string
- history: the conversation history
- isStream: the stream flag
Returns:
- message: the generated code
- stream: the stream channel
func PerformGeneralModelSpecificationRequest ¶
func PerformGeneralModelSpecificationRequest(input string, history []sharedtypes.HistoricMessage, isStream bool, systemPrompt map[string]string, modelIds []string) (message string, stream *chan string)
PerformGeneralModelSpecificationRequest performs a specified request to LLM with a configured model and Systemprompt.
Tags:
- @displayName: General LLM Request (Specified System Prompt)
Parameters:
- input: the user input
- history: the conversation history
- isStream: the flag to indicate whether the response should be streamed
- systemPrompt: the system prompt
- modelId: the model ID
Returns:
- message: the response message
- stream: the stream channel
func PerformGeneralRequest ¶
func PerformGeneralRequest(input string, history []sharedtypes.HistoricMessage, isStream bool, systemPrompt string) (message string, stream *chan string)
PerformGeneralRequest performs a general chat completion request to LLM
Tags:
- @displayName: General LLM Request
Parameters:
- input: the input string
- history: the conversation history
- isStream: the stream flag
- systemPrompt: the system prompt
Returns:
- message: the generated message
- stream: the stream channel
func PerformGeneralRequestNoStreaming ¶
func PerformGeneralRequestNoStreaming(input string, history []sharedtypes.HistoricMessage, systemPrompt string) (message string)
PerformGeneralRequestNoStreaming performs a general chat completion request to LLM without streaming
Tags:
- @displayName: General LLM Request (no streaming)
Parameters:
- input: the input string
- history: the conversation history
- systemPrompt: the system prompt
Returns:
- message: the generated message
func PerformGeneralRequestSpecificModel ¶
func PerformGeneralRequestSpecificModel(input string, history []sharedtypes.HistoricMessage, isStream bool, systemPrompt string, modelIds []string) (message string, stream *chan string)
PerformGeneralRequestSpecificModel performs a general request to LLM with a specific model
Tags:
- @displayName: General LLM Request (Specific Models)
Parameters:
- input: the user input
- history: the conversation history
- isStream: the flag to indicate whether the response should be streamed
- systemPrompt: the system prompt
- modelId: the model ID
Returns:
- message: the response message
- stream: the stream channel
func PerformGeneralRequestSpecificModelAndModelOptions ¶
func PerformGeneralRequestSpecificModelAndModelOptions(input string, history []sharedtypes.HistoricMessage, isStream bool, systemPrompt string, modelIds []string, modelOptions sharedtypes.ModelOptions) (message string, stream *chan string)
PerformGeneralRequestSpecificModel performs a general request to LLM with a specific model
Tags:
- @displayName: General LLM Request (Specific Models & Model Options)
Parameters:
- input: the user input
- history: the conversation history
- isStream: the flag to indicate whether the response should be streamed
- systemPrompt: the system prompt
- modelId: the model ID
- modelOptions: the model options
Returns:
- message: the response message
- stream: the stream channel
func PerformGeneralRequestSpecificModelAndModelOptionsNoStreamWithOpenAiInputOutputTokenOutput ¶ added in v1.0.13
func PerformGeneralRequestSpecificModelAndModelOptionsNoStreamWithOpenAiInputOutputTokenOutput(input string, history []sharedtypes.HistoricMessage, systemPrompt string, modelIds []string, modelOptions sharedtypes.ModelOptions, tokenCountModelName string) (message string, inputTokenCount int, outputTokenCount int)
PerformGeneralRequestSpecificModelAndModelOptionsNoStreamWithOpenAiInputOutputTokenOutput performs a general request to LLM with a specific model and model options, and returns the token count using OpenAI token count model. Does not stream the response.
Tags:
- @displayName: General LLM Request (Specific Models, Model Options, No Stream, OpenAI Input & Output Token Output)
Parameters:
- input: the user input
- history: the conversation history
- systemPrompt: the system prompt
- modelIds: the model IDs of the AI models to use
- modelOptions: the model options
- tokenCountModelName: the model name to use for token count
Returns:
- message: the response message
- inputTokenCount: the input token count
- outputTokenCount: the output token count
func PerformGeneralRequestSpecificModelAndModelOptionsNoStreamWithOpenAiTokenOutput ¶
func PerformGeneralRequestSpecificModelAndModelOptionsNoStreamWithOpenAiTokenOutput(input string, history []sharedtypes.HistoricMessage, systemPrompt string, modelIds []string, modelOptions sharedtypes.ModelOptions, tokenCountModelName string) (message string, tokenCount int)
PerformGeneralRequestSpecificModelAndModelOptionsNoStreamWithOpenAiTokenOutput performs a general request to LLM with a specific model and model options, and returns the token count using OpenAI token count model. Does not stream the response.
Tags:
- @displayName: General LLM Request (Specific Models, Model Options, No Stream, OpenAI Token Output)
Parameters:
- input: the user input
- history: the conversation history
- systemPrompt: the system prompt
- modelIds: the model IDs of the AI models to use
- modelOptions: the model options
- tokenCountModelName: the model name to use for token count
Returns:
- message: the response message
- tokenCount: the token count
func PerformGeneralRequestSpecificModelModelOptionsAndImages ¶ added in v1.0.12
func PerformGeneralRequestSpecificModelModelOptionsAndImages(input string, history []sharedtypes.HistoricMessage, isStream bool, systemPrompt string, modelIds []string, modelOptions sharedtypes.ModelOptions, images []string) (message string, stream *chan string)
PerformGeneralRequestSpecificModelModelOptionsAndImages performs a general request to LLM with a specific model including model options and images
Tags:
- @displayName: General LLM Request (Specific Models, Model Options & Images)
Parameters:
- input: the user input
- history: the conversation history
- isStream: the flag to indicate whether the response should be streamed
- systemPrompt: the system prompt
- modelId: the model ID
- modelOptions: the model options
- images: the images to include in the request
Returns:
- message: the response message
- stream: the stream channel
func PerformGeneralRequestSpecificModelNoStreamWithOpenAiTokenOutput ¶
func PerformGeneralRequestSpecificModelNoStreamWithOpenAiTokenOutput(input string, history []sharedtypes.HistoricMessage, systemPrompt string, modelIds []string, tokenCountModelName string) (message string, tokenCount int)
PerformGeneralRequestSpecificModelNoStreamWithOpenAiTokenOutput performs a general request to LLM with a specific model and returns the token count using OpenAI token count model. Does not stream the response.
Tags:
- @displayName: General LLM Request (Specific Models, No Stream, OpenAI Token Output)
Parameters:
- input: the user input
- history: the conversation history
- systemPrompt: the system prompt
- modelIds: the model IDs of the AI models to use
- tokenCountModelName: the model name to use for token count
Returns:
- message: the response message
- tokenCount: the token count
func PerformGeneralRequestWithImages ¶
func PerformGeneralRequestWithImages(input string, history []sharedtypes.HistoricMessage, isStream bool, systemPrompt string, images []string) (message string, stream *chan string)
PerformGeneralRequestWithImages performs a general request to LLM with images
Tags:
- @displayName: General LLM Request (with Images)
Parameters:
- input: the user input
- history: the conversation history
- isStream: the flag to indicate whether the response should be streamed
- systemPrompt: the system prompt
- images: the images
Returns:
- message: the response message
- stream: the stream channel
func PerformKeywordExtractionRequest ¶
PerformKeywordExtractionRequest performs a keywords extraction request to LLM
Tags:
- @displayName: Keyword Extraction
Parameters:
- input: the input string
- maxKeywordsSearch: the maximum number of keywords to search for
Returns:
- keywords: the keywords extracted from the input string as a slice of strings
func PerformMultipleGeneralRequestsAndExtractAttributesWithOpenAiTokenOutput ¶ added in v1.0.11
func PerformMultipleGeneralRequestsAndExtractAttributesWithOpenAiTokenOutput(input string, history []sharedtypes.HistoricMessage, systemPrompt string, modelIds []string, tokenCountModelName string, n int) (uniqueCriterion []sharedtypes.MaterialLlmCriterion, tokenCount int)
PerformMultipleGeneralRequestsAndExtractAttributesWithOpenAiTokenOutput performs multiple general LLM requests using specific models, extracts structured attributes (criteria) from the responses, and returns the total token count using the specified OpenAI token counting model. This version does not stream responses.
Tags:
- @displayName: Multiple General LLM Requests (Specific Models, No Stream, Attribute Extraction, OpenAI Token Output)
Parameters:
- input: the user input string
- history: the conversation history for context
- systemPrompt: the system prompt to guide the LLM
- modelIds: the model IDs of the LLMs to query
- tokenCountModelName: the model name used for token count calculation
- n: number of parallel requests to perform
Returns:
- uniqueCriterion: a deduplicated list of extracted attributes (criteria) from all responses
- tokenCount: the total token count (input tokens × n + combined output tokens)
func PerformSummaryRequest ¶
PerformSummaryRequest performs a summary request to LLM
Tags:
- @displayName: Summary
Parameters:
- input: the input string
Returns:
- summary: the summary extracted from the input string
func PerformVectorEmbeddingRequest ¶
PerformVectorEmbeddingRequest performs a vector embedding request to LLM
Tags:
- @displayName: Embeddings
Parameters:
- input: the input string
Returns:
- embeddedVector: the embedded vector in float32 format
func PerformVectorEmbeddingRequestWithTokenLimitCatch ¶
func PerformVectorEmbeddingRequestWithTokenLimitCatch(input string, tokenLimitMessage string) (embeddedVector []float32, tokenLimitReached bool, responseMessage string)
PerformVectorEmbeddingRequestWithTokenLimitCatch performs a vector embedding request to LLM and catches the token limit error message
Tags:
- @displayName: Embeddings with Token Limit Catch
Parameters:
- input: the input string
Returns:
- embeddedVector: the embedded vector in float32 format
func PrintFeedback ¶
func PrintFeedback(feedback sharedtypes.Feedback)
PrintFeedback prints the feedback to the console in JSON format
Tags:
- @displayName: Print Feedback
Parameters:
- feedback: the feedback to print
func ProcessMainAgentOutput ¶ added in v1.0.13
ProcessMainAgentOutput this function process output of llm
Tags:
- @displayName: ProcessMainAgentOutput
Parameters:
- llmOutput: the llm output for main agent
Returns:
- messageTo: send the message to this recipient
- message: message to send to the recipient
func ProcessSubworkflowIdentificationOutput ¶ added in v1.0.9
ProcessSubworkflowIdentificationOutput this function process output of llm
Tags:
- @displayName: ProcessSubworkflowIdentificationOutput
Parameters:
- llmOutput: the llm output for subworkflow identification
Returns:
- status: status of processing
- workflowName: the identified subworkflow name
func QdrantCreateCollection ¶
QdrantCreateCollection creates a collection in qdrant
Tags:
- @displayName: Create Qdrant Collection
Params:
- collectionName (string): The name of the collection
- vectorSize (uint64): The size of the vectors stored in this collection
- vectorDistance (string): The distance metric to use of vector similarity search (cosine, dot, euclid, manhattan)
func QdrantCreateIndex ¶
QdrantCreateIndex creates a field index on a qdrant collection
Tags:
- @displayName: Create Qdrant Index
Params:
- collectionName (string): The name of the collection
- fieldName (string): The name of the payload field to create an index on
- fieldType (string): The qdrant type that the payload field is expected to be
- wait (bool): Whether to wait for the index to be created or return immediately & continue indexing in background
func QdrantInsertData ¶
func QdrantInsertData(collectionName string, data []interface{}, idFieldName string, vectorFieldName string)
QdrantInsertData inserts data into a collection in qdrant
Tags:
- @displayName: Insert Data into Qdrant
Params:
- collectionName (string): The name of the collection
- data ([]interface{}): The data points to insert (func will fail if elements are not `map[string]any`)
- idFieldName (string): The name of the field to use as the ID
- vectorFieldName (string): The name of the field to use as the vector
func RetrieveDependencies ¶
func RetrieveDependencies( relationshipName string, relationshipDirection string, sourceDocumentId string, nodeTypesFilter sharedtypes.DbArrayFilter, maxHopsNumber int) (dependenciesIds []string)
RetrieveDependencies retrieves the dependencies of the specified source node.
The function returns the list of dependencies.
Tags:
- @displayName: Retrieve Dependencies
Parameters:
- relationshipName: the name of the relationship to retrieve dependencies for.
- relationshipDirection: the direction of the relationship to retrieve dependencies for.
- sourceDocumentId: the document ID of the source node.
- nodeTypesFilter: filter based on node types.
- maxHopsNumber: maximum number of hops to traverse.
Returns:
- dependenciesIds: the list of dependencies
func SelectedSolution ¶ added in v1.0.13
SelectedSolution this function parse the selected solution
Tags:
- @displayName: SelectedSolution
Parameters:
- selectedSolution: selected solution found by the LLM
Returns:
- solution: parsed solution
func SendLogicAppNotificationEmail ¶
func SendLogicAppNotificationEmail(logicAppEndpoint string, email string, subject string, content string)
SendLogicAppNotificationEmail sends a POST request to the email service.
Tags:
- @displayName: Send Email Notification
Parameters:
- endpoint: The email service endpoint.
- email: The email address.
- subject: The email subject.
- content: The email content.
func SendRestAPICall ¶
func SendRestAPICall(requestType string, endpoint string, header map[string]string, query map[string]string, jsonBody string) (success bool, returnJsonBody string)
SendAPICall sends an API call to the specified URL with the specified headers and query parameters.
Tags:
- @displayName: REST Call
Parameters:
- requestType: the type of the request (GET, POST, PUT, PATCH, DELETE)
- urlString: the URL to send the request to
- headers: the headers to include in the request
- query: the query parameters to include in the request
- jsonBody: the body of the request as a JSON string
Returns:
- success: a boolean indicating whether the request was successful
- returnJsonBody: the JSON body of the response as a string
func SendVectorsToKnowledgeDB ¶
func SendVectorsToKnowledgeDB(vector []float32, keywords []string, keywordsSearch bool, collection string, similaritySearchResults int, similaritySearchMinScore float64) (databaseResponse []sharedtypes.DbResponse)
SendVectorsToKnowledgeDB sends the given vector to the KnowledgeDB and returns the most relevant data. The number of results is specified in the config file. The keywords are used to filter the results. The min score filter is also specified in the config file. If it is not specified, the default value is used.
The function returns the most relevant data.
Tags:
- @displayName: Similarity Search
Parameters:
- vector: the vector to be sent to the KnowledgeDB
- keywords: the keywords to be used to filter the results
- keywordsSearch: the flag to enable the keywords search
- collection: the collection name
- similaritySearchResults: the number of results to be returned
- similaritySearchMinScore: the minimum score for the results
Returns:
- databaseResponse: an array of the most relevant data
func SerializeResponse ¶ added in v1.0.8
func SerializeResponse(criteriaSuggestions []sharedtypes.MaterialCriterionWithGuid, tokens int) (result string)
SerializeResponse formats the criteria to a response suitable for the UI clients in string format
Tags:
- @displayName: Serialize response for clients
Parameters:
- criteriaSuggestions: the list of criteria with their identities
- tokens: tokens consumed by the request
Returns:
- result: string representation of the response in JSON format
func SetCopilotGenerateRequestJsonBody ¶ added in v1.0.10
func SetCopilotGenerateRequestJsonBody( query string, sessionID string, mode string, timeout int, priority int, agentPreference string, saveIntermediate bool, similarityTopK int, noCritique bool, maxIterations int, forceAzure bool, ) (jsonBody string)
SetGenerateRequestJsonBody creates a JSON body for the generate request to RHSC Copilot. It takes various parameters to configure the request and returns the JSON string.
Tags:
- @displayName: Copilot Generate Request JSON Body
Parameters:
- query: the query string for the request.
- sessionID: the session ID for the request.
- mode: the mode of operation for the request.
- timeout: the timeout for the request in seconds.
- priority: the priority of the request.
- agentPreference: the preferred agent for the request.
- saveIntermediate: whether to save intermediate results.
- similarityTopK: the number of top similar results to consider.
- noCritique: whether to disable critique.
- maxIterations: the maximum number of iterations for the request.
- forceAzure: whether to force the use of Azure for the request.
func ShortenMessageHistory ¶
func ShortenMessageHistory(history []sharedtypes.HistoricMessage, maxLength int) (updatedHistory []sharedtypes.HistoricMessage)
ShortenMessageHistory shortens the conversation history to a maximum length. It will retain only the most recent messages and older messages will be removed.
Tags:
- @displayName: Shorten History
Parameters:
- history: the conversation history
- maxLength: the maximum length of the conversation history
Returns:
- updatedHistory: the updated conversation history
func SimilaritySearch ¶
func SimilaritySearch( collectionName string, embeddedVector []float32, maxRetrievalCount int, filters sharedtypes.DbFilters, minScore float64, getLeafNodes bool, getSiblings bool, getParent bool, getChildren bool) (databaseResponse []sharedtypes.DbResponse)
SimilaritySearch performs a similarity search in the KnowledgeDB.
The function returns the similarity search results.
Tags:
- @displayName: Similarity Search (Filtered)
Parameters:
- collectionName: the name of the collection to which the data objects will be added.
- embeddedVector: the embedded vector used for searching.
- maxRetrievalCount: the maximum number of results to be retrieved.
- outputFields: the fields to be included in the output.
- filters: the filter for the query.
- minScore: the minimum score filter.
- getLeafNodes: flag to indicate whether to retrieve all the leaf nodes in the result node branch.
- getSiblings: flag to indicate whether to retrieve the previous and next node to the result nodes.
- getParent: flag to indicate whether to retrieve the parent object.
- getChildren: flag to indicate whether to retrieve the children objects.
Returns:
- databaseResponse: the similarity search results
func SimilartitySearchOnPathDescriptions ¶
func SimilartitySearchOnPathDescriptions(instruction string, toolName string) (descriptions []string)
SimilartitySearchOnPathDescriptions do similarity search on path description
Tags:
- @displayName: SimilartitySearchOnPathDescriptions
Parameters:
- instruction: the user query
- toolName: the tool name
Returns:
- descriptions: the list of descriptions
func SimilartitySearchOnPathDescriptionsQdrant ¶ added in v1.0.5
func SimilartitySearchOnPathDescriptionsQdrant(vector []float32, collection string, similaritySearchResults int, similaritySearchMinScore float64) (descriptions []string)
SimilartitySearchOnPathDescriptions (Qdrant) do similarity search on path description
Tags:
- @displayName: SimilartitySearchOnPathDescriptions (Qdrant)
Parameters:
- instruction: the user query
- toolName: the tool name
Returns:
- descriptions: the list of descriptions
func StoreElementsInGraphDatabase ¶
func StoreElementsInGraphDatabase(elements []sharedtypes.CodeGenerationElement)
StoreElementsInGraphDatabase stores elements in the graph database.
Tags:
- @displayName: Store Elements in Graph Database
Parameters:
- elements: code generation elements.
func StoreElementsInVectorDatabase ¶
func StoreElementsInVectorDatabase(elements []sharedtypes.CodeGenerationElement, elementsCollectionName string, batchSize int, vectorDistance string)
StoreElementsInVectorDatabase stores elements in the vector database.
Tags:
- @displayName: Store Elements in Vector Database
Parameters:
- elements: code generation elements.
- elementsCollectionName: name of the collection.
- batchSize: batch size for embeddings.
- vectorDistance: the distance metric to use for the vector index (cosine, dot, euclid, manhattan)
func StoreExamplesInGraphDatabase ¶
func StoreExamplesInGraphDatabase(examples []sharedtypes.CodeGenerationExample)
StoreExamplesInGraphDatabase stores examples in the graph database.
Tags:
- @displayName: Store Examples in Graph Database
Parameters:
- examples: code generation examples.
func StoreExamplesInVectorDatabase ¶
func StoreExamplesInVectorDatabase(examples []sharedtypes.CodeGenerationExample, examplesCollectionName string, batchSize int, vectorDistance string)
StoreExamplesInVectorDatabase stores examples in the vector database.
Tags:
- @displayName: Store Examples in Vector Database
Parameters:
- examples: code generation examples.
- examplesCollectionName: name of the collection.
- batchSize: batch size for embeddings.
- vectorDistance: the distance metric to use for the vector index (cosine, dot, euclid, manhattan)
func StoreUserGuideSectionsInGraphDatabase ¶
func StoreUserGuideSectionsInGraphDatabase(sections []sharedtypes.CodeGenerationUserGuideSection)
StoreUserGuideSectionsInGraphDatabase stores user guide sections in the graph database.
Tags:
- @displayName: Store User Guide Sections in Graph Database
Parameters:
- elements: user guide sections.
- label: label for the sections (UserGuide by default).
func StoreUserGuideSectionsInVectorDatabase ¶
func StoreUserGuideSectionsInVectorDatabase(sections []sharedtypes.CodeGenerationUserGuideSection, userGuideCollectionName string, batchSize int, chunkSize int, chunkOverlap int, vectorDistance string)
StoreUserGuideSectionsInVectorDatabase stores user guide sections in the vector database.
Tags:
- @displayName: Store User Guide Sections in Vector Database
Parameters:
- sections: user guide sections.
- userGuideCollectionName: name of the collection.
- batchSize: batch size for embeddings.
- chunkSize: size of the chunks.
- chunkOverlap: overlap of the chunks.
- vectorDistance: the distance metric to use for the vector index (cosine, dot, euclid, manhattan)
func StringConcat ¶ added in v1.0.13
StringConcat concatenates 2 strings together, with an optional separator.
Tags:
- @displayName: Concatenate Strings
Parameters
- a (string) the first string
- b (string) the second string
- separator (string) the separator string. If not provided, will be an empty string.
func StringFormat ¶ added in v1.0.13
StringFormat formats any data as a string.
Use this to turn non-string data into a string representation. This uses go's `fmt.Sprintf` under the hood.
Tags:
- @displayName: Format data as string
Parameters
- data (any): the data to format as a string
- format (string): the format specifier to use. If not provided will default to "%v". See the [go fmt docs](https://pkg.go.dev/fmt) for details.
func SynthesizeActions ¶
func SynthesizeActions(message string, properties []string, actions []map[string]string) (updatedActions []map[string]string)
SynthesizeActions update action as per user instruction
Tags:
- @displayName: SynthesizeActions
Parameters:
- message: the message from the llm
- properties: the list of properties
- actions: the list of actions
Returns:
- updatedActions: the list of synthesized actions
func SynthesizeActionsTool13 ¶ added in v1.0.7
SynthesizeActionsTool13 synthesize actions based on user instruction
Tags:
- @displayName: SynthesizeActionsTool13
Parameters:
- content: the llm content
Returns:
- result: the synthesized string
func SynthesizeActionsTool14 ¶ added in v1.0.7
SynthesizeActionsTool14 synthesize actions based on user instruction
Tags:
- @displayName: SynthesizeActionsTool14
Parameters:
- content: the llm content
Returns:
- result: the synthesized string
func SynthesizeActionsTool4 ¶
func SynthesizeActionsTool4(message string, actions []map[string]string) (updatedActions []map[string]string)
SynthesizeActionsTool4 update action as per user instruction
Tags:
- @displayName: SynthesizeActionsTool4
Parameters:
- message: the message from the llm
- actions: the list of actions
Returns:
- updatedActions: the list of synthesized actions
func UpdateTotalTokenCountForCustomerMongoDb ¶
func UpdateTotalTokenCountForCustomerMongoDb(apiKey string, mongoDbUrl string, mongoDatabaseName string, mongoDbCollectionName string, additionalTokenCount int) (tokenLimitReached bool)
UpdateTotalTokenCountForCustomerMongoDb updates the total token count for the given customer in the MongoDB database.
Tags:
- @displayName: Update Total Token Count
Parameters:
- apiKey: The API key of the customer.
- mongoDbUrl: The URL of the MongoDB database.
- mongoDatabaseName: The name of the MongoDB database.
- mongoDbCollectionName: The name of the MongoDB collection.
- additionalTokenCount: The number of additional tokens to add to the total token count.
Returns:
- tokenLimitReached: A boolean indicating whether the customer has reached the token limit.
func UpdateTotalTokenCountForUserIdMongoDb ¶
func UpdateTotalTokenCountForUserIdMongoDb(userId string, mongoDbUrl string, mongoDatabaseName string, mongoDbCollectionName string, additionalInputTokenCount int, additionalOutputTokenCount int, hoursUntilTokenLimitReset int) (tokenLimitReached bool)
UpdateTotalTokenCountForUserIdMongoDb updates the total token count for the given user ID in the MongoDB database.
Tags:
- @displayName: Update Total Token Count by User ID
Parameters:
- userId: The user ID of the customer.
- mongoDbUrl: The URL of the MongoDB database.
- mongoDatabaseName: The name of the MongoDB database.
- mongoDbCollectionName: The name of the MongoDB collection.
- additionalTokenCount: The number of additional tokens to add to the total token count.
Returns:
- tokenLimitReached: A boolean indicating whether the customer has reached the token limit.
Types ¶
type ACSSearchRequest ¶
type ACSSearchRequest struct {
Search string `json:"search"`
VectorQueries []ACSVectorQuery `json:"vectorQueries"`
VectorFilterMode string `json:"vectorFilterMode"`
Filter string `json:"filter"`
QueryType string `json:"queryType"`
SemanticConfiguration string `json:"semanticConfiguration"`
Top int `json:"top"`
Select string `json:"select"`
Count bool `json:"count"`
}
ACSRequest represents the request structure for the Azure Cognitive Search.
type ACSSearchResponseALH ¶
type ACSSearchResponseALH struct {
SourcetitleSAP string `json:"sourcetitleSAP"`
SourceURLSAP string `json:"sourceURLSAP"`
SourcetitleDCB string `json:"sourcetitleDCB"`
SourceURLDCB string `json:"sourceURLDCB"`
Content string `json:"content"`
TypeOFasset string `json:"typeOFasset"`
Physics string `json:"physics"`
Product string `json:"product"`
Version string `json:"version"`
Weight float64 `json:"weight"`
TokenSize int `json:"token_size"`
SearchScore float64 `json:"@search.score"`
SearchRerankerScore float64 `json:"@search.rerankerScore"`
IndexName string `json:"indexName"`
}
ACSSearchResponse represents the response structure for the Azure Cognitive Search for ansysgpt-alh & ansysgpt-scbu.
type ACSSearchResponseCrtech ¶
type ACSSearchResponseCrtech struct {
Physics string `json:"physics"`
SourceTitleLvl3 string `json:"sourceTitle_lvl3"`
SourceURLLvl3 string `json:"sourceURL_lvl3"`
TokenSize int `json:"token_size"`
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"`
BridgeId string `json:"bridge_id"`
SearchScore float64 `json:"@search.score"`
SearchRerankerScore float64 `json:"@search.rerankerScore"`
IndexName string `json:"indexName"`
}
ACSSearchResponseCrtech represents the response structure for the Azure Cognitive Search for external-crtech-thermal-desktop.
type ACSSearchResponseLSdyna ¶
type ACSSearchResponseLSdyna struct {
Title string `json:"title"`
Url string `json:"url"`
Content string `json:"content"`
TypeOFasset string `json:"typeOFasset"`
Physics string `json:"physics"`
Product string `json:"product"`
TokenSize int `json:"token_size"`
SearchScore float64 `json:"@search.score"`
SearchRerankerScore float64 `json:"@search.rerankerScore"`
IndexName string `json:"indexName"`
}
ACSSearchResponse represents the response structure for the Azure Cognitive Search for lsdyna-documentation-r14.
type ACSSearchResponseStruct ¶
type ACSSearchResponseStruct struct {
OdataContext string `json:"@odata.context"`
OdataCount int `json:"@odata.count"`
Value []sharedtypes.ACSSearchResponse `json:"value"`
}
ACSSearchResponseStruct represents the response structure for the Azure Cognitive Search for granular-ansysgpt, ansysgpt-documentation-2023r2, scade-documentation-2023r2, ansys-dot-com-marketing.
type ACSSearchResponseStructALH ¶
type ACSSearchResponseStructALH struct {
OdataContext string `json:"@odata.context"`
OdataCount int `json:"@odata.count"`
Value []ACSSearchResponseALH `json:"value"`
}
ACSSearchResponseStruct represents the response structure for the Azure Cognitive Search for ansysgpt-alh & ansysgpt-scbu.
type ACSSearchResponseStructCrtech ¶
type ACSSearchResponseStructCrtech struct {
OdataContext string `json:"@odata.context"`
OdataCount int `json:"@odata.count"`
Value []ACSSearchResponseCrtech `json:"value"`
}
ACSSearchResponseStructCrtech represents the response structure for the Azure Cognitive Search for external-crtech-thermal-desktop.
type ACSSearchResponseStructLSdyna ¶
type ACSSearchResponseStructLSdyna struct {
OdataContext string `json:"@odata.context"`
OdataCount int `json:"@odata.count"`
Value []ACSSearchResponseLSdyna `json:"value"`
}
ACSSearchResponseStruct represents the response structure for the Azure Cognitive Search for lsdyna-documentation-r14.
type ACSVectorQuery ¶
type ACSVectorQuery struct {
Kind string `json:"kind"`
K int `json:"k"`
Vector []float32 `json:"vector"`
Fields string `json:"fields"`
}
ACSVectorQuery represents the vector query structure for the Azure Cognitive Search.
type AnsysGPTRetrieverModuleRequest ¶ added in v1.0.12
type AnsysGPTRetrieverModuleRequest struct {
UserInput string `json:"user_input"`
DataSource string `json:"data_source"`
FilterPhysics string `json:"filter_physics"`
NumDocs int `json:"num_docs"`
Platform string `json:"platform"`
}
AnsysGPTRetrieverModuleRequest represents the request structure for the Ansys GPT Retriever Module.
type AppendMessageHistoryRole ¶
type AppendMessageHistoryRole string
type DataExtractionBranch ¶
type DataExtractionBranch struct {
Text string
ChildDataObjects []*sharedtypes.DbData
ChildDataIds []uuid.UUID
}
DataExtractionBranch represents the branch structure for the data extraction.
type DataExtractionLLMInputChannelItem ¶
type DataExtractionLLMInputChannelItem struct {
Data *sharedtypes.DbData
Adapter string
ChatRequestType string
MaxNumberOfKeywords uint32
InstructionSequenceWaitGroup *sync.WaitGroup
Lock *sync.Mutex
EmbeddingVector []float32
Summary string
Keywords []string
CollectionName string
}
DataExtractionLLMInputChannelItem represents the input channel item for the data extraction llm handler workers.
type DataExtractionSplitterServiceResponse ¶
type DataExtractionSplitterServiceResponse struct {
Chunks []string `json:"chunks"`
}
type EmailRequest ¶
type EmailRequest struct {
Email string `json:"email"`
Subject string `json:"subject"`
Content string `json:"content"`
}
EmailRequest represents the structure of the POST request body
type GeneralDataExtractionDocument ¶
type GeneralDataExtractionDocument struct {
DocumentName string `json:"document_name"`
Guid string `json:"guid"`
PreviousChunk string `json:"previous_chunk"`
NextChunk string `json:"next_chunk"`
DenseVector []float32 `json:"dense_vector"`
SparseVector map[uint]float32 `json:"sparse_vector"`
Text string `json:"text"`
}
type LlmCriteria ¶ added in v1.0.8
type LlmCriteria struct {
Criteria []sharedtypes.MaterialLlmCriterion
}
type MongoDbContext ¶
type MongoDbContext struct {
Client *mongo.Client
Database *mongo.Database
Collection *mongo.Collection
}
MongoDbContext is the structure for the mongodb client
type MongoDbCustomerObject ¶
type MongoDbCustomerObjectDisco ¶
type MongoDbCustomerObjectDisco struct {
UserId string `bson:"user_id"`
AccessDenied bool `bson:"access_denied"`
ModelId []string `bson:"model_id"`
InputTokenCount int `bson:"input_token_count"`
OutputTokenCount int `bson:"output_token_count"`
TokenLimit int `bson:"token_limit"`
TokenLimitTimestamp int64 `bson:"token_limit_timestamp"`
WarningSent bool `bson:"warning_sent"`
}
type Response ¶ added in v1.0.8
type Response struct {
Criteria []sharedtypes.MaterialCriterionWithGuid
Tokens int
}