diff --git a/core/llm/llms/WatsonX.ts b/core/llm/llms/WatsonX.ts index 504b27412..29ca63c39 100644 --- a/core/llm/llms/WatsonX.ts +++ b/core/llm/llms/WatsonX.ts @@ -4,67 +4,78 @@ import { LLMOptions, ModelProvider, } from "../../index.js"; -import { stripImages } from "../countTokens.js"; +import { stripImages } from "../images.js"; import { BaseLLM } from "../index.js"; const watsonxConfig = { accessToken: { expiration: 0, - token: "" - } + token: "", + }, }; class WatsonX extends BaseLLM { - protected maxStopWords: number | undefined = undefined; constructor(options: LLMOptions) { super(options); } - async getBearerToken(): Promise<{ token: string, expiration: number }> { + async getBearerToken(): Promise<{ token: string; expiration: number }> { if (this.watsonxUrl != null && this.watsonxUrl.includes("cloud.ibm.com")) { // watsonx SaaS - const wxToken = await (await fetch(`https://iam.cloud.ibm.com/identity/token?apikey=${this.watsonxApiKey}&grant_type=urn:ibm:params:oauth:grant-type:apikey`, { - method: "POST", - headers: { - "Content-Type": "application/x-www-form-urlencoded", - "Accept": "application/json" - } - })).json(); + const wxToken = await ( + await fetch( + `https://iam.cloud.ibm.com/identity/token?apikey=${this.watsonxApiKey}&grant_type=urn:ibm:params:oauth:grant-type:apikey`, + { + method: "POST", + headers: { + "Content-Type": "application/x-www-form-urlencoded", + Accept: "application/json", + }, + }, + ) + ).json(); return { token: wxToken["access_token"], - expiration: wxToken["expiration"] + expiration: wxToken["expiration"], }; } else { // watsonx Software - if (this.watsonxZenApiKeyBase64 && this.watsonxZenApiKeyBase64 !== "YOUR_WATSONX_ZENAPIKEY") { + if ( + this.watsonxZenApiKeyBase64 && + this.watsonxZenApiKeyBase64 !== "YOUR_WATSONX_ZENAPIKEY" + ) { // Using ZenApiKey auth return { token: this.watsonxZenApiKeyBase64, - expiration: -1 + expiration: -1, }; } else { // Using username/password auth - const wxToken = await (await fetch(`${this.watsonxUrl}/icp4d-api/v1/authorize`, { - method: "POST", - headers: { - "Content-Type": "application/json", - "Accept": "application/json" - }, - body: JSON.stringify({ - "username": this.watsonxUsername, - "password": this.watsonxPassword + const wxToken = await ( + await fetch(`${this.watsonxUrl}/icp4d-api/v1/authorize`, { + method: "POST", + headers: { + "Content-Type": "application/json", + Accept: "application/json", + }, + body: JSON.stringify({ + username: this.watsonxUsername, + password: this.watsonxPassword, + }), }) - })).json(); - const wxTokenExpiry = await (await fetch(`${this.watsonxUrl}/usermgmt/v1/user/tokenExpiry`, { - method: "GET", - headers: { - "Accept": "application/json", - "Authorization": `Bearer ${wxToken["token"]}` - } - })).json(); + ).json(); + const wxTokenExpiry = await ( + await fetch(`${this.watsonxUrl}/usermgmt/v1/user/tokenExpiry`, { + method: "GET", + headers: { + Accept: "application/json", + Authorization: `Bearer ${wxToken["token"]}`, + }, + }) + ).json(); return { token: wxToken["token"], - expiration: wxTokenExpiry["exp"] + expiration: wxTokenExpiry["exp"], }; } } @@ -114,7 +125,7 @@ class WatsonX extends BaseLLM { protected _getHeaders() { return { "Content-Type": "application/json", - "Authorization": `${watsonxConfig.accessToken.expiration === -1 ? "ZenApiKey" : "Bearer"} ${watsonxConfig.accessToken.token}` + Authorization: `${watsonxConfig.accessToken.expiration === -1 ? "ZenApiKey" : "Bearer"} ${watsonxConfig.accessToken.token}`, }; } @@ -149,43 +160,55 @@ class WatsonX extends BaseLLM { messages: ChatMessage[], options: CompletionOptions, ): AsyncGenerator { - var now = (new Date()).getTime() / 1000; - if (watsonxConfig.accessToken === undefined || now > watsonxConfig.accessToken.expiration || watsonxConfig.accessToken.token === undefined) { + var now = new Date().getTime() / 1000; + if ( + watsonxConfig.accessToken === undefined || + now > watsonxConfig.accessToken.expiration || + watsonxConfig.accessToken.token === undefined + ) { watsonxConfig.accessToken = await this.getBearerToken(); } else { - console.log(`Reusing token (expires in ${(watsonxConfig.accessToken.expiration - now) / 60} mins)`); + console.log( + `Reusing token (expires in ${(watsonxConfig.accessToken.expiration - now) / 60} mins)`, + ); } if (watsonxConfig.accessToken.token === undefined) { throw new Error(`Something went wrong. Check your credentials, please.`); } - var streamResponse = await fetch(`${this.watsonxUrl}/ml/v1/text/generation_stream?version=2023-05-29`, { - method: "POST", - headers: { - "Content-Type": "application/json", - "Authorization": `${watsonxConfig.accessToken.expiration === -1 ? "ZenApiKey" : "Bearer"} ${watsonxConfig.accessToken.token}` - }, - body: JSON.stringify({ - "input": messages[messages.length - 1].content, - "parameters": { - "decoding_method": "greedy", - "max_new_tokens": options.maxTokens ?? 1024, - "min_new_tokens": 1, - "stop_sequences": [], - "repetition_penalty": 1 + var streamResponse = await fetch( + `${this.watsonxUrl}/ml/v1/text/generation_stream?version=2023-05-29`, + { + method: "POST", + headers: { + "Content-Type": "application/json", + Authorization: `${watsonxConfig.accessToken.expiration === -1 ? "ZenApiKey" : "Bearer"} ${watsonxConfig.accessToken.token}`, }, - "model_id": options.model, - "project_id": this.watsonxProjectId - }) - }); + body: JSON.stringify({ + input: messages[messages.length - 1].content, + parameters: { + decoding_method: "greedy", + max_new_tokens: options.maxTokens ?? 1024, + min_new_tokens: 1, + stop_sequences: [], + repetition_penalty: 1, + }, + model_id: options.model, + project_id: this.watsonxProjectId, + }), + }, + ); if (!streamResponse.ok || streamResponse.body === null) { - throw new Error("Something went wrong. No response received, check your connection"); - } - else { + throw new Error( + "Something went wrong. No response received, check your connection", + ); + } else { const reader = streamResponse.body.getReader(); while (true) { const chunk = await reader.read(); - if (chunk.done) { break; } + if (chunk.done) { + break; + } // Decode the stream const textResponseMsg = new TextDecoder().decode(chunk.value); @@ -197,7 +220,9 @@ class WatsonX extends BaseLLM { // console.log(`${el}`); if (el.startsWith("id:")) { generatedTextIndex = parseInt(el.replace(/^id:\s+/, "")); - if (isNaN(generatedTextIndex)) { console.error(`Unable to parse stream chunk ID: ${el}`); } + if (isNaN(generatedTextIndex)) { + console.error(`Unable to parse stream chunk ID: ${el}`); + } } else if (el.startsWith("data:")) { const dataStr = el.replace(/^data:\s+/, ""); try { @@ -214,11 +239,11 @@ class WatsonX extends BaseLLM { generatedChunk = generatedChunk.replaceAll("<|im_start|> ", "\n"); yield { role: "assistant", - content: (generatedChunk), + content: generatedChunk, }; } } } } -export default WatsonX; \ No newline at end of file +export default WatsonX; diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index 7367e0ce2..107c72be3 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -187,7 +187,8 @@ "cloudflare", "deepseek", "azure", - "msty" + "msty", + "watsonx" ], "markdownEnumDescriptions": [ "### OpenAI\nUse gpt-4, gpt-3.5-turbo, or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.\n\n> [Reference](https://docs.continue.dev/reference/Model%20Providers/openai)", @@ -211,7 +212,8 @@ "### Cloudflare Workers AI\n\n[Reference](https://developers.cloudflare.com/workers-ai/)", "### Deepseek\n Deepseek's API provides the best pricing for their state-of-the-art Deepseek Coder models. To get started, obtain an API key from [their console](https://platform.deepseek.com/api_keys)", "### Azure OpenAI\n Azure OpenAI lets you securely run OpenAI's models on Azure. To get started, follow the steps [here](https://docs.continue.dev/reference/Model%20Providers/azure)", - "### Msty\nMsty is the simplest way to get started with online or local LLMs on all desktop platforms - Windows, Mac, and Linux. No fussing around, one-click and you are up and running. To get started, follow these steps:\n1. Download from [Msty.app](https://msty.app/), open the application, and click 'Setup Local AI'.\n2. Go to the Local AI Module page and download a model of your choice.\n3. Once the model has finished downloading, you can start asking questions through Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/Msty)" + "### Msty\nMsty is the simplest way to get started with online or local LLMs on all desktop platforms - Windows, Mac, and Linux. No fussing around, one-click and you are up and running. To get started, follow these steps:\n1. Download from [Msty.app](https://msty.app/), open the application, and click 'Setup Local AI'.\n2. Go to the Local AI Module page and download a model of your choice.\n3. Once the model has finished downloading, you can start asking questions through Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/Msty)", + "### WatsonX\nWatsonx, developed by IBM, offers a variety of pre-trained AI foundation models that can be used for natural language processing (NLP), computer vision, and speech recognition tasks." ], "type": "string" }, @@ -1185,6 +1187,48 @@ } } } + }, + { + "if": { + "properties": { + "provider": { + "enum": ["watsonx"] + } + }, + "required": ["provider"] + }, + "then": { + "properties": { + "watsonxUrl": { + "type": "string" + }, + "watsonxApiKey": { + "type": "string" + }, + "watsonxZenApiKeyBase64": { + "type": "string" + }, + "watsonxUsername": { + "type": "string" + }, + "watsonxPassword": { + "type": "string" + }, + "watsonxProjectId": { + "type": "string" + }, + "model": { + "enum": [ + "ibm/granite-13b-chat-v2", + "ibm/granite-13b-instruct-v2", + "mistralai/mistral-large", + "meta-llama/llama-3-8b-instruct", + "meta-llama/llama-3-70b-instruct" + ] + } + }, + "required": ["watsonxUrl", "watsonxProjectId"] + } } ] }, diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index 836891072..24512fd0e 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -151,7 +151,6 @@ "@biomejs/biome": "1.6.4", "@google/generative-ai": "^0.11.4", "@types/follow-redirects": "^1.14.4", - "@types/isomorphic-fetch": "^0.0.39", "@types/jest": "^29.5.12", "@types/jquery": "^3.5.29", "@types/jsdom": "^21.1.6", diff --git a/gui/package-lock.json b/gui/package-lock.json index cea7192fb..d2cf7916d 100644 --- a/gui/package-lock.json +++ b/gui/package-lock.json @@ -144,7 +144,6 @@ "@biomejs/biome": "1.6.4", "@google/generative-ai": "^0.11.4", "@types/follow-redirects": "^1.14.4", - "@types/isomorphic-fetch": "^0.0.39", "@types/jest": "^29.5.12", "@types/jquery": "^3.5.29", "@types/jsdom": "^21.1.6", diff --git a/gui/src/pages/AddNewModel/ConfigureProvider.tsx b/gui/src/pages/AddNewModel/ConfigureProvider.tsx index 8c2797a53..f4a199c21 100644 --- a/gui/src/pages/AddNewModel/ConfigureProvider.tsx +++ b/gui/src/pages/AddNewModel/ConfigureProvider.tsx @@ -1,6 +1,6 @@ import { ArrowLeftIcon } from "@heroicons/react/24/outline"; import _ from "lodash"; -import { useCallback, useContext, useEffect, useState } from "react"; +import React, { useCallback, useContext, useEffect, useState } from "react"; import { FormProvider, useForm } from "react-hook-form"; import { useDispatch } from "react-redux"; import { useNavigate, useParams } from "react-router-dom"; @@ -14,15 +14,13 @@ import { import StyledMarkdownPreview from "../../components/markdown/StyledMarkdownPreview"; import ModelCard from "../../components/modelSelection/ModelCard"; import ModelProviderTag from "../../components/modelSelection/ModelProviderTag"; +import Toggle from "../../components/modelSelection/Toggle"; import { IdeMessengerContext } from "../../context/IdeMessenger"; import { useNavigationListener } from "../../hooks/useNavigationListener"; import { setDefaultModel } from "../../redux/slices/stateSlice"; import { updatedObj } from "../../util"; import type { ProviderInfo } from "./configs/providers"; import { providers } from "./configs/providers"; -import ContinueButton from "../../components/mainInput/ContinueButton"; -import Toggle from "../../components/modelSelection/Toggle"; -import React from "react"; const GridDiv = styled.div` display: grid; @@ -67,8 +65,6 @@ function ConfigureProvider() { undefined, ); - const [selectedModel, setSelectedModel] = useState({}); - // different authentication flow is required for watsonx. This state helps to determine which flow to use for authentication const [watsonxAuthenticate, setWatsonxAuthenticate] = React.useState(true); @@ -77,13 +73,9 @@ function ConfigureProvider() { setModelInfo(providers[providerName]); } }, [providerName]); - useEffect(() => { - if (modelInfo) { - setSelectedModel(modelInfo); - } - }, [modelInfo]); + const handleContinue = () => { - if (!selectedModel) return; + if (!modelInfo) return; let formParams: any = {}; for (const d of modelInfo.collectInputFor || []) { @@ -115,18 +107,14 @@ function ConfigureProvider() { }, [modelInfo, formMethods]); const enablecardsForApikey = useCallback(() => { - return ( - modelInfo?.collectInputFor - ?.filter((d) => d.isWatsonxAuthenticatedByApiKey) - .some((d) => !formMethods.watch(d.key)) - ); + return modelInfo?.collectInputFor + ?.filter((d) => d.isWatsonxAuthenticatedByApiKey) + .some((d) => !formMethods.watch(d.key)); }, [modelInfo, formMethods]); const enablecardsForCredentials = useCallback(() => { - return ( - modelInfo?.collectInputFor - ?.filter((d) => d.isWatsonxAuthenticatedByCredentials) - .some((d) => !formMethods.watch(d.key)) - ); + return modelInfo?.collectInputFor + ?.filter((d) => d.isWatsonxAuthenticatedByCredentials) + .some((d) => !formMethods.watch(d.key)); }, [modelInfo, formMethods]); return ( @@ -176,7 +164,7 @@ function ConfigureProvider() { {/* The WatsonX Authentication coukd be done by two different ways 1 ==> Using Api key 2 ==> Using Credentials */} - {providerName === "watsonx" ? + {providerName === "watsonx" ? ( <>
{watsonxAuthenticate ? ( <> - {(modelInfo?.collectInputFor?.filter((d) => d.required).length || 0) > - 0 && ( - <> -

Enter required parameters

+ {(modelInfo?.collectInputFor?.filter((d) => d.required) + .length || 0) > 0 && ( + <> +

Enter required parameters

- {modelInfo?.collectInputFor - .filter((d) => d.isWatsonxAuthenticatedByApiKey) - .map((d, idx) => ( -
- - -
- ))} - - )} - ) : - ( - <> - {(modelInfo?.collectInputFor?.filter((d) => d.required).length || 0) > - 0 && ( - <> -

Enter required parameters

+ {modelInfo?.collectInputFor + .filter((d) => d.isWatsonxAuthenticatedByApiKey) + .map((d, idx) => ( +
+ + +
+ ))} + + )} + + ) : ( + <> + {(modelInfo?.collectInputFor?.filter((d) => d.required) + .length || 0) > 0 && ( + <> +

Enter required parameters

- {modelInfo?.collectInputFor - .filter((d) => d.isWatsonxAuthenticatedByCredentials) - .map((d, idx) => ( -
- - -
- ))} - - )} - )} - : + {modelInfo?.collectInputFor + .filter((d) => d.isWatsonxAuthenticatedByCredentials) + .map((d, idx) => ( +
+ + +
+ ))} + + )} + + )} + + ) : ( <> - {(modelInfo?.collectInputFor?.filter((d) => d.required).length || 0) > - 0 && ( - <> -

Enter required parameters

+ {(modelInfo?.collectInputFor?.filter((d) => d.required).length || + 0) > 0 && ( + <> +

Enter required parameters

- {modelInfo?.collectInputFor - ?.filter((d) => d.required) - .map((d, idx) => ( -
- - -
- ))} - - )} - } - - {(modelInfo?.collectInputFor?.filter((d) => !d.required).length || - 0) > 0 && ( -
- - Advanced (optional) - - {modelInfo?.collectInputFor?.map((d, idx) => { - // Check the attribute is only for Watson X - if (d.isWatsonxAttribute) return null; - if (d.required) return null; - return ( -
- - -
- ); - })} -
- )} - - {(modelInfo?.collectInputFor?.filter((d) => d.isWatsonxAttribute) - .length || 0) > 0 && ( -
- - WatsonX (Select a model by model id) - - - {modelInfo?.collectInputFor?.map((d, idx) => { - // Check the attribute is only for Watson X - if (d.isWatsonxAttribute) - return ( -
+ {modelInfo?.collectInputFor + ?.filter((d) => d.required) + .map((d, idx) => ( +
- ); - })} - d.isWatsonxAttribute) - .some((d) => !formMethods.watch(d.key)) - } - showStop={false} - > -
- )} + ))} + + )} + + )} + + {(modelInfo?.collectInputFor?.filter((d) => !d.required).length || + 0) > 0 && ( +
+ + Advanced (optional) + + {modelInfo?.collectInputFor?.map((d, idx) => { + // Check the attribute is only for Watson X + if (d.isWatsonxAttribute) return null; + if (d.required) return null; + return ( +
+ + +
+ ); + })} +
+ )} +

