@xpert-ai/plugin-openai 0.1.0 → 0.2.0

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 ADDED
@@ -0,0 +1,70 @@
1
+ # OpenAI model provider
2
+
3
+ Provides OpenAI text generation, image input, structured output and Xpert function calling through the Responses API.
4
+
5
+ All five current models explicitly declare `openai_responses` for the existing native transport. Host policy and the SDK requirements in [NATIVE_PROTOCOL.md](./NATIVE_PROTOCOL.md) still apply.
6
+
7
+ ## Current models
8
+
9
+ Verified against official API documentation on 2026-10-30. Prices below are USD per million tokens for Standard processing up to 272,000 input tokens.
10
+
11
+ | Model ID | Reasoning efforts | Input | Cached input | Output |
12
+ | --- | --- | ---: | ---: | ---: |
13
+ | `gpt-6-astra` | low, medium, high, xhigh, max | 10 | 1 | 50 |
14
+ | `gpt-6.1-sol` | low, medium, high, xhigh, max | 2 | 0.10 | 10 |
15
+ | `gpt-6.1-terra` | none, low, medium, high, xhigh, max | 1 | 0.05 | 5 |
16
+ | `gpt-6-luna` | none, low, medium, high, xhigh, max | 0.10 | 0.01 | 0.50 |
17
+ | `gpt-6-sol` | none, low, medium, high, xhigh, max | 2 | 0.20 | 10 |
18
+
19
+ All five use `medium` by default, a 1,050,000-token context window, a maximum 922,000-token input and a maximum 128,000-token output including reasoning. The plugin defaults the output budget to 32,768. Input and output must fit in the context window. GPT-6.1 Sol is the newer Sol entry; GPT-6 Sol remains selectable.
20
+
21
+ Sources: [Astra](https://developers.openai.com/api/docs/models/gpt-6-astra), [6.1 Sol](https://developers.openai.com/api/docs/models/gpt-6.1-sol), [6.1 Terra](https://developers.openai.com/api/docs/models/gpt-6.1-terra), [Luna](https://developers.openai.com/api/docs/models/gpt-6-luna), [6 Sol](https://developers.openai.com/api/docs/models/gpt-6-sol), [migration requirements](https://developers.openai.com/api/docs/guides/latest-model).
22
+
23
+ The current additions cover the GPT-6 LLM family. Audio, realtime, embeddings and standalone image/video generation use different APIs and are outside this LLM provider. A model supporting an OpenAI-hosted tool does not automatically register that tool in Xpert.
24
+
25
+ ## Catalog cleanup
26
+
27
+ The preset catalog contains the five GPT-6 models above plus `gpt-5.2`, `gpt-5.2-pro` and `gpt-5.3-codex`.
28
+
29
+ - Remove `gpt-5.4`, `gpt-5.4-pro` and `gpt-5` from Xpert's presets as part of this catalog update. This selection does not imply that all three are shut down by OpenAI.
30
+ - Remove `gpt-5.2-codex` and the old `gpt-5.2-chat` entry. OpenAI has shut down GPT-5.2 Codex and GPT-5.2 Chat (`gpt-5.2-chat-latest` in the official API).
31
+ - Retain GPT-5.3 Codex while it remains available; OpenAI marks it deprecated with shutdown scheduled for 2027-04-01. See the [official deprecations](https://developers.openai.com/api/docs/deprecations).
32
+
33
+ Removed entries are excluded from model selection and native transport discovery. Packaging removes their stale YAML assets from earlier builds. Saved Assistant configurations are not rewritten; select a retained model when migrating an Assistant that uses a removed entry. Legacy request handling remains for saved or custom configurations and does not restore removed catalog entries.
34
+
35
+ ## Configuration
36
+
37
+ 1. Configure the OpenAI provider with an API key authorized for the intended models. Official credential validation reads `/v1/models`; restricted keys need model-list read permission. This validates authentication, not access to every model or billing availability.
38
+ 2. Leave the endpoint empty for `https://api.openai.com/v1`, or supply a Responses-compatible base URL. Custom endpoints use generation-based validation, trying only models in the current preset catalog in catalog order until one succeeds or an error unrelated to model availability occurs.
39
+ 3. Select the exact model ID in the Assistant and set reasoning effort and output budget. No existing Assistant is switched automatically.
40
+
41
+ For the current official models, `temperature` and `top_p` are sent only at `reasoning_effort: none`. Astra and 6.1 Sol never expose `none`. Saved `minimal` values normalize to `low`; saved `none` on Astra/6.1 Sol normalizes to `low`. The endpoint sampling override cannot force unsupported sampling on the official API; explicitly enabled sampling on a custom gateway remains supported.
42
+
43
+ The same sampling restrictions protect registered legacy reasoning models, including retained GPT-5.2 and saved GPT-5.4 configurations. These two models allow sampling with `none` (their API default); switching a call to higher reasoning removes sampling parameters from the serialized request. Registered GPT-5, Pro and Codex models without a `none` mode omit sampling even when explicitly enabled on the official endpoint. See [GPT-5.2 parameter compatibility](https://developers.openai.com/api/docs/guides/latest-model?model=gpt-5.2#gpt-52-parameter-compatibility).
44
+
45
+ The existing LangChain 0.6.9 dependency does not recognize GPT-6 reasoning. The plugin's Responses adapter forwards reasoning for explicitly registered model IDs, including `max`, without guessing capabilities from a name prefix. The outer ChatOpenAI and its custom Responses instance receive the same output, streaming and sampling settings.
46
+
47
+ ## Pricing boundaries
48
+
49
+ - Above **272,000** input tokens, input and cache rates double and output rates increase by 1.5 for the **whole request**. Both detailed price rules and legacy input/output estimates encode this boundary.
50
+ - Cache writes use the documented Standard 30-minute rate: 1.25 times input pricing before long-context adjustments. Cached input and reasoning token details are retained in the standard LangChain usage fields for both streaming and non-streaming responses.
51
+ - Accurate cache billing requires a host SDK that consumes detailed `pricing.rules` and provider usage. Older hosts using only legacy input/output prices cannot calculate cache discounts correctly.
52
+ - Fast, Ultrafast, Batch/Flex, regional surcharges and 12-hour cache retention are not exposed by this plugin. These catalog rates must not be reused for those modes or a custom gateway with different pricing.
53
+ - Full 922K input-limit enforcement remains upstream: the current shared model profile exposes context size and output limits, not a separate maximum input field.
54
+
55
+ ## Validation
56
+
57
+ From the `xpertai` workspace:
58
+
59
+ ```sh
60
+ corepack pnpm exec nx run @xpert-ai/plugin-openai:test --runInBand
61
+ corepack pnpm exec nx run @xpert-ai/plugin-openai:build
62
+ corepack pnpm exec nx run @xpert-ai/plugin-openai:typecheck
63
+ node ../plugin-dev-harness/dist/index.js --workspace . --plugin @xpert-ai/plugin-openai
64
+ ```
65
+
66
+ Follow the harness README's Node 20 recommendation if Node 22 fails to load the dependency graph. For an intentionally unchanged dependency installation, `pnpm_config_verify_deps_before_run=false` skips pnpm's automatic install check; `--skipSync` avoids applying unrelated Nx workspace reference updates.
67
+
68
+ The regression suite uses the real LangChain/OpenAI request serializers with an intercepted fetch and fake credentials. It checks the model catalog, reasoning, sampling, output budget, structured output, tool/image request payloads, a function-call/result round trip, streaming reasoning, token details, authentication and existing gateway behavior. It makes no paid API requests. Lifecycle checks use a disposable Nest application context with host infrastructure mocks; they do not install the plugin into a running Xpert server.
69
+
70
+ After installation, separately verify a real text/image request and a tool-call round trip with the account's actual model permissions. Local checks do not establish installed-runtime or business acceptance.
package/dist/index.js CHANGED
@@ -17,8 +17,8 @@ const plugin = {
17
17
  value: SvgIcon,
18
18
  },
19
19
  displayName: 'OpenAI',
20
- description: 'Provide OpenAI GPT-5 and GPT-5.4 models via Responses API',
21
- keywords: ['OpenAI', 'GPT-5', 'GPT-5.4', 'model', 'llm', 'reasoning', 'Responses API'],
20
+ description: 'Provide OpenAI GPT-6 and GPT-5 models via Responses API',
21
+ keywords: ['OpenAI', 'GPT-6', 'GPT-6.1', 'GPT-5', 'model', 'llm', 'reasoning', 'Responses API'],
22
22
  author: 'XpertAI Team',
23
23
  },
24
24
  config: {
@@ -1,8 +1,8 @@
1
- - gpt-5.4
2
- - gpt-5.4-pro
3
- - gpt-5
1
+ - gpt-6-astra
2
+ - gpt-6.1-sol
3
+ - gpt-6.1-terra
4
+ - gpt-6-luna
5
+ - gpt-6-sol
4
6
  - gpt-5.3-codex
5
7
  - gpt-5.2
6
- - gpt-5.2-chat
7
8
  - gpt-5.2-pro
8
- - gpt-5.2-codex
@@ -0,0 +1,99 @@
1
+ # Source: https://developers.openai.com/api/docs/models/gpt-6-astra (2026-10-30)
2
+ model: gpt-6-astra
3
+ native_protocols:
4
+ - openai_responses
5
+ label:
6
+ en_US: GPT-6 Astra
7
+ zh_Hans: GPT-6 Astra
8
+ model_type: llm
9
+ features:
10
+ - agent-thought
11
+ - tool-call
12
+ - multi-tool-call
13
+ - stream-tool-call
14
+ - structured-output
15
+ - vision
16
+ model_properties:
17
+ mode: chat
18
+ context_size: 1050000
19
+ max_output: 128000
20
+ parameter_rules:
21
+ - name: max_tokens
22
+ use_template: max_tokens
23
+ default: 32768
24
+ min: 16
25
+ max: 128000
26
+ help:
27
+ en_US: Maximum output tokens, including reasoning tokens. Input and output must fit within the context window.
28
+ zh_Hans: 最大输出 Token 数,包含推理 Token;输入和输出合计须在上下文窗口内。
29
+ - name: reasoning_effort
30
+ label:
31
+ en_US: Reasoning Effort
32
+ zh_Hans: 推理力度
33
+ type: string
34
+ required: false
35
+ default: medium
36
+ options:
37
+ - low
38
+ - medium
39
+ - high
40
+ - xhigh
41
+ - max
42
+ help:
43
+ en_US: Higher effort can improve reasoning at the cost of latency and output tokens. Sampling parameters apply only with none.
44
+ zh_Hans: 更高档位可增强推理,但会增加延迟和输出 Token;采样参数仅在 none 档位生效。
45
+ - name: response_format
46
+ label:
47
+ en_US: Response Format
48
+ zh_Hans: 回复格式
49
+ type: string
50
+ required: false
51
+ options:
52
+ - text
53
+ - json_object
54
+ pricing:
55
+ input: '10'
56
+ output: '50'
57
+ unit: '0.000001'
58
+ currency: USD
59
+ # Standard processing; long-context rates apply to the entire request above 272K input tokens.
60
+ tiered_pricing:
61
+ - input: 10
62
+ output: 50
63
+ max_tokens: 272000
64
+ - input: 20
65
+ output: 75.0
66
+ max_tokens: 1050000
67
+ rules:
68
+ - component: input
69
+ unit_price: 10
70
+ unit_size: 1000000
71
+ max_input_tokens: 272000
72
+ - component: output
73
+ unit_price: 50
74
+ unit_size: 1000000
75
+ max_input_tokens: 272000
76
+ - component: cache_read_input
77
+ unit_price: 1
78
+ unit_size: 1000000
79
+ max_input_tokens: 272000
80
+ - component: cache_write_input
81
+ unit_price: 12.50
82
+ unit_size: 1000000
83
+ max_input_tokens: 272000
84
+ - component: input
85
+ unit_price: 20
86
+ unit_size: 1000000
87
+ min_input_tokens: 272001
88
+ - component: output
89
+ unit_price: 75.0
90
+ unit_size: 1000000
91
+ min_input_tokens: 272001
92
+ - component: cache_read_input
93
+ unit_price: 2
94
+ unit_size: 1000000
95
+ min_input_tokens: 272001
96
+ - component: cache_write_input
97
+ unit_price: 25.00
98
+ unit_size: 1000000
99
+ min_input_tokens: 272001
@@ -0,0 +1,116 @@
1
+ # Source: https://developers.openai.com/api/docs/models/gpt-6-luna (2026-10-30)
2
+ model: gpt-6-luna
3
+ native_protocols:
4
+ - openai_responses
5
+ label:
6
+ en_US: GPT-6 Luna
7
+ zh_Hans: GPT-6 Luna
8
+ model_type: llm
9
+ features:
10
+ - agent-thought
11
+ - tool-call
12
+ - multi-tool-call
13
+ - stream-tool-call
14
+ - structured-output
15
+ - vision
16
+ model_properties:
17
+ mode: chat
18
+ context_size: 1050000
19
+ max_output: 128000
20
+ parameter_rules:
21
+ - name: max_tokens
22
+ use_template: max_tokens
23
+ default: 32768
24
+ min: 16
25
+ max: 128000
26
+ help:
27
+ en_US: Maximum output tokens, including reasoning tokens. Input and output must fit within the context window.
28
+ zh_Hans: 最大输出 Token 数,包含推理 Token;输入和输出合计须在上下文窗口内。
29
+ - name: reasoning_effort
30
+ label:
31
+ en_US: Reasoning Effort
32
+ zh_Hans: 推理力度
33
+ type: string
34
+ required: false
35
+ default: medium
36
+ options:
37
+ - none
38
+ - low
39
+ - medium
40
+ - high
41
+ - xhigh
42
+ - max
43
+ help:
44
+ en_US: Higher effort can improve reasoning at the cost of latency and output tokens. Sampling parameters apply only with none.
45
+ zh_Hans: 更高档位可增强推理,但会增加延迟和输出 Token;采样参数仅在 none 档位生效。
46
+ - name: temperature
47
+ use_template: temperature
48
+ default: 1
49
+ min: 0.0
50
+ max: 2.0
51
+ help:
52
+ en_US: Only sent when reasoning effort is none.
53
+ zh_Hans: 仅当推理力度为 none 时发送。
54
+ - name: top_p
55
+ use_template: top_p
56
+ default: 1
57
+ min: 0.0
58
+ max: 1.0
59
+ help:
60
+ en_US: Only sent when reasoning effort is none.
61
+ zh_Hans: 仅当推理力度为 none 时发送。
62
+ - name: response_format
63
+ label:
64
+ en_US: Response Format
65
+ zh_Hans: 回复格式
66
+ type: string
67
+ required: false
68
+ options:
69
+ - text
70
+ - json_object
71
+ pricing:
72
+ input: '0.1'
73
+ output: '0.5'
74
+ unit: '0.000001'
75
+ currency: USD
76
+ # Standard processing; long-context rates apply to the entire request above 272K input tokens.
77
+ tiered_pricing:
78
+ - input: 0.1
79
+ output: 0.5
80
+ max_tokens: 272000
81
+ - input: 0.2
82
+ output: 0.75
83
+ max_tokens: 1050000
84
+ rules:
85
+ - component: input
86
+ unit_price: 0.1
87
+ unit_size: 1000000
88
+ max_input_tokens: 272000
89
+ - component: output
90
+ unit_price: 0.5
91
+ unit_size: 1000000
92
+ max_input_tokens: 272000
93
+ - component: cache_read_input
94
+ unit_price: 0.01
95
+ unit_size: 1000000
96
+ max_input_tokens: 272000
97
+ - component: cache_write_input
98
+ unit_price: 0.125
99
+ unit_size: 1000000
100
+ max_input_tokens: 272000
101
+ - component: input
102
+ unit_price: 0.2
103
+ unit_size: 1000000
104
+ min_input_tokens: 272001
105
+ - component: output
106
+ unit_price: 0.75
107
+ unit_size: 1000000
108
+ min_input_tokens: 272001
109
+ - component: cache_read_input
110
+ unit_price: 0.02
111
+ unit_size: 1000000
112
+ min_input_tokens: 272001
113
+ - component: cache_write_input
114
+ unit_price: 0.250
115
+ unit_size: 1000000
116
+ min_input_tokens: 272001
@@ -0,0 +1,116 @@
1
+ # Source: https://developers.openai.com/api/docs/models/gpt-6-sol (2026-10-30)
2
+ model: gpt-6-sol
3
+ native_protocols:
4
+ - openai_responses
5
+ label:
6
+ en_US: GPT-6 Sol
7
+ zh_Hans: GPT-6 Sol
8
+ model_type: llm
9
+ features:
10
+ - agent-thought
11
+ - tool-call
12
+ - multi-tool-call
13
+ - stream-tool-call
14
+ - structured-output
15
+ - vision
16
+ model_properties:
17
+ mode: chat
18
+ context_size: 1050000
19
+ max_output: 128000
20
+ parameter_rules:
21
+ - name: max_tokens
22
+ use_template: max_tokens
23
+ default: 32768
24
+ min: 16
25
+ max: 128000
26
+ help:
27
+ en_US: Maximum output tokens, including reasoning tokens. Input and output must fit within the context window.
28
+ zh_Hans: 最大输出 Token 数,包含推理 Token;输入和输出合计须在上下文窗口内。
29
+ - name: reasoning_effort
30
+ label:
31
+ en_US: Reasoning Effort
32
+ zh_Hans: 推理力度
33
+ type: string
34
+ required: false
35
+ default: medium
36
+ options:
37
+ - none
38
+ - low
39
+ - medium
40
+ - high
41
+ - xhigh
42
+ - max
43
+ help:
44
+ en_US: Higher effort can improve reasoning at the cost of latency and output tokens. Sampling parameters apply only with none.
45
+ zh_Hans: 更高档位可增强推理,但会增加延迟和输出 Token;采样参数仅在 none 档位生效。
46
+ - name: temperature
47
+ use_template: temperature
48
+ default: 1
49
+ min: 0.0
50
+ max: 2.0
51
+ help:
52
+ en_US: Only sent when reasoning effort is none.
53
+ zh_Hans: 仅当推理力度为 none 时发送。
54
+ - name: top_p
55
+ use_template: top_p
56
+ default: 1
57
+ min: 0.0
58
+ max: 1.0
59
+ help:
60
+ en_US: Only sent when reasoning effort is none.
61
+ zh_Hans: 仅当推理力度为 none 时发送。
62
+ - name: response_format
63
+ label:
64
+ en_US: Response Format
65
+ zh_Hans: 回复格式
66
+ type: string
67
+ required: false
68
+ options:
69
+ - text
70
+ - json_object
71
+ pricing:
72
+ input: '2'
73
+ output: '10'
74
+ unit: '0.000001'
75
+ currency: USD
76
+ # Standard processing; long-context rates apply to the entire request above 272K input tokens.
77
+ tiered_pricing:
78
+ - input: 2
79
+ output: 10
80
+ max_tokens: 272000
81
+ - input: 4
82
+ output: 15.0
83
+ max_tokens: 1050000
84
+ rules:
85
+ - component: input
86
+ unit_price: 2
87
+ unit_size: 1000000
88
+ max_input_tokens: 272000
89
+ - component: output
90
+ unit_price: 10
91
+ unit_size: 1000000
92
+ max_input_tokens: 272000
93
+ - component: cache_read_input
94
+ unit_price: 0.2
95
+ unit_size: 1000000
96
+ max_input_tokens: 272000
97
+ - component: cache_write_input
98
+ unit_price: 2.50
99
+ unit_size: 1000000
100
+ max_input_tokens: 272000
101
+ - component: input
102
+ unit_price: 4
103
+ unit_size: 1000000
104
+ min_input_tokens: 272001
105
+ - component: output
106
+ unit_price: 15.0
107
+ unit_size: 1000000
108
+ min_input_tokens: 272001
109
+ - component: cache_read_input
110
+ unit_price: 0.4
111
+ unit_size: 1000000
112
+ min_input_tokens: 272001
113
+ - component: cache_write_input
114
+ unit_price: 5.00
115
+ unit_size: 1000000
116
+ min_input_tokens: 272001
@@ -0,0 +1,99 @@
1
+ # Source: https://developers.openai.com/api/docs/models/gpt-6.1-sol (2026-10-30)
2
+ model: gpt-6.1-sol
3
+ native_protocols:
4
+ - openai_responses
5
+ label:
6
+ en_US: GPT-6.1 Sol
7
+ zh_Hans: GPT-6.1 Sol
8
+ model_type: llm
9
+ features:
10
+ - agent-thought
11
+ - tool-call
12
+ - multi-tool-call
13
+ - stream-tool-call
14
+ - structured-output
15
+ - vision
16
+ model_properties:
17
+ mode: chat
18
+ context_size: 1050000
19
+ max_output: 128000
20
+ parameter_rules:
21
+ - name: max_tokens
22
+ use_template: max_tokens
23
+ default: 32768
24
+ min: 16
25
+ max: 128000
26
+ help:
27
+ en_US: Maximum output tokens, including reasoning tokens. Input and output must fit within the context window.
28
+ zh_Hans: 最大输出 Token 数,包含推理 Token;输入和输出合计须在上下文窗口内。
29
+ - name: reasoning_effort
30
+ label:
31
+ en_US: Reasoning Effort
32
+ zh_Hans: 推理力度
33
+ type: string
34
+ required: false
35
+ default: medium
36
+ options:
37
+ - low
38
+ - medium
39
+ - high
40
+ - xhigh
41
+ - max
42
+ help:
43
+ en_US: Higher effort can improve reasoning at the cost of latency and output tokens. Sampling parameters apply only with none.
44
+ zh_Hans: 更高档位可增强推理,但会增加延迟和输出 Token;采样参数仅在 none 档位生效。
45
+ - name: response_format
46
+ label:
47
+ en_US: Response Format
48
+ zh_Hans: 回复格式
49
+ type: string
50
+ required: false
51
+ options:
52
+ - text
53
+ - json_object
54
+ pricing:
55
+ input: '2'
56
+ output: '10'
57
+ unit: '0.000001'
58
+ currency: USD
59
+ # Standard processing; long-context rates apply to the entire request above 272K input tokens.
60
+ tiered_pricing:
61
+ - input: 2
62
+ output: 10
63
+ max_tokens: 272000
64
+ - input: 4
65
+ output: 15.0
66
+ max_tokens: 1050000
67
+ rules:
68
+ - component: input
69
+ unit_price: 2
70
+ unit_size: 1000000
71
+ max_input_tokens: 272000
72
+ - component: output
73
+ unit_price: 10
74
+ unit_size: 1000000
75
+ max_input_tokens: 272000
76
+ - component: cache_read_input
77
+ unit_price: 0.1
78
+ unit_size: 1000000
79
+ max_input_tokens: 272000
80
+ - component: cache_write_input
81
+ unit_price: 2.50
82
+ unit_size: 1000000
83
+ max_input_tokens: 272000
84
+ - component: input
85
+ unit_price: 4
86
+ unit_size: 1000000
87
+ min_input_tokens: 272001
88
+ - component: output
89
+ unit_price: 15.0
90
+ unit_size: 1000000
91
+ min_input_tokens: 272001
92
+ - component: cache_read_input
93
+ unit_price: 0.2
94
+ unit_size: 1000000
95
+ min_input_tokens: 272001
96
+ - component: cache_write_input
97
+ unit_price: 5.00
98
+ unit_size: 1000000
99
+ min_input_tokens: 272001
@@ -0,0 +1,116 @@
1
+ # Source: https://developers.openai.com/api/docs/models/gpt-6.1-terra (2026-10-30)
2
+ model: gpt-6.1-terra
3
+ native_protocols:
4
+ - openai_responses
5
+ label:
6
+ en_US: GPT-6.1 Terra
7
+ zh_Hans: GPT-6.1 Terra
8
+ model_type: llm
9
+ features:
10
+ - agent-thought
11
+ - tool-call
12
+ - multi-tool-call
13
+ - stream-tool-call
14
+ - structured-output
15
+ - vision
16
+ model_properties:
17
+ mode: chat
18
+ context_size: 1050000
19
+ max_output: 128000
20
+ parameter_rules:
21
+ - name: max_tokens
22
+ use_template: max_tokens
23
+ default: 32768
24
+ min: 16
25
+ max: 128000
26
+ help:
27
+ en_US: Maximum output tokens, including reasoning tokens. Input and output must fit within the context window.
28
+ zh_Hans: 最大输出 Token 数,包含推理 Token;输入和输出合计须在上下文窗口内。
29
+ - name: reasoning_effort
30
+ label:
31
+ en_US: Reasoning Effort
32
+ zh_Hans: 推理力度
33
+ type: string
34
+ required: false
35
+ default: medium
36
+ options:
37
+ - none
38
+ - low
39
+ - medium
40
+ - high
41
+ - xhigh
42
+ - max
43
+ help:
44
+ en_US: Higher effort can improve reasoning at the cost of latency and output tokens. Sampling parameters apply only with none.
45
+ zh_Hans: 更高档位可增强推理,但会增加延迟和输出 Token;采样参数仅在 none 档位生效。
46
+ - name: temperature
47
+ use_template: temperature
48
+ default: 1
49
+ min: 0.0
50
+ max: 2.0
51
+ help:
52
+ en_US: Only sent when reasoning effort is none.
53
+ zh_Hans: 仅当推理力度为 none 时发送。
54
+ - name: top_p
55
+ use_template: top_p
56
+ default: 1
57
+ min: 0.0
58
+ max: 1.0
59
+ help:
60
+ en_US: Only sent when reasoning effort is none.
61
+ zh_Hans: 仅当推理力度为 none 时发送。
62
+ - name: response_format
63
+ label:
64
+ en_US: Response Format
65
+ zh_Hans: 回复格式
66
+ type: string
67
+ required: false
68
+ options:
69
+ - text
70
+ - json_object
71
+ pricing:
72
+ input: '1'
73
+ output: '5'
74
+ unit: '0.000001'
75
+ currency: USD
76
+ # Standard processing; long-context rates apply to the entire request above 272K input tokens.
77
+ tiered_pricing:
78
+ - input: 1
79
+ output: 5
80
+ max_tokens: 272000
81
+ - input: 2
82
+ output: 7.5
83
+ max_tokens: 1050000
84
+ rules:
85
+ - component: input
86
+ unit_price: 1
87
+ unit_size: 1000000
88
+ max_input_tokens: 272000
89
+ - component: output
90
+ unit_price: 5
91
+ unit_size: 1000000
92
+ max_input_tokens: 272000
93
+ - component: cache_read_input
94
+ unit_price: 0.05
95
+ unit_size: 1000000
96
+ max_input_tokens: 272000
97
+ - component: cache_write_input
98
+ unit_price: 1.25
99
+ unit_size: 1000000
100
+ max_input_tokens: 272000
101
+ - component: input
102
+ unit_price: 2
103
+ unit_size: 1000000
104
+ min_input_tokens: 272001
105
+ - component: output
106
+ unit_price: 7.5
107
+ unit_size: 1000000
108
+ min_input_tokens: 272001
109
+ - component: cache_read_input
110
+ unit_price: 0.10
111
+ unit_size: 1000000
112
+ min_input_tokens: 272001
113
+ - component: cache_write_input
114
+ unit_price: 2.50
115
+ unit_size: 1000000
116
+ min_input_tokens: 272001
@@ -1 +1 @@
1
- {"version":3,"file":"llm.d.ts","sourceRoot":"","sources":["../../src/llm/llm.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAgB,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAmB,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEpE,OAAO,EAGL,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAIL,iBAAiB,EAMlB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAOhE,qBACa,wBAAyB,SAAQ,kBAAkB;;aAGhC,aAAa,EAAE,sBAAsB;gBAArC,aAAa,EAAE,sBAAsB;IAI7D,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBvF,OAAO,CAAC,mBAAmB;IAW3B,OAAO,CAAC,oBAAoB;IAInB,YAAY,CAAC,YAAY,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,iBAAiB;CA+D/E"}
1
+ {"version":3,"file":"llm.d.ts","sourceRoot":"","sources":["../../src/llm/llm.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAgB,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAmB,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEpE,OAAO,EAGL,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAIL,iBAAiB,EAMlB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAOhE,qBACa,wBAAyB,SAAQ,kBAAkB;;aAGhC,aAAa,EAAE,sBAAsB;gBAArC,aAAa,EAAE,sBAAsB;IAI7D,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBvF,OAAO,CAAC,mBAAmB;IAW3B,OAAO,CAAC,oBAAoB;IAInB,YAAY,CAAC,YAAY,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,iBAAiB;CA6D/E"}
package/dist/llm/llm.js CHANGED
@@ -54,8 +54,8 @@ let OpenAILargeLanguageModel = OpenAILargeLanguageModel_1 = class OpenAILargeLan
54
54
  const model = copilotModel.model;
55
55
  const hasCustomEndpoint = !!credentials?.endpoint_url?.trim();
56
56
  const streaming = modelOptions?.streaming ?? !hasCustomEndpoint;
57
- const supportsSamplingParams = shouldEnableSamplingParameters(credentials?.sampling_parameters, params.configuration?.baseURL, model);
58
57
  const reasoningEffort = normalizeOpenAIReasoningEffort(model, modelOptions?.reasoning_effort);
58
+ const supportsSamplingParams = shouldEnableSamplingParameters(credentials?.sampling_parameters, params.configuration?.baseURL, model, reasoningEffort);
59
59
  const reasoning = this.getReasoningOptions(model, reasoningEffort);
60
60
  const langChainReasoning = this.toLangChainReasoning(reasoning);
61
61
  const supportsResponseFormat = shouldEnableResponseFormat(params.configuration?.baseURL, model);
@@ -74,15 +74,12 @@ let OpenAILargeLanguageModel = OpenAILargeLanguageModel_1 = class OpenAILargeLan
74
74
  maxRetries: modelOptions?.maxRetries,
75
75
  useResponsesApi: true,
76
76
  reasoning: langChainReasoning,
77
- responses: new OpenAIReasoningResponsesModel({
78
- ...params,
79
- model,
80
- reasoning: langChainReasoning
81
- }),
82
77
  streamUsage: streaming,
83
78
  }, isNil);
84
79
  const chatModel = new ChatOpenAI({
85
80
  ...fields,
81
+ // Custom Responses instances do not inherit ChatOpenAI constructor fields.
82
+ responses: new OpenAIReasoningResponsesModel(fields),
86
83
  verbose: options?.verbose,
87
84
  callbacks: [
88
85
  ...this.createHandleUsageCallbacks(copilot, model, credentials, handleLLMTokens),
@@ -2,6 +2,8 @@ import { AIMessage } from '@langchain/core/messages';
2
2
  import { ChatGenerationChunk } from '@langchain/core/outputs';
3
3
  import { ChatOpenAIResponses, OpenAIClient } from '@langchain/openai';
4
4
  export declare class OpenAIReasoningResponsesModel extends ChatOpenAIResponses {
5
+ protected _getReasoningParams(options?: this['ParsedCallOptions']): OpenAIClient.Reasoning | undefined;
6
+ invocationParams(options?: this['ParsedCallOptions']): ReturnType<ChatOpenAIResponses['invocationParams']>;
5
7
  protected _convertResponsesMessageToBaseMessage(response: OpenAIClient.Responses.Response): AIMessage;
6
8
  protected _convertResponsesDeltaToBaseMessageChunk(chunk: OpenAIClient.Responses.ResponseStreamEvent): ChatGenerationChunk | null;
7
9
  }