@premai/api-sdk 1.0.45 → 1.0.47
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 +33 -0
- package/dist/anthropic/to-openai.d.ts +1 -1
- package/dist/cli-claude.mjs +4 -0
- package/dist/cli.mjs +2182 -2190
- package/dist/index.cjs +4 -0
- package/dist/index.mjs +4 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -206,6 +206,39 @@ confidential-claude -p /path/to/project
|
|
|
206
206
|
confidential-claude --print "summarize the changed files"
|
|
207
207
|
```
|
|
208
208
|
|
|
209
|
+
## Hermes Agent Integration
|
|
210
|
+
|
|
211
|
+
To use `confidential-proxy` as a custom provider in [Hermes](https://hermes-agent.nousresearch.com/):
|
|
212
|
+
|
|
213
|
+
**1. Start `confidential-proxy` in the background**
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
confidential-proxy --compat openai &
|
|
217
|
+
# or with npx/bunx without a global install:
|
|
218
|
+
bunx -p @premai/api-sdk confidential-proxy --compat openai &
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
The proxy listens on `http://localhost:8000` by default.
|
|
222
|
+
|
|
223
|
+
**2. Register it as a custom provider in `~/.hermes/config.yaml`**
|
|
224
|
+
|
|
225
|
+
```yaml
|
|
226
|
+
custom_providers:
|
|
227
|
+
- name: Prem Confidential API
|
|
228
|
+
base_url: http://127.0.0.1:8000/openai/v1
|
|
229
|
+
api_key: your-api-key
|
|
230
|
+
model: qwen36-27b
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
**3. Restart `hermes-gateway`**
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
hermes-gateway restart
|
|
237
|
+
# or kill and relaunch if restart is not available
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Hermes will now route requests through the encrypted proxy at `localhost:8000`.
|
|
241
|
+
|
|
209
242
|
## Features
|
|
210
243
|
|
|
211
244
|
- Chat Completions - OpenAI and Anthropic compatible APIs with streaming support
|
|
@@ -8,7 +8,7 @@ type AnthropicContentPart = AnthropicTextBlock | {
|
|
|
8
8
|
[key: string]: unknown;
|
|
9
9
|
};
|
|
10
10
|
export type AnthropicMessage = {
|
|
11
|
-
role: "user" | "assistant";
|
|
11
|
+
role: "user" | "assistant" | "system";
|
|
12
12
|
content: string | AnthropicContentPart[];
|
|
13
13
|
};
|
|
14
14
|
export type AnthropicMessagesCreateBody = {
|
package/dist/cli-claude.mjs
CHANGED
|
@@ -615,6 +615,10 @@ function anthropicMessagesCreateToOpenAI(body) {
|
|
|
615
615
|
messages.push(...systemToOpenAiMessages(body.system));
|
|
616
616
|
}
|
|
617
617
|
for (const m of body.messages) {
|
|
618
|
+
if (m.role === "system") {
|
|
619
|
+
messages.push(...systemToOpenAiMessages(m.content));
|
|
620
|
+
continue;
|
|
621
|
+
}
|
|
618
622
|
if (m.role !== "user" && m.role !== "assistant") {
|
|
619
623
|
throw new AnthropicRequestValidationError(`Invalid message role "${m.role}".`);
|
|
620
624
|
}
|