Select a model preset

@@ -359,7 +309,11 @@ function ConfigureProvider() { return ( { - if ((disableModelCards() && enablecardsForApikey() && enablecardsForCredentials())) return; + if ( + disableModelCards() && + enablecardsForApikey() && + enablecardsForCredentials() + ) + return; let formParams: any = {}; for (const d of modelInfo.collectInputFor || []) { const val = formMethods.watch(d.key); diff --git a/gui/src/pages/AddNewModel/configs/models.ts b/gui/src/pages/AddNewModel/configs/models.ts index 33354cae0..2f5e75e12 100644 --- a/gui/src/pages/AddNewModel/configs/models.ts +++ b/gui/src/pages/AddNewModel/configs/models.ts @@ -1,4 +1,4 @@ -import { ChatMessage, ILLM, ModelProvider } from "core"; +import { ILLM, ModelProvider } from "core"; import { ModelProviderTags } from "../../../components/modelSelection/ModelProviderTag"; import { InputDescriptor } from "./providers"; @@ -704,7 +704,7 @@ export const models: { [key: string]: ModelPackage } = { model: "ibm/granite-13b-instruct-v2", contextLength: 20_000, title: "Granite Code", - systemMessage: `You are Granite Chat, an AI language model developed by IBM. You are a cautious assistant. You carefully follow instructions. You are helpful and harmless and you follow ethical guidelines and promote positive behavior. You always respond to greetings (for example, hi, hello, g'day, morning, afternoon, evening, night, what's up, nice to meet you, sup, etc) with "Hello! I am Granite Chat, created by IBM. How can I help you today?". Please do not say anything else and do not start a conversation.` + systemMessage: `You are Granite Chat, an AI language model developed by IBM. You are a cautious assistant. You carefully follow instructions. You are helpful and harmless and you follow ethical guidelines and promote positive behavior. You always respond to greetings (for example, hi, hello, g'day, morning, afternoon, evening, night, what's up, nice to meet you, sup, etc) with "Hello! I am Granite Chat, created by IBM. How can I help you today?". Please do not say anything else and do not start a conversation.`, }, providerOptions: ["watsonx"], icon: "WatsonX.png", @@ -724,9 +724,9 @@ export const models: { [key: string]: ModelPackage } = { isOpenSource: false, }, MetaLlama3: { - title: "Meta-llama3", + title: "Meta Llama 3", description: - "Llama-3 is an auto-regressive language model that uses an optimized transformer architecture.", + "Llama 3 is an auto-regressive language model that uses an optimized transformer architecture.", params: { title: "Meta-llama3-8b", model: "meta-llama/llama-3-8b-instruct", diff --git a/gui/src/pages/AddNewModel/configs/providers.ts b/gui/src/pages/AddNewModel/configs/providers.ts index 2edee979e..6d6f51e73 100644 --- a/gui/src/pages/AddNewModel/configs/providers.ts +++ b/gui/src/pages/AddNewModel/configs/providers.ts @@ -481,6 +481,82 @@ After it's up and running, you can start using Continue.`, ...openSourceModels, ], }, + watsonx: { + title: "WatsonX", + provider: "watsonx", + refPage: "watsonX", + description: + "Explore foundation models from IBM and other third-parties depending on your use case.", + longDescription: `Watsonx, developed by IBM, offers a variety of pre-trained AI foundation models that can be used for natural language processing (NLP), computer vision, and speech recognition tasks.`, + collectInputFor: [ + { + inputType: "text", + key: "watsonxUrl", + label: "WatsonX URL", + placeholder: "http://.dataplatform.cloud.ibm.com", + required: true, + isWatsonxAuthenticatedByApiKey: true, + isWatsonxAuthenticatedByCredentials: true, + }, + { + inputType: "text", + key: "watsonxApiKey", + label: "WatsonX API Key", + placeholder: "Enter your API key", + required: true, + isWatsonxAuthenticatedByApiKey: true, + }, + { + inputType: "text", + key: "watsonxProjectId", + label: "WatsonX Project Id", + placeholder: "Enter your project Id", + required: true, + isWatsonxAuthenticatedByApiKey: true, + isWatsonxAuthenticatedByCredentials: true, + }, + { + inputType: "text", + key: "watsonxUsername", + label: "WatsonX Username", + placeholder: "Enter your Username", + required: true, + isWatsonxAuthenticatedByCredentials: true, + }, + { + inputType: "text", + key: "watsonxPassword", + label: "WatsonX Password", + placeholder: "Enter your password", + required: true, + isWatsonxAuthenticatedByCredentials: true, + }, + { + inputType: "text", + key: "title", + label: "Model name", + placeholder: "Granite 13B Chat v2", + isWatsonxAttribute: true, + }, + { + inputType: "text", + key: "model", + label: "Model Id", + placeholder: "ibm/granite-13b-chat-v2", + isWatsonxAttribute: true, + }, + + ...completionParamsInputsConfigs, + ], + icon: "WatsonX.png", + tags: [ModelProviderTags.RequiresApiKey], + packages: [ + models.graniteCode, + models.graniteChat, + models.MistralLarge, + models.MetaLlama3, + ], + }, "free-trial": { title: "Continue limited free trial", provider: "free-trial", @@ -509,80 +585,4 @@ After it's up and running, you can start using Continue.`, ], collectInputFor: [...completionParamsInputsConfigs], }, - watsonx: { - title: "WatsonX", - provider: "watsonx", - refPage: "watsonX", - description: - "Explore foundation models from IBM and other third-parties depending on your use case.", - longDescription: `Watsonx, developed by IBM, offers a variety of pre-trained AI foundation models that can be used for natural language processing (NLP), computer vision, and speech recognition tasks.`, - collectInputFor: [ - { - inputType: "text", - key: "watsonxUrl", - label: "WatsonX URL", - placeholder: "http://.dataplatform.cloud.ibm.com", - required: true, - isWatsonxAuthenticatedByApiKey: true, - isWatsonxAuthenticatedByCredentials: true - }, - { - inputType: "text", - key: "watsonxApiKey", - label: "WatsonX API Key", - placeholder: "Enter your API key", - required: true, - isWatsonxAuthenticatedByApiKey: true - }, - { - inputType: "text", - key: "watsonxProjectId", - label: "WatsonX Project Id", - placeholder: "Enter your project Id", - required: true, - isWatsonxAuthenticatedByApiKey: true, - isWatsonxAuthenticatedByCredentials: true - }, - { - inputType: "text", - key: "watsonxUsername", - label: "WatsonX Username", - placeholder: "Enter your Username", - required: true, - isWatsonxAuthenticatedByCredentials: true - }, - { - inputType: "text", - key: "watsonxPassword", - label: "WatsonX Password", - placeholder: "Enter your password", - required: true, - isWatsonxAuthenticatedByCredentials: true - }, - { - inputType: "text", - key: "title", - label: "Model name", - placeholder: "Granite 13B Chat v2", - isWatsonxAttribute: true, - }, - { - inputType: "text", - key: "model", - label: "Model Id", - placeholder: "ibm/granite-13b-chat-v2", - isWatsonxAttribute: true, - }, - - ...completionParamsInputsConfigs, - ], - icon: "WatsonX.png", - tags: [ModelProviderTags.RequiresApiKey], - packages: [ - models.graniteCode, - models.graniteChat, - models.MistralLarge, - models.MetaLlama3 - ], - }, };