Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added popover to display links to suggested models #616

Closed

Conversation

saimedhi
Copy link
Collaborator

@saimedhi saimedhi commented Feb 12, 2025

Description

  • Added popover to display links to suggested models
  • Included both Embedding and Large Language model examples.
screen-capture.41.webm
Screenshot 2025-02-12 at 10 16 52 AM Screenshot 2025-02-12 at 10 16 12 AM

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Comment on lines 256 to 264
// Large Language Models Documentation Links
export const BEDROCK_CLAUDE_3_SONNET_DOCS_LINK =
'https://github.com/opensearch-project/ml-commons/blob/main/docs/remote_inference_blueprints/bedrock_connector_converse_blueprint.md';

export const OPENAI_GPT35_DOCS_LINK =
'https://github.com/opensearch-project/ml-commons/blob/2.x/docs/remote_inference_blueprints/open_ai_connector_chat_blueprint.md';

export const DEEPSEEK_CHAT_DOCS_LINK =
'https://github.com/opensearch-project/ml-commons/blob/main/docs/remote_inference_blueprints/deepseek_connector_chat_blueprint.md';

// Embedding Models Documentation Links
export const COHERE_EMBEDDING_MODEL_DOCS_LINK =
'https://github.com/opensearch-project/ml-commons/blob/2.x/docs/remote_inference_blueprints/cohere_connector_embedding_blueprint.md';

export const BEDROCK_TITAN_EMBEDDING_DOCS_LINK =
'https://github.com/opensearch-project/ml-commons/blob/2.x/docs/remote_inference_blueprints/bedrock_connector_titan_embedding_blueprint.md';

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the blueprints we want to avoid customers visiting, as they are not compatible with ML inference processors, and generally do not have model interfaces, which means they are not compatible with OpenSearch Flow. We need to point to https://github.com/opensearch-project/dashboards-flow-framework/blob/main/documentation/models.md

For any models not present in that file ^, then suggest to add.

@@ -125,17 +133,58 @@ export function ModelField(props: ModelFieldProps) {
(props.showInvalid ?? true) &&
getIn(errors, `${field.name}.id`) &&
getIn(touched, `${field.name}.id`);
const renderPopover = () => {
if (props.fieldPath === "llm") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a reliable way to determine whether or not we should suggest a model of a certain type; field path names are internal and may change. Suggest to add a prop to ModelField that passes an optional model type, for example. Maybe make an enum of different model types, which is currently just LLM/generative models, and embedding models.

Comment on lines 66 to 70
// Embedding model popover state
const [embeddingModelPopoverOpen, setEmbeddingModelPopoverOpen] = useState<boolean>(false);

// Large Language model popover state
const [largeLaguageModelPopoverOpen, setLargeLaguageModelPopoverOpen] = useState<boolean>(false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about just have a single generic popover state?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These components are very repetitive. How about we have a single component, that takes in a single prop determining the model type, and then dynamically render? They seem identical besides the list of models to display, and maybe one-word differences, like "embedding" vs. "large language".

Additionally, this component should just live next to model_field where it is logically coupled, instead of nested under new_workflow.

@saimedhi saimedhi marked this pull request as draft February 13, 2025 00:23
@saimedhi saimedhi force-pushed the add/model_suggestions branch from 7c84740 to e15bc44 Compare February 17, 2025 23:04
@saimedhi saimedhi closed this Feb 17, 2025
@saimedhi saimedhi force-pushed the add/model_suggestions branch from e15bc44 to e5104c6 Compare February 17, 2025 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants