...

Package sharedtypes

import "github.com/ansys/allie-sharedtypes/pkg/sharedtypes"
Overview
Index

Overview ▾

type ACSSearchResponse

ACSSearchResponse represents the response from the ACS search.

type ACSSearchResponse struct {
    Physics             string  `json:"physics"`
    SourceTitleLvl3     string  `json:"sourceTitle_lvl3"`
    SourceURLLvl3       string  `json:"sourceURL_lvl3"`
    TokenSize           int     `json:"tokenSize"`
    SourceTitleLvl2     string  `json:"sourceTitle_lvl2"`
    Weight              float64 `json:"weight"`
    SourceURLLvl2       string  `json:"sourceURL_lvl2"`
    Product             string  `json:"product"`
    Content             string  `json:"content"`
    TypeOFasset         string  `json:"typeOFasset"`
    Version             string  `json:"version"`
    SearchScore         float64 `json:"@search.score"`
    SearchRerankerScore float64 `json:"@search.rerankerScore"`
    IndexName           string  `json:"indexName"`
}

type AnsysGPTCitation

AnsysGPTCitation represents the citation from the AnsysGPT.

type AnsysGPTCitation struct {
    Title     string  `json:"Title"`
    URL       string  `json:"URL"`
    Relevance float64 `json:"Relevance"`
}

type AnsysGPTDefaultFields

DefaultFields represents the default fields for the user query.

type AnsysGPTDefaultFields struct {
    QueryWord         string
    FieldName         string
    FieldDefaultValue string
}

type DBListCollectionsOutput

DBListCollectionsOutput represents the output of listing collections in the database.

type DBListCollectionsOutput struct {
    Success     bool     `json:"success" description:"Returns true if the collections were listed successfully. Returns false or an error if not."`
    Collections []string `json:"collections" description:"A list of collection names."`
}

type DataExtractionDocumentData

DataExtractionDocumentData represents the data extracted from a document.

type DataExtractionDocumentData struct {
    DocumentName      string    `json:"documentName"`
    DocumentId        string    `json:"documentId"`
    Guid              string    `json:"guid"`
    Level             string    `json:"level"`
    ChildIds          []string  `json:"childIds"`
    ParentId          string    `json:"parentId"`
    PreviousSiblingId string    `json:"previousSiblingId"`
    NextSiblingId     string    `json:"nextSiblingId"`
    LastChildId       string    `json:"lastChildId"`
    FirstChildId      string    `json:"firstChildId"`
    Text              string    `json:"text"`
    Keywords          []string  `json:"keywords"`
    Summary           string    `json:"summary"`
    Embedding         []float32 `json:"embedding"`
}

type DbAddDataInput

DbAddDataInput represents the input for adding data to the database.

type DbAddDataInput struct {
    CollectionName string   `json:"collection_name" description:"Name of the collection to which the data objects will be added. Required for adding data." required:"true"`
    Data           []DbData `json:"data" description:"Data objects to be added to the DB." required:"true"`
}

type DbAddDataOutput

DbAddDataOutput represents the output of adding data to the database.

type DbAddDataOutput struct {
    Success             bool   `json:"success" description:"Returns true if the data was added successfully. Returns false or an error if not."`
    IgnoredObjectsCount int    `json:"ignored_objects_count" description:"Number of ignored documents."`
    Error               string `json:"error" description:"Error message if the collection could not be created."`
}

type DbArrayFilter

DbArrayFilter represents the filter for an array field in the database.

type DbArrayFilter struct {
    NeedAll    bool     `json:"needAll"`
    FilterData []string `json:"filterData"`
}

type DbCreateCollectionInput

DbCreateCollectionInput represents the input for creating a collection in the database.

type DbCreateCollectionInput struct {
    CollectionName string `json:"collection_name" description:"Name of the collection to which the data objects will be added. Required for adding data." required:"true"`
}

type DbCreateCollectionOutput

DbCreateCollectionOutput represents the output of creating a collection in the database.

type DbCreateCollectionOutput struct {
    Success bool   `json:"success" description:"Returns true if the collection was created successfully. Returns false or an error if not."`
    Error   string `json:"error" description:"Error message if the collection could not be created."`
}

type DbData

DbData represents the data stored in the database.

