@simulacra-ai/openai 0.0.2 → 0.0.3
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 +3 -9
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Simulacra OpenAI Provider
|
|
2
2
|
|
|
3
|
-
OpenAI provider
|
|
3
|
+
The OpenAI provider allows Simulacra to use OpenAI models via the OpenAI SDK, including GPT, o1, and o3 series.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -15,8 +15,9 @@ import { Conversation } from "@simulacra-ai/core";
|
|
|
15
15
|
import { OpenAIProvider } from "@simulacra-ai/openai";
|
|
16
16
|
import OpenAI from "openai";
|
|
17
17
|
|
|
18
|
+
// create a provider and conversation
|
|
18
19
|
const provider = new OpenAIProvider(new OpenAI(), { model: MODEL_NAME });
|
|
19
|
-
|
|
20
|
+
using conversation = new Conversation(provider);
|
|
20
21
|
```
|
|
21
22
|
|
|
22
23
|
### OpenAIProviderConfig
|
|
@@ -30,13 +31,6 @@ interface OpenAIProviderConfig {
|
|
|
30
31
|
|
|
31
32
|
Additional properties (`temperature`, `top_p`, etc.) spread into the API request.
|
|
32
33
|
|
|
33
|
-
## System Prompt Handling
|
|
34
|
-
|
|
35
|
-
The provider automatically selects the correct system message role based on the model:
|
|
36
|
-
|
|
37
|
-
- **GPT models** (`gpt-*`): uses `role: "system"`
|
|
38
|
-
- **Other models** (o1, o3, etc.): uses `role: "developer"`
|
|
39
|
-
|
|
40
34
|
## License
|
|
41
35
|
|
|
42
36
|
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simulacra-ai/openai",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "OpenAI provider for the Simulacra conversation engine",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"clean": "rm -rf dist *.tsbuildinfo"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@simulacra-ai/core": "0.0.
|
|
20
|
+
"@simulacra-ai/core": "0.0.3",
|
|
21
21
|
"openai": ">=4.0.0 <7.0.0"
|
|
22
22
|
},
|
|
23
23
|
"repository": {
|