@core-ai/openai 0.14.0 → 0.15.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 +8 -5
- package/dist/chunk-YORO2XQ3.js +1852 -0
- package/dist/compat.d.ts +11 -9
- package/dist/compat.js +19 -456
- package/dist/index.d.ts +4 -7
- package/dist/index.js +8 -740
- package/dist/{provider-options-DzqvHoId.d.ts → provider-options-CpxtGjm0.d.ts} +64 -6
- package/package.json +2 -2
- package/dist/chunk-7MAEB5C7.js +0 -568
package/README.md
CHANGED
|
@@ -29,16 +29,16 @@ const result = await generate({
|
|
|
29
29
|
console.log(result.content);
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
## Chat Completions
|
|
32
|
+
## Chat Completions
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
The same provider exposes OpenAI's strict Chat Completions API under `chat`:
|
|
35
35
|
|
|
36
36
|
```ts
|
|
37
37
|
import { generate } from '@core-ai/core-ai';
|
|
38
|
-
import {
|
|
38
|
+
import { createOpenAI } from '@core-ai/openai';
|
|
39
39
|
|
|
40
|
-
const openai =
|
|
41
|
-
const model = openai.chatModel('gpt-5-mini');
|
|
40
|
+
const openai = createOpenAI({ apiKey: process.env.OPENAI_API_KEY });
|
|
41
|
+
const model = openai.chat.chatModel('gpt-5-mini');
|
|
42
42
|
|
|
43
43
|
const result = await generate({
|
|
44
44
|
model,
|
|
@@ -47,3 +47,6 @@ const result = await generate({
|
|
|
47
47
|
|
|
48
48
|
console.log(result.content);
|
|
49
49
|
```
|
|
50
|
+
|
|
51
|
+
Use `@core-ai/openai-compat` for third-party Chat Completions endpoints that
|
|
52
|
+
return nonstandard compatible fields.
|