@vybestack/llxprt-code 0.1.12 → 0.1.13-nightly.250727.2261021c
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/dist/index.js +0 -0
- package/dist/package.json +5 -5
- package/dist/src/acp/acp.d.ts +208 -0
- package/dist/src/acp/acp.js +193 -0
- package/dist/src/acp/acp.js.map +1 -0
- package/dist/src/acp/acpPeer.d.ts +8 -0
- package/dist/src/acp/acpPeer.js +537 -0
- package/dist/src/acp/acpPeer.js.map +1 -0
- package/dist/src/config/config.d.ts +2 -0
- package/dist/src/config/config.js +73 -19
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/extension.d.ts +2 -2
- package/dist/src/config/extension.js +21 -16
- package/dist/src/config/extension.js.map +1 -1
- package/dist/src/config/settings.d.ts +7 -0
- package/dist/src/config/settings.js +15 -0
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/gemini.js +33 -34
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +1 -1
- package/dist/src/generated/git-commit.js +1 -1
- package/dist/src/nonInteractiveCli.js +36 -3
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/providers/index.d.ts +1 -7
- package/dist/src/providers/index.js +2 -10
- package/dist/src/providers/index.js.map +1 -1
- package/dist/src/providers/providerConfigUtils.d.ts +1 -2
- package/dist/src/providers/providerConfigUtils.js +1 -1
- package/dist/src/providers/providerConfigUtils.js.map +1 -1
- package/dist/src/providers/providerManagerInstance.d.ts +2 -2
- package/dist/src/providers/providerManagerInstance.js +21 -19
- package/dist/src/providers/providerManagerInstance.js.map +1 -1
- package/dist/src/providers/types.d.ts +1 -9
- package/dist/src/providers/types.js +2 -10
- package/dist/src/providers/types.js.map +1 -1
- package/dist/src/services/CommandService.d.ts +3 -1
- package/dist/src/services/CommandService.js +50 -11
- package/dist/src/services/CommandService.js.map +1 -1
- package/dist/src/ui/App.js +24 -25
- package/dist/src/ui/App.js.map +1 -1
- package/dist/src/ui/commands/aboutCommand.js +21 -0
- package/dist/src/ui/commands/aboutCommand.js.map +1 -1
- package/dist/src/ui/commands/baseurlCommand.d.ts +7 -0
- package/dist/src/ui/commands/baseurlCommand.js +22 -0
- package/dist/src/ui/commands/baseurlCommand.js.map +1 -0
- package/dist/src/ui/commands/bugCommand.d.ts +7 -0
- package/dist/src/ui/commands/bugCommand.js +61 -0
- package/dist/src/ui/commands/bugCommand.js.map +1 -0
- package/dist/src/ui/commands/chatCommand.d.ts +7 -0
- package/dist/src/ui/commands/chatCommand.js +170 -0
- package/dist/src/ui/commands/chatCommand.js.map +1 -0
- package/dist/src/ui/commands/clearCommand.js +12 -2
- package/dist/src/ui/commands/clearCommand.js.map +1 -1
- package/dist/src/ui/commands/compressCommand.d.ts +7 -0
- package/dist/src/ui/commands/compressCommand.js +62 -0
- package/dist/src/ui/commands/compressCommand.js.map +1 -0
- package/dist/src/ui/commands/docsCommand.d.ts +7 -0
- package/dist/src/ui/commands/docsCommand.js +29 -0
- package/dist/src/ui/commands/docsCommand.js.map +1 -0
- package/dist/src/ui/commands/editorCommand.d.ts +7 -0
- package/dist/src/ui/commands/editorCommand.js +14 -0
- package/dist/src/ui/commands/editorCommand.js.map +1 -0
- package/dist/src/ui/commands/extensionsCommand.d.ts +7 -0
- package/dist/src/ui/commands/extensionsCommand.js +29 -0
- package/dist/src/ui/commands/extensionsCommand.js.map +1 -0
- package/dist/src/ui/commands/ideCommand.d.ts +8 -0
- package/dist/src/ui/commands/ideCommand.js +123 -0
- package/dist/src/ui/commands/ideCommand.js.map +1 -0
- package/dist/src/{providers/ProviderAwareContentGenerator.d.ts → ui/commands/keyCommand.d.ts} +2 -1
- package/dist/src/ui/commands/keyCommand.js +29 -0
- package/dist/src/ui/commands/keyCommand.js.map +1 -0
- package/dist/src/ui/commands/keyfileCommand.d.ts +7 -0
- package/dist/src/ui/commands/keyfileCommand.js +104 -0
- package/dist/src/ui/commands/keyfileCommand.js.map +1 -0
- package/dist/src/ui/commands/mcpCommand.d.ts +7 -0
- package/dist/src/ui/commands/mcpCommand.js +204 -0
- package/dist/src/ui/commands/mcpCommand.js.map +1 -0
- package/dist/src/ui/commands/modelCommand.d.ts +7 -0
- package/dist/src/ui/commands/modelCommand.js +60 -0
- package/dist/src/ui/commands/modelCommand.js.map +1 -0
- package/dist/src/ui/commands/providerCommand.d.ts +7 -0
- package/dist/src/ui/commands/providerCommand.js +86 -0
- package/dist/src/ui/commands/providerCommand.js.map +1 -0
- package/dist/src/ui/commands/quitCommand.d.ts +7 -0
- package/dist/src/ui/commands/quitCommand.js +32 -0
- package/dist/src/ui/commands/quitCommand.js.map +1 -0
- package/dist/src/ui/commands/restoreCommand.d.ts +8 -0
- package/dist/src/ui/commands/restoreCommand.js +126 -0
- package/dist/src/ui/commands/restoreCommand.js.map +1 -0
- package/dist/src/ui/commands/statsCommand.d.ts +7 -0
- package/dist/src/ui/commands/statsCommand.js +50 -0
- package/dist/src/ui/commands/statsCommand.js.map +1 -0
- package/dist/src/ui/commands/toolsCommand.d.ts +7 -0
- package/dist/src/ui/commands/toolsCommand.js +54 -0
- package/dist/src/ui/commands/toolsCommand.js.map +1 -0
- package/dist/src/ui/commands/types.d.ts +34 -2
- package/dist/src/ui/components/ContextSummaryDisplay.d.ts +6 -1
- package/dist/src/ui/components/ContextSummaryDisplay.js +46 -19
- package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/Footer.d.ts +0 -1
- package/dist/src/ui/components/Footer.js +3 -21
- package/dist/src/ui/components/Footer.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.js +110 -61
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/ProviderModelDialog.d.ts +1 -1
- package/dist/src/ui/components/ThemeDialog.js +25 -24
- package/dist/src/ui/components/ThemeDialog.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.js +3 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -1
- package/dist/src/ui/components/shared/MaxSizedBox.js +69 -2
- package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +3 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.js +60 -10
- package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -1
- package/dist/src/ui/components/shared/text-buffer.js +1 -1
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
- package/dist/src/ui/constants.d.ts +1 -0
- package/dist/src/ui/constants.js +1 -0
- package/dist/src/ui/constants.js.map +1 -1
- package/dist/src/ui/containers/SessionController.js +1 -1
- package/dist/src/ui/containers/SessionController.js.map +1 -1
- package/dist/src/ui/contexts/OpenAIProviderContext.d.ts +1 -2
- package/dist/src/ui/contexts/OpenAIProviderContext.js.map +1 -1
- package/dist/src/ui/hooks/shellCommandProcessor.d.ts +1 -1
- package/dist/src/ui/hooks/shellCommandProcessor.js +35 -11
- package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +2 -9
- package/dist/src/ui/hooks/slashCommandProcessor.js +83 -622
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/useAuthCommand.js +16 -2
- package/dist/src/ui/hooks/useAuthCommand.js.map +1 -1
- package/dist/src/ui/hooks/useCompletion.d.ts +1 -0
- package/dist/src/ui/hooks/useCompletion.js +21 -2
- package/dist/src/ui/hooks/useCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useFocus.d.ts +6 -0
- package/dist/src/ui/hooks/useFocus.js +41 -0
- package/dist/src/ui/hooks/useFocus.js.map +1 -0
- package/dist/src/ui/hooks/useGeminiStream.js +34 -2
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useOpenAIProviderInfo.d.ts +3 -2
- package/dist/src/ui/hooks/useOpenAIProviderInfo.js +5 -4
- package/dist/src/ui/hooks/useOpenAIProviderInfo.js.map +1 -1
- package/dist/src/ui/hooks/usePrivacySettings.js +5 -5
- package/dist/src/ui/hooks/usePrivacySettings.js.map +1 -1
- package/dist/src/ui/hooks/useProviderDialog.d.ts +5 -2
- package/dist/src/ui/hooks/useProviderDialog.js +55 -3
- package/dist/src/ui/hooks/useProviderDialog.js.map +1 -1
- package/dist/src/ui/hooks/useProviderModelDialog.d.ts +1 -1
- package/dist/src/ui/themes/ansi-light.js +1 -1
- package/dist/src/ui/themes/ansi-light.js.map +1 -1
- package/dist/src/ui/themes/googlecode.js +1 -1
- package/dist/src/ui/themes/googlecode.js.map +1 -1
- package/dist/src/ui/themes/xcode.js +1 -1
- package/dist/src/ui/themes/xcode.js.map +1 -1
- package/dist/src/ui/types.d.ts +10 -0
- package/dist/src/ui/types.js.map +1 -1
- package/dist/src/ui/utils/updateCheck.js +10 -6
- package/dist/src/ui/utils/updateCheck.js.map +1 -1
- package/dist/src/utils/userStartupWarnings.js +1 -16
- package/dist/src/utils/userStartupWarnings.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/dist/src/providers/IMessage.d.ts +0 -38
- package/dist/src/providers/IMessage.js +0 -17
- package/dist/src/providers/IMessage.js.map +0 -1
- package/dist/src/providers/IModel.d.ts +0 -23
- package/dist/src/providers/IModel.js +0 -17
- package/dist/src/providers/IModel.js.map +0 -1
- package/dist/src/providers/IProvider.d.ts +0 -32
- package/dist/src/providers/IProvider.js +0 -17
- package/dist/src/providers/IProvider.js.map +0 -1
- package/dist/src/providers/ITool.d.ts +0 -23
- package/dist/src/providers/ITool.js +0 -17
- package/dist/src/providers/ITool.js.map +0 -1
- package/dist/src/providers/ProviderAwareContentGenerator.js +0 -9
- package/dist/src/providers/ProviderAwareContentGenerator.js.map +0 -1
- package/dist/src/providers/ProviderManager.d.ts +0 -19
- package/dist/src/providers/ProviderManager.js +0 -63
- package/dist/src/providers/ProviderManager.js.map +0 -1
- package/dist/src/providers/ProviderManagerAdapter.d.ts +0 -17
- package/dist/src/providers/ProviderManagerAdapter.js +0 -113
- package/dist/src/providers/ProviderManagerAdapter.js.map +0 -1
- package/dist/src/providers/README-qwen3.md +0 -60
- package/dist/src/providers/adapters/IStreamAdapter.d.ts +0 -18
- package/dist/src/providers/adapters/IStreamAdapter.js +0 -7
- package/dist/src/providers/adapters/IStreamAdapter.js.map +0 -1
- package/dist/src/providers/anthropic/AnthropicProvider.d.ts +0 -46
- package/dist/src/providers/anthropic/AnthropicProvider.js +0 -478
- package/dist/src/providers/anthropic/AnthropicProvider.js.map +0 -1
- package/dist/src/providers/contentGeneratorProvider.d.ts +0 -13
- package/dist/src/providers/contentGeneratorProvider.js +0 -17
- package/dist/src/providers/contentGeneratorProvider.js.map +0 -1
- package/dist/src/providers/gemini/GeminiProvider.d.ts +0 -72
- package/dist/src/providers/gemini/GeminiProvider.js +0 -454
- package/dist/src/providers/gemini/GeminiProvider.js.map +0 -1
- package/dist/src/providers/integration/TEST_INSTRUCTIONS.md +0 -197
- package/dist/src/providers/openai/ConversationCache.d.ts +0 -20
- package/dist/src/providers/openai/ConversationCache.js +0 -109
- package/dist/src/providers/openai/ConversationCache.js.map +0 -1
- package/dist/src/providers/openai/IChatGenerateParams.d.ts +0 -11
- package/dist/src/providers/openai/IChatGenerateParams.js +0 -2
- package/dist/src/providers/openai/IChatGenerateParams.js.map +0 -1
- package/dist/src/providers/openai/OpenAIProvider.d.ts +0 -71
- package/dist/src/providers/openai/OpenAIProvider.js +0 -486
- package/dist/src/providers/openai/OpenAIProvider.js.map +0 -1
- package/dist/src/providers/openai/Qwen3FireworksProvider.d.ts +0 -39
- package/dist/src/providers/openai/Qwen3FireworksProvider.js +0 -209
- package/dist/src/providers/openai/Qwen3FireworksProvider.js.map +0 -1
- package/dist/src/providers/openai/RESPONSES_API_MODELS.d.ts +0 -2
- package/dist/src/providers/openai/RESPONSES_API_MODELS.js +0 -14
- package/dist/src/providers/openai/RESPONSES_API_MODELS.js.map +0 -1
- package/dist/src/providers/openai/buildResponsesRequest.d.ts +0 -67
- package/dist/src/providers/openai/buildResponsesRequest.js +0 -144
- package/dist/src/providers/openai/buildResponsesRequest.js.map +0 -1
- package/dist/src/providers/openai/docs/accessing-provider-info.md +0 -172
- package/dist/src/providers/openai/docs/params-mapping.md +0 -91
- package/dist/src/providers/openai/docs/qwen3-fireworks.md +0 -47
- package/dist/src/providers/openai/docs/responses-api-tool-calls.md +0 -96
- package/dist/src/providers/openai/estimateRemoteTokens.d.ts +0 -26
- package/dist/src/providers/openai/estimateRemoteTokens.js +0 -75
- package/dist/src/providers/openai/estimateRemoteTokens.js.map +0 -1
- package/dist/src/providers/openai/getOpenAIProviderInfo.d.ts +0 -46
- package/dist/src/providers/openai/getOpenAIProviderInfo.js +0 -74
- package/dist/src/providers/openai/getOpenAIProviderInfo.js.map +0 -1
- package/dist/src/providers/openai/parseResponsesStream.d.ts +0 -3
- package/dist/src/providers/openai/parseResponsesStream.js +0 -444
- package/dist/src/providers/openai/parseResponsesStream.js.map +0 -1
- package/dist/src/providers/parsers/TextToolCallParser.d.ts +0 -35
- package/dist/src/providers/parsers/TextToolCallParser.js +0 -248
- package/dist/src/providers/parsers/TextToolCallParser.js.map +0 -1
- package/dist/src/providers/tokenizers/AnthropicTokenizer.d.ts +0 -19
- package/dist/src/providers/tokenizers/AnthropicTokenizer.js +0 -37
- package/dist/src/providers/tokenizers/AnthropicTokenizer.js.map +0 -1
- package/dist/src/providers/tokenizers/ITokenizer.d.ts +0 -18
- package/dist/src/providers/tokenizers/ITokenizer.js +0 -17
- package/dist/src/providers/tokenizers/ITokenizer.js.map +0 -1
- package/dist/src/providers/tokenizers/OpenAITokenizer.d.ts +0 -24
- package/dist/src/providers/tokenizers/OpenAITokenizer.js +0 -56
- package/dist/src/providers/tokenizers/OpenAITokenizer.js.map +0 -1
- package/dist/src/tools/IToolFormatter.d.ts +0 -40
- package/dist/src/tools/IToolFormatter.js +0 -17
- package/dist/src/tools/IToolFormatter.js.map +0 -1
- package/dist/src/tools/ToolFormatter.d.ts +0 -45
- package/dist/src/tools/ToolFormatter.js +0 -216
- package/dist/src/tools/ToolFormatter.js.map +0 -1
- package/dist/vybestack-llxprt-code-0.1.12.tgz +0 -0
@@ -1,91 +0,0 @@
|
|
1
|
-
# OpenAI Responses API Parameter Mapping
|
2
|
-
|
3
|
-
This document describes how parameters are mapped from our internal `ResponsesRequestParams` to the OpenAI Responses API format.
|
4
|
-
|
5
|
-
## Field Mapping Table
|
6
|
-
|
7
|
-
| Internal Field | Responses API Field | Type | Notes |
|
8
|
-
| ------------------- | ------------------- | ------------------------ | -------------------------------------------------------------- |
|
9
|
-
| `messages` | `messages` | `IMessage[]` | Direct mapping. Cannot be used with `prompt`. |
|
10
|
-
| `prompt` | `prompt` | `string` | Shortcut for simple queries. Cannot be used with `messages`. |
|
11
|
-
| `tools` | `tools` | `ITool[]` | Maximum 16 tools allowed. Total JSON size must be <32KB. |
|
12
|
-
| `stream` | `stream` | `boolean` | Enables streaming responses. |
|
13
|
-
| `conversationId` | `conversation_id` | `string` | For stateful conversations. Triggers message trimming warning. |
|
14
|
-
| `parentId` | `parent_id` | `string` | Parent message ID for conversation threading. |
|
15
|
-
| `tool_choice` | `tool_choice` | `string \| object` | Tool selection strategy. |
|
16
|
-
| `stateful` | `stateful` | `boolean` | Enables stateful conversation mode. |
|
17
|
-
| `model` | `model` | `string` | **Required**. Model identifier. |
|
18
|
-
| `temperature` | `temperature` | `number` | Sampling temperature (0-2). |
|
19
|
-
| `max_tokens` | `max_tokens` | `number` | Maximum tokens to generate. |
|
20
|
-
| `top_p` | `top_p` | `number` | Nucleus sampling parameter. |
|
21
|
-
| `frequency_penalty` | `frequency_penalty` | `number` | Frequency penalty (-2 to 2). |
|
22
|
-
| `presence_penalty` | `presence_penalty` | `number` | Presence penalty (-2 to 2). |
|
23
|
-
| `stop` | `stop` | `string \| string[]` | Stop sequences. |
|
24
|
-
| `n` | `n` | `number` | Number of completions to generate. |
|
25
|
-
| `logprobs` | `logprobs` | `boolean` | Include log probabilities. |
|
26
|
-
| `top_logprobs` | `top_logprobs` | `number` | Number of top log probabilities to return. |
|
27
|
-
| `response_format` | `response_format` | `object` | Response format specification. |
|
28
|
-
| `seed` | `seed` | `number` | Random seed for deterministic output. |
|
29
|
-
| `logit_bias` | `logit_bias` | `Record<string, number>` | Token bias adjustments. |
|
30
|
-
| `user` | `user` | `string` | End-user identifier. |
|
31
|
-
|
32
|
-
## Validation Rules
|
33
|
-
|
34
|
-
### 1. Message/Prompt Exclusivity
|
35
|
-
|
36
|
-
- Either `messages` or `prompt` must be provided, but not both
|
37
|
-
- Throws error if both are specified
|
38
|
-
- Throws error if neither is specified
|
39
|
-
|
40
|
-
### 2. Tool Constraints
|
41
|
-
|
42
|
-
- Maximum 16 tools allowed
|
43
|
-
- Total JSON size of tools must be less than 32KB
|
44
|
-
- Throws error if limits are exceeded
|
45
|
-
|
46
|
-
### 3. Stateful Mode Warnings
|
47
|
-
|
48
|
-
- When `conversationId` is provided with `messages`, a warning is logged
|
49
|
-
- Future implementations may trim messages to maintain context window
|
50
|
-
|
51
|
-
### 4. Required Fields
|
52
|
-
|
53
|
-
- `model` is always required for the Responses API
|
54
|
-
|
55
|
-
## Usage Examples
|
56
|
-
|
57
|
-
### Simple Prompt Request
|
58
|
-
|
59
|
-
```typescript
|
60
|
-
const request = buildResponsesRequest({
|
61
|
-
model: 'gpt-4o',
|
62
|
-
prompt: 'Hello, how are you?',
|
63
|
-
stream: true,
|
64
|
-
});
|
65
|
-
```
|
66
|
-
|
67
|
-
### Conversation with Tools
|
68
|
-
|
69
|
-
```typescript
|
70
|
-
const request = buildResponsesRequest({
|
71
|
-
model: 'gpt-4o',
|
72
|
-
messages: [{ role: 'user', content: 'What is the weather?' }],
|
73
|
-
tools: [weatherTool],
|
74
|
-
tool_choice: 'auto',
|
75
|
-
temperature: 0.7,
|
76
|
-
});
|
77
|
-
```
|
78
|
-
|
79
|
-
### Stateful Conversation
|
80
|
-
|
81
|
-
```typescript
|
82
|
-
const request = buildResponsesRequest({
|
83
|
-
model: 'gpt-4o',
|
84
|
-
messages: [
|
85
|
-
/* conversation history */
|
86
|
-
],
|
87
|
-
conversationId: 'conv-123',
|
88
|
-
parentId: 'msg-456',
|
89
|
-
stateful: true,
|
90
|
-
});
|
91
|
-
```
|
@@ -1,47 +0,0 @@
|
|
1
|
-
# Qwen3-Fireworks Provider
|
2
|
-
|
3
|
-
This provider enables support for the Qwen3-235B model through Fireworks AI's OpenAI-compatible API.
|
4
|
-
|
5
|
-
## Setup
|
6
|
-
|
7
|
-
1. Get a Fireworks AI API key from https://app.fireworks.ai/
|
8
|
-
|
9
|
-
2. Set your API key using one of these methods:
|
10
|
-
|
11
|
-
```bash
|
12
|
-
# Environment variable
|
13
|
-
export FIREWORKS_API_KEY=your-api-key
|
14
|
-
|
15
|
-
# Or use the CLI
|
16
|
-
gemini-cli
|
17
|
-
/provider qwen3-fireworks
|
18
|
-
/key your-api-key
|
19
|
-
```
|
20
|
-
|
21
|
-
3. Switch to the Qwen3-Fireworks provider:
|
22
|
-
```
|
23
|
-
/provider qwen3-fireworks
|
24
|
-
```
|
25
|
-
|
26
|
-
## Features
|
27
|
-
|
28
|
-
- **Model**: Qwen3-235B - A powerful 235 billion parameter model
|
29
|
-
- **Context Window**: 16,384 tokens
|
30
|
-
- **Tool Support**: Full OpenAI-compatible function calling
|
31
|
-
- **Special Token Cleaning**: Automatically removes Qwen3-specific control tokens from responses
|
32
|
-
|
33
|
-
## Implementation Details
|
34
|
-
|
35
|
-
The provider extends the OpenAI provider with:
|
36
|
-
|
37
|
-
- Automatic cleaning of Qwen3 control tokens (`<|im_start|>`, `<|im_end|>`, etc.)
|
38
|
-
- Removal of special function tokens (`<|reserved_special_token_*|>`)
|
39
|
-
- Proper handling of multiple newlines in responses
|
40
|
-
|
41
|
-
## Pricing
|
42
|
-
|
43
|
-
Check Fireworks AI's pricing page for current rates: https://fireworks.ai/pricing
|
44
|
-
|
45
|
-
## Troubleshooting
|
46
|
-
|
47
|
-
If you see Qwen3 control tokens in responses, ensure you're using the latest version of the provider.
|
@@ -1,96 +0,0 @@
|
|
1
|
-
# OpenAI Responses API Tool Call Support
|
2
|
-
|
3
|
-
This document describes how tool calls are handled when using the OpenAI Responses API (e.g., with o3 models).
|
4
|
-
|
5
|
-
## Event Flow
|
6
|
-
|
7
|
-
The Responses API uses a different event structure than the Chat Completions API:
|
8
|
-
|
9
|
-
1. **`response.output_item.added`** - Signals the start of a new function call
|
10
|
-
- Contains `item.id`, `item.call_id`, `item.name`
|
11
|
-
- `item.type` must be `"function_call"`
|
12
|
-
|
13
|
-
2. **`response.function_call_arguments.delta`** - Streams function arguments
|
14
|
-
- Contains `item_id` to match the function call
|
15
|
-
- Contains `delta` with partial argument JSON
|
16
|
-
|
17
|
-
3. **`response.output_item.done`** - Signals function call completion
|
18
|
-
- Contains the complete `item` with final `arguments`
|
19
|
-
- Parser yields the complete tool call at this point
|
20
|
-
|
21
|
-
## Implementation Details
|
22
|
-
|
23
|
-
### State Management
|
24
|
-
|
25
|
-
The parser maintains a `Map` of in-progress function calls:
|
26
|
-
|
27
|
-
```typescript
|
28
|
-
const functionCalls = new Map<
|
29
|
-
string,
|
30
|
-
{
|
31
|
-
id: string; // call_id or item.id
|
32
|
-
name: string; // function name
|
33
|
-
arguments: string; // accumulated JSON arguments
|
34
|
-
output_index: number; // position in output array
|
35
|
-
}
|
36
|
-
>();
|
37
|
-
```
|
38
|
-
|
39
|
-
### Event Processing
|
40
|
-
|
41
|
-
1. **On `response.output_item.added`**: Create new function call entry
|
42
|
-
2. **On `response.function_call_arguments.delta`**: Append to arguments
|
43
|
-
3. **On `response.output_item.done`**: Yield complete tool call and cleanup
|
44
|
-
|
45
|
-
### Output Format
|
46
|
-
|
47
|
-
Tool calls are yielded in the standard format expected by the rest of the system:
|
48
|
-
|
49
|
-
```typescript
|
50
|
-
{
|
51
|
-
role: ContentGeneratorRole.ASSISTANT,
|
52
|
-
content: '',
|
53
|
-
tool_calls: [{
|
54
|
-
id: string,
|
55
|
-
type: 'function',
|
56
|
-
function: {
|
57
|
-
name: string,
|
58
|
-
arguments: string // JSON string
|
59
|
-
}
|
60
|
-
}]
|
61
|
-
}
|
62
|
-
```
|
63
|
-
|
64
|
-
## Example Event Sequence
|
65
|
-
|
66
|
-
```
|
67
|
-
// 1. Function call starts
|
68
|
-
{"type":"response.output_item.added","item":{"id":"fc_123","type":"function_call","call_id":"call_abc","name":"get_weather"}}
|
69
|
-
|
70
|
-
// 2. Arguments stream in
|
71
|
-
{"type":"response.function_call_arguments.delta","item_id":"fc_123","delta":"{\"location\":"}
|
72
|
-
{"type":"response.function_call_arguments.delta","item_id":"fc_123","delta":"\"San Francisco, CA\"}"}
|
73
|
-
|
74
|
-
// 3. Function call completes
|
75
|
-
{"type":"response.output_item.done","item":{"id":"fc_123","type":"function_call","arguments":"{\"location\":\"San Francisco, CA\"}","call_id":"call_abc","name":"get_weather"}}
|
76
|
-
```
|
77
|
-
|
78
|
-
## Edge Cases Handled
|
79
|
-
|
80
|
-
1. **No call_id**: Falls back to `item.id` if `call_id` is not provided
|
81
|
-
2. **Empty arguments**: Yields empty string for functions with no parameters
|
82
|
-
3. **Concurrent calls**: Tracks multiple function calls by their unique IDs
|
83
|
-
4. **Interleaved content**: Text deltas and tool calls can be mixed in the stream
|
84
|
-
5. **Final arguments**: Uses `item.arguments` from the done event as the source of truth
|
85
|
-
|
86
|
-
## Testing
|
87
|
-
|
88
|
-
See `parseResponsesStream.responsesToolCalls.test.ts` for comprehensive test coverage including:
|
89
|
-
|
90
|
-
- Basic tool call parsing
|
91
|
-
- Streaming argument assembly
|
92
|
-
- Multiple concurrent tool calls
|
93
|
-
- Empty arguments
|
94
|
-
- Interleaved content and tool calls
|
95
|
-
- Usage data handling
|
96
|
-
- Edge cases
|
@@ -1,26 +0,0 @@
|
|
1
|
-
import { IMessage } from '../IMessage.js';
|
2
|
-
import { ConversationCache } from './ConversationCache.js';
|
3
|
-
export declare const MODEL_CONTEXT_SIZE: Record<string, number>;
|
4
|
-
/**
|
5
|
-
* Estimates the total tokens used including remote stored context
|
6
|
-
* @param model The model being used
|
7
|
-
* @param cache The conversation cache instance
|
8
|
-
* @param conversationId The conversation ID
|
9
|
-
* @param parentId The parent message ID
|
10
|
-
* @param promptTokens The tokens in the current prompt
|
11
|
-
* @returns Object with token usage information
|
12
|
-
*/
|
13
|
-
export declare function estimateRemoteTokens(model: string, cache: ConversationCache, conversationId: string | undefined, parentId: string | undefined, promptTokens: number): {
|
14
|
-
totalTokens: number;
|
15
|
-
remoteTokens: number;
|
16
|
-
promptTokens: number;
|
17
|
-
maxTokens: number;
|
18
|
-
contextUsedPercent: number;
|
19
|
-
tokensRemaining: number;
|
20
|
-
};
|
21
|
-
/**
|
22
|
-
* Estimates tokens for a message array (rough approximation)
|
23
|
-
* @param messages Array of messages
|
24
|
-
* @returns Estimated token count
|
25
|
-
*/
|
26
|
-
export declare function estimateMessagesTokens(messages: IMessage[]): number;
|
@@ -1,75 +0,0 @@
|
|
1
|
-
// Model context size configuration
|
2
|
-
export const MODEL_CONTEXT_SIZE = {
|
3
|
-
'gpt-4.1': 1_000_000,
|
4
|
-
o3: 200_000,
|
5
|
-
'o3-pro': 200_000,
|
6
|
-
'o3-mini': 200_000,
|
7
|
-
o1: 200_000,
|
8
|
-
'o1-mini': 200_000,
|
9
|
-
'gpt-4o': 128_000,
|
10
|
-
'gpt-4o-mini': 128_000,
|
11
|
-
'gpt-4o-realtime': 128_000,
|
12
|
-
'gpt-4-turbo': 128_000,
|
13
|
-
'gpt-4-turbo-preview': 128_000,
|
14
|
-
'gpt-3.5-turbo': 16_385,
|
15
|
-
// Default fallback
|
16
|
-
default: 128_000,
|
17
|
-
};
|
18
|
-
/**
|
19
|
-
* Estimates the total tokens used including remote stored context
|
20
|
-
* @param model The model being used
|
21
|
-
* @param cache The conversation cache instance
|
22
|
-
* @param conversationId The conversation ID
|
23
|
-
* @param parentId The parent message ID
|
24
|
-
* @param promptTokens The tokens in the current prompt
|
25
|
-
* @returns Object with token usage information
|
26
|
-
*/
|
27
|
-
export function estimateRemoteTokens(model, cache, conversationId, parentId, promptTokens) {
|
28
|
-
// Find the context size by checking if model starts with known prefixes
|
29
|
-
let maxTokens = MODEL_CONTEXT_SIZE.default;
|
30
|
-
for (const [knownModel, contextSize] of Object.entries(MODEL_CONTEXT_SIZE)) {
|
31
|
-
if (knownModel !== 'default' && model.startsWith(knownModel)) {
|
32
|
-
maxTokens = contextSize;
|
33
|
-
break;
|
34
|
-
}
|
35
|
-
}
|
36
|
-
// Get accumulated tokens from cache
|
37
|
-
const remoteTokens = conversationId && parentId
|
38
|
-
? cache.getAccumulatedTokens(conversationId, parentId)
|
39
|
-
: 0;
|
40
|
-
const totalTokens = remoteTokens + promptTokens;
|
41
|
-
const tokensRemaining = Math.max(0, maxTokens - totalTokens);
|
42
|
-
const contextUsedPercent = Math.min(100, (totalTokens / maxTokens) * 100);
|
43
|
-
return {
|
44
|
-
totalTokens,
|
45
|
-
remoteTokens,
|
46
|
-
promptTokens,
|
47
|
-
maxTokens,
|
48
|
-
contextUsedPercent,
|
49
|
-
tokensRemaining,
|
50
|
-
};
|
51
|
-
}
|
52
|
-
/**
|
53
|
-
* Estimates tokens for a message array (rough approximation)
|
54
|
-
* @param messages Array of messages
|
55
|
-
* @returns Estimated token count
|
56
|
-
*/
|
57
|
-
export function estimateMessagesTokens(messages) {
|
58
|
-
// Rough estimation: ~4 characters per token
|
59
|
-
let totalChars = 0;
|
60
|
-
for (const message of messages) {
|
61
|
-
// Add role tokens (usually 1-2 tokens)
|
62
|
-
totalChars += 8;
|
63
|
-
// Add content
|
64
|
-
if (message.content) {
|
65
|
-
totalChars += message.content.length;
|
66
|
-
}
|
67
|
-
// Add tool calls overhead
|
68
|
-
if (message.tool_calls) {
|
69
|
-
totalChars += JSON.stringify(message.tool_calls).length;
|
70
|
-
}
|
71
|
-
}
|
72
|
-
// Rough approximation: 4 characters per token
|
73
|
-
return Math.ceil(totalChars / 4);
|
74
|
-
}
|
75
|
-
//# sourceMappingURL=estimateRemoteTokens.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"estimateRemoteTokens.js","sourceRoot":"","sources":["../../../../src/providers/openai/estimateRemoteTokens.ts"],"names":[],"mappings":"AAGA,mCAAmC;AACnC,MAAM,CAAC,MAAM,kBAAkB,GAA2B;IACxD,SAAS,EAAE,SAAS;IACpB,EAAE,EAAE,OAAO;IACX,QAAQ,EAAE,OAAO;IACjB,SAAS,EAAE,OAAO;IAClB,EAAE,EAAE,OAAO;IACX,SAAS,EAAE,OAAO;IAClB,QAAQ,EAAE,OAAO;IACjB,aAAa,EAAE,OAAO;IACtB,iBAAiB,EAAE,OAAO;IAC1B,aAAa,EAAE,OAAO;IACtB,qBAAqB,EAAE,OAAO;IAC9B,eAAe,EAAE,MAAM;IACvB,mBAAmB;IACnB,OAAO,EAAE,OAAO;CACjB,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAClC,KAAa,EACb,KAAwB,EACxB,cAAkC,EAClC,QAA4B,EAC5B,YAAoB;IASpB,wEAAwE;IACxE,IAAI,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC;IAC3C,KAAK,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE,CAAC;QAC3E,IAAI,UAAU,KAAK,SAAS,IAAI,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAC7D,SAAS,GAAG,WAAW,CAAC;YACxB,MAAM;QACR,CAAC;IACH,CAAC;IAED,oCAAoC;IACpC,MAAM,YAAY,GAChB,cAAc,IAAI,QAAQ;QACxB,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC,cAAc,EAAE,QAAQ,CAAC;QACtD,CAAC,CAAC,CAAC,CAAC;IAER,MAAM,WAAW,GAAG,YAAY,GAAG,YAAY,CAAC;IAChD,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC,CAAC;IAC7D,MAAM,kBAAkB,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,WAAW,GAAG,SAAS,CAAC,GAAG,GAAG,CAAC,CAAC;IAE1E,OAAO;QACL,WAAW;QACX,YAAY;QACZ,YAAY;QACZ,SAAS;QACT,kBAAkB;QAClB,eAAe;KAChB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAoB;IACzD,4CAA4C;IAC5C,IAAI,UAAU,GAAG,CAAC,CAAC;IAEnB,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,uCAAuC;QACvC,UAAU,IAAI,CAAC,CAAC;QAEhB,cAAc;QACd,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YACpB,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC;QACvC,CAAC;QAED,0BAA0B;QAC1B,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YACvB,UAAU,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC;QAC1D,CAAC;IACH,CAAC;IAED,8CAA8C;IAC9C,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;AACnC,CAAC"}
|
@@ -1,46 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license
|
3
|
-
* Copyright 2025 Vybestack LLC
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
5
|
-
*/
|
6
|
-
import { Config } from '@vybestack/llxprt-code-core';
|
7
|
-
import { ConversationCache } from './ConversationCache.js';
|
8
|
-
type OpenAIProviderLike = {
|
9
|
-
name: string;
|
10
|
-
getCurrentModel?: () => string;
|
11
|
-
getConversationCache?: () => ConversationCache;
|
12
|
-
shouldUseResponses?: (model: string) => boolean;
|
13
|
-
[key: string]: unknown;
|
14
|
-
};
|
15
|
-
export interface OpenAIProviderInfo {
|
16
|
-
provider: OpenAIProviderLike | null;
|
17
|
-
conversationCache: ConversationCache | null;
|
18
|
-
isResponsesAPI: boolean;
|
19
|
-
currentModel: string | null;
|
20
|
-
remoteTokenInfo: {
|
21
|
-
promptTokenCount?: number;
|
22
|
-
candidatesTokenCount?: number;
|
23
|
-
totalTokenCount?: number;
|
24
|
-
};
|
25
|
-
}
|
26
|
-
/**
|
27
|
-
* Retrieves OpenAI provider information from the current Config instance
|
28
|
-
* @param config The Config instance from the app
|
29
|
-
* @returns OpenAI provider info if available, null values otherwise
|
30
|
-
*/
|
31
|
-
export declare function getOpenAIProviderInfo(config: Config): OpenAIProviderInfo;
|
32
|
-
export {};
|
33
|
-
/**
|
34
|
-
* Example usage in a React component or hook:
|
35
|
-
*
|
36
|
-
* const openAIInfo = getOpenAIProviderInfo(config);
|
37
|
-
* if (openAIInfo.provider && openAIInfo.conversationCache) {
|
38
|
-
* // Access conversation cache
|
39
|
-
* const cachedMessages = openAIInfo.conversationCache.get(conversationId, parentId);
|
40
|
-
*
|
41
|
-
* // Check if using Responses API
|
42
|
-
* if (openAIInfo.isResponsesAPI) {
|
43
|
-
* console.log('Using OpenAI Responses API');
|
44
|
-
* }
|
45
|
-
* }
|
46
|
-
*/
|
@@ -1,74 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license
|
3
|
-
* Copyright 2025 Vybestack LLC
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
5
|
-
*/
|
6
|
-
import { RESPONSES_API_MODELS } from './RESPONSES_API_MODELS.js';
|
7
|
-
/**
|
8
|
-
* Retrieves OpenAI provider information from the current Config instance
|
9
|
-
* @param config The Config instance from the app
|
10
|
-
* @returns OpenAI provider info if available, null values otherwise
|
11
|
-
*/
|
12
|
-
export function getOpenAIProviderInfo(config) {
|
13
|
-
const result = {
|
14
|
-
provider: null,
|
15
|
-
conversationCache: null,
|
16
|
-
isResponsesAPI: false,
|
17
|
-
currentModel: null,
|
18
|
-
remoteTokenInfo: {},
|
19
|
-
};
|
20
|
-
try {
|
21
|
-
// Access the provider manager from config via getter to avoid private property issues
|
22
|
-
const providerManager = config.getProviderManager?.();
|
23
|
-
if (!providerManager || !providerManager.hasActiveProvider()) {
|
24
|
-
return result;
|
25
|
-
}
|
26
|
-
// Get the active provider
|
27
|
-
const activeProvider = providerManager.getActiveProvider();
|
28
|
-
if (!activeProvider || activeProvider.name !== 'openai') {
|
29
|
-
return result;
|
30
|
-
}
|
31
|
-
// Narrow to expected provider type using feature detection
|
32
|
-
const openaiProvider = activeProvider;
|
33
|
-
result.provider = openaiProvider;
|
34
|
-
// Access the conversation cache via public getter or lax cast
|
35
|
-
if (typeof openaiProvider.getConversationCache === 'function') {
|
36
|
-
result.conversationCache = openaiProvider.getConversationCache();
|
37
|
-
}
|
38
|
-
else if ('conversationCache' in openaiProvider) {
|
39
|
-
// Cast only if property actually exists (type guard)
|
40
|
-
result.conversationCache =
|
41
|
-
openaiProvider.conversationCache ?? null;
|
42
|
-
}
|
43
|
-
// Get current model
|
44
|
-
result.currentModel = openaiProvider.getCurrentModel?.() || null;
|
45
|
-
// Check if using Responses API (fall back to static list)
|
46
|
-
if (openaiProvider.shouldUseResponses && result.currentModel) {
|
47
|
-
result.isResponsesAPI = openaiProvider.shouldUseResponses(result.currentModel);
|
48
|
-
}
|
49
|
-
else if (result.currentModel) {
|
50
|
-
result.isResponsesAPI = RESPONSES_API_MODELS.includes(result.currentModel);
|
51
|
-
}
|
52
|
-
// Note: Remote token info would need to be tracked separately during API calls
|
53
|
-
// This is a placeholder for where that information would be stored
|
54
|
-
}
|
55
|
-
catch (error) {
|
56
|
-
console.error('Error accessing OpenAI provider info:', error);
|
57
|
-
}
|
58
|
-
return result;
|
59
|
-
}
|
60
|
-
/**
|
61
|
-
* Example usage in a React component or hook:
|
62
|
-
*
|
63
|
-
* const openAIInfo = getOpenAIProviderInfo(config);
|
64
|
-
* if (openAIInfo.provider && openAIInfo.conversationCache) {
|
65
|
-
* // Access conversation cache
|
66
|
-
* const cachedMessages = openAIInfo.conversationCache.get(conversationId, parentId);
|
67
|
-
*
|
68
|
-
* // Check if using Responses API
|
69
|
-
* if (openAIInfo.isResponsesAPI) {
|
70
|
-
* console.log('Using OpenAI Responses API');
|
71
|
-
* }
|
72
|
-
* }
|
73
|
-
*/
|
74
|
-
//# sourceMappingURL=getOpenAIProviderInfo.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getOpenAIProviderInfo.js","sourceRoot":"","sources":["../../../../src/providers/openai/getOpenAIProviderInfo.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AA4BjE;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAc;IAClD,MAAM,MAAM,GAAuB;QACjC,QAAQ,EAAE,IAAI;QACd,iBAAiB,EAAE,IAAI;QACvB,cAAc,EAAE,KAAK;QACrB,YAAY,EAAE,IAAI;QAClB,eAAe,EAAE,EAAE;KACpB,CAAC;IAEF,IAAI,CAAC;QACH,sFAAsF;QACtF,MAAM,eAAe,GACnB,MACD,CAAC,kBAAkB,EAAE,EAAE,CAAC;QACzB,IAAI,CAAC,eAAe,IAAI,CAAC,eAAe,CAAC,iBAAiB,EAAE,EAAE,CAAC;YAC7D,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,0BAA0B;QAC1B,MAAM,cAAc,GAAG,eAAe,CAAC,iBAAiB,EAAE,CAAC;QAC3D,IAAI,CAAC,cAAc,IAAI,cAAc,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACxD,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,2DAA2D;QAC3D,MAAM,cAAc,GAAG,cAA+C,CAAC;QACvE,MAAM,CAAC,QAAQ,GAAG,cAAc,CAAC;QAEjC,8DAA8D;QAC9D,IAAI,OAAO,cAAc,CAAC,oBAAoB,KAAK,UAAU,EAAE,CAAC;YAC9D,MAAM,CAAC,iBAAiB,GAAG,cAAc,CAAC,oBAAoB,EAAE,CAAC;QACnE,CAAC;aAAM,IAAI,mBAAmB,IAAI,cAAc,EAAE,CAAC;YACjD,qDAAqD;YACrD,MAAM,CAAC,iBAAiB;gBAEpB,cAGD,CAAC,iBAAiB,IAAI,IAAI,CAAC;QAChC,CAAC;QAED,oBAAoB;QACpB,MAAM,CAAC,YAAY,GAAG,cAAc,CAAC,eAAe,EAAE,EAAE,IAAI,IAAI,CAAC;QAEjE,0DAA0D;QAC1D,IAAI,cAAc,CAAC,kBAAkB,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;YAC7D,MAAM,CAAC,cAAc,GAAG,cAAc,CAAC,kBAAkB,CACvD,MAAM,CAAC,YAAY,CACpB,CAAC;QACJ,CAAC;aAAM,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;YAC/B,MAAM,CAAC,cAAc,GACnB,oBACD,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QAClC,CAAC;QAED,+EAA+E;QAC/E,mEAAmE;IACrE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,uCAAuC,EAAE,KAAK,CAAC,CAAC;IAChE,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;;;;;;GAaG"}
|