@naturali/sdk 0.178.0 → 0.179.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/dist/index.mjs CHANGED
@@ -1734,14 +1734,38 @@ var Assistant = class {
1734
1734
  });
1735
1735
  }
1736
1736
  /**
1737
- * Read the conversation
1737
+ * List your conversations
1738
1738
  *
1739
- * The newest 100 messages of your conversation with the Assistant in the app, oldest first. An account that has not messaged it yet has an empty conversation.
1739
+ * Your conversations with the Assistant in the app, newest first. Each is a session of its own; a conversation on Discord or WhatsApp is not listed here.
1740
1740
  *
1741
1741
  */
1742
- static listAssistantMessages(options) {
1742
+ static listAssistantSessions(options) {
1743
1743
  return (options?.client ?? client).get({
1744
- url: "/v1/assistant/messages",
1744
+ url: "/v1/assistant/sessions",
1745
+ ...options
1746
+ });
1747
+ }
1748
+ /**
1749
+ * Start a conversation
1750
+ *
1751
+ * Opens a new, empty conversation with the Assistant. It costs nothing until a message is sent, and it does not expire.
1752
+ *
1753
+ */
1754
+ static createAssistantSession(options) {
1755
+ return (options?.client ?? client).post({
1756
+ url: "/v1/assistant/sessions",
1757
+ ...options
1758
+ });
1759
+ }
1760
+ /**
1761
+ * Read a conversation
1762
+ *
1763
+ * The newest 100 messages of one conversation, oldest first.
1764
+ *
1765
+ */
1766
+ static listAssistantSessionMessages(options) {
1767
+ return (options.client ?? client).get({
1768
+ url: "/v1/assistant/sessions/{session_id}/messages",
1745
1769
  ...options
1746
1770
  });
1747
1771
  }
@@ -1751,9 +1775,9 @@ var Assistant = class {
1751
1775
  * Runs one turn as your account and answers with the messages it added: yours, then the Assistant's reply. The turn is paid from your credit and refused before it runs when the balance is below zero.
1752
1776
  *
1753
1777
  */
1754
- static sendAssistantMessage(options) {
1778
+ static sendAssistantSessionMessage(options) {
1755
1779
  return (options.client ?? client).post({
1756
- url: "/v1/assistant/messages",
1780
+ url: "/v1/assistant/sessions/{session_id}/messages",
1757
1781
  ...options,
1758
1782
  headers: {
1759
1783
  "Content-Type": "application/json",
@@ -2085,7 +2109,7 @@ var Deciders = class {
2085
2109
  /**
2086
2110
  * Create a decider
2087
2111
  *
2088
- * Creates a decider at version 1: a named question set and the backend that answers it, exactly one of `agent_id` and `tool_id`. Every question declares a finite answer space, validated here. The backend must be in the decider's project. An agent must carry no tool surface — no tool binding left active by `active_tool_ids` and no `knowledge_config.write_memory_store_id` — or the create is refused with `400 DECIDER_AGENT_NOT_TOOL_LESS`. A tool must be `http` or `pipeline` and must not pin `state` or `questions` in its `preset_parameters`, or the create is refused with `400 DECIDER_TOOL_NOT_CALLABLE`. A duplicate `name` in the project is `409 NAME_CONFLICT`.
2112
+ * Creates a decider at version 1: a named question set and the backend that answers it, exactly one of `agent_id` and `tool_id`. Every question declares a finite answer space, validated here. The backend must be in the decider's project. An agent must carry no tool surface — no tool binding left active by `active_tool_ids` and no `knowledge_config.write_memory_store_id` — or the create is refused with `400 DECIDER_AGENT_NOT_TOOL_LESS`. A tool must be `http` or `pipeline` and must not pin `input` or `questions` in its `preset_parameters`, or the create is refused with `400 DECIDER_TOOL_NOT_CALLABLE`. A duplicate `name` in the project is `409 NAME_CONFLICT`.
2089
2113
  */
2090
2114
  static createDecider(options) {
2091
2115
  return (options.client ?? client).post({
@@ -2174,11 +2198,11 @@ var Deciders = class {
2174
2198
  /**
2175
2199
  * Request a decision
2176
2200
  *
2177
- * Evaluates the decider against `state` and records the decision. The questions come from the decider, never from the request, so a call site can only supply what is judged.
2201
+ * Evaluates the decider against `input` and records the decision. The questions come from the decider, never from the request, so a call site can only supply what is judged. To send the questions with the request, use `POST /v1/projects/{project_id}/decisions`.
2178
2202
  *
2179
2203
  * Everything that can refuse the request is checked before the decision is written, so a refusal is a `4xx` and never a polled failure: the agent's tool surface (`400 DECIDER_AGENT_NOT_TOOL_LESS`), a tool that cannot answer (`400 DECIDER_TOOL_NOT_CALLABLE`), a paused project (`409 PROJECT_PAUSED`) and, for an agent, quota admission (`429 QUOTA_EXCEEDED`).
2180
2204
  *
2181
- * A tool backend is called with `{ state, questions }` and must answer `{ answers: { <question id>: { choice | score | value, probabilities? } } }`; an answer outside that contract fails the decision with `DECISION_ANSWER_INVALID`.
2205
+ * A tool backend is called with `{ input, questions }` and must answer `{ answers: [{ name, probability | choice | score, probabilities?, confidence? }] }`, the request and response of OpenAI's Decisions API; an answer outside that contract fails the decision with `DECISION_ANSWER_INVALID`.
2182
2206
  *
2183
2207
  * With `wait: false`, the default, the answer is `201` with the decision `queued`; poll `GET /v1/projects/{project_id}/decisions/{decision_id}` or subscribe to `decisions.completed` and `decisions.failed`. With `wait: true` it is `201` with the decision settled.
2184
2208
  */
@@ -2204,6 +2228,23 @@ var Deciders = class {
2204
2228
  });
2205
2229
  }
2206
2230
  /**
2231
+ * Request a decision with inline questions
2232
+ *
2233
+ * Evaluates `questions` sent with the request against `input`, answered by the agent or tool the request names (exactly one of `agent_id` and `tool_id`, held to the same rules as a decider's backend), and records the decision with its questions. The request and answers are those of OpenAI's Decisions API, with the backend in place of `model`.
2234
+ *
2235
+ * No decider names the questions, so the decision carries them in `questions` and has no `decider_id` or `decider_version`. Admission, `wait` and the tool contract are those of `POST /v1/projects/{project_id}/deciders/{decider_id}/decisions`.
2236
+ */
2237
+ static createInlineDecision(options) {
2238
+ return (options.client ?? client).post({
2239
+ url: "/v1/projects/{project_id}/decisions",
2240
+ ...options,
2241
+ headers: {
2242
+ "Content-Type": "application/json",
2243
+ ...options.headers
2244
+ }
2245
+ });
2246
+ }
2247
+ /**
2207
2248
  * Get a decision
2208
2249
  *
2209
2250
  * Returns a decision. Poll it after a `wait: false` request until `status` is `completed` or `failed`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/sdk",
3
- "version": "0.178.0",
3
+ "version": "0.179.0",
4
4
  "description": "TypeScript SDK for the naturali.ai API, generated from its OpenAPI specs",
5
5
  "keywords": [
6
6
  "naturali",
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "devDependencies": {
40
40
  "@hey-api/openapi-ts": "^0.99.0",
41
- "@naturali/api": "0.178.0",
41
+ "@naturali/api": "0.179.0",
42
42
  "@ttoss/openapi-codegen": "^0.5.0",
43
43
  "@types/node": "^26.5.1",
44
44
  "tsdown": "^0.23.0",