From f0f5b5e91db5384ab9f5beae0a352c3b78505bd1 Mon Sep 17 00:00:00 2001 From: Elias TOURNEUX Date: Wed, 17 Dec 2025 14:02:07 -0500 Subject: [PATCH 1/3] Add OVHcloud AI Endpoints block and add it also in Hugging Face block --- apps/docs/components/icons.tsx | 12 ++ apps/docs/components/ui/icon-mapping.ts | 2 + apps/docs/content/docs/en/blocks/agent.mdx | 2 +- apps/docs/content/docs/en/tools/meta.json | 1 + apps/docs/content/docs/en/tools/ovhcloud.mdx | 83 ++++++++++ apps/docs/content/docs/fr/blocks/agent.mdx | 2 +- apps/docs/content/docs/fr/tools/meta.json | 1 + apps/docs/content/docs/fr/tools/ovhcloud.mdx | 83 ++++++++++ .../app/(landing)/components/footer/consts.ts | 1 + .../components/integrations/integrations.tsx | 1 + apps/sim/blocks/blocks/huggingface.ts | 1 + apps/sim/blocks/blocks/ovhcloud.ts | 144 ++++++++++++++++++ apps/sim/blocks/registry.ts | 2 + apps/sim/components/icons.tsx | 12 ++ apps/sim/tools/huggingface/chat.ts | 1 + apps/sim/tools/ovhcloud/chat.ts | 123 +++++++++++++++ apps/sim/tools/ovhcloud/embeddings.ts | 74 +++++++++ apps/sim/tools/ovhcloud/index.ts | 5 + apps/sim/tools/ovhcloud/types.ts | 45 ++++++ apps/sim/tools/registry.ts | 3 + 20 files changed, 596 insertions(+), 2 deletions(-) create mode 100644 apps/docs/content/docs/en/tools/ovhcloud.mdx create mode 100644 apps/docs/content/docs/fr/tools/ovhcloud.mdx create mode 100644 apps/sim/blocks/blocks/ovhcloud.ts create mode 100644 apps/sim/tools/ovhcloud/chat.ts create mode 100644 apps/sim/tools/ovhcloud/embeddings.ts create mode 100644 apps/sim/tools/ovhcloud/index.ts create mode 100644 apps/sim/tools/ovhcloud/types.ts diff --git a/apps/docs/components/icons.tsx b/apps/docs/components/icons.tsx index 12ead996f7..5ca2bf0922 100644 --- a/apps/docs/components/icons.tsx +++ b/apps/docs/components/icons.tsx @@ -4223,3 +4223,15 @@ export function SpotifyIcon(props: SVGProps) { ) } + +export function OVHcloudIcon(props: SVGProps) { + return ( + + + + ) +} diff --git a/apps/docs/components/ui/icon-mapping.ts b/apps/docs/components/ui/icon-mapping.ts index 9771381871..43e3b089e1 100644 --- a/apps/docs/components/ui/icon-mapping.ts +++ b/apps/docs/components/ui/icon-mapping.ts @@ -67,6 +67,7 @@ import { NotionIcon, OpenAIIcon, OutlookIcon, + OVHcloudIcon, PackageSearchIcon, ParallelIcon, PerplexityIcon, @@ -231,4 +232,5 @@ export const blockTypeToIconMap: Record = { mysql: MySQLIcon, browser_use: BrowserUseIcon, stt: STTIcon, + ovhcloud: OVHcloudIcon, } diff --git a/apps/docs/content/docs/en/blocks/agent.mdx b/apps/docs/content/docs/en/blocks/agent.mdx index 205d9b1ddc..ad13973be6 100644 --- a/apps/docs/content/docs/en/blocks/agent.mdx +++ b/apps/docs/content/docs/en/blocks/agent.mdx @@ -69,7 +69,7 @@ Extend agent capabilities with external integrations. Select from 60+ pre-built - **Data Sources**: Notion, Google Sheets, Airtable, Supabase, Pinecone - **Web Services**: Firecrawl, Google Search, Exa AI, browser automation - **Development**: GitHub, Jira, Linear -- **AI Services**: OpenAI, Perplexity, Hugging Face, ElevenLabs +- **AI Services**: OpenAI, Perplexity, Hugging Face, ElevenLabs, OVHcloud AI Endpoints **Execution Modes:** - **Auto**: Model decides when to use tools based on context diff --git a/apps/docs/content/docs/en/tools/meta.json b/apps/docs/content/docs/en/tools/meta.json index 7ca67d7a90..28d8fd6014 100644 --- a/apps/docs/content/docs/en/tools/meta.json +++ b/apps/docs/content/docs/en/tools/meta.json @@ -63,6 +63,7 @@ "onedrive", "openai", "outlook", + "ovhcloud", "parallel_ai", "perplexity", "pinecone", diff --git a/apps/docs/content/docs/en/tools/ovhcloud.mdx b/apps/docs/content/docs/en/tools/ovhcloud.mdx new file mode 100644 index 0000000000..a641bada53 --- /dev/null +++ b/apps/docs/content/docs/en/tools/ovhcloud.mdx @@ -0,0 +1,83 @@ +--- +title: OVHcloud AI Endpoints +description: Use OVHcloud AI Endpoints LLM and embeddings models +--- + +import { BlockInfoCard } from "@/components/ui/block-info-card" + + + +{/* MANUAL-CONTENT-START:intro */} +[OVHcloud AI Endpoints](https://www.ovhcloud.com/en/public-cloud/ai-endpoints/) offers generative AI models and secure APIs to interact with popular open-weight models. Enjoy sovereignty, data privacy and GDPR compliance on the infrastructure of the European Cloud Provider leader. + +With OVHcloud AI Endpoints, you can: + +- **Data security and confidentiality**: Data security and confidentiality for you and your users is a priority on our platform. Your data will never be used to train or improve our AI models; this is one of our many security guarantees. +- **Conversational AI**: Enhance your apps by adding conversational AI that interacts naturally with users in real time. +- **Standard APIs**: Popular APIs (like OpenAI) for easy integration. +- **Performance**: Achieve high inference performance using OVHcloud’s GPU infrastructure. +- **Security**: Underlying platform with ISO 27000, SOC, and healthcare data certifications. +- **Sandbox**: Interactively test and explore models in a simplified environment +- **More than 40 models**: A constantly updated range of popular, open-weight models +{/* MANUAL-CONTENT-END */} + + +## Usage Instructions + +Integrate OVHcloud AI Endpoints into the workflow. Can generate chat completions or embeddings using our open-weight models. + + + +## Tools + +### `ovhcloud_chat` + +Generate chat completions using OVHcloud AI Endpoints LLM models + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `systemPrompt` | string | No | System prompt to guide the model behavior | +| `content` | string | Yes | The user message content to send to the model | +| `model` | string | Yes | Model to use for chat completions \(e.g., gpt-oss-120b, llama@latest\) | +| `max_tokens` | number | No | Maximum number of tokens to generate | +| `temperature` | number | No | Sampling temperature between 0 and 1 | +| `apiKey` | string | Yes | OVHcloud AI Endpoints API key | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `content` | string | Generated text content | +| `model` | string | Model used for generation | +| `usage` | object | Token usage information | + +### `ovhcloud_embeddings` + +Generate embeddings from your input + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `input` | string | Yes | The input you want to embed | +| `model` | string | Yes | Model to use for embeddings \(e.g., BGE-M3, bge-multilingual-gemma2\) | +| `apiKey` | string | Yes | OVHcloud AI Endpoints API key | + +#### Output + +| Parameter | Type | Description | +| --------- | ---- | ----------- | +| `embedding` | array | Generated embedding | +| `model` | string | Model used for generation | +| `usage` | object | Token usage information | + + +## Notes + +- Category: `tools` +- Type: `ovhcloud` \ No newline at end of file diff --git a/apps/docs/content/docs/fr/blocks/agent.mdx b/apps/docs/content/docs/fr/blocks/agent.mdx index b543ef4ff1..ed0e22043b 100644 --- a/apps/docs/content/docs/fr/blocks/agent.mdx +++ b/apps/docs/content/docs/fr/blocks/agent.mdx @@ -69,7 +69,7 @@ Votre clé API pour le fournisseur LLM sélectionné. Elle est stockée en toute - **Sources de données** : Notion, Google Sheets, Airtable, Supabase, Pinecone - **Services web** : Firecrawl, Google Search, Exa AI, automatisation de navigateur - **Développement** : GitHub, Jira, Linear -- **Services IA** : OpenAI, Perplexity, Hugging Face, ElevenLabs +- **Services IA** : OpenAI, Perplexity, Hugging Face, ElevenLabs, OVHcloud AI Endpoints **Modes d'exécution :** - **Auto** : le modèle décide quand utiliser les outils en fonction du contexte diff --git a/apps/docs/content/docs/fr/tools/meta.json b/apps/docs/content/docs/fr/tools/meta.json index d6d5b93b96..81dd37c07d 100644 --- a/apps/docs/content/docs/fr/tools/meta.json +++ b/apps/docs/content/docs/fr/tools/meta.json @@ -42,6 +42,7 @@ "onedrive", "openai", "outlook", + "ovhcloud", "parallel_ai", "perplexity", "pinecone", diff --git a/apps/docs/content/docs/fr/tools/ovhcloud.mdx b/apps/docs/content/docs/fr/tools/ovhcloud.mdx new file mode 100644 index 0000000000..3562e289ab --- /dev/null +++ b/apps/docs/content/docs/fr/tools/ovhcloud.mdx @@ -0,0 +1,83 @@ +--- +title: OVHcloud AI Endpoints +description: Utilisez les modèles LLM et d'embeddings d'OVHcloud AI Endpoints +--- + +import { BlockInfoCard } from "@/components/ui/block-info-card" + + + +{/* MANUAL-CONTENT-START:intro */} +[OVHcloud AI Endpoints](https://www.ovhcloud.com/fr/public-cloud/ai-endpoints/) propose des modèles d'IA générative et des API sécurisées pour interagir avec les modèles open-weight les plus populaires. Profitez de la souveraineté, de la confidentialité des données et de la conformité RGPD sur l'infrastructure du leader européen du Cloud. + +Avec OVHcloud AI Endpoints, vous pouvez bénéficier de : + +- **Sécurité et confidentialité des données** : La sécurité et la confidentialité de vos données et de celles de vos utilisateurs sont une priorité. Vos données ne seront jamais utilisées pour entraîner ou améliorer nos modèles d'IA ; c'est l'une de nos nombreuses garanties de sécurité. +- **IA Conversationnelle** : Améliorez vos applications en ajoutant une IA conversationnelle qui interagit naturellement avec les utilisateurs en temps réel. +- **API Standards** : Utilisation d'API populaires (comme OpenAI) pour une intégration simplifiée. +- **Performance** : Obtenez des performances d'inférence élevées grâce à l'infrastructure GPU d'OVHcloud. +- **Sécurité** : Plateforme sous-jacente certifiée ISO 27000, SOC et HDS (données de santé). +- **Sandbox** : Testez et explorez les modèles de manière interactive dans un environnement simplifié. +- **Plus de 40 modèles** : Une gamme de modèles open-weight populaires, constamment mise à jour. +{/* MANUAL-CONTENT-END */} + + +## Instructions d'utilisation + +Intégrez OVHcloud AI Endpoints dans votre flux de travail. Vous pouvez générer des complétions de chat ou des embeddings en utilisant nos modèles open-weight. + + +## Outils + +### `ovhcloud_chat` + +Générer des complétions de chat via les modèles LLM d'OVHcloud AI Endpoints. + +#### Entrée (Input) + +| Paramètre | Type | Requis | Description | +| --------- | ---- | -------- | ----------- | +| `systemPrompt` | string | Non | Prompt système pour guider le comportement du modèle | +| `content` | string | Oui | Contenu du message utilisateur à envoyer au modèle | +| `model` | string | Oui | Modèle à utiliser pour les complétions de chat (ex: gpt-oss-120b, llama@latest) | +| `max_tokens` | number | Non | Nombre maximum de tokens à générer | +| `temperature` | number | Non | Température d'échantillonnage entre 0 et 1 | +| `apiKey` | string | Oui | Clé API OVHcloud AI Endpoints | + +#### Sortie (Output) + +| Paramètre | Type | Description | +| --------- | ---- | ----------- | +| `content` | string | Contenu textuel généré | +| `model` | string | Modèle utilisé pour la génération | +| `usage` | object | Informations sur la consommation de tokens | + +### `ovhcloud_embeddings` + +Générer des embeddings à partir de vos données. + +#### Entrée (Input) + +| Paramètre | Type | Requis | Description | +| --------- | ---- | -------- | ----------- | +| `input` | string | Oui | Le texte que vous souhaitez transformer en embedding | +| `model` | string | Oui | Modèle à utiliser pour les embeddings (ex: BGE-M3, bge-multilingual-gemma2) | +| `apiKey` | string | Oui | Clé API OVHcloud AI Endpoints | + +#### Sortie (Output) + +| Paramètre | Type | Description | +| --------- | ---- | ----------- | +| `embedding` | array | Tableau des poids d'embedding | +| `model` | string | Modèle utilisé pour la génération | +| `usage` | object | Informations sur la consommation de tokens | + + + +## Notes + +- Catégorie : `tools` +- Type : `ovhcloud` \ No newline at end of file diff --git a/apps/sim/app/(landing)/components/footer/consts.ts b/apps/sim/app/(landing)/components/footer/consts.ts index 7e55d03a2a..e921db7fad 100644 --- a/apps/sim/app/(landing)/components/footer/consts.ts +++ b/apps/sim/app/(landing)/components/footer/consts.ts @@ -57,6 +57,7 @@ export const FOOTER_TOOLS = [ 'OneDrive', 'OpenAI', 'Outlook', + 'OVHcloud AI Endpoints', 'Parallel AI', 'Perplexity', 'Pinecone', diff --git a/apps/sim/app/(landing)/components/integrations/integrations.tsx b/apps/sim/app/(landing)/components/integrations/integrations.tsx index 04e9487a22..8a3fc85c00 100644 --- a/apps/sim/app/(landing)/components/integrations/integrations.tsx +++ b/apps/sim/app/(landing)/components/integrations/integrations.tsx @@ -14,6 +14,7 @@ const modelProviderIcons = [ { icon: Icons.DeepseekIcon, label: 'Deepseek' }, { icon: Icons.ElevenLabsIcon, label: 'ElevenLabs' }, { icon: Icons.VllmIcon, label: 'vLLM' }, + { icon: Icons.OVHcloudIcon, label: 'OVHcloud AI Endpoints' }, ] const communicationIcons = [ diff --git a/apps/sim/blocks/blocks/huggingface.ts b/apps/sim/blocks/blocks/huggingface.ts index c02f4a9bf3..088723c37e 100644 --- a/apps/sim/blocks/blocks/huggingface.ts +++ b/apps/sim/blocks/blocks/huggingface.ts @@ -48,6 +48,7 @@ export const HuggingFaceBlock: BlockConfig = { { label: 'Replicate', id: 'replicate' }, { label: 'SambaNova', id: 'sambanova' }, { label: 'Together', id: 'together' }, + { label: 'OVHcloud AI Endpoints', id: 'ovhcloud' }, ], value: () => 'novita', }, diff --git a/apps/sim/blocks/blocks/ovhcloud.ts b/apps/sim/blocks/blocks/ovhcloud.ts new file mode 100644 index 0000000000..59eabfa16b --- /dev/null +++ b/apps/sim/blocks/blocks/ovhcloud.ts @@ -0,0 +1,144 @@ +import { OVHcloudIcon } from '@/components/icons' +import { AuthMode, type BlockConfig } from '@/blocks/types' +import type { OVHcloudChatResponse } from '@/tools/ovhcloud/types' + +type OVHcloudResponse = OVHcloudChatResponse + +export const OVHcloudBlock: BlockConfig = { + type: 'ovhcloud', + name: 'OVHcloud AI Endpoints', + description: 'Use OVHcloud AI Endpoints LLM models', + longDescription: + 'Integrate OVHcloud AI Endpoints models into your workflow. Use the Europe leading cloud provider inference compute, with sovereignty, data privacy and GDPR compliance.', + authMode: AuthMode.ApiKey, + docsLink: 'https://docs.sim.ai/tools/ovhcloud', + category: 'tools', + bgColor: '#000E9C', + icon: OVHcloudIcon, + subBlocks: [ + { + id: 'operation', + title: 'Operation', + type: 'dropdown', + options: [ + { label: 'Chat', id: 'ovhcloud_chat' }, + { label: 'Embeddings', id: 'ovhcloud_embeddings' }, + ], + value: () => 'ovhcloud_chat', + }, + // Chat operation inputs + { + id: 'systemPrompt', + title: 'System Prompt', + type: 'long-input', + placeholder: 'System prompt to guide the model behavior...', + condition: { field: 'operation', value: 'ovhcloud_chat' }, + }, + { + id: 'content', + title: 'User Prompt', + type: 'long-input', + placeholder: 'Enter your prompt here...', + required: true, + condition: { field: 'operation', value: 'ovhcloud_chat' }, + }, + { + id: 'model', + title: 'Model', + type: 'short-input', + placeholder: 'Enter your model here...', + required: true, + }, + { + id: 'temperature', + title: 'Temperature', + type: 'slider', + min: 0, + max: 1, + value: () => '0.7', + condition: { field: 'operation', value: 'ovhcloud_chat' }, + }, + { + id: 'max_tokens', + title: 'Max Tokens', + type: 'short-input', + placeholder: 'Maximum number of tokens', + condition: { field: 'operation', value: 'ovhcloud_chat' }, + }, + // Embeddings operation inputs + { + id: 'input', + title: 'Input Text', + type: 'long-input', + placeholder: 'Enter text to generate embeddings...', + required: true, + condition: { field: 'operation', value: 'ovhcloud_embeddings' }, + }, + { + id: 'apiKey', + title: 'API Key', + type: 'short-input', + placeholder: 'Enter your OVHcloud AI Endpoints API key', + password: true, + required: true, + }, + ], + tools: { + access: ['ovhcloud_chat', 'ovhcloud_embeddings'], + config: { + tool: (params) => { + switch (params.operation) { + case 'ovhcloud_chat': + return 'ovhcloud_chat' + case 'ovhcloud_embeddings': + return 'ovhcloud_embeddings' + default: + return 'ovhcloud_chat' + } + }, + params: (params) => { + if (params.operation === 'ovhcloud_embeddings') { + return { + apiKey: params.apiKey, + model: params.model, + input: params.input, + } + } + + // Chat params + const chatParams = { + apiKey: params.apiKey, + model: params.model, + content: params.content, + systemPrompt: params.systemPrompt, + max_tokens: params.max_tokens ? Number.parseInt(params.max_tokens) : undefined, + temperature: params.temperature ? Number.parseFloat(params.temperature) : undefined, + } + + return chatParams + }, + }, + }, + inputs: { + operation: { type: 'string', description: 'Operation to perform' }, + // Chat operation inputs + content: { type: 'string', description: 'User prompt content' }, + systemPrompt: { type: 'string', description: 'System instructions' }, + model: { type: 'string', description: 'AI model to use' }, + max_tokens: { type: 'string', description: 'Maximum output tokens' }, + temperature: { type: 'string', description: 'Response randomness' }, + // Embeddings operation inputs + input: { type: 'string', description: 'Text input for embeddings' }, + // Common + apiKey: { type: 'string', description: 'OVHcloud API key' }, + }, + outputs: { + // Chat outputs + content: { type: 'string', description: 'Generated response' }, + model: { type: 'string', description: 'Model used' }, + usage: { type: 'json', description: 'Token usage' }, + // Embeddings outputs + embeddings: { type: 'json', description: 'Generated embeddings' }, + embedding_model: { type: 'string', description: 'Embedding model used' }, + }, +} \ No newline at end of file diff --git a/apps/sim/blocks/registry.ts b/apps/sim/blocks/registry.ts index ca1f30e845..d57811bff9 100644 --- a/apps/sim/blocks/registry.ts +++ b/apps/sim/blocks/registry.ts @@ -75,6 +75,7 @@ import { NotionBlock } from '@/blocks/blocks/notion' import { OneDriveBlock } from '@/blocks/blocks/onedrive' import { OpenAIBlock } from '@/blocks/blocks/openai' import { OutlookBlock } from '@/blocks/blocks/outlook' +import { OVHcloudBlock } from '@/blocks/blocks/ovhcloud' import { ParallelBlock } from '@/blocks/blocks/parallel' import { PerplexityBlock } from '@/blocks/blocks/perplexity' import { PineconeBlock } from '@/blocks/blocks/pinecone' @@ -216,6 +217,7 @@ export const registry: Record = { onedrive: OneDriveBlock, openai: OpenAIBlock, outlook: OutlookBlock, + ovhcloud: OVHcloudBlock, parallel_ai: ParallelBlock, perplexity: PerplexityBlock, pinecone: PineconeBlock, diff --git a/apps/sim/components/icons.tsx b/apps/sim/components/icons.tsx index 12ead996f7..5ca2bf0922 100644 --- a/apps/sim/components/icons.tsx +++ b/apps/sim/components/icons.tsx @@ -4223,3 +4223,15 @@ export function SpotifyIcon(props: SVGProps) { ) } + +export function OVHcloudIcon(props: SVGProps) { + return ( + + + + ) +} diff --git a/apps/sim/tools/huggingface/chat.ts b/apps/sim/tools/huggingface/chat.ts index d6364cd6d4..82a439aba9 100644 --- a/apps/sim/tools/huggingface/chat.ts +++ b/apps/sim/tools/huggingface/chat.ts @@ -74,6 +74,7 @@ export const chatTool: ToolConfig = { + id: 'ovhcloud_chat', + name: 'OVHcloud AI Endpoints Chat', + description: 'Generate completions using OVHcloud AI Endpoints LLM models', + version: '1.0', + + params: { + systemPrompt: { + type: 'string', + required: false, + visibility: 'user-or-llm', + description: 'System prompt to guide the model behavior', + }, + content: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The user message content to send to the model', + }, + model: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Model to use for chat completions (e.g., gpt-oss-120b, llama@latest)', + }, + max_tokens: { + type: 'number', + required: false, + visibility: 'user-only', + description: 'Maximum number of tokens to generate', + }, + temperature: { + type: 'number', + required: false, + visibility: 'user-only', + description: 'Sampling temperature between 0 and 1', + }, + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'OVHcloud AI Endpoints API key', + }, + }, + + request: { + method: 'POST', + url: () => 'https://oai.endpoints.kepler.ai.cloud.ovh.net/v1/chat/completions', + headers: (params) => ({ + Authorization: `Bearer ${params.apiKey}`, + 'Content-Type': 'application/json', + }), + body: (params) => { + const messages: Array<{ role: string; content: string }> = [] + + // Add system prompt if provided + if (params.systemPrompt) { + messages.push({ + role: 'system', + content: params.systemPrompt, + }) + } + + // Add user message + messages.push({ + role: 'user', + content: params.content, + }) + + const body: Record = { + model: params.model, + messages: messages, + } + + // Add optional parameters if provided + if (params.max_tokens !== undefined) { + body.max_tokens = Number(params.max_tokens) || 10000 + } + + if (params.temperature !== undefined) { + body.temperature = Number(params.temperature) + } + + return body + }, + }, + + transformResponse: async (response) => { + const data = await response.json() + return { + success: true, + output: { + content: data.choices[0].message.content, + model: data.model, + usage: { + prompt_tokens: data.usage.prompt_tokens, + completion_tokens: data.usage.completion_tokens, + total_tokens: data.usage.total_tokens, + }, + }, + } + }, + + outputs: { + content: { type: 'string', description: 'Generated text content' }, + model: { type: 'string', description: 'Model used for generation' }, + usage: { + type: 'object', + description: 'Token usage information', + properties: { + prompt_tokens: { type: 'number', description: 'Number of tokens in the prompt' }, + completion_tokens: { + type: 'number', + description: 'Number of tokens in the completion', + }, + total_tokens: { type: 'number', description: 'Total number of tokens used' }, + }, + }, + }, +} diff --git a/apps/sim/tools/ovhcloud/embeddings.ts b/apps/sim/tools/ovhcloud/embeddings.ts new file mode 100644 index 0000000000..67cba07f14 --- /dev/null +++ b/apps/sim/tools/ovhcloud/embeddings.ts @@ -0,0 +1,74 @@ +import type { OVHcloudEmbeddingsParams, OVHcloudEmbeddingsResponse } from '@/tools/ovhcloud/types' +import type { ToolConfig } from '@/tools/types' + +export const embeddingsTool: ToolConfig = { + id: 'ovhcloud_embeddings', + name: 'OVHcloud AI Endpoints Embeddings', + description: 'Generate embeddings using OVHcloud AI Endpoints models', + version: '1.0', + + params: { + model: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Model to use for embeddings', + }, + apiKey: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'OVHcloud AI Endpoints API key', + }, + }, + + request: { + method: 'POST', + url: () => 'https://oai.endpoints.kepler.ai.cloud.ovh.net/v1/embeddings', + headers: (params) => ({ + Authorization: `Bearer ${params.apiKey}`, + 'Content-Type': 'application/json', + }), + body: (params) => { + const body: Record = { + model: params.model, + input: params.input, + } + + return body + }, + }, + + transformResponse: async (response) => { + const data = await response.json() + return { + success: true, + output: { + embedding: data.data[0].embedding, + model: data.model, + usage: { + prompt_tokens: data.usage.prompt_tokens, + completion_tokens: data.usage.completion_tokens, + total_tokens: data.usage.total_tokens, + }, + }, + } + }, + + outputs: { + embedding: { type: 'string', description: 'Generated embeddings' }, + model: { type: 'string', description: 'Model used for generation' }, + usage: { + type: 'object', + description: 'Token usage information', + properties: { + prompt_tokens: { type: 'number', description: 'Number of tokens in the prompt' }, + completion_tokens: { + type: 'number', + description: 'Number of tokens in the completion', + }, + total_tokens: { type: 'number', description: 'Total number of tokens used' }, + }, + }, + }, +} diff --git a/apps/sim/tools/ovhcloud/index.ts b/apps/sim/tools/ovhcloud/index.ts new file mode 100644 index 0000000000..cf9391214b --- /dev/null +++ b/apps/sim/tools/ovhcloud/index.ts @@ -0,0 +1,5 @@ +import { chatTool } from '@/tools/ovhcloud/chat' +import { embeddingsTool } from '@/tools/ovhcloud/embeddings' + +export const ovhcloudChatTool = chatTool +export const ovhcloudEmbeddingsTool = embeddingsTool \ No newline at end of file diff --git a/apps/sim/tools/ovhcloud/types.ts b/apps/sim/tools/ovhcloud/types.ts new file mode 100644 index 0000000000..a6c4cafd60 --- /dev/null +++ b/apps/sim/tools/ovhcloud/types.ts @@ -0,0 +1,45 @@ +import type { ToolResponse } from '@/tools/types' + +export interface OVHcloudMessage { + role: string + content: string +} + +export interface OVHcloudChatParams { + systemPrompt?: string + content: string + model: string + max_tokens?: number + temperature?: number + apiKey: string +} + +export interface OVHcloudChatResponse extends ToolResponse { + output: { + content: string + model: string + usage: { + prompt_tokens: number + completion_tokens: number + total_tokens: number + } + } +} + +export interface OVHcloudEmbeddingsParams { + input: string + model: string + apiKey: string +} + +export interface OVHcloudEmbeddingsResponse extends ToolResponse { + output: { + embedding: number[] + model: string + usage: { + prompt_tokens: number + completion_tokens: number + total_tokens: number + } + } +} diff --git a/apps/sim/tools/registry.ts b/apps/sim/tools/registry.ts index ed28b15e1b..537c29629a 100644 --- a/apps/sim/tools/registry.ts +++ b/apps/sim/tools/registry.ts @@ -756,6 +756,7 @@ import { outlookReadTool, outlookSendTool, } from '@/tools/outlook' +import { ovhcloudChatTool, ovhcloudEmbeddingsTool } from '@/tools/ovhcloud' import { parallelDeepResearchTool, parallelExtractTool, parallelSearchTool } from '@/tools/parallel' import { perplexityChatTool, perplexitySearchTool } from '@/tools/perplexity' import { @@ -2588,4 +2589,6 @@ export const tools: Record = { spotify_set_repeat: spotifySetRepeatTool, spotify_set_shuffle: spotifySetShuffleTool, spotify_transfer_playback: spotifyTransferPlaybackTool, + ovhcloud_chat: ovhcloudChatTool, + ovhcloud_embeddings: ovhcloudEmbeddingsTool, } From f028a0b3e188337f7fb879195f7b811e94c3492e Mon Sep 17 00:00:00 2001 From: Elias TOURNEUX Date: Wed, 17 Dec 2025 14:11:14 -0500 Subject: [PATCH 2/3] Add missing input parameter and fix mismatch type --- apps/sim/tools/ovhcloud/embeddings.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/sim/tools/ovhcloud/embeddings.ts b/apps/sim/tools/ovhcloud/embeddings.ts index 67cba07f14..f22bf22cf8 100644 --- a/apps/sim/tools/ovhcloud/embeddings.ts +++ b/apps/sim/tools/ovhcloud/embeddings.ts @@ -14,6 +14,12 @@ export const embeddingsTool: ToolConfig Date: Wed, 17 Dec 2025 16:03:26 -0500 Subject: [PATCH 3/3] Add OVHcloudEmbeddingsResponse --- apps/sim/blocks/blocks/ovhcloud.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/sim/blocks/blocks/ovhcloud.ts b/apps/sim/blocks/blocks/ovhcloud.ts index 59eabfa16b..a3bb528a34 100644 --- a/apps/sim/blocks/blocks/ovhcloud.ts +++ b/apps/sim/blocks/blocks/ovhcloud.ts @@ -1,8 +1,8 @@ import { OVHcloudIcon } from '@/components/icons' import { AuthMode, type BlockConfig } from '@/blocks/types' -import type { OVHcloudChatResponse } from '@/tools/ovhcloud/types' +import type { OVHcloudChatResponse, OVHcloudEmbeddingsResponse } from '@/tools/ovhcloud/types' -type OVHcloudResponse = OVHcloudChatResponse +type OVHcloudResponse = OVHcloudChatResponse | OVHcloudEmbeddingsResponse export const OVHcloudBlock: BlockConfig = { type: 'ovhcloud',