From a47476c78d91bd50d0c8f4bee5480ca58d8a2ef5 Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Tue, 10 Jun 2025 12:04:42 -0700 Subject: [PATCH 01/11] add hugging face tool --- apps/sim/blocks/blocks/huggingface.ts | 124 +++++++++++++++++ apps/sim/blocks/registry.ts | 2 + apps/sim/components/icons.tsx | 17 +++ apps/sim/tools/huggingface/chat.ts | 184 ++++++++++++++++++++++++++ apps/sim/tools/huggingface/index.ts | 3 + apps/sim/tools/huggingface/types.ts | 29 ++++ apps/sim/tools/registry.ts | 2 + 7 files changed, 361 insertions(+) create mode 100644 apps/sim/blocks/blocks/huggingface.ts create mode 100644 apps/sim/tools/huggingface/chat.ts create mode 100644 apps/sim/tools/huggingface/index.ts create mode 100644 apps/sim/tools/huggingface/types.ts diff --git a/apps/sim/blocks/blocks/huggingface.ts b/apps/sim/blocks/blocks/huggingface.ts new file mode 100644 index 00000000000..b37dbf8cd5c --- /dev/null +++ b/apps/sim/blocks/blocks/huggingface.ts @@ -0,0 +1,124 @@ +import { HuggingFaceIcon } from '@/components/icons' +import type { HuggingFaceChatResponse } from '@/tools/huggingface/types' +import type { BlockConfig } from '../types' + +export const HuggingFaceBlock: BlockConfig = { + type: 'huggingface', + name: 'Hugging Face', + description: 'Use Hugging Face Inference API', + longDescription: + 'Generate completions using Hugging Face Inference API with access to various open-source models. Leverage cutting-edge AI models for chat completions, content generation, and AI-powered conversations with customizable parameters.', + docsLink: 'https://docs.simstudio.ai/tools/huggingface', + category: 'tools', + bgColor: '#FFD21E', // Hugging Face yellow color + icon: HuggingFaceIcon, + subBlocks: [ + { + id: 'systemPrompt', + title: 'System Prompt', + type: 'long-input', + layout: 'full', + placeholder: 'Enter system prompt to guide the model behavior...', + rows: 3, + }, + { + id: 'content', + title: 'User Prompt', + type: 'long-input', + layout: 'full', + placeholder: 'Enter your message here...', + rows: 3, + }, + { + id: 'provider', + title: 'Provider', + type: 'dropdown', + layout: 'half', + options: [ + { label: 'Novita', id: 'novita' }, + { label: 'Cerebras', id: 'cerebras' }, + { label: 'Cohere', id: 'cohere' }, + { label: 'Fal AI', id: 'fal' }, + { label: 'Fireworks', id: 'fireworks' }, + { label: 'Hyperbolic', id: 'hyperbolic' }, + { label: 'HF Inference', id: 'hf-inference' }, + { label: 'Nebius', id: 'nebius' }, + { label: 'Nscale', id: 'nscale' }, + { label: 'Replicate', id: 'replicate' }, + { label: 'SambaNova', id: 'sambanova' }, + { label: 'Together', id: 'together' }, + ], + value: () => 'novita', + }, + { + id: 'model', + title: 'Model', + type: 'short-input', + layout: 'half', + placeholder: 'e.g., deepseek/deepseek-v3-0324, llama3.1-8b, meta-llama/Llama-3.2-3B-Instruct-Turbo', + description: 'The model must be available for the selected provider.', + }, + { + id: 'temperature', + title: 'Temperature', + type: 'slider', + layout: 'half', + min: 0, + max: 2, + value: () => '0.7', + }, + { + id: 'maxTokens', + title: 'Max Tokens', + type: 'short-input', + layout: 'half', + placeholder: 'e.g., 1000', + }, + { + id: 'apiKey', + title: 'API Token', + type: 'short-input', + layout: 'full', + placeholder: 'Enter your Hugging Face API token', + password: true, + }, + ], + tools: { + access: ['huggingface_chat'], + config: { + tool: () => 'huggingface_chat', + params: (params) => { + const toolParams = { + apiKey: params.apiKey, + provider: params.provider, + model: params.model, + content: params.content, + systemPrompt: params.systemPrompt, + temperature: params.temperature ? Number.parseFloat(params.temperature) : undefined, + maxTokens: params.maxTokens ? Number.parseInt(params.maxTokens) : undefined, + stream: false, // Always false + } + + return toolParams + }, + }, + }, + inputs: { + systemPrompt: { type: 'string', required: false }, + content: { type: 'string', required: true }, + provider: { type: 'string', required: true }, + model: { type: 'string', required: true }, + temperature: { type: 'string', required: false }, + maxTokens: { type: 'string', required: false }, + apiKey: { type: 'string', required: true }, + }, + outputs: { + response: { + type: { + content: 'string', + model: 'string', + usage: 'any', + }, + }, + }, +} \ No newline at end of file diff --git a/apps/sim/blocks/registry.ts b/apps/sim/blocks/registry.ts index d758c9c6f6b..e82d2e9a4df 100644 --- a/apps/sim/blocks/registry.ts +++ b/apps/sim/blocks/registry.ts @@ -62,6 +62,7 @@ import { VisionBlock } from './blocks/vision' import { WhatsAppBlock } from './blocks/whatsapp' import { XBlock } from './blocks/x' import { YouTubeBlock } from './blocks/youtube' +import { HuggingFaceBlock } from './blocks/huggingface' import type { BlockConfig } from './types' // Registry of all available blocks, alphabetically sorted @@ -124,6 +125,7 @@ export const registry: Record = { whatsapp: WhatsAppBlock, x: XBlock, youtube: YouTubeBlock, + huggingface: HuggingFaceBlock, } // Helper functions to access the registry diff --git a/apps/sim/components/icons.tsx b/apps/sim/components/icons.tsx index 2237b27e1e9..c5f4c3d7594 100644 --- a/apps/sim/components/icons.tsx +++ b/apps/sim/components/icons.tsx @@ -2827,3 +2827,20 @@ export function PackageSearchIcon(props: SVGProps) { ) } +export function HuggingFaceIcon(props: SVGProps) { + return ( + + + + ) +} \ No newline at end of file diff --git a/apps/sim/tools/huggingface/chat.ts b/apps/sim/tools/huggingface/chat.ts new file mode 100644 index 00000000000..eadf59b442b --- /dev/null +++ b/apps/sim/tools/huggingface/chat.ts @@ -0,0 +1,184 @@ +import type { ToolConfig } from '../types' +import type { HuggingFaceChatParams, HuggingFaceChatResponse } from './types' + +export const chatTool: ToolConfig = { + id: 'huggingface_chat', + name: 'Hugging Face Chat', + description: 'Generate completions using Hugging Face Inference API', + version: '1.0', + + params: { + apiKey: { + type: 'string', + required: true, + requiredForToolCall: true, + description: 'Hugging Face API token', + }, + provider: { + type: 'string', + required: true, + description: 'The provider to use for the API request (e.g., novita, cerebras, etc.)', + }, + model: { + type: 'string', + required: true, + description: 'Model to use for chat completions (e.g., deepseek/deepseek-v3-0324)', + }, + content: { + type: 'string', + required: true, + description: 'The user message content to send to the model', + }, + systemPrompt: { + type: 'string', + required: false, + description: 'System prompt to guide the model behavior', + }, + maxTokens: { + type: 'number', + required: false, + description: 'Maximum number of tokens to generate', + }, + temperature: { + type: 'number', + required: false, + description: 'Sampling temperature (0-2). Higher values make output more random', + }, + stream: { + type: 'boolean', + required: false, + description: 'Whether to stream the response', + }, + }, + + request: { + method: 'POST', + url: (params) => { + // Provider-specific endpoint mapping + const endpointMap: Record = { + novita: '/v3/openai/chat/completions', + cerebras: '/v1/chat/completions', + cohere: '/v1/chat/completions', + fal: '/v1/chat/completions', + fireworks: '/v1/chat/completions', + hyperbolic: '/v1/chat/completions', + 'hf-inference': '/v1/chat/completions', + nebius: '/v1/chat/completions', + nscale: '/v1/chat/completions', + replicate: '/v1/chat/completions', + sambanova: '/v1/chat/completions', + together: '/v1/chat/completions', + } + + const endpoint = endpointMap[params.provider] || '/v1/chat/completions' + return `https://router.huggingface.co/${params.provider}${endpoint}` + }, + headers: (params) => ({ + Authorization: `Bearer ${params.apiKey}`, + 'Content-Type': 'application/json', + }), + body: (params) => { + const messages = [] + + // 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, + stream: params.stream || false, + } + + // Add optional parameters if provided + if (params.temperature !== undefined) { + body.temperature = Number(params.temperature) + } + + if (params.maxTokens !== undefined) { + body.max_tokens = Number(params.maxTokens) + } + + return body + }, + }, + + transformResponse: async (response, params) => { + try { + // Check if the response was successful + if (!response.ok) { + const errorData = await response.json().catch(() => null) + console.error('Hugging Face API error:', { + status: response.status, + statusText: response.statusText, + errorData, + url: response.url, + }) + + const errorMessage = errorData + ? `API error: ${response.status} ${response.statusText} - ${JSON.stringify(errorData)}` + : `API error: ${response.status} ${response.statusText}` + + throw new Error(errorMessage) + } + + const data = await response.json() + + // Validate response structure + if (!data.choices || !data.choices[0] || !data.choices[0].message) { + console.error('Invalid Hugging Face response format:', data) + throw new Error('Invalid response format from Hugging Face API') + } + + return { + success: true, + output: { + content: data.choices[0].message.content, + model: data.model || params?.model || 'unknown', + usage: data.usage + ? { + prompt_tokens: data.usage.prompt_tokens || 0, + completion_tokens: data.usage.completion_tokens || 0, + total_tokens: data.usage.total_tokens || 0, + } + : undefined, + }, + } + } catch (error: any) { + console.error('Failed to process Hugging Face response:', error) + throw error + } + }, + + transformError: (error) => { + let errorMessage = 'Unknown error occurred' + + if (error) { + if (typeof error === 'string') { + errorMessage = error + } else if (error.message) { + errorMessage = error.message + } else if (error.error) { + errorMessage = error.error + } else { + try { + errorMessage = JSON.stringify(error) + } catch (e) { + errorMessage = 'Error occurred but could not be serialized' + } + } + } + + return `Hugging Face chat completion failed: ${errorMessage}` + }, +} \ No newline at end of file diff --git a/apps/sim/tools/huggingface/index.ts b/apps/sim/tools/huggingface/index.ts new file mode 100644 index 00000000000..d8ed4dc89b3 --- /dev/null +++ b/apps/sim/tools/huggingface/index.ts @@ -0,0 +1,3 @@ +import { chatTool } from './chat' + +export const huggingfaceChatTool = chatTool \ No newline at end of file diff --git a/apps/sim/tools/huggingface/types.ts b/apps/sim/tools/huggingface/types.ts new file mode 100644 index 00000000000..a3e364cb3df --- /dev/null +++ b/apps/sim/tools/huggingface/types.ts @@ -0,0 +1,29 @@ +import type { ToolResponse } from '../types' + +export interface HuggingFaceMessage { + role: 'user' | 'assistant' | 'system' + content: string +} + +export interface HuggingFaceChatParams { + apiKey: string + provider: string + model: string + content: string + systemPrompt?: string + maxTokens?: number + temperature?: number + stream?: boolean +} + +export interface HuggingFaceChatResponse extends ToolResponse { + output: { + content: string + model: string + usage?: { + prompt_tokens: number + completion_tokens: number + total_tokens: number + } + } +} \ No newline at end of file diff --git a/apps/sim/tools/registry.ts b/apps/sim/tools/registry.ts index 00bd7aed5f5..099d5317157 100644 --- a/apps/sim/tools/registry.ts +++ b/apps/sim/tools/registry.ts @@ -97,6 +97,7 @@ import { visionTool } from './vision' import { whatsappSendMessageTool } from './whatsapp' import { xReadTool, xSearchTool, xUserTool, xWriteTool } from './x' import { youtubeSearchTool } from './youtube' +import { huggingfaceChatTool } from './huggingface' // Registry of all available tools export const tools: Record = { @@ -214,4 +215,5 @@ export const tools: Record = { google_calendar_list: googleCalendarListTool, google_calendar_quick_add: googleCalendarQuickAddTool, google_calendar_invite: googleCalendarInviteTool, + huggingface_chat: huggingfaceChatTool, } From c7c7a1a60a07a3e8adde0d5265082e05d692323d Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Tue, 10 Jun 2025 12:37:30 -0700 Subject: [PATCH 02/11] docs: add Hugging Face tool documentation --- apps/docs/content/docs/tools/huggingface.mdx | 87 ++++++++++++++++++++ apps/docs/content/docs/tools/meta.json | 3 +- 2 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 apps/docs/content/docs/tools/huggingface.mdx diff --git a/apps/docs/content/docs/tools/huggingface.mdx b/apps/docs/content/docs/tools/huggingface.mdx new file mode 100644 index 00000000000..27de8844a5c --- /dev/null +++ b/apps/docs/content/docs/tools/huggingface.mdx @@ -0,0 +1,87 @@ +--- +title: Hugging Face +description: Use Hugging Face Inference API +--- + +import { BlockInfoCard } from "@/components/ui/block-info-card" + + + + `} +/> + +## Usage Instructions + +Generate completions using Hugging Face Inference API with access to various open-source models. Leverage cutting-edge AI models for chat completions, content generation, and AI-powered conversations with customizable parameters. + + + +## Tools + +### `huggingface_chat` + +Generate completions using Hugging Face Inference API + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `apiKey` | string | Yes | Hugging Face API token | +| `provider` | string | Yes | The provider to use for the API request \(e.g., novita, cerebras, etc.\) | +| `model` | string | Yes | Model to use for chat completions \(e.g., deepseek/deepseek-v3-0324\) | +| `content` | string | Yes | The user message content to send to the model | +| `systemPrompt` | string | No | System prompt to guide the model behavior | +| `maxTokens` | number | No | Maximum number of tokens to generate | +| `temperature` | number | No | Sampling temperature \(0-2\). Higher values make output more random | +| `stream` | boolean | No | Whether to stream the response | + +#### Output + +| Parameter | Type | +| --------- | ---- | +| `content` | string | +| `model` | string | +| `usage` | string | +| `completion_tokens` | string | +| `total_tokens` | string | + + + +## Block Configuration + +### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `systemPrompt` | string | No | System Prompt - Enter system prompt to guide the model behavior... | + + + +### Outputs + +| Output | Type | Description | +| ------ | ---- | ----------- | +| `response` | object | Output from response | +| โ†ณ `content` | string | content of the response | +| โ†ณ `model` | string | model of the response | +| โ†ณ `usage` | any | usage of the response | + + +## Notes + +- Category: `tools` +- Type: `huggingface` diff --git a/apps/docs/content/docs/tools/meta.json b/apps/docs/content/docs/tools/meta.json index 380fb990b8d..8eeae11157e 100644 --- a/apps/docs/content/docs/tools/meta.json +++ b/apps/docs/content/docs/tools/meta.json @@ -19,6 +19,7 @@ "google_search", "google_sheets", "guesty", + "huggingface", "image_generator", "jina", "jira", @@ -53,4 +54,4 @@ "x", "youtube" ] -} +} \ No newline at end of file From 887a04f11e8056a442f542682ac60314d472dda2 Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Tue, 10 Jun 2025 12:39:40 -0700 Subject: [PATCH 03/11] fix: format and lint Hugging Face integration files --- apps/docs/content/docs/tools/meta.json | 2 +- apps/sim/blocks/blocks/huggingface.ts | 5 +++-- apps/sim/blocks/registry.ts | 2 +- apps/sim/components/icons.tsx | 2 +- apps/sim/tools/huggingface/chat.ts | 10 +++++----- apps/sim/tools/huggingface/index.ts | 2 +- apps/sim/tools/huggingface/types.ts | 2 +- apps/sim/tools/registry.ts | 2 +- 8 files changed, 14 insertions(+), 13 deletions(-) diff --git a/apps/docs/content/docs/tools/meta.json b/apps/docs/content/docs/tools/meta.json index 8eeae11157e..80332879640 100644 --- a/apps/docs/content/docs/tools/meta.json +++ b/apps/docs/content/docs/tools/meta.json @@ -54,4 +54,4 @@ "x", "youtube" ] -} \ No newline at end of file +} diff --git a/apps/sim/blocks/blocks/huggingface.ts b/apps/sim/blocks/blocks/huggingface.ts index b37dbf8cd5c..a7758fd7c59 100644 --- a/apps/sim/blocks/blocks/huggingface.ts +++ b/apps/sim/blocks/blocks/huggingface.ts @@ -55,7 +55,8 @@ export const HuggingFaceBlock: BlockConfig = { title: 'Model', type: 'short-input', layout: 'half', - placeholder: 'e.g., deepseek/deepseek-v3-0324, llama3.1-8b, meta-llama/Llama-3.2-3B-Instruct-Turbo', + placeholder: + 'e.g., deepseek/deepseek-v3-0324, llama3.1-8b, meta-llama/Llama-3.2-3B-Instruct-Turbo', description: 'The model must be available for the selected provider.', }, { @@ -121,4 +122,4 @@ export const HuggingFaceBlock: BlockConfig = { }, }, }, -} \ No newline at end of file +} diff --git a/apps/sim/blocks/registry.ts b/apps/sim/blocks/registry.ts index e82d2e9a4df..aab7f1419f9 100644 --- a/apps/sim/blocks/registry.ts +++ b/apps/sim/blocks/registry.ts @@ -25,6 +25,7 @@ import { GoogleCalendarBlock } from './blocks/google_calendar' import { GoogleDocsBlock } from './blocks/google_docs' import { GoogleDriveBlock } from './blocks/google_drive' import { GoogleSheetsBlock } from './blocks/google_sheets' +import { HuggingFaceBlock } from './blocks/huggingface' // import { GuestyBlock } from './blocks/guesty' import { ImageGeneratorBlock } from './blocks/image_generator' import { JinaBlock } from './blocks/jina' @@ -62,7 +63,6 @@ import { VisionBlock } from './blocks/vision' import { WhatsAppBlock } from './blocks/whatsapp' import { XBlock } from './blocks/x' import { YouTubeBlock } from './blocks/youtube' -import { HuggingFaceBlock } from './blocks/huggingface' import type { BlockConfig } from './types' // Registry of all available blocks, alphabetically sorted diff --git a/apps/sim/components/icons.tsx b/apps/sim/components/icons.tsx index c5f4c3d7594..77759430b7f 100644 --- a/apps/sim/components/icons.tsx +++ b/apps/sim/components/icons.tsx @@ -2843,4 +2843,4 @@ export function HuggingFaceIcon(props: SVGProps) { /> ) -} \ No newline at end of file +} diff --git a/apps/sim/tools/huggingface/chat.ts b/apps/sim/tools/huggingface/chat.ts index eadf59b442b..650edcd9bb0 100644 --- a/apps/sim/tools/huggingface/chat.ts +++ b/apps/sim/tools/huggingface/chat.ts @@ -79,7 +79,7 @@ export const chatTool: ToolConfig { const messages = [] - + // Add system prompt if provided if (params.systemPrompt) { messages.push({ @@ -87,7 +87,7 @@ export const chatTool: ToolConfig { let errorMessage = 'Unknown error occurred' - + if (error) { if (typeof error === 'string') { errorMessage = error @@ -178,7 +178,7 @@ export const chatTool: ToolConfig = { From 5c28a4f707f37dbe47373f21fb67b84262607700 Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Tue, 10 Jun 2025 12:46:21 -0700 Subject: [PATCH 04/11] docs: add manual intro section to Hugging Face documentation --- apps/docs/content/docs/tools/huggingface.mdx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/apps/docs/content/docs/tools/huggingface.mdx b/apps/docs/content/docs/tools/huggingface.mdx index 27de8844a5c..75ab643d055 100644 --- a/apps/docs/content/docs/tools/huggingface.mdx +++ b/apps/docs/content/docs/tools/huggingface.mdx @@ -24,6 +24,23 @@ import { BlockInfoCard } from "@/components/ui/block-info-card" `} /> +{/* MANUAL-CONTENT-START:intro */} +[Hugging Face](https://huggingface.co/) is the leading platform for open-source AI models, providing access to thousands of state-of-the-art machine learning models. This integration allows you to use Hugging Face's Inference API to generate chat completions and content using various AI providers and models. + +## Key Features + +- **12 Inference Providers** - Access models through Novita, Cerebras, Cohere, Together, and 8 other providers + +## Getting Started + +1. Get your API key from [huggingface.co/settings/tokens](https://huggingface.co/settings/tokens) +2. Choose a provider (e.g., "novita", "cerebras", "together") +3. Specify a model that's available for your provider +4. Add your prompts and generate content + +๐Ÿ’ก **Tip**: Different providers offer different models. Make sure the model you specify is supported by your selected provider. +{/* MANUAL-CONTENT-END:intro */} + ## Usage Instructions Generate completions using Hugging Face Inference API with access to various open-source models. Leverage cutting-edge AI models for chat completions, content generation, and AI-powered conversations with customizable parameters. From 0d81f906ba6da01cc28576f4a080b65f6fde9414 Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Tue, 10 Jun 2025 13:03:53 -0700 Subject: [PATCH 05/11] feat: replace Record with proper HuggingFaceRequestBody interface --- .../content/docs/tools/google_calendar.mdx | 34 +++++- apps/docs/content/docs/tools/huggingface.mdx | 19 +--- apps/docs/content/docs/tools/knowledge.mdx | 33 +++++- apps/sim/blocks/blocks/huggingface.ts | 2 +- apps/sim/tools/huggingface/chat.ts | 17 ++- apps/sim/tools/huggingface/types.ts | 20 +++- apps/sim/tools/registry.ts | 2 +- docker-compose.temp.yml | 55 +++++++++ docker/dev.Dockerfile | 30 +++++ rebuild-local.sh | 107 ++++++++++++++++++ 10 files changed, 286 insertions(+), 33 deletions(-) create mode 100644 docker-compose.temp.yml create mode 100644 docker/dev.Dockerfile create mode 100755 rebuild-local.sh diff --git a/apps/docs/content/docs/tools/google_calendar.mdx b/apps/docs/content/docs/tools/google_calendar.mdx index e539292d929..1bac14004d0 100644 --- a/apps/docs/content/docs/tools/google_calendar.mdx +++ b/apps/docs/content/docs/tools/google_calendar.mdx @@ -90,7 +90,7 @@ In Sim Studio, the Google Calendar integration enables your agents to programmat ## Usage Instructions -Integrate Google Calendar functionality to create, read, update, and list calendar events within your workflow. Automate scheduling, check availability, and manage events using OAuth authentication. +Integrate Google Calendar functionality to create, read, update, and list calendar events within your workflow. Automate scheduling, check availability, and manage events using OAuth authentication. Email invitations are sent asynchronously and delivery depends on recipients @@ -180,6 +180,38 @@ Create events from natural language text | --------- | ---- | | `content` | string | +### `google_calendar_invite` + +Invite attendees to an existing Google Calendar event + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `accessToken` | string | Yes | Access token for Google Calendar API | +| `calendarId` | string | No | Calendar ID \(defaults to primary\) | +| `eventId` | string | Yes | Event ID to invite attendees to | +| `attendees` | array | Yes | Array of attendee email addresses to invite | +| `sendUpdates` | string | No | How to send updates to attendees: all, externalOnly, or none | +| `replaceExisting` | boolean | No | Whether to replace existing attendees or add to them \(defaults to false\) | + +#### Output + +| Parameter | Type | +| --------- | ---- | +| `metadata` | string | +| `htmlLink` | string | +| `status` | string | +| `summary` | string | +| `description` | string | +| `location` | string | +| `start` | string | +| `end` | string | +| `attendees` | string | +| `creator` | string | +| `organizer` | string | +| `content` | string | + ## Block Configuration diff --git a/apps/docs/content/docs/tools/huggingface.mdx b/apps/docs/content/docs/tools/huggingface.mdx index 75ab643d055..6e17237c5ef 100644 --- a/apps/docs/content/docs/tools/huggingface.mdx +++ b/apps/docs/content/docs/tools/huggingface.mdx @@ -24,23 +24,6 @@ import { BlockInfoCard } from "@/components/ui/block-info-card" `} /> -{/* MANUAL-CONTENT-START:intro */} -[Hugging Face](https://huggingface.co/) is the leading platform for open-source AI models, providing access to thousands of state-of-the-art machine learning models. This integration allows you to use Hugging Face's Inference API to generate chat completions and content using various AI providers and models. - -## Key Features - -- **12 Inference Providers** - Access models through Novita, Cerebras, Cohere, Together, and 8 other providers - -## Getting Started - -1. Get your API key from [huggingface.co/settings/tokens](https://huggingface.co/settings/tokens) -2. Choose a provider (e.g., "novita", "cerebras", "together") -3. Specify a model that's available for your provider -4. Add your prompts and generate content - -๐Ÿ’ก **Tip**: Different providers offer different models. Make sure the model you specify is supported by your selected provider. -{/* MANUAL-CONTENT-END:intro */} - ## Usage Instructions Generate completions using Hugging Face Inference API with access to various open-source models. Leverage cutting-edge AI models for chat completions, content generation, and AI-powered conversations with customizable parameters. @@ -95,7 +78,7 @@ Generate completions using Hugging Face Inference API | `response` | object | Output from response | | โ†ณ `content` | string | content of the response | | โ†ณ `model` | string | model of the response | -| โ†ณ `usage` | any | usage of the response | +| โ†ณ `usage` | json | usage of the response | ## Notes diff --git a/apps/docs/content/docs/tools/knowledge.mdx b/apps/docs/content/docs/tools/knowledge.mdx index 5da46bc00b6..c999f3a1713 100644 --- a/apps/docs/content/docs/tools/knowledge.mdx +++ b/apps/docs/content/docs/tools/knowledge.mdx @@ -1,6 +1,6 @@ --- title: Knowledge -description: Search knowledge +description: Use vector search --- import { BlockInfoCard } from "@/components/ui/block-info-card" @@ -49,7 +49,7 @@ In Sim Studio, the Knowledge Base block enables your agents to perform intellige ## Usage Instructions -Perform semantic vector search across your knowledge base to find the most relevant content. Uses advanced AI embeddings to understand meaning and context, returning the most similar documents to your search query. +Perform semantic vector search across your knowledge base or upload new chunks to documents. Uses advanced AI embeddings to understand meaning and context for search operations. @@ -78,6 +78,31 @@ Search for similar content in a knowledge base using vector similarity | `totalResults` | string | | `message` | string | +### `knowledge_upload_chunk` + +Upload a new chunk to a document in a knowledge base + +#### Input + +| Parameter | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `knowledgeBaseId` | string | Yes | ID of the knowledge base containing the document | +| `documentId` | string | Yes | ID of the document to upload the chunk to | +| `content` | string | Yes | Content of the chunk to upload | + +#### Output + +| Parameter | Type | +| --------- | ---- | +| `data` | string | +| `chunkIndex` | string | +| `content` | string | +| `contentLength` | string | +| `tokenCount` | string | +| `enabled` | string | +| `createdAt` | string | +| `updatedAt` | string | + ## Block Configuration @@ -86,7 +111,7 @@ Search for similar content in a knowledge base using vector similarity | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | -| `knowledgeBaseId` | string | Yes | Knowledge Base - Select knowledge base | +| `operation` | string | Yes | Operation | @@ -101,6 +126,8 @@ Search for similar content in a knowledge base using vector similarity | โ†ณ `topK` | number | topK of the response | | โ†ณ `totalResults` | number | totalResults of the response | | โ†ณ `message` | string | message of the response | +| โ†ณ `success` | boolean | success of the response | +| โ†ณ `data` | json | data of the response | ## Notes diff --git a/apps/sim/blocks/blocks/huggingface.ts b/apps/sim/blocks/blocks/huggingface.ts index a7758fd7c59..a80a0e4fbdf 100644 --- a/apps/sim/blocks/blocks/huggingface.ts +++ b/apps/sim/blocks/blocks/huggingface.ts @@ -118,7 +118,7 @@ export const HuggingFaceBlock: BlockConfig = { type: { content: 'string', model: 'string', - usage: 'any', + usage: 'json', }, }, }, diff --git a/apps/sim/tools/huggingface/chat.ts b/apps/sim/tools/huggingface/chat.ts index 650edcd9bb0..82438a4b12b 100644 --- a/apps/sim/tools/huggingface/chat.ts +++ b/apps/sim/tools/huggingface/chat.ts @@ -1,5 +1,10 @@ import type { ToolConfig } from '../types' -import type { HuggingFaceChatParams, HuggingFaceChatResponse } from './types' +import type { + HuggingFaceChatParams, + HuggingFaceChatResponse, + HuggingFaceMessage, + HuggingFaceRequestBody, +} from './types' export const chatTool: ToolConfig = { id: 'huggingface_chat', @@ -78,7 +83,7 @@ export const chatTool: ToolConfig { - const messages = [] + const messages: HuggingFaceMessage[] = [] // Add system prompt if provided if (params.systemPrompt) { @@ -94,7 +99,7 @@ export const chatTool: ToolConfig = { + const body: HuggingFaceRequestBody = { model: params.model, messages: messages, stream: params.stream || false, @@ -151,7 +156,11 @@ export const chatTool: ToolConfig = { autoblocks_prompt_manager: autoblocksPromptManagerTool, openai_embeddings: openAIEmbeddings, http_request: httpRequest, + huggingface_chat: huggingfaceChatTool, hubspot_contacts: hubspotContacts, salesforce_opportunities: salesforceOpportunities, function_execute: functionExecuteTool, @@ -215,5 +216,4 @@ export const tools: Record = { google_calendar_list: googleCalendarListTool, google_calendar_quick_add: googleCalendarQuickAddTool, google_calendar_invite: googleCalendarInviteTool, - huggingface_chat: huggingfaceChatTool, } diff --git a/docker-compose.temp.yml b/docker-compose.temp.yml new file mode 100644 index 00000000000..683df874e2b --- /dev/null +++ b/docker-compose.temp.yml @@ -0,0 +1,55 @@ +services: + simstudio: + image: simstudio-dev:latest + restart: unless-stopped + ports: + - '3000:3000' + volumes: + - ./apps/sim:/app/apps/sim + - ./packages:/app/packages + deploy: + resources: + limits: + memory: 8G + environment: + - DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio + - BETTER_AUTH_URL=http://localhost:3000 + - NEXT_PUBLIC_APP_URL=http://localhost:3000 + - BETTER_AUTH_SECRET=your_auth_secret_here + - ENCRYPTION_KEY=your_encryption_key_here + - FREESTYLE_API_KEY=placeholder + - GOOGLE_CLIENT_ID=placeholder + - GOOGLE_CLIENT_SECRET=placeholder + - GITHUB_CLIENT_ID=placeholder + - GITHUB_CLIENT_SECRET=placeholder + - RESEND_API_KEY=placeholder + - OLLAMA_URL=http://localhost:11434 + depends_on: + db: + condition: service_healthy + healthcheck: + test: ['CMD', 'wget', '--spider', '--quiet', 'http://127.0.0.1:3000'] + interval: 90s + timeout: 5s + retries: 3 + start_period: 30s + + db: + image: pgvector/pgvector:pg17 + restart: unless-stopped + ports: + - '5432:5432' + environment: + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=postgres + - POSTGRES_DB=simstudio + volumes: + - postgres_data:/var/lib/postgresql/data + healthcheck: + test: ['CMD-SHELL', 'pg_isready -U postgres'] + interval: 5s + timeout: 5s + retries: 5 + +volumes: + postgres_data: diff --git a/docker/dev.Dockerfile b/docker/dev.Dockerfile new file mode 100644 index 00000000000..a3d16b57d07 --- /dev/null +++ b/docker/dev.Dockerfile @@ -0,0 +1,30 @@ +FROM oven/bun:alpine AS base + +WORKDIR /app + +# Install dependencies +COPY package.json bun.lock ./ +RUN mkdir -p apps +COPY apps/sim/package.json ./apps/sim/package.json + +# Install all dependencies (including dev dependencies for development) +RUN bun install + +# Copy source code +COPY . . + +# Install sharp for Next.js image optimization +WORKDIR /app/apps/sim +RUN bun install sharp + +# Set development environment +ENV NODE_ENV=development +ENV NEXT_TELEMETRY_DISABLED=1 +ENV VERCEL_TELEMETRY_DISABLED=1 + +# Expose port +EXPOSE 3000 + +# Go back to root and start development server +WORKDIR /app +CMD ["bun", "run", "dev"] \ No newline at end of file diff --git a/rebuild-local.sh b/rebuild-local.sh new file mode 100755 index 00000000000..49ec8475c4b --- /dev/null +++ b/rebuild-local.sh @@ -0,0 +1,107 @@ +#!/bin/bash + +echo "๐Ÿ”„ Building local development version with your changes..." + +# Stop current containers +docker-compose -f docker-compose.prod.yml down +docker-compose -f docker-compose.temp.yml down 2>/dev/null || true + +# Clean up Docker to prevent layer corruption issues +echo "๐Ÿงน Cleaning up Docker cache to prevent build issues..." +docker builder prune -f +docker system prune -f + +# Remove any existing dev image to force fresh build +docker rmi simstudio-dev:latest 2>/dev/null || true + +# Build local development image with no cache to avoid corruption +echo "๐Ÿ“ฆ Building development image (this may take a few minutes)..." +if ! docker build --no-cache -f docker/dev.Dockerfile -t simstudio-dev:latest .; then + echo "โŒ Build failed! Trying with different approach..." + echo "๐Ÿ”ง Attempting to fix Docker build environment..." + + # More aggressive cleanup + docker system prune -a -f + docker builder prune -a -f + + # Try again with no cache + if ! docker build --no-cache -f docker/dev.Dockerfile -t simstudio-dev:latest .; then + echo "โŒ Build still failing. This might be a Docker Desktop issue." + echo "๐Ÿ’ก Try restarting Docker Desktop and run this script again." + echo "๐Ÿ’ก Or increase Docker Desktop memory to 8GB+ in Settings โ†’ Resources" + exit 1 + fi +fi + +# Create temporary docker-compose file with local development image +cat > docker-compose.temp.yml << EOF +services: + simstudio: + image: simstudio-dev:latest + restart: unless-stopped + ports: + - '3000:3000' + volumes: + - ./apps/sim:/app/apps/sim + - ./packages:/app/packages + deploy: + resources: + limits: + memory: 8G + environment: + - DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio + - BETTER_AUTH_URL=http://localhost:3000 + - NEXT_PUBLIC_APP_URL=http://localhost:3000 + - BETTER_AUTH_SECRET=your_auth_secret_here + - ENCRYPTION_KEY=your_encryption_key_here + - FREESTYLE_API_KEY=placeholder + - GOOGLE_CLIENT_ID=placeholder + - GOOGLE_CLIENT_SECRET=placeholder + - GITHUB_CLIENT_ID=placeholder + - GITHUB_CLIENT_SECRET=placeholder + - RESEND_API_KEY=placeholder + - OLLAMA_URL=http://localhost:11434 + depends_on: + db: + condition: service_healthy + healthcheck: + test: ['CMD', 'wget', '--spider', '--quiet', 'http://127.0.0.1:3000'] + interval: 90s + timeout: 5s + retries: 3 + start_period: 30s + + db: + image: pgvector/pgvector:pg17 + restart: unless-stopped + ports: + - '5432:5432' + environment: + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=postgres + - POSTGRES_DB=simstudio + volumes: + - postgres_data:/var/lib/postgresql/data + healthcheck: + test: ['CMD-SHELL', 'pg_isready -U postgres'] + interval: 5s + timeout: 5s + retries: 5 + +volumes: + postgres_data: +EOF + +# Start with local development image +echo "๐Ÿš€ Starting development environment..." +if docker-compose -f docker-compose.temp.yml up -d; then + echo "โœ… Development version running at http://localhost:3000" + echo "๐Ÿ”ฅ Changes to files will be reflected automatically with hot reload!" + echo "" + echo "๐Ÿ’ก To see logs: docker-compose -f docker-compose.temp.yml logs -f simstudio" + echo "๐Ÿ’ก To stop: docker-compose -f docker-compose.temp.yml down" + echo "๐Ÿ’ก To go back to production: docker-compose -f docker-compose.prod.yml up -d" +else + echo "โŒ Failed to start containers!" + exit 1 +fi \ No newline at end of file From 8dc4e8b589e862fb826fab1c771d1ba4546886c9 Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Tue, 10 Jun 2025 13:46:56 -0700 Subject: [PATCH 06/11] accidental local files added --- docker-compose.temp.yml | 55 --------------------- docker/dev.Dockerfile | 30 ----------- rebuild-local.sh | 107 ---------------------------------------- 3 files changed, 192 deletions(-) delete mode 100644 docker-compose.temp.yml delete mode 100644 docker/dev.Dockerfile delete mode 100755 rebuild-local.sh diff --git a/docker-compose.temp.yml b/docker-compose.temp.yml deleted file mode 100644 index 683df874e2b..00000000000 --- a/docker-compose.temp.yml +++ /dev/null @@ -1,55 +0,0 @@ -services: - simstudio: - image: simstudio-dev:latest - restart: unless-stopped - ports: - - '3000:3000' - volumes: - - ./apps/sim:/app/apps/sim - - ./packages:/app/packages - deploy: - resources: - limits: - memory: 8G - environment: - - DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio - - BETTER_AUTH_URL=http://localhost:3000 - - NEXT_PUBLIC_APP_URL=http://localhost:3000 - - BETTER_AUTH_SECRET=your_auth_secret_here - - ENCRYPTION_KEY=your_encryption_key_here - - FREESTYLE_API_KEY=placeholder - - GOOGLE_CLIENT_ID=placeholder - - GOOGLE_CLIENT_SECRET=placeholder - - GITHUB_CLIENT_ID=placeholder - - GITHUB_CLIENT_SECRET=placeholder - - RESEND_API_KEY=placeholder - - OLLAMA_URL=http://localhost:11434 - depends_on: - db: - condition: service_healthy - healthcheck: - test: ['CMD', 'wget', '--spider', '--quiet', 'http://127.0.0.1:3000'] - interval: 90s - timeout: 5s - retries: 3 - start_period: 30s - - db: - image: pgvector/pgvector:pg17 - restart: unless-stopped - ports: - - '5432:5432' - environment: - - POSTGRES_USER=postgres - - POSTGRES_PASSWORD=postgres - - POSTGRES_DB=simstudio - volumes: - - postgres_data:/var/lib/postgresql/data - healthcheck: - test: ['CMD-SHELL', 'pg_isready -U postgres'] - interval: 5s - timeout: 5s - retries: 5 - -volumes: - postgres_data: diff --git a/docker/dev.Dockerfile b/docker/dev.Dockerfile deleted file mode 100644 index a3d16b57d07..00000000000 --- a/docker/dev.Dockerfile +++ /dev/null @@ -1,30 +0,0 @@ -FROM oven/bun:alpine AS base - -WORKDIR /app - -# Install dependencies -COPY package.json bun.lock ./ -RUN mkdir -p apps -COPY apps/sim/package.json ./apps/sim/package.json - -# Install all dependencies (including dev dependencies for development) -RUN bun install - -# Copy source code -COPY . . - -# Install sharp for Next.js image optimization -WORKDIR /app/apps/sim -RUN bun install sharp - -# Set development environment -ENV NODE_ENV=development -ENV NEXT_TELEMETRY_DISABLED=1 -ENV VERCEL_TELEMETRY_DISABLED=1 - -# Expose port -EXPOSE 3000 - -# Go back to root and start development server -WORKDIR /app -CMD ["bun", "run", "dev"] \ No newline at end of file diff --git a/rebuild-local.sh b/rebuild-local.sh deleted file mode 100755 index 49ec8475c4b..00000000000 --- a/rebuild-local.sh +++ /dev/null @@ -1,107 +0,0 @@ -#!/bin/bash - -echo "๐Ÿ”„ Building local development version with your changes..." - -# Stop current containers -docker-compose -f docker-compose.prod.yml down -docker-compose -f docker-compose.temp.yml down 2>/dev/null || true - -# Clean up Docker to prevent layer corruption issues -echo "๐Ÿงน Cleaning up Docker cache to prevent build issues..." -docker builder prune -f -docker system prune -f - -# Remove any existing dev image to force fresh build -docker rmi simstudio-dev:latest 2>/dev/null || true - -# Build local development image with no cache to avoid corruption -echo "๐Ÿ“ฆ Building development image (this may take a few minutes)..." -if ! docker build --no-cache -f docker/dev.Dockerfile -t simstudio-dev:latest .; then - echo "โŒ Build failed! Trying with different approach..." - echo "๐Ÿ”ง Attempting to fix Docker build environment..." - - # More aggressive cleanup - docker system prune -a -f - docker builder prune -a -f - - # Try again with no cache - if ! docker build --no-cache -f docker/dev.Dockerfile -t simstudio-dev:latest .; then - echo "โŒ Build still failing. This might be a Docker Desktop issue." - echo "๐Ÿ’ก Try restarting Docker Desktop and run this script again." - echo "๐Ÿ’ก Or increase Docker Desktop memory to 8GB+ in Settings โ†’ Resources" - exit 1 - fi -fi - -# Create temporary docker-compose file with local development image -cat > docker-compose.temp.yml << EOF -services: - simstudio: - image: simstudio-dev:latest - restart: unless-stopped - ports: - - '3000:3000' - volumes: - - ./apps/sim:/app/apps/sim - - ./packages:/app/packages - deploy: - resources: - limits: - memory: 8G - environment: - - DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio - - BETTER_AUTH_URL=http://localhost:3000 - - NEXT_PUBLIC_APP_URL=http://localhost:3000 - - BETTER_AUTH_SECRET=your_auth_secret_here - - ENCRYPTION_KEY=your_encryption_key_here - - FREESTYLE_API_KEY=placeholder - - GOOGLE_CLIENT_ID=placeholder - - GOOGLE_CLIENT_SECRET=placeholder - - GITHUB_CLIENT_ID=placeholder - - GITHUB_CLIENT_SECRET=placeholder - - RESEND_API_KEY=placeholder - - OLLAMA_URL=http://localhost:11434 - depends_on: - db: - condition: service_healthy - healthcheck: - test: ['CMD', 'wget', '--spider', '--quiet', 'http://127.0.0.1:3000'] - interval: 90s - timeout: 5s - retries: 3 - start_period: 30s - - db: - image: pgvector/pgvector:pg17 - restart: unless-stopped - ports: - - '5432:5432' - environment: - - POSTGRES_USER=postgres - - POSTGRES_PASSWORD=postgres - - POSTGRES_DB=simstudio - volumes: - - postgres_data:/var/lib/postgresql/data - healthcheck: - test: ['CMD-SHELL', 'pg_isready -U postgres'] - interval: 5s - timeout: 5s - retries: 5 - -volumes: - postgres_data: -EOF - -# Start with local development image -echo "๐Ÿš€ Starting development environment..." -if docker-compose -f docker-compose.temp.yml up -d; then - echo "โœ… Development version running at http://localhost:3000" - echo "๐Ÿ”ฅ Changes to files will be reflected automatically with hot reload!" - echo "" - echo "๐Ÿ’ก To see logs: docker-compose -f docker-compose.temp.yml logs -f simstudio" - echo "๐Ÿ’ก To stop: docker-compose -f docker-compose.temp.yml down" - echo "๐Ÿ’ก To go back to production: docker-compose -f docker-compose.prod.yml up -d" -else - echo "โŒ Failed to start containers!" - exit 1 -fi \ No newline at end of file From d4b178ca0d2ce1f87531a83be0bc03af923d73b0 Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Tue, 10 Jun 2025 13:49:00 -0700 Subject: [PATCH 07/11] restore some docs --- .../content/docs/tools/google_calendar.mdx | 34 +------------------ apps/docs/content/docs/tools/knowledge.mdx | 33 ++---------------- 2 files changed, 4 insertions(+), 63 deletions(-) diff --git a/apps/docs/content/docs/tools/google_calendar.mdx b/apps/docs/content/docs/tools/google_calendar.mdx index 1bac14004d0..e539292d929 100644 --- a/apps/docs/content/docs/tools/google_calendar.mdx +++ b/apps/docs/content/docs/tools/google_calendar.mdx @@ -90,7 +90,7 @@ In Sim Studio, the Google Calendar integration enables your agents to programmat ## Usage Instructions -Integrate Google Calendar functionality to create, read, update, and list calendar events within your workflow. Automate scheduling, check availability, and manage events using OAuth authentication. Email invitations are sent asynchronously and delivery depends on recipients +Integrate Google Calendar functionality to create, read, update, and list calendar events within your workflow. Automate scheduling, check availability, and manage events using OAuth authentication. @@ -180,38 +180,6 @@ Create events from natural language text | --------- | ---- | | `content` | string | -### `google_calendar_invite` - -Invite attendees to an existing Google Calendar event - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `accessToken` | string | Yes | Access token for Google Calendar API | -| `calendarId` | string | No | Calendar ID \(defaults to primary\) | -| `eventId` | string | Yes | Event ID to invite attendees to | -| `attendees` | array | Yes | Array of attendee email addresses to invite | -| `sendUpdates` | string | No | How to send updates to attendees: all, externalOnly, or none | -| `replaceExisting` | boolean | No | Whether to replace existing attendees or add to them \(defaults to false\) | - -#### Output - -| Parameter | Type | -| --------- | ---- | -| `metadata` | string | -| `htmlLink` | string | -| `status` | string | -| `summary` | string | -| `description` | string | -| `location` | string | -| `start` | string | -| `end` | string | -| `attendees` | string | -| `creator` | string | -| `organizer` | string | -| `content` | string | - ## Block Configuration diff --git a/apps/docs/content/docs/tools/knowledge.mdx b/apps/docs/content/docs/tools/knowledge.mdx index c999f3a1713..5da46bc00b6 100644 --- a/apps/docs/content/docs/tools/knowledge.mdx +++ b/apps/docs/content/docs/tools/knowledge.mdx @@ -1,6 +1,6 @@ --- title: Knowledge -description: Use vector search +description: Search knowledge --- import { BlockInfoCard } from "@/components/ui/block-info-card" @@ -49,7 +49,7 @@ In Sim Studio, the Knowledge Base block enables your agents to perform intellige ## Usage Instructions -Perform semantic vector search across your knowledge base or upload new chunks to documents. Uses advanced AI embeddings to understand meaning and context for search operations. +Perform semantic vector search across your knowledge base to find the most relevant content. Uses advanced AI embeddings to understand meaning and context, returning the most similar documents to your search query. @@ -78,31 +78,6 @@ Search for similar content in a knowledge base using vector similarity | `totalResults` | string | | `message` | string | -### `knowledge_upload_chunk` - -Upload a new chunk to a document in a knowledge base - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `knowledgeBaseId` | string | Yes | ID of the knowledge base containing the document | -| `documentId` | string | Yes | ID of the document to upload the chunk to | -| `content` | string | Yes | Content of the chunk to upload | - -#### Output - -| Parameter | Type | -| --------- | ---- | -| `data` | string | -| `chunkIndex` | string | -| `content` | string | -| `contentLength` | string | -| `tokenCount` | string | -| `enabled` | string | -| `createdAt` | string | -| `updatedAt` | string | - ## Block Configuration @@ -111,7 +86,7 @@ Upload a new chunk to a document in a knowledge base | Parameter | Type | Required | Description | | --------- | ---- | -------- | ----------- | -| `operation` | string | Yes | Operation | +| `knowledgeBaseId` | string | Yes | Knowledge Base - Select knowledge base | @@ -126,8 +101,6 @@ Upload a new chunk to a document in a knowledge base | โ†ณ `topK` | number | topK of the response | | โ†ณ `totalResults` | number | totalResults of the response | | โ†ณ `message` | string | message of the response | -| โ†ณ `success` | boolean | success of the response | -| โ†ณ `data` | json | data of the response | ## Notes From 33db17a47dc76aafe4756de17145a41dd070c4aa Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Tue, 10 Jun 2025 13:52:37 -0700 Subject: [PATCH 08/11] make layout full for model field --- apps/sim/blocks/blocks/huggingface.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/sim/blocks/blocks/huggingface.ts b/apps/sim/blocks/blocks/huggingface.ts index a80a0e4fbdf..b240eab621d 100644 --- a/apps/sim/blocks/blocks/huggingface.ts +++ b/apps/sim/blocks/blocks/huggingface.ts @@ -54,7 +54,7 @@ export const HuggingFaceBlock: BlockConfig = { id: 'model', title: 'Model', type: 'short-input', - layout: 'half', + layout: 'full', placeholder: 'e.g., deepseek/deepseek-v3-0324, llama3.1-8b, meta-llama/Llama-3.2-3B-Instruct-Turbo', description: 'The model must be available for the selected provider.', From ac04733070b44134ae89d54e0742d118602a3719 Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Tue, 10 Jun 2025 17:32:23 -0700 Subject: [PATCH 09/11] change huggingface logo --- apps/sim/blocks/blocks/huggingface.ts | 2 +- apps/sim/components/icons.tsx | 19 +++++++------------ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/apps/sim/blocks/blocks/huggingface.ts b/apps/sim/blocks/blocks/huggingface.ts index b240eab621d..8aa50ec516d 100644 --- a/apps/sim/blocks/blocks/huggingface.ts +++ b/apps/sim/blocks/blocks/huggingface.ts @@ -10,7 +10,7 @@ export const HuggingFaceBlock: BlockConfig = { 'Generate completions using Hugging Face Inference API with access to various open-source models. Leverage cutting-edge AI models for chat completions, content generation, and AI-powered conversations with customizable parameters.', docsLink: 'https://docs.simstudio.ai/tools/huggingface', category: 'tools', - bgColor: '#FFD21E', // Hugging Face yellow color + bgColor: '#181C1E', icon: HuggingFaceIcon, subBlocks: [ { diff --git a/apps/sim/components/icons.tsx b/apps/sim/components/icons.tsx index 77759430b7f..eec9936c0f6 100644 --- a/apps/sim/components/icons.tsx +++ b/apps/sim/components/icons.tsx @@ -2829,18 +2829,13 @@ export function PackageSearchIcon(props: SVGProps) { } export function HuggingFaceIcon(props: SVGProps) { return ( - - + + + + + + + ) } From 3aaaaaf2dd86fa586daa7d025bd863b12c6af169 Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Tue, 10 Jun 2025 17:33:44 -0700 Subject: [PATCH 10/11] add manual content --- apps/docs/content/docs/tools/huggingface.mdx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/apps/docs/content/docs/tools/huggingface.mdx b/apps/docs/content/docs/tools/huggingface.mdx index 6e17237c5ef..5b35a945dc4 100644 --- a/apps/docs/content/docs/tools/huggingface.mdx +++ b/apps/docs/content/docs/tools/huggingface.mdx @@ -24,12 +24,24 @@ import { BlockInfoCard } from "@/components/ui/block-info-card" `} /> +{/* MANUAL-CONTENT-START:intro */} +[HuggingFace](https://huggingface.co/) is a leading AI platform that provides access to thousands of pre-trained machine learning models and powerful inference capabilities. With its extensive model hub and robust API, HuggingFace offers comprehensive tools for both research and production AI applications. +With HuggingFace, you can: + +Access pre-trained models: Utilize models for text generation, translation, image processing, and more +Generate AI completions: Create content using state-of-the-art language models through the Inference API +Natural language processing: Process and analyze text with specialized NLP models +Deploy at scale: Host and serve models for production applications +Customize models: Fine-tune existing models for specific use cases + +In Sim Studio, the HuggingFace integration enables your agents to programmatically generate completions using the HuggingFace Inference API. This allows for powerful automation scenarios such as content generation, text analysis, code completion, and creative writing. Your agents can generate completions with natural language prompts, access specialized models for different tasks, and integrate AI-generated content into workflows. This integration bridges the gap between your AI workflows and machine learning capabilities, enabling seamless AI-powered automation with one of the world's most comprehensive ML platforms. +{/* MANUAL-CONTENT-END */} + ## Usage Instructions Generate completions using Hugging Face Inference API with access to various open-source models. Leverage cutting-edge AI models for chat completions, content generation, and AI-powered conversations with customizable parameters. - ## Tools ### `huggingface_chat` From cf5e35911f2d9d5abfa02c0b204308ed07030cbd Mon Sep 17 00:00:00 2001 From: Vikhyath Mondreti Date: Tue, 10 Jun 2025 17:36:18 -0700 Subject: [PATCH 11/11] fix lint --- apps/sim/components/icons.tsx | 45 +++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/apps/sim/components/icons.tsx b/apps/sim/components/icons.tsx index eec9936c0f6..1f061476d34 100644 --- a/apps/sim/components/icons.tsx +++ b/apps/sim/components/icons.tsx @@ -2829,13 +2829,44 @@ export function PackageSearchIcon(props: SVGProps) { } export function HuggingFaceIcon(props: SVGProps) { return ( - - - - - - - + + + + + + + ) }