# externalfunctions import "github.com/ansys/aali-flowkit/pkg/externalfunctions" ## Index - Variables - [func AddAvailableAttributesToSystemPrompt\(userDesignRequirements string, systemPromptTemplate string, allAvailableAttributes \[\]sharedtypes.MaterialAttribute, availableSearchCriteria \[\]string, traceID string, spanID string\) \(fullSystemPrompt string, childSpanID string\)](<#AddAvailableAttributesToSystemPrompt>) - [func AddDataRequest\(collectionName string, documentData \[\]sharedtypes.DbData\)](<#AddDataRequest>) - [func AddGraphDbParameter\(parameters aali\_graphdb.ParameterMap, name string, value string, paramType string\) aali\_graphdb.ParameterMap](<#AddGraphDbParameter>) - [func AddGuidsToAttributes\(criteriaSuggestions \[\]sharedtypes.MaterialLlmCriterion, availableAttributes \[\]sharedtypes.MaterialAttribute, traceID string, spanID string\) \(criteriaWithGuids \[\]sharedtypes.MaterialCriterionWithGuid, childSpanID string\)](<#AddGuidsToAttributes>) - [func AecGetContextFromRetrieverModule\(retrieverModuleEndpoint string, userQuery string, dataSources \[\]string, physics \[\]string, topK int, plattform string, retrieverModuleKey string\) \(context \[\]sharedtypes.AnsysGPTRetrieverModuleChunk\)](<#AecGetContextFromRetrieverModule>) - [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>) - [func AisAcsSemanticHybridSearchs\(acsEndpoint string, acsApiKey string, acsApiVersion string, query string, embeddedQuery \[\]float32, indexList \[\]string, physics \[\]string, topK int\) \[\]sharedtypes.ACSSearchResponse](<#AisAcsSemanticHybridSearchs>) - [func AisChangeAcsResponsesByFactor\(factors map\[string\]float64, semanticSearchOutput \[\]sharedtypes.ACSSearchResponse\) \(changedSemanticSearchOutput \[\]sharedtypes.ACSSearchResponse\)](<#AisChangeAcsResponsesByFactor>) - [func AisPerformLLMRephraseRequest\(systemTemplate string, userTemplate string, query string, history \[\]sharedtypes.HistoricMessage, tokenCountModelName string\) \(rephrasedQuery string, inputTokenCount int, outputTokenCount int\)](<#AisPerformLLMRephraseRequest>) - [func AisReturnIndexList\(accessPoint string, physics \[\]string, version \[\]string\) \(indexList \[\]string\)](<#AisReturnIndexList>) - [func AnsysGPTACSSemanticHybridSearchs\(acsEndpoint string, acsApiKey string, acsApiVersion string, query string, embeddedQuery \[\]float32, indexList \[\]string, filter map\[string\]string, topK int\) \(output \[\]sharedtypes.ACSSearchResponse\)](<#AnsysGPTACSSemanticHybridSearchs>) - [func AnsysGPTBuildFinalQuery\(refrasedQuery string, context \[\]sharedtypes.ACSSearchResponse\) \(finalQuery string, errorResponse string, displayFixedMessageToUser bool\)](<#AnsysGPTBuildFinalQuery>) - [func AnsysGPTCheckProhibitedWords\(query string, prohibitedWords \[\]string, errorResponseMessage string\) \(foundProhibited bool, responseMessage string\)](<#AnsysGPTCheckProhibitedWords>) - [func AnsysGPTExtractFieldsFromQuery\(query string, fieldValues map\[string\]\[\]string, defaultFields \[\]sharedtypes.AnsysGPTDefaultFields\) \(fields map\[string\]string\)](<#AnsysGPTExtractFieldsFromQuery>) - [func AnsysGPTGetSystemPrompt\(query string, prohibitedWords \[\]string, template string\) \(systemPrompt string\)](<#AnsysGPTGetSystemPrompt>) - [func AnsysGPTPerformLLMRephraseRequest\(userTemplate string, query string, history \[\]sharedtypes.HistoricMessage, systemPrompt string\) \(rephrasedQuery string\)](<#AnsysGPTPerformLLMRephraseRequest>) - [func AnsysGPTPerformLLMRephraseRequestNew\(template string, query string, history \[\]sharedtypes.HistoricMessage\) \(rephrasedQuery string\)](<#AnsysGPTPerformLLMRephraseRequestNew>) - [func AnsysGPTPerformLLMRequest\(finalQuery string, history \[\]sharedtypes.HistoricMessage, systemPrompt string, isStream bool\) \(message string, stream \*chan string\)](<#AnsysGPTPerformLLMRequest>) - [func AnsysGPTRemoveNoneCitationsFromSearchResponse\(semanticSearchOutput \[\]sharedtypes.ACSSearchResponse, citations \[\]sharedtypes.AnsysGPTCitation\) \(reducedSemanticSearchOutput \[\]sharedtypes.ACSSearchResponse\)](<#AnsysGPTRemoveNoneCitationsFromSearchResponse>) - [func AnsysGPTReorderSearchResponseAndReturnOnlyTopK\(semanticSearchOutput \[\]sharedtypes.ACSSearchResponse, topK int\) \(reorderedSemanticSearchOutput \[\]sharedtypes.ACSSearchResponse\)](<#AnsysGPTReorderSearchResponseAndReturnOnlyTopK>) - [func AnsysGPTReturnIndexList\(indexGroups \[\]string\) \(indexList \[\]string\)](<#AnsysGPTReturnIndexList>) - [func AppendMeshPilotHistory\(history \[\]map\[string\]string, role, content string\) \(updatedHistory \[\]map\[string\]string\)](<#AppendMeshPilotHistory>) - [func AppendMessageHistory\(newMessage string, role AppendMessageHistoryRole, history \[\]sharedtypes.HistoricMessage\) \(updatedHistory \[\]sharedtypes.HistoricMessage\)](<#AppendMessageHistory>) - [func AppendStringSlices\(slice1, slice2, slice3, slice4, slice5 \[\]string\) \[\]string](<#AppendStringSlices>) - [func AppendToolHistory\(toolHistory \[\]map\[string\]string, toolId, toolName, toolArguments, toolResponse string\) \(updatedToolHistory \[\]map\[string\]string\)](<#AppendToolHistory>) - [func AssignStringToString\(inputString string\) \(outputString string\)](<#AssignStringToString>) - [func BuildFinalQueryForCodeLLMRequest\(request string, knowledgedbResponse \[\]sharedtypes.DbResponse\) \(finalQuery string\)](<#BuildFinalQueryForCodeLLMRequest>) - [func BuildFinalQueryForGeneralLLMRequest\(request string, knowledgedbResponse \[\]sharedtypes.DbResponse\) \(finalQuery string\)](<#BuildFinalQueryForGeneralLLMRequest>) - [func BuildLibraryContext\(message string, libraryContext string\) \(messageWithContext string\)](<#BuildLibraryContext>) - [func CastAnyToBool\(data any\) bool](<#CastAnyToBool>) - [func CastAnyToByte\(data any\) byte](<#CastAnyToByte>) - [func CastAnyToComplex128\(data any\) complex128](<#CastAnyToComplex128>) - [func CastAnyToComplex64\(data any\) complex64](<#CastAnyToComplex64>) - [func CastAnyToFloat32\(data any\) float32](<#CastAnyToFloat32>) - [func CastAnyToFloat64\(data any\) float64](<#CastAnyToFloat64>) - [func CastAnyToInt\(data any\) int](<#CastAnyToInt>) - [func CastAnyToInt16\(data any\) int16](<#CastAnyToInt16>) - [func CastAnyToInt32\(data any\) int32](<#CastAnyToInt32>) - [func CastAnyToInt64\(data any\) int64](<#CastAnyToInt64>) - [func CastAnyToInt8\(data any\) int8](<#CastAnyToInt8>) - [func CastAnyToInterface\(data any\) interface\{\}](<#CastAnyToInterface>) - [func CastAnyToRune\(data any\) rune](<#CastAnyToRune>) - [func CastAnyToString\(data any\) string](<#CastAnyToString>) - [func CastAnyToUint\(data any\) uint](<#CastAnyToUint>) - [func CastAnyToUint16\(data any\) uint16](<#CastAnyToUint16>) - [func CastAnyToUint32\(data any\) uint32](<#CastAnyToUint32>) - [func CastAnyToUint64\(data any\) uint64](<#CastAnyToUint64>) - [func CastAnyToUint8\(data any\) uint8](<#CastAnyToUint8>) - [func CastArrayMapStringAnyToAny\(data \[\]map\[string\]any\) any](<#CastArrayMapStringAnyToAny>) - [func CastBoolToAny\(data bool\) any](<#CastBoolToAny>) - [func CastByteToAny\(data byte\) any](<#CastByteToAny>) - [func CastComplex128ToAny\(data complex128\) any](<#CastComplex128ToAny>) - [func CastComplex64ToAny\(data complex64\) any](<#CastComplex64ToAny>) - [func CastFloat32ToAny\(data float32\) any](<#CastFloat32ToAny>) - [func CastFloat64ToAny\(data float64\) any](<#CastFloat64ToAny>) - [func CastInt16ToAny\(data int16\) any](<#CastInt16ToAny>) - [func CastInt32ToAny\(data int32\) any](<#CastInt32ToAny>) - [func CastInt64ToAny\(data int64\) any](<#CastInt64ToAny>) - [func CastInt8ToAny\(data int8\) any](<#CastInt8ToAny>) - [func CastIntToAny\(data int\) any](<#CastIntToAny>) - [func CastInterfaceToAny\(data interface\{\}\) any](<#CastInterfaceToAny>) - [func CastRuneToAny\(data rune\) any](<#CastRuneToAny>) - [func CastStringToAny\(data string\) any](<#CastStringToAny>) - [func CastUint16ToAny\(data uint16\) any](<#CastUint16ToAny>) - [func CastUint32ToAny\(data uint32\) any](<#CastUint32ToAny>) - [func CastUint64ToAny\(data uint64\) any](<#CastUint64ToAny>) - [func CastUint8ToAny\(data uint8\) any](<#CastUint8ToAny>) - [func CastUintToAny\(data uint\) any](<#CastUintToAny>) - [func CheckApiKeyAuthKvDb\(kvdbEndpoint string, apiKey string, traceID string, spanID string\) \(isAuthenticated bool, childSpanID string\)](<#CheckApiKeyAuthKvDb>) - [func CheckApiKeyAuthMongoDb\(apiKey string, mongoDbUrl string, mongoDatabaseName string, mongoDbCollectionName string\) \(isAuthenticated bool\)](<#CheckApiKeyAuthMongoDb>) - [func CheckCreateUserIdMongoDb\(userId string, temporaryTokenLimit int, hoursUntilTokenLimitReset int, modelId \[\]string, mongoDbUrl string, mongoDatabaseName string, mongoDbCollectionName string\) \(existingUser bool\)](<#CheckCreateUserIdMongoDb>) - [func CheckTokenLimitReached\(query string, tokenLimit int, modelName string, tokenLimitMessage string\) \(tokenLimitReached bool, responseMessage string\)](<#CheckTokenLimitReached>) - [func CreateChildSpan\(ctx \*logging.ContextMap, traceID string, parentSpanID string\) \(childSpanID string\)](<#CreateChildSpan>) - [func CreateCollectionRequest\(collectionName string, vectorSize uint64, vectorDistance string\)](<#CreateCollectionRequest>) - [func CreateDbFilter\(guid \[\]string, documentId \[\]string, documentName \[\]string, level \[\]string, tags sharedtypes.DbArrayFilter, keywords sharedtypes.DbArrayFilter, metadata \[\]sharedtypes.DbJsonFilter\) \(databaseFilter sharedtypes.DbFilters\)](<#CreateDbFilter>) - [func CreateEmbeddings\(dense bool, sparse bool, colbert bool, isDocument bool, passages \[\]string\) \(dense\_vector \[\]\[\]float32, lexical\_weights \[\]map\[uint\]float32, colbert\_vecs \[\]\[\]\[\]float32, func\_error error\)](<#CreateEmbeddings>) - [func CreateGeneralDataExtractionDocumentObjects\(documentName string, documentChunks \[\]string, denseEmbeddings \[\]\[\]float32, sparseEmbeddings \[\]map\[uint\]float32\) \(extractionData \[\]interface\{\}\)](<#CreateGeneralDataExtractionDocumentObjects>) - [func CreateKeywordsDbFilter\(keywords \[\]string, needAll bool\) \(databaseFilter sharedtypes.DbArrayFilter\)](<#CreateKeywordsDbFilter>) - [func CreateMessageWithVariable\(message string, variable string\) \(updatedMessage string\)](<#CreateMessageWithVariable>) - [func CreateMetadataDbFilter\(fieldName string, fieldType string, filterData \[\]string, needAll bool\) \(databaseFilter sharedtypes.DbJsonFilter\)](<#CreateMetadataDbFilter>) - [func CreateTagsDbFilter\(tags \[\]string, needAll bool\) \(databaseFilter sharedtypes.DbArrayFilter\)](<#CreateTagsDbFilter>) - [func DenyCustomerAccessAndSendWarningKvDb\(kvdbEndpoint string, apiKey string, traceID string, spanID string\) \(customerName string, sendWarning bool, childSpanID string\)](<#DenyCustomerAccessAndSendWarningKvDb>) - [func DenyCustomerAccessAndSendWarningMongoDb\(apiKey string, mongoDbUrl string, mongoDatabaseName string, mongoDbCollectionName string\) \(customerName string, sendWarning bool\)](<#DenyCustomerAccessAndSendWarningMongoDb>) - [func DenyCustomerAccessAndSendWarningMongoDbUserId\(userId string, mongoDbUrl string, mongoDatabaseName string, mongoDbCollectionName string\) \(sendWarning bool\)](<#DenyCustomerAccessAndSendWarningMongoDbUserId>) - [func DownloadGithubFileContent\(githubRepoName string, githubRepoOwner string, githubRepoBranch string, gihubFilePath string, githubAccessToken string\) \(checksum string, content \[\]byte\)](<#DownloadGithubFileContent>) - [func DownloadGithubFilesContent\(githubRepoName string, githubRepoOwner string, githubRepoBranch string, gihubFilePaths \[\]string, githubAccessToken string\) \(filesMap map\[string\]\[\]byte\)](<#DownloadGithubFilesContent>) - [func ExecuteTool\(serverURL, toolName string, args map\[string\]interface\{\}\) \(map\[string\]interface\{\}, error\)](<#ExecuteTool>) - [func ExtractCriteriaSuggestions\(llmResponse string, traceID string, spanID string\) \(criteriaSuggestions \[\]sharedtypes.MaterialLlmCriterion, childSpanID string\)](<#ExtractCriteriaSuggestions>) - [func ExtractDesignRequirementsAndSearchCriteria\(userInput string, traceID string, spanID string\) \(designRequirements string, availableSearchCriteria \[\]string, childSpanID string\)](<#ExtractDesignRequirementsAndSearchCriteria>) - [func ExtractJSONStringField\(jsonStr string, keyPath string\) string](<#ExtractJSONStringField>) - [func ExtractJson\(text string, traceID string, spanID string\) \(json string, childSpanID string\)](<#ExtractJson>) - [func FetchActionsPathFromPathDescription\(db\_name, description, nodeLabel string\) \(actions \[\]map\[string\]string\)](<#FetchActionsPathFromPathDescription>) - [func FetchNodeDescriptionsFromPathDescription\(db\_name, description string\) \(actionDescriptions string\)](<#FetchNodeDescriptionsFromPathDescription>) - [func FetchPropertiesFromPathDescription\(db\_name, description string\) \(properties \[\]string\)](<#FetchPropertiesFromPathDescription>) - [func FilterOutDuplicateAttributes\(criteriaSuggestions \[\]sharedtypes.MaterialLlmCriterion, traceID string, spanID string\) \(filtered \[\]sharedtypes.MaterialLlmCriterion, childSpanID string\)](<#FilterOutDuplicateAttributes>) - [func FilterOutNonExistingAttributes\(criteriaSuggestions \[\]sharedtypes.MaterialCriterionWithGuid, availableSearchCriteria \[\]string, traceID string, spanID string\) \(filtered \[\]sharedtypes.MaterialCriterionWithGuid, childSpanID string\)](<#FilterOutNonExistingAttributes>) - [func FinalizeMessage\(message string\) \(result string\)](<#FinalizeMessage>) - [func FinalizeResult\(actions \[\]map\[string\]string, toolName string\) \(result string\)](<#FinalizeResult>) - [func FindRelevantPathDescription\(descriptions \[\]string, message string\) \(relevantDescription string\)](<#FindRelevantPathDescription>) - [func GeneralGraphDbQuery\(query string, parameters aali\_graphdb.ParameterMap\) \[\]map\[string\]any](<#GeneralGraphDbQuery>) - [func GeneralQuery\(collectionName string, maxRetrievalCount int, outputFields \[\]string, filters sharedtypes.DbFilters\) \(databaseResponse \[\]sharedtypes.DbResponse\)](<#GeneralQuery>) - [func GenerateActionsSubWorkflowPrompt\(userInstruction string\) \(systemPrompt string, userPrompt string\)](<#GenerateActionsSubWorkflowPrompt>) - [func GenerateDocumentTree\(documentName string, documentId string, documentChunks \[\]string, embeddingsDimensions int, getSummary bool, getKeywords bool, numKeywords int, chunkSize int, numLlmWorkers int\) \(returnedDocumentData \[\]sharedtypes.DbData\)](<#GenerateDocumentTree>) - [func GenerateHelperSubWorkflowPrompt\(userInstruction string\) \(systemPrompt string, userPrompt string\)](<#GenerateHelperSubWorkflowPrompt>) - [func GenerateUUID\(\) string](<#GenerateUUID>) - [func GenerateUserPrompt\(userInstruction string, userPromptTemplate string\) \(userPrompt string\)](<#GenerateUserPrompt>) - [func GenerateUserPromptWithContext\(userInstruction string, context string, userPromptTemplate string\) \(userPrompt string\)](<#GenerateUserPromptWithContext>) - [func GenerateUserPromptWithList\(userInstruction string, userList \[\]string, userPromptTemplate string\) \(userPrompt string\)](<#GenerateUserPromptWithList>) - [func GetActionsFromConfig\(toolName string\) \(result string\)](<#GetActionsFromConfig>) - [func GetDocumentType\(filePath string\) \(documentType string\)](<#GetDocumentType>) - [func GetGithubFilesToExtract\(githubRepoName string, githubRepoOwner string, githubRepoBranch string, githubAccessToken string, githubFileExtensions \[\]string, githubFilteredDirectories \[\]string, githubExcludedDirectories \[\]string\) \(githubFilesToExtract \[\]string\)](<#GetGithubFilesToExtract>) - [func GetListCollections\(\) \(collectionsList \[\]string\)](<#GetListCollections>) - [func GetLocalFileContent\(localFilePath string\) \(checksum string, content \[\]byte\)](<#GetLocalFileContent>) - [func GetLocalFilesContent\(localFilePaths \[\]string\) \(filesMap map\[string\]\[\]byte\)](<#GetLocalFilesContent>) - [func GetLocalFilesToExtract\(localPath string, localFileExtensions \[\]string, localFilteredDirectories \[\]string, localExcludedDirectories \[\]string\) \(localFilesToExtract \[\]string\)](<#GetLocalFilesToExtract>) - [func GetResource\(serverURL, resourceName string\) \(map\[string\]interface\{\}, error\)](<#GetResource>) - [func GetSelectedSolution\(arguments string\) \(solution string\)](<#GetSelectedSolution>) - [func GetSolutionsToFixProblem\(db\_name, fmFailureCode, primeMeshFailureCode string\) \(solutions string\)](<#GetSolutionsToFixProblem>) - [func GetSystemPrompt\(serverURL, promptName string\) \(string, error\)](<#GetSystemPrompt>) - [func JsonPath\(pat string, data any, oneResult bool\) any](<#JsonPath>) - [func LangchainSplitter\(bytesContent \[\]byte, documentType string, chunkSize int, chunkOverlap int\) \(output \[\]string\)](<#LangchainSplitter>) - [func ListAll\(serverURL string\) \(map\[string\]\[\]string, error\)](<#ListAll>) - [func LoadAndCheckExampleDependencies\(dependenciesContent \[\]byte, elements \[\]sharedtypes.CodeGenerationElement, instancesReplacementDict map\[string\]string, InstancesReplacementPriorityList \[\]string\) \(checkedDependenciesMap map\[string\]\[\]string, equivalencesMap map\[string\]map\[string\]string\)](<#LoadAndCheckExampleDependencies>) - [func LoadCodeGenerationElements\(content \[\]byte, elementsFilePath string\) \(elements \[\]sharedtypes.CodeGenerationElement\)](<#LoadCodeGenerationElements>) - [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>) - [func LoadUserGuideSections\(source string, sectionFilePaths \[\]string, githubRepoName string, githubRepoOwner string, githubRepoBranch string, githubAccessToken string\) \(sections \[\]sharedtypes.CodeGenerationUserGuideSection\)](<#LoadUserGuideSections>) - [func LogRequestFailed\(traceID string, spanID string\) \(childSpanID string\)](<#LogRequestFailed>) - [func LogRequestFailedDebugWithMessage\(msg1, msg2 string, traceID string, spanID string\) \(childSpanID string\)](<#LogRequestFailedDebugWithMessage>) - [func LogRequestSuccess\(traceID string, spanID string\) \(childSpanID string\)](<#LogRequestSuccess>) - [func MarkdownToHTML\(markdown string\) \(html string\)](<#MarkdownToHTML>) - [func ParseHistory\(historyJson string\) \(history \[\]map\[string\]string\)](<#ParseHistory>) - [func ParseHistoryToHistoricMessages\(historyJson string\) \(history \[\]sharedtypes.HistoricMessage\)](<#ParseHistoryToHistoricMessages>) - [func PerformBatchEmbeddingRequest\(input \[\]string\) \(embeddedVectors \[\]\[\]float32\)](<#PerformBatchEmbeddingRequest>) - [func PerformBatchHybridEmbeddingRequest\(input \[\]string, maxBatchSize int\) \(denseEmbeddings \[\]\[\]float32, sparseEmbeddings \[\]map\[uint\]float32\)](<#PerformBatchHybridEmbeddingRequest>) - [func PerformCodeLLMRequest\(input string, history \[\]sharedtypes.HistoricMessage, isStream bool, validateCode bool\) \(message string, stream \*chan string\)](<#PerformCodeLLMRequest>) - [func PerformGeneralModelSpecificationRequest\(input string, history \[\]sharedtypes.HistoricMessage, isStream bool, systemPrompt map\[string\]string, modelIds \[\]string\) \(message string, stream \*chan string\)](<#PerformGeneralModelSpecificationRequest>) - [func PerformGeneralRequest\(input string, history \[\]sharedtypes.HistoricMessage, isStream bool, systemPrompt string\) \(message string, stream \*chan string\)](<#PerformGeneralRequest>) - [func PerformGeneralRequestNoStreaming\(input string, history \[\]sharedtypes.HistoricMessage, systemPrompt string\) \(message string\)](<#PerformGeneralRequestNoStreaming>) - [func PerformGeneralRequestSpecificModel\(input string, history \[\]sharedtypes.HistoricMessage, isStream bool, systemPrompt string, modelIds \[\]string\) \(message string, stream \*chan string\)](<#PerformGeneralRequestSpecificModel>) - [func PerformGeneralRequestSpecificModelAndModelOptions\(input string, history \[\]sharedtypes.HistoricMessage, isStream bool, systemPrompt string, modelIds \[\]string, modelOptions sharedtypes.ModelOptions\) \(message string, stream \*chan string\)](<#PerformGeneralRequestSpecificModelAndModelOptions>) - [func PerformGeneralRequestSpecificModelAndModelOptionsNoStreamWithOpenAiInputOutputTokenOutput\(input string, history \[\]sharedtypes.HistoricMessage, systemPrompt string, modelIds \[\]string, modelOptions sharedtypes.ModelOptions, tokenCountModelName string\) \(message string, inputTokenCount int, outputTokenCount int\)](<#PerformGeneralRequestSpecificModelAndModelOptionsNoStreamWithOpenAiInputOutputTokenOutput>) - [func PerformGeneralRequestSpecificModelAndModelOptionsNoStreamWithOpenAiTokenOutput\(input string, history \[\]sharedtypes.HistoricMessage, systemPrompt string, modelIds \[\]string, modelOptions sharedtypes.ModelOptions, tokenCountModelName string\) \(message string, tokenCount int\)](<#PerformGeneralRequestSpecificModelAndModelOptionsNoStreamWithOpenAiTokenOutput>) - [func PerformGeneralRequestSpecificModelModelOptionsAndImages\(input string, history \[\]sharedtypes.HistoricMessage, isStream bool, systemPrompt string, modelIds \[\]string, modelOptions sharedtypes.ModelOptions, images \[\]string\) \(message string, stream \*chan string\)](<#PerformGeneralRequestSpecificModelModelOptionsAndImages>) - [func PerformGeneralRequestSpecificModelNoStreamWithOpenAiTokenOutput\(input string, history \[\]sharedtypes.HistoricMessage, systemPrompt string, modelIds \[\]string, tokenCountModelName string\) \(message string, tokenCount int\)](<#PerformGeneralRequestSpecificModelNoStreamWithOpenAiTokenOutput>) - [func PerformGeneralRequestWithImages\(input string, history \[\]sharedtypes.HistoricMessage, isStream bool, systemPrompt string, images \[\]string\) \(message string, stream \*chan string\)](<#PerformGeneralRequestWithImages>) - [func PerformKeywordExtractionRequest\(input string, maxKeywordsSearch uint32\) \(keywords \[\]string\)](<#PerformKeywordExtractionRequest>) - [func PerformMultipleGeneralRequestsAndExtractAttributesWithOpenAiTokenOutput\(input string, history \[\]sharedtypes.HistoricMessage, systemPrompt string, modelIds \[\]string, tokenCountModelName string, n int, traceID string, spanID string\) \(uniqueCriterion \[\]sharedtypes.MaterialLlmCriterion, tokenCount int, childSpanID string\)](<#PerformMultipleGeneralRequestsAndExtractAttributesWithOpenAiTokenOutput>) - [func PerformSummaryRequest\(input string\) \(summary string\)](<#PerformSummaryRequest>) - [func PerformVectorEmbeddingRequest\(input string\) \(embeddedVector \[\]float32\)](<#PerformVectorEmbeddingRequest>) - [func PerformVectorEmbeddingRequestWithTokenLimitCatch\(input string, tokenLimitMessage string\) \(embeddedVector \[\]float32, tokenLimitReached bool, responseMessage string\)](<#PerformVectorEmbeddingRequestWithTokenLimitCatch>) - [func PrintFeedback\(feedback sharedtypes.Feedback\)](<#PrintFeedback>) - [func ProcessMainAgentOutput\(llmOutput string\) \(messageTo string, message string\)](<#ProcessMainAgentOutput>) - [func ProcessSubworkflowIdentificationOutput\(llmOutput string\) \(status string, workflowName string\)](<#ProcessSubworkflowIdentificationOutput>) - [func QdrantCreateCollection\(collectionName string, vectorSize uint64, vectorDistance string\)](<#QdrantCreateCollection>) - [func QdrantCreateIndex\(collectionName string, fieldName string, fieldType string, wait bool\)](<#QdrantCreateIndex>) - [func QdrantInsertData\(collectionName string, data \[\]interface\{\}, idFieldName string, vectorFieldName string\)](<#QdrantInsertData>) - [func RetrieveDependencies\(relationshipName string, relationshipDirection string, sourceDocumentId string, nodeTypesFilter sharedtypes.DbArrayFilter, maxHopsNumber int\) \(dependenciesIds \[\]string\)](<#RetrieveDependencies>) - [func SelectedSolution\(selectedSolution string\) \(solution string\)](<#SelectedSolution>) - [func SendLogicAppNotificationEmail\(logicAppEndpoint string, email string, subject string, content string\)](<#SendLogicAppNotificationEmail>) - [func SendRestAPICall\(requestType string, endpoint string, header map\[string\]string, query map\[string\]string, jsonBody string\) \(success bool, returnJsonBody string\)](<#SendRestAPICall>) - [func SendVectorsToKnowledgeDB\(vector \[\]float32, keywords \[\]string, keywordsSearch bool, collection string, similaritySearchResults int, similaritySearchMinScore float64\) \(databaseResponse \[\]sharedtypes.DbResponse\)](<#SendVectorsToKnowledgeDB>) - [func SerializeResponse\(criteriaSuggestions \[\]sharedtypes.MaterialCriterionWithGuid, tokens int, traceID string, spanID string\) \(result string, childSpanID string\)](<#SerializeResponse>) - [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\)](<#SetCopilotGenerateRequestJsonBody>) - [func ShortenMessageHistory\(history \[\]sharedtypes.HistoricMessage, maxLength int\) \(updatedHistory \[\]sharedtypes.HistoricMessage\)](<#ShortenMessageHistory>) - [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>) - [func SimilartitySearchOnPathDescriptions\(instruction string, toolName string\) \(descriptions \[\]string\)](<#SimilartitySearchOnPathDescriptions>) - [func SimilartitySearchOnPathDescriptionsQdrant\(vector \[\]float32, collection string, similaritySearchResults int, similaritySearchMinScore float64\) \(descriptions \[\]string\)](<#SimilartitySearchOnPathDescriptionsQdrant>) - [func StartTrace\(\) \(traceID string, spanID string\)](<#StartTrace>) - [func StoreElementsInGraphDatabase\(elements \[\]sharedtypes.CodeGenerationElement\)](<#StoreElementsInGraphDatabase>) - [func StoreElementsInVectorDatabase\(elements \[\]sharedtypes.CodeGenerationElement, elementsCollectionName string, batchSize int, vectorDistance string\)](<#StoreElementsInVectorDatabase>) - [func StoreExamplesInGraphDatabase\(examples \[\]sharedtypes.CodeGenerationExample\)](<#StoreExamplesInGraphDatabase>) - [func StoreExamplesInVectorDatabase\(examples \[\]sharedtypes.CodeGenerationExample, examplesCollectionName string, batchSize int, vectorDistance string\)](<#StoreExamplesInVectorDatabase>) - [func StoreUserGuideSectionsInGraphDatabase\(sections \[\]sharedtypes.CodeGenerationUserGuideSection\)](<#StoreUserGuideSectionsInGraphDatabase>) - [func StoreUserGuideSectionsInVectorDatabase\(sections \[\]sharedtypes.CodeGenerationUserGuideSection, userGuideCollectionName string, batchSize int, chunkSize int, chunkOverlap int, vectorDistance string\)](<#StoreUserGuideSectionsInVectorDatabase>) - [func StringConcat\(a string, b string, separator string\) string](<#StringConcat>) - [func StringFormat\(data any, format string\) string](<#StringFormat>) - [func SynthesizeActions\(message string, properties \[\]string, actions \[\]map\[string\]string\) \(updatedActions \[\]map\[string\]string\)](<#SynthesizeActions>) - [func SynthesizeActionsTool11\(content string\) \(result string\)](<#SynthesizeActionsTool11>) - [func SynthesizeActionsTool12\(content string\) \(result string\)](<#SynthesizeActionsTool12>) - [func SynthesizeActionsTool17\(content string\) \(result string\)](<#SynthesizeActionsTool17>) - [func SynthesizeActionsTool2\(message string, actions \[\]map\[string\]string\) \(updatedActions \[\]map\[string\]string\)](<#SynthesizeActionsTool2>) - [func UpdateTotalTokenCountForCustomerKvDb\(kvdbEndpoint string, apiKey string, additionalTokenCount int, traceID string, spanID string\) \(tokenLimitReached bool, childSpanID string\)](<#UpdateTotalTokenCountForCustomerKvDb>) - [func UpdateTotalTokenCountForCustomerMongoDb\(apiKey string, mongoDbUrl string, mongoDatabaseName string, mongoDbCollectionName string, additionalTokenCount int\) \(tokenLimitReached bool\)](<#UpdateTotalTokenCountForCustomerMongoDb>) - [func UpdateTotalTokenCountForUserIdMongoDb\(userId string, mongoDbUrl string, mongoDatabaseName string, mongoDbCollectionName string, additionalInputTokenCount int, additionalOutputTokenCount int, hoursUntilTokenLimitReset int\) \(tokenLimitReached bool\)](<#UpdateTotalTokenCountForUserIdMongoDb>) - [type ACSSearchRequest](<#ACSSearchRequest>) - [type ACSSearchResponseALH](<#ACSSearchResponseALH>) - [type ACSSearchResponseCrtech](<#ACSSearchResponseCrtech>) - [type ACSSearchResponseLSdyna](<#ACSSearchResponseLSdyna>) - [type ACSSearchResponseStruct](<#ACSSearchResponseStruct>) - [type ACSSearchResponseStructALH](<#ACSSearchResponseStructALH>) - [type ACSSearchResponseStructCrtech](<#ACSSearchResponseStructCrtech>) - [type ACSSearchResponseStructLSdyna](<#ACSSearchResponseStructLSdyna>) - [type ACSVectorQuery](<#ACSVectorQuery>) - [type AnsysGPTRetrieverModuleRequest](<#AnsysGPTRetrieverModuleRequest>) - [type AppendMessageHistoryRole](<#AppendMessageHistoryRole>) - [type DataExtractionBranch](<#DataExtractionBranch>) - [type DataExtractionLLMInputChannelItem](<#DataExtractionLLMInputChannelItem>) - [type DataExtractionSplitterServiceRequest](<#DataExtractionSplitterServiceRequest>) - [type DataExtractionSplitterServiceResponse](<#DataExtractionSplitterServiceResponse>) - [type EmailRequest](<#EmailRequest>) - [type GeneralDataExtractionDocument](<#GeneralDataExtractionDocument>) - [type LlmCriteria](<#LlmCriteria>) - [type MongoDbContext](<#MongoDbContext>) - [type MongoDbCustomerObject](<#MongoDbCustomerObject>) - [type MongoDbCustomerObjectDisco](<#MongoDbCustomerObjectDisco>) - [type Response](<#Response>) - [type TokenCountUpdateRequest](<#TokenCountUpdateRequest>) ## Variables var ExternalFunctionsMap = map[string]interface{}{ "PerformVectorEmbeddingRequest": PerformVectorEmbeddingRequest, "PerformVectorEmbeddingRequestWithTokenLimitCatch": PerformVectorEmbeddingRequestWithTokenLimitCatch, "PerformBatchEmbeddingRequest": PerformBatchEmbeddingRequest, "PerformBatchHybridEmbeddingRequest": PerformBatchHybridEmbeddingRequest, "PerformKeywordExtractionRequest": PerformKeywordExtractionRequest, "PerformGeneralRequest": PerformGeneralRequest, "PerformGeneralRequestWithImages": PerformGeneralRequestWithImages, "PerformGeneralModelSpecificationRequest": PerformGeneralModelSpecificationRequest, "PerformGeneralRequestSpecificModel": PerformGeneralRequestSpecificModel, "PerformGeneralRequestSpecificModelAndModelOptions": PerformGeneralRequestSpecificModelAndModelOptions, "PerformGeneralRequestSpecificModelModelOptionsAndImages": PerformGeneralRequestSpecificModelModelOptionsAndImages, "PerformGeneralRequestSpecificModelNoStreamWithOpenAiTokenOutput": PerformGeneralRequestSpecificModelNoStreamWithOpenAiTokenOutput, "PerformGeneralRequestSpecificModelAndModelOptionsNoStreamWithOpenAiTokenOutput": PerformGeneralRequestSpecificModelAndModelOptionsNoStreamWithOpenAiTokenOutput, "PerformGeneralRequestSpecificModelAndModelOptionsNoStreamWithOpenAiInputOutputTokenOutput": PerformGeneralRequestSpecificModelAndModelOptionsNoStreamWithOpenAiInputOutputTokenOutput, "PerformCodeLLMRequest": PerformCodeLLMRequest, "PerformGeneralRequestNoStreaming": PerformGeneralRequestNoStreaming, "BuildLibraryContext": BuildLibraryContext, "BuildFinalQueryForGeneralLLMRequest": BuildFinalQueryForGeneralLLMRequest, "BuildFinalQueryForCodeLLMRequest": BuildFinalQueryForCodeLLMRequest, "AppendMessageHistory": AppendMessageHistory, "ShortenMessageHistory": ShortenMessageHistory, "CheckTokenLimitReached": CheckTokenLimitReached, "SendVectorsToKnowledgeDB": SendVectorsToKnowledgeDB, "GetListCollections": GetListCollections, "RetrieveDependencies": RetrieveDependencies, "GeneralGraphDbQuery": GeneralGraphDbQuery, "AddGraphDbParameter": AddGraphDbParameter, "GeneralQuery": GeneralQuery, "SimilaritySearch": SimilaritySearch, "CreateKeywordsDbFilter": CreateKeywordsDbFilter, "CreateTagsDbFilter": CreateTagsDbFilter, "CreateMetadataDbFilter": CreateMetadataDbFilter, "CreateDbFilter": CreateDbFilter, "AnsysGPTCheckProhibitedWords": AnsysGPTCheckProhibitedWords, "AnsysGPTExtractFieldsFromQuery": AnsysGPTExtractFieldsFromQuery, "AnsysGPTPerformLLMRephraseRequest": AnsysGPTPerformLLMRephraseRequest, "AnsysGPTPerformLLMRephraseRequestNew": AnsysGPTPerformLLMRephraseRequestNew, "AnsysGPTBuildFinalQuery": AnsysGPTBuildFinalQuery, "AnsysGPTPerformLLMRequest": AnsysGPTPerformLLMRequest, "AnsysGPTReturnIndexList": AnsysGPTReturnIndexList, "AnsysGPTACSSemanticHybridSearchs": AnsysGPTACSSemanticHybridSearchs, "AnsysGPTRemoveNoneCitationsFromSearchResponse": AnsysGPTRemoveNoneCitationsFromSearchResponse, "AnsysGPTReorderSearchResponseAndReturnOnlyTopK": AnsysGPTReorderSearchResponseAndReturnOnlyTopK, "AnsysGPTGetSystemPrompt": AnsysGPTGetSystemPrompt, "AisPerformLLMRephraseRequest": AisPerformLLMRephraseRequest, "AisReturnIndexList": AisReturnIndexList, "AisAcsSemanticHybridSearchs": AisAcsSemanticHybridSearchs, "AisChangeAcsResponsesByFactor": AisChangeAcsResponsesByFactor, "AecGetContextFromRetrieverModule": AecGetContextFromRetrieverModule, "AecPerformLLMFinalRequest": AecPerformLLMFinalRequest, "GetGithubFilesToExtract": GetGithubFilesToExtract, "GetLocalFilesToExtract": GetLocalFilesToExtract, "AppendStringSlices": AppendStringSlices, "DownloadGithubFileContent": DownloadGithubFileContent, "GetLocalFileContent": GetLocalFileContent, "GetDocumentType": GetDocumentType, "LangchainSplitter": LangchainSplitter, "GenerateDocumentTree": GenerateDocumentTree, "AddDataRequest": AddDataRequest, "CreateCollectionRequest": CreateCollectionRequest, "CreateGeneralDataExtractionDocumentObjects": CreateGeneralDataExtractionDocumentObjects, "AssignStringToString": AssignStringToString, "SendRestAPICall": SendRestAPICall, "PrintFeedback": PrintFeedback, "ExtractJSONStringField": ExtractJSONStringField, "GenerateUUID": GenerateUUID, "JsonPath": JsonPath, "StringConcat": StringConcat, "StringFormat": StringFormat, "LoadCodeGenerationElements": LoadCodeGenerationElements, "LoadCodeGenerationExamples": LoadCodeGenerationExamples, "LoadAndCheckExampleDependencies": LoadAndCheckExampleDependencies, "LoadUserGuideSections": LoadUserGuideSections, "StoreElementsInVectorDatabase": StoreElementsInVectorDatabase, "StoreElementsInGraphDatabase": StoreElementsInGraphDatabase, "StoreExamplesInVectorDatabase": StoreExamplesInVectorDatabase, "StoreExamplesInGraphDatabase": StoreExamplesInGraphDatabase, "StoreUserGuideSectionsInVectorDatabase": StoreUserGuideSectionsInVectorDatabase, "StoreUserGuideSectionsInGraphDatabase": StoreUserGuideSectionsInGraphDatabase, "SimilartitySearchOnPathDescriptions": SimilartitySearchOnPathDescriptions, "FindRelevantPathDescription": FindRelevantPathDescription, "FetchPropertiesFromPathDescription": FetchPropertiesFromPathDescription, "FetchNodeDescriptionsFromPathDescription": FetchNodeDescriptionsFromPathDescription, "FetchActionsPathFromPathDescription": FetchActionsPathFromPathDescription, "SynthesizeActions": SynthesizeActions, "FinalizeResult": FinalizeResult, "GetSolutionsToFixProblem": GetSolutionsToFixProblem, "GetSelectedSolution": GetSelectedSolution, "AppendToolHistory": AppendToolHistory, "AppendMeshPilotHistory": AppendMeshPilotHistory, "GetActionsFromConfig": GetActionsFromConfig, "ParseHistory": ParseHistory, "SynthesizeActionsTool2": SynthesizeActionsTool2, "SynthesizeActionsTool11": SynthesizeActionsTool11, "SynthesizeActionsTool12": SynthesizeActionsTool12, "SynthesizeActionsTool17": SynthesizeActionsTool17, "SimilartitySearchOnPathDescriptionsQdrant": SimilartitySearchOnPathDescriptionsQdrant, "GenerateActionsSubWorkflowPrompt": GenerateActionsSubWorkflowPrompt, "ProcessSubworkflowIdentificationOutput": ProcessSubworkflowIdentificationOutput, "MarkdownToHTML": MarkdownToHTML, "ParseHistoryToHistoricMessages": ParseHistoryToHistoricMessages, "FinalizeMessage": FinalizeMessage, "GenerateUserPrompt": GenerateUserPrompt, "GenerateUserPromptWithList": GenerateUserPromptWithList, "GenerateUserPromptWithContext": GenerateUserPromptWithContext, "SelectedSolution": SelectedSolution, "ProcessMainAgentOutput": ProcessMainAgentOutput, "GenerateHelperSubWorkflowPrompt": GenerateHelperSubWorkflowPrompt, "QdrantCreateCollection": QdrantCreateCollection, "QdrantInsertData": QdrantInsertData, "CheckApiKeyAuthMongoDb": CheckApiKeyAuthMongoDb, "CheckCreateUserIdMongoDb": CheckCreateUserIdMongoDb, "UpdateTotalTokenCountForCustomerMongoDb": UpdateTotalTokenCountForCustomerMongoDb, "UpdateTotalTokenCountForUserIdMongoDb": UpdateTotalTokenCountForUserIdMongoDb, "DenyCustomerAccessAndSendWarningMongoDb": DenyCustomerAccessAndSendWarningMongoDb, "DenyCustomerAccessAndSendWarningMongoDbUserId": DenyCustomerAccessAndSendWarningMongoDbUserId, "SendLogicAppNotificationEmail": SendLogicAppNotificationEmail, "CreateMessageWithVariable": CreateMessageWithVariable, "ListAll": ListAll, "ExecuteTool": ExecuteTool, "GetResource": GetResource, "GetSystemPrompt": GetSystemPrompt, "StartTrace": StartTrace, "SerializeResponse": SerializeResponse, "AddGuidsToAttributes": AddGuidsToAttributes, "FilterOutNonExistingAttributes": FilterOutNonExistingAttributes, "FilterOutDuplicateAttributes": FilterOutDuplicateAttributes, "ExtractCriteriaSuggestions": ExtractCriteriaSuggestions, "LogRequestSuccess": LogRequestSuccess, "LogRequestFailed": LogRequestFailed, "LogRequestFailedDebugWithMessage": LogRequestFailedDebugWithMessage, "PerformMultipleGeneralRequestsAndExtractAttributesWithOpenAiTokenOutput": PerformMultipleGeneralRequestsAndExtractAttributesWithOpenAiTokenOutput, "CheckApiKeyAuthKvDb": CheckApiKeyAuthKvDb, "UpdateTotalTokenCountForCustomerKvDb": UpdateTotalTokenCountForCustomerKvDb, "DenyCustomerAccessAndSendWarningKvDb": DenyCustomerAccessAndSendWarningKvDb, "AddAvailableAttributesToSystemPrompt": AddAvailableAttributesToSystemPrompt, "ExtractDesignRequirementsAndSearchCriteria": ExtractDesignRequirementsAndSearchCriteria, "SetCopilotGenerateRequestJsonBody": SetCopilotGenerateRequestJsonBody, } ## func AddAvailableAttributesToSystemPrompt func AddAvailableAttributesToSystemPrompt(userDesignRequirements string, systemPromptTemplate string, allAvailableAttributes []sharedtypes.MaterialAttribute, availableSearchCriteria []string, traceID string, spanID string) (fullSystemPrompt string, childSpanID string) AddAvailableAttributesToSystemPrompt adds available attributes to the system prompt template. Tags: - @displayName: Add Available Attributes to System Prompt Parameters: - userDesignRequirements: design requirements provided by the user - systemPromptTemplate: the prompt template string to modify - allAvailableAttributes: the list of all available attributes - availableSearchCriteria: the list of available search criteria \(GUIDs\) - traceID: the trace ID in decimal format - spanID: the span ID in decimal format Returns: - fullSystemPrompt: the full system prompt to send to the LLM, including available attributes - childSpanID: the child span ID created for this operation ## 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 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 func AddGuidsToAttributes(criteriaSuggestions []sharedtypes.MaterialLlmCriterion, availableAttributes []sharedtypes.MaterialAttribute, traceID string, spanID string) (criteriaWithGuids []sharedtypes.MaterialCriterionWithGuid, childSpanID string) 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 - traceID: the trace ID in decimal format - spanID: the span ID in decimal format Returns: - criteriaWithGuids: the list of criteria with their identities - childSpanID: the child span ID created for this operation ## func AecGetContextFromRetrieverModule 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 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 func AnsysGPTReturnIndexList(indexGroups []string) (indexList []string) 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 func AppendStringSlices(slice1, slice2, slice3, slice4, slice5 []string) []string 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 func AssignStringToString(inputString string) (outputString string) 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 func BuildLibraryContext(message string, libraryContext string) (messageWithContext string) 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 func CastAnyToBool(data any) bool 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 func CastAnyToByte(data any) byte 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 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 func CastAnyToComplex64(data any) complex64 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 func CastAnyToFloat32(data any) float32 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 func CastAnyToFloat64(data any) float64 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 func CastAnyToInt(data any) int 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 func CastAnyToInt16(data any) int16 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 func CastAnyToInt32(data any) int32 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 func CastAnyToInt64(data any) int64 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 func CastAnyToInt8(data any) int8 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 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 func CastAnyToRune(data any) rune 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 func CastAnyToString(data any) string 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 func CastAnyToUint(data any) uint 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 func CastAnyToUint16(data any) uint16 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 func CastAnyToUint32(data any) uint32 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 func CastAnyToUint64(data any) uint64 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 func CastAnyToUint8(data any) uint8 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 func CastArrayMapStringAnyToAny(data []map[string]any) any 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 func CastBoolToAny(data bool) any CastBoolToAny casts data of type bool to any Tags: - @displayName: Cast Bool to Any Parameters: - data \(bool\) Returns - any ## func CastByteToAny func CastByteToAny(data byte) any CastByteToAny casts data of type byte to any Tags: - @displayName: Cast Byte to Any Parameters: - data \(byte\) Returns - any ## func CastComplex128ToAny 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 func CastComplex64ToAny(data complex64) any CastComplex64ToAny casts data of type complex64 to any Tags: - @displayName: Cast Complex64 to Any Parameters: - data \(complex64\) Returns - any ## func CastFloat32ToAny func CastFloat32ToAny(data float32) any CastFloat32ToAny casts data of type float32 to any Tags: - @displayName: Cast Float32 to Any Parameters: - data \(float32\) Returns - any ## func CastFloat64ToAny func CastFloat64ToAny(data float64) any CastFloat64ToAny casts data of type float64 to any Tags: - @displayName: Cast Float64 to Any Parameters: - data \(float64\) Returns - any ## func CastInt16ToAny func CastInt16ToAny(data int16) any CastInt16ToAny casts data of type int16 to any Tags: - @displayName: Cast Int16 to Any Parameters: - data \(int16\) Returns - any ## func CastInt32ToAny func CastInt32ToAny(data int32) any CastInt32ToAny casts data of type int32 to any Tags: - @displayName: Cast Int32 to Any Parameters: - data \(int32\) Returns - any ## func CastInt64ToAny func CastInt64ToAny(data int64) any CastInt64ToAny casts data of type int64 to any Tags: - @displayName: Cast Int64 to Any Parameters: - data \(int64\) Returns - any ## func CastInt8ToAny func CastInt8ToAny(data int8) any CastInt8ToAny casts data of type int8 to any Tags: - @displayName: Cast Int8 to Any Parameters: - data \(int8\) Returns - any ## func CastIntToAny func CastIntToAny(data int) any CastIntToAny casts data of type int to any Tags: - @displayName: Cast Int to Any Parameters: - data \(int\) Returns - any ## func CastInterfaceToAny 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 func CastRuneToAny(data rune) any CastRuneToAny casts data of type rune to any Tags: - @displayName: Cast Rune to Any Parameters: - data \(rune\) Returns - any ## func CastStringToAny func CastStringToAny(data string) any CastStringToAny casts data of type string to any Tags: - @displayName: Cast String to Any Parameters: - data \(string\) Returns - any ## func CastUint16ToAny func CastUint16ToAny(data uint16) any CastUint16ToAny casts data of type uint16 to any Tags: - @displayName: Cast Uint16 to Any Parameters: - data \(uint16\) Returns - any ## func CastUint32ToAny func CastUint32ToAny(data uint32) any CastUint32ToAny casts data of type uint32 to any Tags: - @displayName: Cast Uint32 to Any Parameters: - data \(uint32\) Returns - any ## func CastUint64ToAny func CastUint64ToAny(data uint64) any CastUint64ToAny casts data of type uint64 to any Tags: - @displayName: Cast Uint64 to Any Parameters: - data \(uint64\) Returns - any ## func CastUint8ToAny func CastUint8ToAny(data uint8) any CastUint8ToAny casts data of type uint8 to any Tags: - @displayName: Cast Uint8 to Any Parameters: - data \(uint8\) Returns - any ## func CastUintToAny func CastUintToAny(data uint) any CastUintToAny casts data of type uint to any Tags: - @displayName: Cast Uint to Any Parameters: - data \(uint\) Returns - any ## func CheckApiKeyAuthKvDb func CheckApiKeyAuthKvDb(kvdbEndpoint string, apiKey string, traceID string, spanID string) (isAuthenticated bool, childSpanID string) CheckApiKeyAuthKvDb checks if the provided API key is authenticated against the KVDB. Tags: - @displayName: Verify API Key Parameters: - kvdbEndpoint: the KVDB endpoint - apiKey: The API key to check - traceID: the trace ID in decimal format - spanID: the span ID in decimal format Returns: - isAuthenticated: true if the API key is authenticated, false otherwise - childSpanID: the child span ID created for this operation ## 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 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 CreateChildSpan func CreateChildSpan(ctx *logging.ContextMap, traceID string, parentSpanID string) (childSpanID string) ## func CreateCollectionRequest func CreateCollectionRequest(collectionName string, vectorSize uint64, vectorDistance string) 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 CreateEmbeddings(dense bool, sparse bool, colbert bool, isDocument bool, passages []string) (dense_vector [][]float32, lexical_weights []map[uint]float32, colbert_vecs [][][]float32, func_error error) ## 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 func CreateMessageWithVariable(message string, variable string) (updatedMessage string) 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 DenyCustomerAccessAndSendWarningKvDb func DenyCustomerAccessAndSendWarningKvDb(kvdbEndpoint string, apiKey string, traceID string, spanID string) (customerName string, sendWarning bool, childSpanID string) DenyCustomerAccessAndSendWarningKvDb denies access to a customer and sends a warning if not already sent Tags: - @displayName: Deny Customer Access and Send Warning Parameters: - kvdbEndpoint: the KVDB endpoint - apiKey: The API key of the customer - traceID: the trace ID in decimal format - spanID: the span ID in decimal format Returns: - customerName: The name of the customer - sendWarning: true if a warning was sent, false if it was already sent - childSpanID: the child span ID created for this operation ## 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 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 func ExtractCriteriaSuggestions(llmResponse string, traceID string, spanID string) (criteriaSuggestions []sharedtypes.MaterialLlmCriterion, childSpanID string) 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 - traceID: the trace ID in decimal format - spanID: the span ID in decimal format Returns: - criteriaSuggestions: the list of criteria suggestions extracted from the LLM response - childSpanID: the child span ID created for this operation ## func ExtractDesignRequirementsAndSearchCriteria func ExtractDesignRequirementsAndSearchCriteria(userInput string, traceID string, spanID string) (designRequirements string, availableSearchCriteria []string, childSpanID string) ExtractDesignRequirementsAndSearchCriteria parses the user input JSON and returns the design requirements string and the list of available search criteria GUIDs. Tags: - @displayName: Extract Design Requirements and Search Criteria Parameters: - userInput: the user input JSON string - traceID: the trace ID in decimal format - spanID: the span ID in decimal format Returns: - designRequirements: the extracted design requirements string - availableSearchCriteria: the extracted list of attribute GUIDs - childSpanID: the child span ID created for this operation ## func ExtractJSONStringField func ExtractJSONStringField(jsonStr string, keyPath string) string 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 func ExtractJson(text string, traceID string, spanID string) (json string, childSpanID string) ## 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 func FetchPropertiesFromPathDescription(db_name, description string) (properties []string) FetchPropertiesFromPathDescription get properties from path description Tags: - @displayName: FetchPropertiesFromPathDescription Parameters: - description: the desctiption of path Returns: - properties: the list of descriptions ## func FilterOutDuplicateAttributes func FilterOutDuplicateAttributes(criteriaSuggestions []sharedtypes.MaterialLlmCriterion, traceID string, spanID string) (filtered []sharedtypes.MaterialLlmCriterion, childSpanID string) 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 - traceID: the trace ID in decimal format - spanID: the span ID in decimal format Returns: - filtered: the list of criteria suggestions excluding duplicates based on attribute names - childSpanID: the child span ID created for this operation ## func FilterOutNonExistingAttributes func FilterOutNonExistingAttributes(criteriaSuggestions []sharedtypes.MaterialCriterionWithGuid, availableSearchCriteria []string, traceID string, spanID string) (filtered []sharedtypes.MaterialCriterionWithGuid, childSpanID string) FilterOutNonExistingAttributes filters out criteria suggestions that do not match any of the available attributes based on their GUIDs Tags: - @displayName: Filter out non\-existing attributes Parameters: - criteriaSuggestions: current list of criteria suggestions - availableSearchCriteria: the list of available search criteria \(GUIDs\) - traceID: the trace ID in decimal format - spanID: the span ID in decimal format Returns: - filtered: the list of criteria suggestions excluding those that do not match any of the available search criteria - childSpanID: the child span ID created for this operation ## func FinalizeMessage func FinalizeMessage(message string) (result string) 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 func FinalizeResult(actions []map[string]string, toolName string) (result string) 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 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 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 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 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 func GenerateUserPrompt(userInstruction string, userPromptTemplate string) (userPrompt string) 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 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 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 func GetActionsFromConfig(toolName string) (result string) 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 func GetDocumentType(filePath string) (documentType string) 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 func GetLocalFileContent(localFilePath string) (checksum string, content []byte) 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 func GetLocalFilesContent(localFilePaths []string) (filesMap map[string][]byte) 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 func GetResource(serverURL, resourceName string) (map[string]interface{}, error) 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 func GetSelectedSolution(arguments string) (solution string) 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 func GetSystemPrompt(serverURL, promptName string) (string, error) 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 func JsonPath(pat string, data any, oneResult bool) any 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 func ListAll(serverURL string) (map[string][]string, error) 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 func LogRequestFailed(traceID string, spanID string) (childSpanID string) LogRequestFailed writes a .Info log entry indicating that a request was not completed successfully. Tags: - @displayName: Log request failed Parameters: - traceID: the trace ID in decimal format - spanID: the span ID in decimal format Returns: - childSpanID: the child span ID created for this operation ## func LogRequestFailedDebugWithMessage func LogRequestFailedDebugWithMessage(msg1, msg2 string, traceID string, spanID string) (childSpanID 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 - traceID: the trace ID in decimal format - spanID: the span ID in decimal format Returns: - childSpanID: the child span ID created for this operation ## func LogRequestSuccess func LogRequestSuccess(traceID string, spanID string) (childSpanID string) LogRequestSuccess writes a .Info log entry indicating that a request was completed successfully. Tags: - @displayName: Log request success Parameters: - traceID: the trace ID in decimal format - spanID: the span ID in decimal format Returns: - childSpanID: the child span ID created for this operation ## func MarkdownToHTML func MarkdownToHTML(markdown string) (html string) MarkdownToHTML this function converts markdown to html Tags: - @displayName: MarkdownToHTML Parameters: - markdown: content in markdown format Returns: - html: content in html format ## func ParseHistory func ParseHistory(historyJson string) (history []map[string]string) 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 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 func PerformBatchEmbeddingRequest(input []string) (embeddedVectors [][]float32) 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 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 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 func PerformKeywordExtractionRequest(input string, maxKeywordsSearch uint32) (keywords []string) 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 func PerformMultipleGeneralRequestsAndExtractAttributesWithOpenAiTokenOutput(input string, history []sharedtypes.HistoricMessage, systemPrompt string, modelIds []string, tokenCountModelName string, n int, traceID string, spanID string) (uniqueCriterion []sharedtypes.MaterialLlmCriterion, tokenCount int, childSpanID string) 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 - traceID: the trace ID in decimal format - spanID: the span ID in decimal format Returns: - uniqueCriterion: a deduplicated list of extracted attributes \(criteria\) from all responses - tokenCount: the total token count \(input tokens × n \+ combined output tokens\) - childSpanID: the child span ID created for this operation ## func PerformSummaryRequest func PerformSummaryRequest(input string) (summary string) 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 func PerformVectorEmbeddingRequest(input string) (embeddedVector []float32) 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 func ProcessMainAgentOutput(llmOutput string) (messageTo string, message string) 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 func ProcessSubworkflowIdentificationOutput(llmOutput string) (status string, workflowName string) 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 func QdrantCreateCollection(collectionName string, vectorSize uint64, vectorDistance string) 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 func QdrantCreateIndex(collectionName string, fieldName string, fieldType string, wait bool) 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 func SelectedSolution(selectedSolution string) (solution string) 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 func SerializeResponse(criteriaSuggestions []sharedtypes.MaterialCriterionWithGuid, tokens int, traceID string, spanID string) (result string, childSpanID string) SerializeResponse formats the criteria to a response suitable for the UI clients in string format Tags: - @displayName: Serialize response for clients Parameters: - tokens: tokens consumed by the request - traceID: the trace ID in decimal format - spanID: the span ID in decimal format Returns: - result: string representation of the response in JSON format - childSpanID: the child span ID created for this operation ## func SetCopilotGenerateRequestJsonBody 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 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 StartTrace func StartTrace() (traceID string, spanID string) StartTrace generates a new trace ID and span ID for tracing Tags: - @displayName: Start new trace Parameters: - str: a string Returns: - traceID: a 128\-bit trace ID in decimal format - spanID: a 64\-bit span ID in decimal format ## 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 func StringConcat(a string, b string, separator string) string 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 func StringFormat(data any, format string) string 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 SynthesizeActionsTool11 func SynthesizeActionsTool11(content string) (result string) SynthesizeActionsTool11 synthesize actions based on user instruction Tags: - @displayName: SynthesizeActionsTool11 Parameters: - content: the llm content Returns: - result: the synthesized string ## func SynthesizeActionsTool12 func SynthesizeActionsTool12(content string) (result string) SynthesizeActionsTool12 synthesize actions based on user instruction Tags: - @displayName: SynthesizeActionsTool12 Parameters: - content: the llm content Returns: - result: the synthesized string ## func SynthesizeActionsTool17 func SynthesizeActionsTool17(content string) (result string) SynthesizeActionsTool17 synthesize actions based on user instruction Tags: - @displayName: SynthesizeActionsTool17 Parameters: - content: the llm content Returns: - result: the synthesized string ## func SynthesizeActionsTool2 func SynthesizeActionsTool2(message string, actions []map[string]string) (updatedActions []map[string]string) SynthesizeActionsTool2 update action as per user instruction Tags: - @displayName: SynthesizeActionsTool2 Parameters: - message: the message from the llm - actions: the list of actions Returns: - updatedActions: the list of synthesized actions ## func UpdateTotalTokenCountForCustomerKvDb func UpdateTotalTokenCountForCustomerKvDb(kvdbEndpoint string, apiKey string, additionalTokenCount int, traceID string, spanID string) (tokenLimitReached bool, childSpanID string) UpdateTotalTokenCountForCustomerKvDb updates the total token count for a customer in the KVDB Tags: - @displayName: Update Customer Token Count Parameters: - kvdbEndpoint: the KVDB endpoint - apiKey: The API key of the customer - additionalTokenCount: The number of tokens to add to the customer's total token count - traceID: the trace ID in decimal format - spanID: the span ID in decimal format Returns: - tokenLimitReached: true if the new total token count exceeds the customer's token limit, false otherwise - childSpanID: the child span ID created for this operation ## 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. ## type ACSSearchRequest ACSRequest represents the request structure for the Azure Cognitive Search. 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"` } ## type ACSSearchResponseALH ACSSearchResponse represents the response structure for the Azure Cognitive Search for ansysgpt\-alh & ansysgpt\-scbu. 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"` } ## type ACSSearchResponseCrtech ACSSearchResponseCrtech represents the response structure for the Azure Cognitive Search for external\-crtech\-thermal\-desktop. 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"` } ## type ACSSearchResponseLSdyna ACSSearchResponse represents the response structure for the Azure Cognitive Search for lsdyna\-documentation\-r14. 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"` } ## type ACSSearchResponseStruct ACSSearchResponseStruct represents the response structure for the Azure Cognitive Search for granular\-ansysgpt, ansysgpt\-documentation\-2023r2, scade\-documentation\-2023r2, ansys\-dot\-com\-marketing. type ACSSearchResponseStruct struct { OdataContext string `json:"@odata.context"` OdataCount int `json:"@odata.count"` Value []sharedtypes.ACSSearchResponse `json:"value"` } ## type ACSSearchResponseStructALH ACSSearchResponseStruct represents the response structure for the Azure Cognitive Search for ansysgpt\-alh & ansysgpt\-scbu. type ACSSearchResponseStructALH struct { OdataContext string `json:"@odata.context"` OdataCount int `json:"@odata.count"` Value []ACSSearchResponseALH `json:"value"` } ## type ACSSearchResponseStructCrtech ACSSearchResponseStructCrtech represents the response structure for the Azure Cognitive Search for external\-crtech\-thermal\-desktop. type ACSSearchResponseStructCrtech struct { OdataContext string `json:"@odata.context"` OdataCount int `json:"@odata.count"` Value []ACSSearchResponseCrtech `json:"value"` } ## type ACSSearchResponseStructLSdyna ACSSearchResponseStruct represents the response structure for the Azure Cognitive Search for lsdyna\-documentation\-r14. type ACSSearchResponseStructLSdyna struct { OdataContext string `json:"@odata.context"` OdataCount int `json:"@odata.count"` Value []ACSSearchResponseLSdyna `json:"value"` } ## type ACSVectorQuery ACSVectorQuery represents the vector query structure for the Azure Cognitive Search. type ACSVectorQuery struct { Kind string `json:"kind"` K int `json:"k"` Vector []float32 `json:"vector"` Fields string `json:"fields"` } ## type AnsysGPTRetrieverModuleRequest AnsysGPTRetrieverModuleRequest represents the request structure for the Ansys GPT Retriever Module. 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"` } ## type AppendMessageHistoryRole type AppendMessageHistoryRole string ## type DataExtractionBranch DataExtractionBranch represents the branch structure for the data extraction. type DataExtractionBranch struct { Text string ChildDataObjects []*sharedtypes.DbData ChildDataIds []uuid.UUID } ## type DataExtractionLLMInputChannelItem DataExtractionLLMInputChannelItem represents the input channel item for the data extraction llm handler workers. 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 } ## type DataExtractionSplitterServiceRequest type DataExtractionSplitterServiceRequest struct { DocumentContent []byte `json:"document_content"` ChunkSize int `json:"chunk_size"` ChunkOverlap int `json:"chunk_overlap"` } ## type DataExtractionSplitterServiceResponse type DataExtractionSplitterServiceResponse struct { Chunks []string `json:"chunks"` } ## type EmailRequest EmailRequest represents the structure of the POST request body type EmailRequest struct { Email string `json:"email"` Subject string `json:"subject"` Content string `json:"content"` } ## 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 type LlmCriteria struct { Criteria []sharedtypes.MaterialLlmCriterion } ## type MongoDbContext MongoDbContext is the structure for the mongodb client type MongoDbContext struct { Client *mongo.Client Database *mongo.Database Collection *mongo.Collection } ## type MongoDbCustomerObject type MongoDbCustomerObject struct { ApiKey string `bson:"api_key"` CustomerName string `bson:"customer_name"` AccessDenied bool `bson:"access_denied"` TotalTokenCount int `bson:"total_token_usage"` TokenLimit int `bson:"token_limit"` WarningSent bool `bson:"warning_sent"` } ## 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 type Response struct { Criteria []sharedtypes.MaterialCriterionWithGuid Tokens int } ## type TokenCountUpdateRequest type TokenCountUpdateRequest struct { InputToken int `json:"input_token"` OutputToken int `json:"output_token"` Platform string `json:"platform"` } Generated by [gomarkdoc]()