@yourgpt/llm-sdk 2.0.2-beta.1 → 2.0.2-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import { L as LLMAdapter, W as WebSearchConfig, P as ChatCompletionRequest, g as StreamEvent, aj as CompletionResult, a2 as OllamaModelOptions } from '../types-ClJBhmS0.mjs';
2
- export { Q as AdapterFactory, av as AnthropicContentBlock, aw as OpenAIContentBlock, at as attachmentToAnthropicDocument, as as attachmentToAnthropicImage, au as attachmentToOpenAIImage, ak as formatMessages, am as formatMessagesForAnthropic, an as formatMessagesForOpenAI, al as formatTools, aq as hasImageAttachments, ar as hasMediaAttachments, ao as messageToAnthropicContent, ap as messageToOpenAIContent } from '../types-ClJBhmS0.mjs';
1
+ import { L as LLMAdapter, W as WebSearchConfig, P as ChatCompletionRequest, g as StreamEvent, aj as CompletionResult, a2 as OllamaModelOptions } from '../types-C_f95PKp.mjs';
2
+ export { Q as AdapterFactory, av as AnthropicContentBlock, aw as OpenAIContentBlock, at as attachmentToAnthropicDocument, as as attachmentToAnthropicImage, au as attachmentToOpenAIImage, ak as formatMessages, am as formatMessagesForAnthropic, an as formatMessagesForOpenAI, al as formatTools, aq as hasImageAttachments, ar as hasMediaAttachments, ao as messageToAnthropicContent, ap as messageToOpenAIContent } from '../types-C_f95PKp.mjs';
3
3
  import 'zod';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
- import { L as LLMAdapter, W as WebSearchConfig, P as ChatCompletionRequest, g as StreamEvent, aj as CompletionResult, a2 as OllamaModelOptions } from '../types-ClJBhmS0.js';
2
- export { Q as AdapterFactory, av as AnthropicContentBlock, aw as OpenAIContentBlock, at as attachmentToAnthropicDocument, as as attachmentToAnthropicImage, au as attachmentToOpenAIImage, ak as formatMessages, am as formatMessagesForAnthropic, an as formatMessagesForOpenAI, al as formatTools, aq as hasImageAttachments, ar as hasMediaAttachments, ao as messageToAnthropicContent, ap as messageToOpenAIContent } from '../types-ClJBhmS0.js';
1
+ import { L as LLMAdapter, W as WebSearchConfig, P as ChatCompletionRequest, g as StreamEvent, aj as CompletionResult, a2 as OllamaModelOptions } from '../types-C_f95PKp.js';
2
+ export { Q as AdapterFactory, av as AnthropicContentBlock, aw as OpenAIContentBlock, at as attachmentToAnthropicDocument, as as attachmentToAnthropicImage, au as attachmentToOpenAIImage, ak as formatMessages, am as formatMessagesForAnthropic, an as formatMessagesForOpenAI, al as formatTools, aq as hasImageAttachments, ar as hasMediaAttachments, ao as messageToAnthropicContent, ap as messageToOpenAIContent } from '../types-C_f95PKp.js';
3
3
  import 'zod';
4
4
 