type DbData struct {
    Guid              string                 `json:"guid"`
    DocumentId        string                 `json:"document_id"`
    DocumentName      string                 `json:"document_name"`
    Text              string                 `json:"text"`
    Keywords          []string               `json:"keywords"`
    Summary           string                 `json:"summary"`
    Embedding         []float32              `json:"embeddings"`
    Tags              []string               `json:"tags"`
    Metadata          map[string]interface{} `json:"metadata"`
    ParentId          string                 `json:"parent_id"`
    ChildIds          []string               `json:"child_ids"`
    PreviousSiblingId string                 `json:"previous_sibling_id"`
    NextSiblingId     string                 `json:"next_sibling_id"`
    LastChildId       string                 `json:"last_child_id"`
    FirstChildId      string                 `json:"first_child_id"`
    Level             string                 `json:"level"`
    HasNeo4jEntry     bool                   `json:"has_neo4j_entry"`
}

type DbFilters

DbFilters represents the filters for the database.

type DbFilters struct {
    // Filters for string fields
    GuidFilter         []string `json:"guid,omitempty"`
    DocumentIdFilter   []string `json:"document_id,omitempty"`
    DocumentNameFilter []string `json:"document_name,omitempty"`
    LevelFilter        []string `json:"level,omitempty"`

    // Filters for array fields
    TagsFilter     DbArrayFilter `json:"tags,omitempty"`
    KeywordsFilter DbArrayFilter `json:"keywords,omitempty"`

    // Filters for JSON fields
    MetadataFilter []DbJsonFilter `json:"metadata,omitempty"`
}

type DbJsonFilter

DbJsonFilter represents the filter for a JSON field in the database.

type DbJsonFilter struct {
    FieldName  string   `json:"fieldName"`
    FieldType  string   `json:"fieldType" description:"Can be either string or array."` // "string" or "array"
    FilterData []string `json:"filterData"`
    NeedAll    bool     `json:"needAll" description:"Only needed if the FieldType is array."` // only needed for array fields
}

type DbResponse

DbResponse represents the response from the database.

type DbResponse struct {
    Guid              string                 `json:"guid"`
    DocumentId        string                 `json:"document_id"`
    DocumentName      string                 `json:"document_name"`
    Text              string                 `json:"text"`
    Keywords          []string               `json:"keywords"`
    Summary           string                 `json:"summary"`
    Embedding         []float32              `json:"embeddings"`
    Tags              []string               `json:"tags"`
    Metadata          map[string]interface{} `json:"metadata"`
    ParentId          string                 `json:"parent_id"`
    ChildIds          []string               `json:"child_ids"`
    PreviousSiblingId string                 `json:"previous_sibling_id"`
    NextSiblingId     string                 `json:"next_sibling_id"`
    LastChildId       string                 `json:"last_child_id"`
    FirstChildId      string                 `json:"first_child_id"`
    Distance          float64                `json:"distance"`
    Level             string                 `json:"level"`
    HasNeo4jEntry     bool                   `json:"has_neo4j_entry"`

    // Siblings
    Parent    *DbData  `json:"parent,omitempty"`
    Children  []DbData `json:"children,omitempty"`
    LeafNodes []DbData `json:"leaf_nodes,omitempty"`
    Siblings  []DbData `json:"siblings,omitempty"`
}

type ErrorResponse

ErrorResponse represents the error response sent to the client when something fails during the processing of the request.

type ErrorResponse struct {
    Code    int    `json:"code"`
    Message string `json:"message"`
}

type GeneralNeo4jQueryInput

GeneralNeo4jQueryInput represents the input for executing a Neo4j query.

type GeneralNeo4jQueryInput struct {
    Query string `json:"query" description:"Neo4j query to be executed. Required for executing a query." required:"true"`
}

type GeneralNeo4jQueryOutput

GeneralNeo4jQueryOutput represents the output of executing a Neo4j query.

type GeneralNeo4jQueryOutput struct {
    Success  bool          `json:"success" description:"Returns true if the query was executed successfully. Returns false or an error if not."`
    Response Neo4jResponse `json:"response" description:"Summary and records of the query execution."`
}

type HandlerRequest

HandlerRequest represents the client request for a specific chat or embeddings operation.

