Skip to content

Commit

Permalink
added popover to display links to suggested models (#625)
Browse files Browse the repository at this point in the history
Signed-off-by: saimedhi <[email protected]>
(cherry picked from commit ccfbb9e)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Feb 21, 2025
1 parent a66f7e2 commit 72c638e
Show file tree
Hide file tree
Showing 5 changed files with 523 additions and 28 deletions.
52 changes: 52 additions & 0 deletions common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@ export enum MODEL_TYPE {
SPARSE_ENCODER = 'sparse_encoder',
}

export enum MODEL_CATEGORY {
EMBEDDING = 'EMBEDDING',
LLM = 'LLM',
}

/**
* Various constants pertaining to the drag-and-drop UI components
*/
Expand Down Expand Up @@ -262,6 +267,27 @@ export const ML_RESPONSE_PROCESSOR_EXAMPLE_DOCS_LINK =
export const UPDATE_MODEL_DOCS_LINK =
'https://opensearch.org/docs/latest/ml-commons-plugin/api/model-apis/update-model/';

// Large Language Models Documentation Links
export const BEDROCK_CLAUDE_3_SONNET_DOCS_LINK =
'https://github.com/opensearch-project/dashboards-flow-framework/blob/main/documentation/models.md#claude-3-sonnet-hosted-on-amazon-bedrock';

export const OPENAI_GPT35_DOCS_LINK =
'https://github.com/opensearch-project/dashboards-flow-framework/blob/main/documentation/models.md#openai-gpt-35';

export const DEEPSEEK_CHAT_DOCS_LINK =
'https://github.com/opensearch-project/dashboards-flow-framework/blob/main/documentation/models.md#deepseek-chat';

// Embedding Models Documentation Links
export const COHERE_EMBEDDING_MODEL_DOCS_LINK =
'https://github.com/opensearch-project/dashboards-flow-framework/blob/main/documentation/models.md#cohere-embed';

export const BEDROCK_TITAN_EMBEDDING_DOCS_LINK =
'https://github.com/opensearch-project/dashboards-flow-framework/blob/main/documentation/models.md#amazon-bedrock-titan-text-embedding';

// ML Models setup Documentation Link
export const ML_MODELS_SETUP_DOCS_LINK =
'https://github.com/opensearch-project/dashboards-flow-framework/blob/main/documentation/models.md';

/**
* Text chunking algorithm constants
*/
Expand Down Expand Up @@ -431,6 +457,24 @@ export const SEMANTIC_SEARCH_QUERY_NEURAL = {
},
},
};
export const SEMANTIC_SEARCH_TEMPLATE_QUERY = {
query: {
template: {
knn: {
[VECTOR_FIELD_PATTERN]: {
vector: VECTOR_PATTERN,
k: 2,
},
},
},
},
ext: {
ml_inference: {
text: QUERY_TEXT_PATTERN,
},
},
};

export const MULTIMODAL_SEARCH_QUERY_NEURAL = {
_source: {
excludes: [VECTOR_FIELD_PATTERN],
Expand Down Expand Up @@ -596,6 +640,14 @@ export const QUERY_PRESETS = [
name: WORKFLOW_TYPE.MULTIMODAL_SEARCH,
query: customStringify(MULTIMODAL_SEARCH_QUERY_BOOL),
},
{
name: 'Semantic search (neural query)',
query: customStringify(SEMANTIC_SEARCH_QUERY_NEURAL),
},
{
name: 'Semantic search (template query)',
query: customStringify(SEMANTIC_SEARCH_TEMPLATE_QUERY),
},
{
name: `Hybrid search (match & k-NN queries)`,
query: customStringify(HYBRID_SEARCH_QUERY_MATCH_KNN),
Expand Down
Loading

0 comments on commit 72c638e

Please sign in to comment.