@caeliq/llms 1.0.56 → 1.0.58
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.
- package/README.md +92 -10
- package/dist/api/middleware.d.ts +9 -0
- package/dist/api/routes.d.ts +15 -0
- package/dist/cjs/server.cjs +225 -215
- package/dist/cjs/server.cjs.map +4 -4
- package/dist/cursor-sdk/events-to-sse.d.ts +113 -0
- package/dist/cursor-sdk/hooks-template.d.ts +2 -0
- package/dist/cursor-sdk/host-env.d.ts +38 -0
- package/dist/cursor-sdk/lifecycle-planner.d.ts +69 -0
- package/dist/cursor-sdk/prompt.d.ts +59 -0
- package/dist/cursor-sdk/runner.d.ts +40 -0
- package/dist/cursor-sdk/send.d.ts +9 -0
- package/dist/cursor-sdk/session.d.ts +199 -0
- package/dist/cursor-sdk/shared.d.ts +28 -0
- package/dist/cursor-sdk/tool-paths.d.ts +26 -0
- package/dist/cursor-sdk/tools.d.ts +15 -0
- package/dist/cursor-sdk/turn-identity.d.ts +46 -0
- package/dist/cursor-sdk/turn-output.d.ts +77 -0
- package/dist/cursor-sdk/usage.d.ts +28 -0
- package/dist/esm/server.mjs +225 -215
- package/dist/esm/server.mjs.map +4 -4
- package/dist/index.d.ts +2 -0
- package/dist/plugins/index.d.ts +4 -0
- package/dist/plugins/output/console-handler.d.ts +23 -0
- package/dist/plugins/output/index.d.ts +29 -0
- package/dist/plugins/output/output-manager.d.ts +110 -0
- package/dist/plugins/output/temp-file-handler.d.ts +53 -0
- package/dist/plugins/output/types.d.ts +157 -0
- package/dist/plugins/output/webhook-handler.d.ts +37 -0
- package/dist/plugins/plugin-manager.d.ts +62 -0
- package/dist/plugins/token-speed.d.ts +22 -0
- package/dist/plugins/types.d.ts +25 -0
- package/dist/server.d.ts +60 -0
- package/dist/services/config.d.ts +32 -0
- package/dist/services/provider.d.ts +34 -0
- package/dist/services/tokenizer.d.ts +44 -0
- package/dist/services/transformer.d.ts +28 -0
- package/dist/tests/anthropic.stream-boundaries.d.ts +1 -0
- package/dist/tests/anthropic.stream-cancel.d.ts +1 -0
- package/dist/tests/anthropic.tool-call-id-sanitize.d.ts +1 -0
- package/dist/tests/anthropic.turn-intent.d.ts +1 -0
- package/dist/tests/antigravity.claude-tool-schema.d.ts +1 -0
- package/dist/tests/antigravity.endpoint-fallback.d.ts +1 -0
- package/dist/tests/cache-control.strip.d.ts +1 -0
- package/dist/tests/cache-paths.integration.d.ts +1 -0
- package/dist/tests/claude-auth.beta-headers.d.ts +1 -0
- package/dist/tests/codex-auth.reliability.d.ts +1 -0
- package/dist/tests/cursor-sdk.cancel.d.ts +1 -0
- package/dist/tests/cursor-sdk.host-env.d.ts +1 -0
- package/dist/tests/cursor-sdk.interrupt-reentry.d.ts +1 -0
- package/dist/tests/cursor-sdk.lifecycle-planner.d.ts +1 -0
- package/dist/tests/cursor-sdk.on-delta-thinking.d.ts +1 -0
- package/dist/tests/cursor-sdk.pending-next-rejection.d.ts +1 -0
- package/dist/tests/cursor-sdk.progress-only.d.ts +1 -0
- package/dist/tests/cursor-sdk.runner-recovery.d.ts +1 -0
- package/dist/tests/cursor-sdk.scratch-paths.d.ts +1 -0
- package/dist/tests/cursor-sdk.scratch-report.d.ts +1 -0
- package/dist/tests/cursor-sdk.send.d.ts +1 -0
- package/dist/tests/cursor-sdk.stream-error.d.ts +1 -0
- package/dist/tests/cursor-sdk.thinking-signature.d.ts +1 -0
- package/dist/tests/cursor-sdk.tool-call-id.d.ts +1 -0
- package/dist/tests/cursor-sdk.trailing-turn-fallback.d.ts +1 -0
- package/dist/tests/cursor-sdk.turn-coordination.d.ts +1 -0
- package/dist/tests/cursor-sdk.turn-identity.d.ts +1 -0
- package/dist/tests/cursor-sdk.usage.d.ts +1 -0
- package/dist/tests/deepseek.reasoning.d.ts +1 -0
- package/dist/tests/gemini.abnormal-finish.d.ts +1 -0
- package/dist/tests/gemini.dual-dialect-request.d.ts +1 -0
- package/dist/tests/gemini.function-call-signatures.d.ts +1 -0
- package/dist/tests/gemini.parity.d.ts +1 -0
- package/dist/tests/gemini.thinking-effort.d.ts +1 -0
- package/dist/tests/gemini.thought-signature-roundtrip.d.ts +1 -0
- package/dist/tests/opencode-headers.no-provider-retry.d.ts +1 -0
- package/dist/tests/stream.upstream-terminated.d.ts +1 -0
- package/dist/tests/thinking-sequencer.dual-dialect.d.ts +1 -0
- package/dist/tests/transformer-service.endpoints.d.ts +1 -0
- package/dist/tests/upstream-ports.smoke.d.ts +1 -0
- package/dist/tokenizer/api-tokenizer.d.ts +45 -0
- package/dist/tokenizer/huggingface-tokenizer.d.ts +52 -0
- package/dist/tokenizer/tiktoken-tokenizer.d.ts +20 -0
- package/dist/transformer/anthropic.transformer.d.ts +22 -0
- package/dist/transformer/antigravity-auth.transformer.d.ts +15 -0
- package/dist/transformer/cerebras.transformer.d.ts +16 -0
- package/dist/transformer/chrome-on-device.transformer.d.ts +7 -0
- package/dist/transformer/claude-auth.transformer.d.ts +25 -0
- package/dist/transformer/cleancache.transformer.d.ts +6 -0
- package/dist/transformer/codex.transformer.d.ts +61 -0
- package/dist/transformer/cursor-sdk.transformer.d.ts +25 -0
- package/dist/transformer/customparams.transformer.d.ts +30 -0
- package/dist/transformer/deepseek.transformer.d.ts +7 -0
- package/dist/transformer/enhancetool.transformer.d.ts +6 -0
- package/dist/transformer/extrathinktag.transformer.d.ts +10 -0
- package/dist/transformer/forcereasoning.transformer.d.ts +8 -0
- package/dist/transformer/gemini.transformer.d.ts +15 -0
- package/dist/transformer/groq.transformer.d.ts +7 -0
- package/dist/transformer/index.d.ts +65 -0
- package/dist/transformer/maxcompletiontokens.transformer.d.ts +6 -0
- package/dist/transformer/maxtoken.transformer.d.ts +9 -0
- package/dist/transformer/mistral.transformer.d.ts +25 -0
- package/dist/transformer/openai.responses.transformer.d.ts +13 -0
- package/dist/transformer/openai.transformer.d.ts +52 -0
- package/dist/transformer/opencode-headers.transformer.d.ts +30 -0
- package/dist/transformer/openrouter.transformer.d.ts +10 -0
- package/dist/transformer/qwen-auth.transformer.d.ts +9 -0
- package/dist/transformer/reasoning.transformer.d.ts +10 -0
- package/dist/transformer/sampling.transformer.d.ts +13 -0
- package/dist/transformer/streamoptions.transformer.d.ts +6 -0
- package/dist/transformer/tooluse.transformer.d.ts +7 -0
- package/dist/transformer/vercel.transformer.d.ts +11 -0
- package/dist/transformer/vertex-claude.transformer.d.ts +9 -0
- package/dist/transformer/vertex-gemini.transformer.d.ts +12 -0
- package/dist/transformer/vertex-openai.transformer.d.ts +19 -0
- package/dist/types/llm.d.ts +255 -0
- package/dist/types/transformer.d.ts +29 -0
- package/dist/types/turn-intent.d.ts +26 -0
- package/dist/utils/antigravity-auth.d.ts +75 -0
- package/dist/utils/auth-recovery.d.ts +2 -0
- package/dist/utils/cache.d.ts +14 -0
- package/dist/utils/cacheControl.d.ts +44 -0
- package/dist/utils/claude-auth.d.ts +22 -0
- package/dist/utils/codex-auth.d.ts +33 -0
- package/dist/utils/converter.d.ts +11 -0
- package/dist/utils/cursor-auth.d.ts +3 -0
- package/dist/utils/deepseek.util.d.ts +28 -0
- package/dist/utils/gemini-cache.d.ts +8 -0
- package/dist/utils/gemini-thinking.d.ts +66 -0
- package/dist/utils/gemini.util.d.ts +43 -0
- package/dist/utils/google.util.d.ts +160 -0
- package/dist/utils/image.d.ts +1 -0
- package/dist/utils/mistral.util.d.ts +14 -0
- package/dist/utils/openai.util.d.ts +17 -0
- package/dist/utils/qwen-auth.d.ts +13 -0
- package/dist/utils/redact.d.ts +30 -0
- package/dist/utils/request.d.ts +4 -0
- package/dist/utils/retry.d.ts +27 -0
- package/dist/utils/router.d.ts +42 -0
- package/dist/utils/schema.d.ts +46 -0
- package/dist/utils/sse/SSEParser.transform.d.ts +6 -0
- package/dist/utils/sse/SSESerializer.transform.d.ts +3 -0
- package/dist/utils/sse/index.d.ts +3 -0
- package/dist/utils/sse/rewriteStream.d.ts +9 -0
- package/dist/utils/stream.d.ts +11 -0
- package/dist/utils/thinking.d.ts +33 -0
- package/dist/utils/thought-signature-cache.d.ts +34 -0
- package/dist/utils/toolArgumentsParser.d.ts +8 -0
- package/dist/utils/toolCallId.d.ts +15 -0
- package/dist/utils/vertex-claude.util.d.ts +47 -0
- package/package.json +3 -3
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ConfigService } from "../services/config";
|
|
2
|
+
import { TokenizerService } from "../services/tokenizer";
|
|
3
|
+
interface Tool {
|
|
4
|
+
name: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
input_schema: object;
|
|
7
|
+
}
|
|
8
|
+
interface ContentBlockParam {
|
|
9
|
+
type: string;
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}
|
|
12
|
+
interface MessageParam {
|
|
13
|
+
role: string;
|
|
14
|
+
content: string | ContentBlockParam[];
|
|
15
|
+
}
|
|
16
|
+
/** Normalize `provider/model` or `provider,model` into our `provider,model` form. */
|
|
17
|
+
export declare function normalizeModelSelector(value: string | undefined | null): string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Strip Claude Code's billing helper system block.
|
|
20
|
+
* Returns true when that block marks the request as a subagent.
|
|
21
|
+
*/
|
|
22
|
+
export declare function removeClaudeCodeBillingSystemHeader(body: any): boolean;
|
|
23
|
+
/** Prefer system tag, then early user-message tag; strip whichever matched. */
|
|
24
|
+
export declare function extractAndRemoveClaudeCodeSubagentModelTag(body: any): string | undefined;
|
|
25
|
+
export declare const calculateTokenCount: (messages: MessageParam[], system: any, tools: Tool[]) => number;
|
|
26
|
+
export interface RouterContext {
|
|
27
|
+
configService: ConfigService;
|
|
28
|
+
tokenizerService?: TokenizerService;
|
|
29
|
+
event?: any;
|
|
30
|
+
}
|
|
31
|
+
export type RouterScenarioType = 'default' | 'background' | 'think' | 'longContext' | 'webSearch' | 'subagent';
|
|
32
|
+
export interface RouterFallbackConfig {
|
|
33
|
+
default?: string[];
|
|
34
|
+
background?: string[];
|
|
35
|
+
think?: string[];
|
|
36
|
+
longContext?: string[];
|
|
37
|
+
webSearch?: string[];
|
|
38
|
+
subagent?: string[];
|
|
39
|
+
}
|
|
40
|
+
export declare const router: (req: any, _res: any, context: RouterContext) => Promise<void>;
|
|
41
|
+
export declare const searchProjectBySession: (sessionId: string, logger?: any) => Promise<string | null>;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recursively sanitizes a JSON schema by:
|
|
3
|
+
* 1. Stripping unknown fields (not in VALID_SCHEMA_FIELDS)
|
|
4
|
+
* 2. Removing enum from non-string types
|
|
5
|
+
* 3. Removing format from string types (except "enum" and "date-time")
|
|
6
|
+
* 4. Removing format: 'uri' from any type
|
|
7
|
+
* 5. Removing $schema field
|
|
8
|
+
*
|
|
9
|
+
* This is a superset of normalizeJsonSchema that also handles
|
|
10
|
+
* field whitelisting and enum/format cleanup needed by providers
|
|
11
|
+
* like Gemini and Mistral.
|
|
12
|
+
*/
|
|
13
|
+
export declare function sanitizeJsonSchema(schema: any, parentKey?: string): any;
|
|
14
|
+
/**
|
|
15
|
+
* Collapse union subschemas that carry no `type` of their own.
|
|
16
|
+
*
|
|
17
|
+
* Antigravity serves Claude models by parsing our Gemini `generateContent` body
|
|
18
|
+
* into the Gemini Schema proto and re-emitting it as an Anthropic tool schema. A
|
|
19
|
+
* subschema with `anyOf` and no sibling `type` has no proto type to carry, and
|
|
20
|
+
* what comes out the far side fails Anthropic's draft 2020-12 validation:
|
|
21
|
+
*
|
|
22
|
+
* tools.18.custom.input_schema: JSON schema is invalid.
|
|
23
|
+
*
|
|
24
|
+
* Adding a sibling `type` is not an option — Gemini rejects that outright with
|
|
25
|
+
* "type and anyOf cannot be both populated" — so the union is collapsed onto its
|
|
26
|
+
* first typed branch instead, and the alternatives are recorded in the
|
|
27
|
+
* description so the model still knows they exist. Lossy, but the alternative is
|
|
28
|
+
* that every request carrying such a tool fails.
|
|
29
|
+
*
|
|
30
|
+
* Gemini itself handles typeless unions fine, so this is only for backends
|
|
31
|
+
* reached through the Gemini wire format.
|
|
32
|
+
*/
|
|
33
|
+
export declare function collapseTypelessUnions(schema: any): any;
|
|
34
|
+
/**
|
|
35
|
+
* Normalizes a JSON schema by removing fields that may cause API rejections:
|
|
36
|
+
* - format: 'uri' from string types
|
|
37
|
+
* - $schema field
|
|
38
|
+
*
|
|
39
|
+
* For full sanitization (field whitelist, enum/format cleanup), use sanitizeJsonSchema instead.
|
|
40
|
+
*/
|
|
41
|
+
export declare function normalizeJsonSchema(schema: any): any;
|
|
42
|
+
/**
|
|
43
|
+
* Normalizes tool function parameters by removing problematic fields.
|
|
44
|
+
* Uses sanitizeJsonSchema for thorough cleanup.
|
|
45
|
+
*/
|
|
46
|
+
export declare function normalizeToolParameters(parameters: any): any;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rewrite stream utility
|
|
3
|
+
* Reads source readablestream and returns a new readablestream,
|
|
4
|
+
* processor processes source data and pushes returned new value to new stream,
|
|
5
|
+
* no push if no return value
|
|
6
|
+
* @param stream
|
|
7
|
+
* @param processor
|
|
8
|
+
*/
|
|
9
|
+
export declare const rewriteStream: (stream: ReadableStream, processor: (data: any, controller: ReadableStreamController<any>) => Promise<any>) => ReadableStream;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface StreamContext {
|
|
2
|
+
controller: ReadableStreamDefaultController;
|
|
3
|
+
encoder: TextEncoder;
|
|
4
|
+
}
|
|
5
|
+
export declare function createSSEStreamReader(response: Response, processLine: (line: string, context: StreamContext) => void, options?: {
|
|
6
|
+
bufferSize?: number;
|
|
7
|
+
onComplete?: (context: StreamContext) => void;
|
|
8
|
+
logger?: any;
|
|
9
|
+
}): Response;
|
|
10
|
+
export declare function encodeSSEData(data: string, encoder: TextEncoder): Uint8Array;
|
|
11
|
+
export declare function encodeSSELine(line: string, encoder: TextEncoder): Uint8Array;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Accumulator for streaming reasoning/thinking content.
|
|
3
|
+
* Used to buffer reasoning chunks across SSE events and emit
|
|
4
|
+
* a final thinking block with signature when reasoning completes.
|
|
5
|
+
*/
|
|
6
|
+
export interface ReasoningAccumulator {
|
|
7
|
+
content: string;
|
|
8
|
+
isComplete: boolean;
|
|
9
|
+
hasContent: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function createReasoningAccumulator(): ReasoningAccumulator;
|
|
12
|
+
export declare function accumulateReasoning(accumulator: ReasoningAccumulator, text: string): void;
|
|
13
|
+
export declare function finalizeReasoning(accumulator: ReasoningAccumulator): {
|
|
14
|
+
content: string;
|
|
15
|
+
signature: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Build a chat.completion.chunk with a thinking delta.
|
|
19
|
+
* Used when emitting accumulated reasoning content as a thinking block.
|
|
20
|
+
*/
|
|
21
|
+
export declare function buildThinkingChunk(baseData: any, thinking: {
|
|
22
|
+
content?: string;
|
|
23
|
+
signature?: string;
|
|
24
|
+
}): any;
|
|
25
|
+
/**
|
|
26
|
+
* Extract reasoning text from various provider-specific delta fields.
|
|
27
|
+
* Supports: delta.reasoning_content (DeepSeek/Mistral), delta.reasoning (OpenRouter)
|
|
28
|
+
*/
|
|
29
|
+
export declare function extractReasoningText(delta: any): string | null;
|
|
30
|
+
/**
|
|
31
|
+
* Remove reasoning-specific fields from a delta after extraction.
|
|
32
|
+
*/
|
|
33
|
+
export declare function cleanReasoningFields(delta: any): void;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thought signatures for tool calls, carried across turns on behalf of clients
|
|
3
|
+
* that cannot round-trip them.
|
|
4
|
+
*
|
|
5
|
+
* Gemini 3 / Antigravity sign the reasoning behind every `functionCall` and
|
|
6
|
+
* expect that signature back when the call is replayed. Anthropic's `tool_use`
|
|
7
|
+
* block has no field to carry it — and must not grow one, since Claude Code's
|
|
8
|
+
* wire format is fixed — so the signature is lost the moment a turn reaches the
|
|
9
|
+
* client. The documented `skip_thought_signature_validator` sentinel stops the
|
|
10
|
+
* request from 400ing, but Google is explicit that it is a last resort that
|
|
11
|
+
* "will negatively impact model performance": the model is handed back its own
|
|
12
|
+
* earlier tool calls stripped of the signed reasoning that produced them.
|
|
13
|
+
*
|
|
14
|
+
* Observed consequence in a long Claude Code session: upstream signatures shrank
|
|
15
|
+
* from ~1.2 KB to a 56-byte stub over six replayed tool calls, then the model
|
|
16
|
+
* emitted an empty `functionCall` and the turn died with
|
|
17
|
+
* `MALFORMED_FUNCTION_CALL` ("Function call is empty - no input to parse").
|
|
18
|
+
*
|
|
19
|
+
* So CCR keeps the signatures here instead of discarding them, keyed by the one
|
|
20
|
+
* identifier that does survive the round trip:
|
|
21
|
+
*
|
|
22
|
+
* upstream functionCall.id → Anthropic tool_use.id
|
|
23
|
+
* → tool_result.tool_use_id → Unified tool_calls[].id
|
|
24
|
+
*
|
|
25
|
+
* Entries are scoped per provider: a signature minted by one upstream is not
|
|
26
|
+
* valid at another, so a conversation re-routed mid-session misses the cache and
|
|
27
|
+
* falls back to the sentinel rather than replaying a foreign signature.
|
|
28
|
+
*/
|
|
29
|
+
export declare function rememberThoughtSignature(scope: string | undefined, id: string | undefined, signature: string | undefined): void;
|
|
30
|
+
export declare function recallThoughtSignature(scope: string | undefined, id: string | undefined): string | undefined;
|
|
31
|
+
/** Test hook. */
|
|
32
|
+
export declare function clearThoughtSignatureCache(): void;
|
|
33
|
+
/** Test hook. */
|
|
34
|
+
export declare function thoughtSignatureCacheSize(): number;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse tool call arguments function
|
|
3
|
+
* First try standard JSON parsing, then JSON5 parsing, finally use jsonrepair for safe repair
|
|
4
|
+
*
|
|
5
|
+
* @param argsString - Parameter string to parse
|
|
6
|
+
* @returns Parsed parameter object or safe empty object
|
|
7
|
+
*/
|
|
8
|
+
export declare function parseToolArguments(argsString: string, logger?: any): string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare function isValidAnthropicToolCallId(id: unknown): id is string;
|
|
2
|
+
/**
|
|
3
|
+
* Coerce an id into Anthropic's allowed alphabet.
|
|
4
|
+
*
|
|
5
|
+
* Runs of invalid characters collapse to a single `_` rather than being
|
|
6
|
+
* deleted: deletion can merge two distinct ids into one (`a\nb` and `ab` both
|
|
7
|
+
* become `ab`), and a duplicate `tool_use.id` is a worse failure than a long
|
|
8
|
+
* one — it silently mispairs tool results.
|
|
9
|
+
*
|
|
10
|
+
* Must be deterministic and idempotent. The same id arrives from two
|
|
11
|
+
* independent directions — emitted on the response and echoed back by the
|
|
12
|
+
* client on the next request — and both must map to the same value or the
|
|
13
|
+
* `tool_use` / `tool_result` pair stops matching.
|
|
14
|
+
*/
|
|
15
|
+
export declare function sanitizeToolCallId(id: unknown): string | undefined;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { UnifiedChatRequest } from "../types/llm";
|
|
2
|
+
interface ClaudeMessage {
|
|
3
|
+
role: "user" | "assistant";
|
|
4
|
+
content: Array<{
|
|
5
|
+
type: "text" | "image" | "tool_use" | "tool_result";
|
|
6
|
+
text?: string;
|
|
7
|
+
source?: {
|
|
8
|
+
type: "base64";
|
|
9
|
+
media_type: string;
|
|
10
|
+
data: string;
|
|
11
|
+
};
|
|
12
|
+
id?: string;
|
|
13
|
+
name?: string;
|
|
14
|
+
input?: Record<string, any>;
|
|
15
|
+
tool_use_id?: string;
|
|
16
|
+
content?: string | Array<any>;
|
|
17
|
+
}>;
|
|
18
|
+
}
|
|
19
|
+
interface ClaudeTool {
|
|
20
|
+
name: string;
|
|
21
|
+
description: string;
|
|
22
|
+
input_schema: {
|
|
23
|
+
type: string;
|
|
24
|
+
properties: Record<string, any>;
|
|
25
|
+
required?: string[];
|
|
26
|
+
additionalProperties?: boolean;
|
|
27
|
+
$schema?: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
interface VertexClaudeRequest {
|
|
31
|
+
anthropic_version: "vertex-2023-10-16";
|
|
32
|
+
messages: ClaudeMessage[];
|
|
33
|
+
max_tokens: number;
|
|
34
|
+
stream?: boolean;
|
|
35
|
+
temperature?: number;
|
|
36
|
+
top_p?: number;
|
|
37
|
+
top_k?: number;
|
|
38
|
+
tools?: ClaudeTool[];
|
|
39
|
+
tool_choice?: "auto" | "none" | {
|
|
40
|
+
type: "tool";
|
|
41
|
+
name: string;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export declare function buildRequestBody(request: UnifiedChatRequest): VertexClaudeRequest;
|
|
45
|
+
export declare function transformRequestOut(request: Record<string, any>): UnifiedChatRequest;
|
|
46
|
+
export declare function transformResponseOut(response: Response, providerName: string, logger?: any): Promise<Response>;
|
|
47
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caeliq/llms",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.58",
|
|
4
4
|
"description": "A universal LLM API transformation server",
|
|
5
5
|
"main": "dist/cjs/server.cjs",
|
|
6
6
|
"module": "dist/esm/server.mjs",
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@anthropic-ai/sdk": "^0.54.0",
|
|
33
|
-
"@caeliq/ccr-shared": "^2.0
|
|
33
|
+
"@caeliq/ccr-shared": "^2.1.0",
|
|
34
34
|
"@cursor/sdk": "^1.0.23",
|
|
35
35
|
"@fastify/cors": "^11.0.1",
|
|
36
|
-
"@google/genai": "^
|
|
36
|
+
"@google/genai": "^2.13.0",
|
|
37
37
|
"@huggingface/tokenizers": "^0.0.6",
|
|
38
38
|
"dotenv": "^16.5.0",
|
|
39
39
|
"fastify": "^5.4.0",
|