agentic-server 0.28.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 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 https://github.com/constructive-io/constructive --skill pgpm
143
- npx skills add https://github.com/constructive-io/constructive --skill constructive-testing
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
- ...(body.temperature !== undefined && {
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
- const usage = { prompt_tokens: 0, completion_tokens: 0, total_tokens: 0 };
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.28.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",
@@ -29,7 +29,7 @@
29
29
  "test:watch": "jest --watch"
30
30
  },
31
31
  "dependencies": {
32
- "@pgpmjs/logger": "^2.26.0"
32
+ "@pgpmjs/logger": "^2.27.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/express": "^5.0.6",
@@ -51,5 +51,5 @@
51
51
  "metering",
52
52
  "constructive"
53
53
  ],
54
- "gitHead": "34e91da5b3dd9c0cae14875afe609993acf53a84"
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
- ...(body.temperature !== undefined && {
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
- const usage = { prompt_tokens: 0, completion_tokens: 0, total_tokens: 0 };
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',