@aigne/openai 0.4.3 → 0.5.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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.5.0](https://github.com/AIGNE-io/aigne-framework/compare/openai-v0.4.3...openai-v0.5.0) (2025-07-01)
4
+
5
+
6
+ ### Features
7
+
8
+ * **cli:** support HTTPS_PROXY and named path param ([#196](https://github.com/AIGNE-io/aigne-framework/issues/196)) ([04e684e](https://github.com/AIGNE-io/aigne-framework/commit/04e684ee26bc2d79924b0e3cb541cd07a7191804))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @aigne/core bumped to 1.27.0
16
+ * devDependencies
17
+ * @aigne/test-utils bumped to 0.4.11
18
+
3
19
  ## [0.4.3](https://github.com/AIGNE-io/aigne-framework/compare/openai-v0.4.2...openai-v0.4.3) (2025-06-30)
4
20
 
5
21
 
@@ -1,6 +1,6 @@
1
1
  import { type AgentProcessResult, ChatModel, type ChatModelInput, type ChatModelInputMessage, type ChatModelInputTool, type ChatModelOptions, type ChatModelOutput, type Role } from "@aigne/core";
2
2
  import { type PromiseOrValue } from "@aigne/core/utils/type-utils.js";
3
- import OpenAI from "openai";
3
+ import OpenAI, { type ClientOptions } from "openai";
4
4
  import type { ChatCompletionMessageParam, ChatCompletionTool } from "openai/resources";
5
5
  import { z } from "zod";
6
6
  export interface OpenAIChatModelCapabilities {
@@ -38,6 +38,10 @@ export interface OpenAIChatModelOptions {
38
38
  * Additional model options to control behavior
39
39
  */
40
40
  modelOptions?: ChatModelOptions;
41
+ /**
42
+ * Client options for OpenAI API
43
+ */
44
+ clientOptions?: Partial<ClientOptions>;
41
45
  }
42
46
  /**
43
47
  * @hidden
@@ -88,6 +88,7 @@ class OpenAIChatModel extends core_1.ChatModel {
88
88
  this._client ??= new openai_1.default({
89
89
  baseURL: this.options?.baseURL,
90
90
  apiKey,
91
+ ...this.options?.clientOptions,
91
92
  });
92
93
  return this._client;
93
94
  }
@@ -1,6 +1,6 @@
1
1
  import { type AgentProcessResult, ChatModel, type ChatModelInput, type ChatModelInputMessage, type ChatModelInputTool, type ChatModelOptions, type ChatModelOutput, type Role } from "@aigne/core";
2
2
  import { type PromiseOrValue } from "@aigne/core/utils/type-utils.js";
3
- import OpenAI from "openai";
3
+ import OpenAI, { type ClientOptions } from "openai";
4
4
  import type { ChatCompletionMessageParam, ChatCompletionTool } from "openai/resources";
5
5
  import { z } from "zod";
6
6
  export interface OpenAIChatModelCapabilities {
@@ -38,6 +38,10 @@ export interface OpenAIChatModelOptions {
38
38
  * Additional model options to control behavior
39
39
  */
40
40
  modelOptions?: ChatModelOptions;
41
+ /**
42
+ * Client options for OpenAI API
43
+ */
44
+ clientOptions?: Partial<ClientOptions>;
41
45
  }
42
46
  /**
43
47
  * @hidden
@@ -1,6 +1,6 @@
1
1
  import { type AgentProcessResult, ChatModel, type ChatModelInput, type ChatModelInputMessage, type ChatModelInputTool, type ChatModelOptions, type ChatModelOutput, type Role } from "@aigne/core";
2
2
  import { type PromiseOrValue } from "@aigne/core/utils/type-utils.js";
3
- import OpenAI from "openai";
3
+ import OpenAI, { type ClientOptions } from "openai";
4
4
  import type { ChatCompletionMessageParam, ChatCompletionTool } from "openai/resources";
5
5
  import { z } from "zod";
6
6
  export interface OpenAIChatModelCapabilities {
@@ -38,6 +38,10 @@ export interface OpenAIChatModelOptions {
38
38
  * Additional model options to control behavior
39
39
  */
40
40
  modelOptions?: ChatModelOptions;
41
+ /**
42
+ * Client options for OpenAI API
43
+ */
44
+ clientOptions?: Partial<ClientOptions>;
41
45
  }
42
46
  /**
43
47
  * @hidden
@@ -79,6 +79,7 @@ export class OpenAIChatModel extends ChatModel {
79
79
  this._client ??= new OpenAI({
80
80
  baseURL: this.options?.baseURL,
81
81
  apiKey,
82
+ ...this.options?.clientOptions,
82
83
  });
83
84
  return this._client;
84
85
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/openai",
3
- "version": "0.4.3",
3
+ "version": "0.5.0",
4
4
  "description": "AIGNE OpenAI SDK for integrating with OpenAI's GPT models and API services",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -35,7 +35,7 @@
35
35
  "nanoid": "^5.1.5",
36
36
  "openai": "^4.87.3",
37
37
  "zod": "^3.24.4",
38
- "@aigne/core": "^1.26.0"
38
+ "@aigne/core": "^1.27.0"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/bun": "^1.2.12",
@@ -43,7 +43,7 @@
43
43
  "npm-run-all": "^4.1.5",
44
44
  "rimraf": "^6.0.1",
45
45
  "typescript": "^5.8.3",
46
- "@aigne/test-utils": "^0.4.10"
46
+ "@aigne/test-utils": "^0.4.11"
47
47
  },
48
48
  "scripts": {
49
49
  "lint": "tsc --noEmit",