agentic-server 0.29.0 → 0.30.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 +4 -3
- package/esm/transforms.js +9 -4
- package/package.json +2 -2
- package/transforms.js +9 -4
package/README.md
CHANGED
|
@@ -138,9 +138,10 @@ Install skills for AI coding agents:
|
|
|
138
138
|
# All platform skills (security, blueprints, codegen, billing, etc.)
|
|
139
139
|
npx skills add constructive-io/constructive-skills
|
|
140
140
|
|
|
141
|
-
# Individual repo skills (pgpm, testing, CLI, search, etc.)
|
|
142
|
-
npx skills add
|
|
143
|
-
npx skills add
|
|
141
|
+
# Individual repo skills (pgpm, safegres, testing, CLI, search, etc.)
|
|
142
|
+
npx skills add constructive-io/constructive --skill pgpm
|
|
143
|
+
npx skills add constructive-io/constructive --skill safegres
|
|
144
|
+
npx skills add constructive-io/constructive --skill constructive-testing
|
|
144
145
|
```
|
|
145
146
|
|
|
146
147
|
## Credits
|
package/esm/transforms.js
CHANGED
|
@@ -51,13 +51,16 @@ export function transformChatRequest(provider, body) {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
if (provider.type === 'ollama') {
|
|
54
|
+
// Ollama takes sampling settings under `options`; `max_tokens` is `num_predict`.
|
|
55
|
+
const options = {
|
|
56
|
+
...(body.temperature !== undefined && { temperature: body.temperature }),
|
|
57
|
+
...(body.max_tokens !== undefined && { num_predict: body.max_tokens })
|
|
58
|
+
};
|
|
54
59
|
return {
|
|
55
60
|
model: model || 'llama3',
|
|
56
61
|
messages: flattenContentParts(body.messages),
|
|
57
62
|
stream: false,
|
|
58
|
-
...(
|
|
59
|
-
options: { temperature: body.temperature }
|
|
60
|
-
})
|
|
63
|
+
...(Object.keys(options).length > 0 && { options })
|
|
61
64
|
};
|
|
62
65
|
}
|
|
63
66
|
if (provider.type === 'anthropic') {
|
|
@@ -140,7 +143,9 @@ export function transformEmbedResponse(data, provider) {
|
|
|
140
143
|
if (provider.type === 'ollama') {
|
|
141
144
|
const raw = (data.embeddings || data.embedding || []);
|
|
142
145
|
const embeddings = Array.isArray(raw[0]) ? raw : [raw];
|
|
143
|
-
|
|
146
|
+
// Ollama reports the prompt tokens of an embed as `prompt_eval_count`.
|
|
147
|
+
const promptTokens = data.prompt_eval_count || 0;
|
|
148
|
+
const usage = { prompt_tokens: promptTokens, completion_tokens: 0, total_tokens: promptTokens };
|
|
144
149
|
return {
|
|
145
150
|
body: {
|
|
146
151
|
object: 'list',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentic-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"description": "Standalone OpenAI-compatible LLM gateway — multi-provider proxy with pluggable inference metering",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"metering",
|
|
52
52
|
"constructive"
|
|
53
53
|
],
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "bee9337d5df205c1339a542b9ee749272e9f34f2"
|
|
55
55
|
}
|
package/transforms.js
CHANGED
|
@@ -57,13 +57,16 @@ function transformChatRequest(provider, body) {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
if (provider.type === 'ollama') {
|
|
60
|
+
// Ollama takes sampling settings under `options`; `max_tokens` is `num_predict`.
|
|
61
|
+
const options = {
|
|
62
|
+
...(body.temperature !== undefined && { temperature: body.temperature }),
|
|
63
|
+
...(body.max_tokens !== undefined && { num_predict: body.max_tokens })
|
|
64
|
+
};
|
|
60
65
|
return {
|
|
61
66
|
model: model || 'llama3',
|
|
62
67
|
messages: flattenContentParts(body.messages),
|
|
63
68
|
stream: false,
|
|
64
|
-
...(
|
|
65
|
-
options: { temperature: body.temperature }
|
|
66
|
-
})
|
|
69
|
+
...(Object.keys(options).length > 0 && { options })
|
|
67
70
|
};
|
|
68
71
|
}
|
|
69
72
|
if (provider.type === 'anthropic') {
|
|
@@ -146,7 +149,9 @@ function transformEmbedResponse(data, provider) {
|
|
|
146
149
|
if (provider.type === 'ollama') {
|
|
147
150
|
const raw = (data.embeddings || data.embedding || []);
|
|
148
151
|
const embeddings = Array.isArray(raw[0]) ? raw : [raw];
|
|
149
|
-
|
|
152
|
+
// Ollama reports the prompt tokens of an embed as `prompt_eval_count`.
|
|
153
|
+
const promptTokens = data.prompt_eval_count || 0;
|
|
154
|
+
const usage = { prompt_tokens: promptTokens, completion_tokens: 0, total_tokens: promptTokens };
|
|
150
155
|
return {
|
|
151
156
|
body: {
|
|
152
157
|
object: 'list',
|