5
5
  /**
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { G as GenerateTextParams, a as GenerateTextResult, S as StreamTextParams, b as StreamTextResult, T as ToolContext, c as Tool, A as AIProvider, d as ActionDefinition, e as ToolDefinition, f as AgentLoopConfig, K as KnowledgeBaseConfig, W as WebSearchConfig, L as LLMAdapter, D as DoneEventMessage, g as StreamEvent, h as ToolCallInfo, i as TokenUsageRaw, M as Message, j as ToolResponse } from './types-ClJBhmS0.mjs';
2
- export { Q as AdapterFactory, Z as AnthropicProviderConfig, a4 as AnthropicTool, a6 as AnthropicToolResult, a5 as AnthropicToolUse, p as AssistantMessage, a0 as AzureProviderConfig, X as BaseProviderConfig, P as ChatCompletionRequest, ai as Citation, C as CoreMessage, O as DEFAULT_CAPABILITIES, m as DoGenerateParams, n as DoGenerateResult, H as ErrorChunk, F as FilePart, E as FinishChunk, N as FinishReason, ab as GeminiFunctionCall, aa as GeminiFunctionDeclaration, ac as GeminiFunctionResponse, v as GenerateStep, _ as GoogleProviderConfig, I as ImagePart, ad as LLMConfig, k as LanguageModel, l as ModelCapabilities, a2 as OllamaModelOptions, a1 as OllamaProviderConfig, Y as OpenAIProviderConfig, a7 as OpenAITool, a8 as OpenAIToolCall, a9 as OpenAIToolResult, V as ProviderCapabilities, a3 as ProviderFormatter, R as ResponseOptions, x as StreamChunk, w as StreamPart, o as SystemMessage, y as TextDeltaChunk, s as TextPart, J as TokenUsage, t as ToolCall, z as ToolCallChunk, ah as ToolExecution, ae as ToolLocation, q as ToolMessage, u as ToolResult, B as ToolResultChunk, af as UnifiedToolCall, ag as UnifiedToolResult, r as UserContentPart, U as UserMessage, $ as XAIProviderConfig } from './types-ClJBhmS0.mjs';
1
+ import { G as GenerateTextParams, a as GenerateTextResult, S as StreamTextParams, b as StreamTextResult, T as ToolContext, c as Tool, A as AIProvider, d as ActionDefinition, e as ToolDefinition, f as AgentLoopConfig, K as KnowledgeBaseConfig, W as WebSearchConfig, L as LLMAdapter, D as DoneEventMessage, g as StreamEvent, h as ToolCallInfo, i as TokenUsageRaw, M as Message, j as ToolResponse } from './types-C_f95PKp.mjs';
2
+ export { Q as AdapterFactory, Z as AnthropicProviderConfig, a4 as AnthropicTool, a6 as AnthropicToolResult, a5 as AnthropicToolUse, p as AssistantMessage, a0 as AzureProviderConfig, X as BaseProviderConfig, P as ChatCompletionRequest, ai as Citation, C as CoreMessage, O as DEFAULT_CAPABILITIES, m as DoGenerateParams, n as DoGenerateResult, H as ErrorChunk, F as FilePart, E as FinishChunk, N as FinishReason, ab as GeminiFunctionCall, aa as GeminiFunctionDeclaration, ac as GeminiFunctionResponse, v as GenerateStep, _ as GoogleProviderConfig, I as ImagePart, ad as LLMConfig, k as LanguageModel, l as ModelCapabilities, a2 as OllamaModelOptions, a1 as OllamaProviderConfig, Y as OpenAIProviderConfig, a7 as OpenAITool, a8 as OpenAIToolCall, a9 as OpenAIToolResult, V as ProviderCapabilities, a3 as ProviderFormatter, R as ResponseOptions, x as StreamChunk, w as StreamPart, o as SystemMessage, y as TextDeltaChunk, s as TextPart, J as TokenUsage, t as ToolCall, z as ToolCallChunk, ah as ToolExecution, ae as ToolLocation, q as ToolMessage, u as ToolResult, B as ToolResultChunk, af as UnifiedToolCall, ag as UnifiedToolResult, r as UserContentPart, U as UserMessage, $ as XAIProviderConfig } from './types-C_f95PKp.mjs';
3
3
  import { z } from 'zod';
4
4
  import * as hono from 'hono';
5
5
  import { Hono } from 'hono';
@@ -106,6 +106,13 @@ interface ToolConfig<TParams extends z.ZodType, TResult = unknown> {
106
106
  parameters: TParams;
107
107
  /** Function to execute when the tool is called */
108
108
  execute: (params: z.infer<TParams>, context: ToolContext) => Promise<TResult>;
109
+ /**
110
+ * Hide this tool's execution from the chat UI.
111
+ * When true, tool calls and results won't be displayed to the user,
112
+ * but the tool will still execute normally.
113
+ * @default false
114
+ */
115
+ hidden?: boolean;
109
116
  }