type HandlerRequest struct {
    Adapter             string            `json:"adapter"` // "chat", "embeddings"
    InstructionGuid     string            `json:"instructionGuid"`
    ModelIds            []string          `json:"modelIds"`               // optional model ids to define a set of specific models to be used for this request
    Data                interface{}       `json:"data"`                   // for embeddings, this can be a string or []string; for chat, only string is allowed
    Images              []string          `json:"images"`                 // List of images in base64 format
    ChatRequestType     string            `json:"chatRequestType"`        // "summary", "code", "keywords", "general"; only relevant if "adapter" is "chat"
    DataStream          bool              `json:"dataStream"`             // only relevant if "adapter" is "chat"
    MaxNumberOfKeywords uint32            `json:"maxNumberOfKeywords"`    // only relevant if "chatRequestType" is "keywords"
    IsConversation      bool              `json:"isConversation"`         // only relevant if "chatRequestType" is "code"
    ConversationHistory []HistoricMessage `json:"conversationHistory"`    // only relevant if "isConversation" is true
    GeneralContext      string            `json:"generalContext"`         // any added context you might need
    MsgContext          string            `json:"msgContext"`             // any added context you might need
    SystemPrompt        string            `json:"systemPrompt"`           // only relevant if "chatRequestType" is "general"
    ModelOptions        ModelOptions      `json:"modelOptions,omitempty"` // only relevant if "adapter" is "chat"
}

type HandlerResponse

HandlerResponse represents the LLM Handler response for a specific request.

type HandlerResponse struct {
    // Common properties
    InstructionGuid string `json:"instructionGuid"`
    Type            string `json:"type"` // "info", "error", "chat", "embeddings"

    // Chat properties
    IsLast           *bool   `json:"isLast,omitempty"`
    Position         *uint32 `json:"position,omitempty"`
    InputTokenCount  *int    `json:"inputTokenCount,omitempty"`
    OutputTokenCount *int    `json:"outputTokenCount,omitempty"`
    ChatData         *string `json:"chatData,omitempty"`

    // Embeddings properties
    EmbeddedData interface{} `json:"embeddedData,omitempty"` // []float32 or [][]float32

    // Error properties
    Error *ErrorResponse `json:"error,omitempty"`

    // Info properties
    InfoMessage *string `json:"infoMessage,omitempty"`
}

type HistoricMessage

HistoricMessage represents a past chat messages.

type HistoricMessage struct {
    Role    string   `json:"role"`
    Content string   `json:"content"`
    Images  []string `json:"images"` // image in base64 format
}

type ModelOptions

OpenAIOption represents an option for an OpenAI API call.

type ModelOptions struct {
    FrequencyPenalty *float32 `json:"frequencyPenalty,omitempty"`
    MaxTokens        *int32   `json:"maxTokens,omitempty"`
    PresencePenalty  *float32 `json:"presencePenalty,omitempty"`
    Stop             []string `json:"stop,omitempty"`
    Temperature      *float32 `json:"temperature,omitempty"`
    TopP             *float32 `json:"topP,omitempty"`
}

type Neo4jResponse

neo4jResponse represents the response from the Neo4j query.

type Neo4jResponse struct {
    Record          neo4jRecord     `json:"record"`
    SummaryCounters summaryCounters `json:"summaryCounters"`
}

type TransferDetails

TransferDetails holds communication channels for the websocket listener and writer.

type TransferDetails struct {
    ResponseChannel chan HandlerResponse
    RequestChannel  chan HandlerRequest
}

type neo4jRecord

neo4jRecord represents the record from the Neo4j query.

type neo4jRecord []struct {
    Values []value `json:"Values"`
}

type props

props represents the properties from the Neo4j query.

type props struct {
    CollectionName string   `json:"collectionName"`
    DocumentId     string   `json:"documentId"`
    DocumentTypes  []string `json:"documentTypes,omitempty"`
    Guid           string   `json:"guid,omitempty"`
}

type summaryCounters

summaryCounters represents the summary counters from the Neo4j query.

type summaryCounters struct {
    NodesCreated         int `json:"nodes_created"`
    NodesDeleted         int `json:"nodes_deleted"`
    RelationshipsCreated int `json:"relationships_created"`
    RelationshipsDeleted int `json:"relationships_deleted"`
    PropertiesSet        int `json:"properties_set"`
    LabelsAdded          int `json:"labels_added"`
    LabelsRemoved        int `json:"labels_removed"`
    IndexesAdded         int `json:"indexes_added"`
    IndexesRemoved       int `json:"indexes_removed"`
    ConstraintsAdded     int `json:"constraints_added"`
    ConstraintsRemoved   int `json:"constraints_removed"`
}

type value

value represents the value from the Neo4j query.

type value struct {
    Id        int      `json:"Id"`
    NodeTypes []string `json:"Labels"`
    Props     props    `json:"Props"`
}