@agentick/shared
Advanced tools
+6
-6
| { | ||
| "name": "@agentick/shared", | ||
| "version": "0.2.0", | ||
| "version": "0.2.1", | ||
| "description": "Shared types and utilities for Agentick", | ||
@@ -12,2 +12,7 @@ "keywords": [ | ||
| "author": "Ryan Lindgren", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/agenticklabs/agentick.git", | ||
| "directory": "packages/shared" | ||
| }, | ||
| "files": [ | ||
@@ -75,7 +80,2 @@ "dist" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/agenticklabs/agentick.git", | ||
| "directory": "packages/shared" | ||
| }, | ||
| "scripts": { | ||
@@ -82,0 +82,0 @@ "build": "tsc -p tsconfig.build.json", |
+25
-19
@@ -26,3 +26,3 @@ # @agentick/shared | ||
| provider: "myorg", | ||
| contextWindow: 32768, // 32k context | ||
| contextWindow: 32768, // 32k context | ||
| maxOutputTokens: 8192, | ||
@@ -63,3 +63,3 @@ supportsToolUse: true, | ||
| const info = getModelInfo("gpt-4o"); | ||
| console.log(info?.contextWindow); // 128000 | ||
| console.log(info?.contextWindow); // 128000 | ||
| console.log(info?.supportsVision); // true | ||
@@ -69,7 +69,7 @@ | ||
| const contextWindow = getContextWindow("claude-3-5-sonnet"); | ||
| console.log(contextWindow); // 200000 | ||
| console.log(contextWindow); // 200000 | ||
| // Calculate utilization percentage | ||
| const utilization = getContextUtilization("gpt-4o", 64000); | ||
| console.log(utilization); // 50 | ||
| console.log(utilization); // 50 | ||
| ``` | ||
@@ -81,8 +81,8 @@ | ||
| interface ModelInfo { | ||
| name: string; // Display name | ||
| provider: string; // Provider name (openai, anthropic, google, etc.) | ||
| contextWindow: number; // Context window size in tokens | ||
| maxOutputTokens?: number; // Max output tokens | ||
| releaseDate?: string; // Model release date | ||
| supportsVision?: boolean; // Supports image input | ||
| name: string; // Display name | ||
| provider: string; // Provider name (openai, anthropic, google, etc.) | ||
| contextWindow: number; // Context window size in tokens | ||
| maxOutputTokens?: number; // Max output tokens | ||
| releaseDate?: string; // Model release date | ||
| supportsVision?: boolean; // Supports image input | ||
| supportsToolUse?: boolean; // Supports tool/function calling | ||
@@ -113,4 +113,4 @@ isReasoningModel?: boolean; // Extended thinking model (o1, etc.) | ||
| const effectiveInfo = getEffectiveModelInfo( | ||
| { contextWindow: 256000 }, // Adapter reports 256k | ||
| "custom-model" | ||
| { contextWindow: 256000 }, // Adapter reports 256k | ||
| "custom-model", | ||
| ); | ||
@@ -127,5 +127,5 @@ | ||
| formatContextWindow(128000); // "128K" | ||
| formatContextWindow(1000000); // "1M" | ||
| formatContextWindow(2097152); // "2.1M" | ||
| formatContextWindow(128000); // "128K" | ||
| formatContextWindow(1000000); // "1M" | ||
| formatContextWindow(2097152); // "2.1M" | ||
| ``` | ||
@@ -157,3 +157,3 @@ | ||
| }, | ||
| name: "person", // optional | ||
| name: "person", // optional | ||
| }; | ||
@@ -171,3 +171,9 @@ ``` | ||
| ```typescript | ||
| import type { ContentBlock, TextBlock, ImageBlock, ToolUseBlock, ToolResultBlock } from "@agentick/shared"; | ||
| import type { | ||
| ContentBlock, | ||
| TextBlock, | ||
| ImageBlock, | ||
| ToolUseBlock, | ||
| ToolResultBlock, | ||
| } from "@agentick/shared"; | ||
@@ -252,3 +258,3 @@ // Text content | ||
| totalTokens: 2000, | ||
| utilization: 1.56, // percentage | ||
| utilization: 1.56, // percentage | ||
| supportsVision: true, | ||
@@ -286,3 +292,3 @@ supportsToolUse: true, | ||
| throw new AbortError("User cancelled"); | ||
| throw AbortError.timeout(30000); // Timeout via AbortError factory | ||
| throw AbortError.timeout(30000); // Timeout via AbortError factory | ||
| ``` | ||
@@ -289,0 +295,0 @@ |
329
1.86%463441
-0.01%