110
117
  /**
111
118
  * Create a type-safe tool definition
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { G as GenerateTextParams, a as GenerateTextResult, S as StreamTextParams, b as StreamTextResult, T as ToolContext, c as Tool, A as AIProvider, d as ActionDefinition, e as ToolDefinition, f as AgentLoopConfig, K as KnowledgeBaseConfig, W as WebSearchConfig, L as LLMAdapter, D as DoneEventMessage, g as StreamEvent, h as ToolCallInfo, i as TokenUsageRaw, M as Message, j as ToolResponse } from './types-ClJBhmS0.js';
2
- export { Q as AdapterFactory, Z as AnthropicProviderConfig, a4 as AnthropicTool, a6 as AnthropicToolResult, a5 as AnthropicToolUse, p as AssistantMessage, a0 as AzureProviderConfig, X as BaseProviderConfig, P as ChatCompletionRequest, ai as Citation, C as CoreMessage, O as DEFAULT_CAPABILITIES, m as DoGenerateParams, n as DoGenerateResult, H as ErrorChunk, F as FilePart, E as FinishChunk, N as FinishReason, ab as GeminiFunctionCall, aa as GeminiFunctionDeclaration, ac as GeminiFunctionResponse, v as GenerateStep, _ as GoogleProviderConfig, I as ImagePart, ad as LLMConfig, k as LanguageModel, l as ModelCapabilities, a2 as OllamaModelOptions, a1 as OllamaProviderConfig, Y as OpenAIProviderConfig, a7 as OpenAITool, a8 as OpenAIToolCall, a9 as OpenAIToolResult, V as ProviderCapabilities, a3 as ProviderFormatter, R as ResponseOptions, x as StreamChunk, w as StreamPart, o as SystemMessage, y as TextDeltaChunk, s as TextPart, J as TokenUsage, t as ToolCall, z as ToolCallChunk, ah as ToolExecution, ae as ToolLocation, q as ToolMessage, u as ToolResult, B as ToolResultChunk, af as UnifiedToolCall, ag as UnifiedToolResult, r as UserContentPart, U as UserMessage, $ as XAIProviderConfig } from './types-ClJBhmS0.js';
1
+ import { G as GenerateTextParams, a as GenerateTextResult, S as StreamTextParams, b as StreamTextResult, T as ToolContext, c as Tool, A as AIProvider, d as ActionDefinition, e as ToolDefinition, f as AgentLoopConfig, K as KnowledgeBaseConfig, W as WebSearchConfig, L as LLMAdapter, D as DoneEventMessage, g as StreamEvent, h as ToolCallInfo, i as TokenUsageRaw, M as Message, j as ToolResponse } from './types-C_f95PKp.js';
2
+ export { Q as AdapterFactory, Z as AnthropicProviderConfig, a4 as AnthropicTool, a6 as AnthropicToolResult, a5 as AnthropicToolUse, p as AssistantMessage, a0 as AzureProviderConfig, X as BaseProviderConfig, P as ChatCompletionRequest, ai as Citation, C as CoreMessage, O as DEFAULT_CAPABILITIES, m as DoGenerateParams, n as DoGenerateResult, H as ErrorChunk, F as FilePart, E as FinishChunk, N as FinishReason, ab as GeminiFunctionCall, aa as GeminiFunctionDeclaration, ac as GeminiFunctionResponse, v as GenerateStep, _ as GoogleProviderConfig, I as ImagePart, ad as LLMConfig, k as LanguageModel, l as ModelCapabilities, a2 as OllamaModelOptions, a1 as OllamaProviderConfig, Y as OpenAIProviderConfig, a7 as OpenAITool, a8 as OpenAIToolCall, a9 as OpenAIToolResult, V as ProviderCapabilities, a3 as ProviderFormatter, R as ResponseOptions, x as StreamChunk, w as StreamPart, o as SystemMessage, y as TextDeltaChunk, s as TextPart, J as TokenUsage, t as ToolCall, z as ToolCallChunk, ah as ToolExecution, ae as ToolLocation, q as ToolMessage, u as ToolResult, B as ToolResultChunk, af as UnifiedToolCall, ag as UnifiedToolResult, r as UserContentPart, U as UserMessage, $ as XAIProviderConfig } from './types-C_f95PKp.js';
3
3
  import { z } from 'zod';
4
4
  import * as hono from 'hono';
5
5
  import { Hono } from 'hono';
@@ -106,6 +106,13 @@ interface ToolConfig<TParams extends z.ZodType, TResult = unknown> {
106
106
  parameters: TParams;
107
107
  /** Function to execute when the tool is called */
108
108
  execute: (params: z.infer<TParams>, context: ToolContext) => Promise<TResult>;
109
+ /**
110
+ * Hide this tool's execution from the chat UI.
111
+ * When true, tool calls and results won't be displayed to the user,
112
+ * but the tool will still execute normally.
113
+ * @default false
114
+ */
115
+ hidden?: boolean;
109
116
  }
110
117
  /**
111
118
  * Create a type-safe tool definition
package/dist/index.js CHANGED
@@ -8,7 +8,8 @@ function tool(config) {
8
8
  return {
9
9
  description: config.description,
10
10
  parameters: config.parameters,
11
- execute: config.execute
11
+ execute: config.execute,
12
+ hidden: config.hidden
12
13
  };
13
14
  }
14
15
  function toolToJsonSchema(toolDef) {