@reminix/sdk 0.8.2 → 0.8.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.
Files changed (98) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +10 -43
  3. package/client.d.mts +5 -5
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +5 -5
  6. package/client.d.ts.map +1 -1
  7. package/client.js +3 -3
  8. package/client.js.map +1 -1
  9. package/client.mjs +3 -3
  10. package/client.mjs.map +1 -1
  11. package/core/streaming.d.mts +33 -0
  12. package/core/streaming.d.mts.map +1 -0
  13. package/core/streaming.d.ts +33 -0
  14. package/core/streaming.d.ts.map +1 -0
  15. package/core/streaming.js +263 -0
  16. package/core/streaming.js.map +1 -0
  17. package/core/streaming.mjs +258 -0
  18. package/core/streaming.mjs.map +1 -0
  19. package/index.d.mts +0 -1
  20. package/index.d.mts.map +1 -1
  21. package/index.d.ts +0 -1
  22. package/index.d.ts.map +1 -1
  23. package/index.js +1 -5
  24. package/index.js.map +1 -1
  25. package/index.mjs +0 -2
  26. package/index.mjs.map +1 -1
  27. package/internal/decoders/line.d.mts +17 -0
  28. package/internal/decoders/line.d.mts.map +1 -0
  29. package/internal/decoders/line.d.ts +17 -0
  30. package/internal/decoders/line.d.ts.map +1 -0
  31. package/internal/decoders/line.js +113 -0
  32. package/internal/decoders/line.js.map +1 -0
  33. package/internal/decoders/line.mjs +108 -0
  34. package/internal/decoders/line.mjs.map +1 -0
  35. package/internal/parse.d.mts.map +1 -1
  36. package/internal/parse.d.ts.map +1 -1
  37. package/internal/parse.js +10 -0
  38. package/internal/parse.js.map +1 -1
  39. package/internal/parse.mjs +10 -0
  40. package/internal/parse.mjs.map +1 -1
  41. package/internal/request-options.d.mts +2 -0
  42. package/internal/request-options.d.mts.map +1 -1
  43. package/internal/request-options.d.ts +2 -0
  44. package/internal/request-options.d.ts.map +1 -1
  45. package/internal/request-options.js.map +1 -1
  46. package/internal/request-options.mjs.map +1 -1
  47. package/package.json +1 -1
  48. package/resources/agents.d.mts +49 -40
  49. package/resources/agents.d.mts.map +1 -1
  50. package/resources/agents.d.ts +49 -40
  51. package/resources/agents.d.ts.map +1 -1
  52. package/resources/agents.js +7 -127
  53. package/resources/agents.js.map +1 -1
  54. package/resources/agents.mjs +7 -126
  55. package/resources/agents.mjs.map +1 -1
  56. package/resources/index.d.mts +2 -2
  57. package/resources/index.d.mts.map +1 -1
  58. package/resources/index.d.ts +2 -2
  59. package/resources/index.d.ts.map +1 -1
  60. package/resources/index.js +3 -3
  61. package/resources/index.js.map +1 -1
  62. package/resources/index.mjs +1 -1
  63. package/resources/index.mjs.map +1 -1
  64. package/resources/{project.d.mts → projects.d.mts} +31 -7
  65. package/resources/projects.d.mts.map +1 -0
  66. package/resources/{project.d.ts → projects.d.ts} +31 -7
  67. package/resources/projects.d.ts.map +1 -0
  68. package/resources/{project.js → projects.js} +8 -7
  69. package/resources/projects.js.map +1 -0
  70. package/resources/{project.mjs → projects.mjs} +6 -5
  71. package/resources/projects.mjs.map +1 -0
  72. package/src/client.ts +14 -4
  73. package/src/core/streaming.ts +315 -0
  74. package/src/index.ts +0 -4
  75. package/src/internal/decoders/line.ts +135 -0
  76. package/src/internal/parse.ts +14 -0
  77. package/src/internal/request-options.ts +2 -0
  78. package/src/resources/agents.ts +101 -67
  79. package/src/resources/index.ts +6 -1
  80. package/src/resources/{project.ts → projects.ts} +35 -7
  81. package/src/streaming.ts +2 -87
  82. package/src/version.ts +1 -1
  83. package/streaming.d.mts +1 -30
  84. package/streaming.d.mts.map +1 -1
  85. package/streaming.d.ts +1 -30
  86. package/streaming.d.ts.map +1 -1
  87. package/streaming.js +3 -80
  88. package/streaming.js.map +1 -1
  89. package/streaming.mjs +1 -78
  90. package/streaming.mjs.map +1 -1
  91. package/version.d.mts +1 -1
  92. package/version.d.ts +1 -1
  93. package/version.js +1 -1
  94. package/version.mjs +1 -1
  95. package/resources/project.d.mts.map +0 -1
  96. package/resources/project.d.ts.map +0 -1
  97. package/resources/project.js.map +0 -1
  98. package/resources/project.mjs.map +0 -1
@@ -1,7 +1,8 @@
1
1
  import { APIResource } from "../core/resource.js";
2
+ import * as AgentsAPI from "./agents.js";
2
3
  import { APIPromise } from "../core/api-promise.js";
4
+ import { Stream } from "../core/streaming.js";
3
5
  import { RequestOptions } from "../internal/request-options.js";
4
- import { Stream, StreamChunk } from "../streaming.js";
5
6
  export declare class Agents extends APIResource {
6
7
  /**
7
8
  * Have a conversational interaction with an agent. This endpoint maintains
@@ -43,7 +44,9 @@ export declare class Agents extends APIResource {
43
44
  * });
44
45
  * ```
45
46
  */
46
- chat(name: string, body: AgentChatParams, options?: RequestOptions): APIPromise<AgentChatResponse>;
47
+ chat(name: string, body: AgentChatParamsNonStreaming, options?: RequestOptions): APIPromise<AgentChatResponse>;
48
+ chat(name: string, body: AgentChatParamsStreaming, options?: RequestOptions): APIPromise<Stream<StreamChunk>>;
49
+ chat(name: string, body: AgentChatParamsBase, options?: RequestOptions): APIPromise<Stream<StreamChunk> | AgentChatResponse>;
47
50
  /**
48
51
  * Execute a one-shot task with an agent. This endpoint is designed for
49
52
  * task-oriented operations where you provide input and receive a complete output.
@@ -78,41 +81,9 @@ export declare class Agents extends APIResource {
78
81
  * });
79
82
  * ```
80
83
  */
81
- invoke(name: string, body: AgentInvokeParams, options?: RequestOptions): APIPromise<AgentInvokeResponse>;
82
- /**
83
- * Streaming variant of chat(). Returns an async iterable of chunks.
84
- *
85
- * Have a conversational interaction with an agent with real-time streaming.
86
- * Each chunk contains a portion of the response as it's generated.
87
- *
88
- * @example
89
- * ```ts
90
- * const stream = await client.agents.chatStream('my-agent', {
91
- * messages: [{ role: 'user', content: 'Tell me a story' }],
92
- * });
93
- * for await (const chunk of stream) {
94
- * process.stdout.write(chunk.chunk);
95
- * }
96
- * ```
97
- */
98
- chatStream(name: string, body: Omit<AgentChatParams, 'stream'>, options?: RequestOptions): Promise<Stream<StreamChunk>>;
99
- /**
100
- * Streaming variant of invoke(). Returns an async iterable of chunks.
101
- *
102
- * Execute a one-shot task with an agent with real-time streaming.
103
- * Each chunk contains a portion of the response as it's generated.
104
- *
105
- * @example
106
- * ```ts
107
- * const stream = await client.agents.invokeStream('my-agent', {
108
- * input: { task: 'generate', prompt: 'Write a poem' },
109
- * });
110
- * for await (const chunk of stream) {
111
- * process.stdout.write(chunk.chunk);
112
- * }
113
- * ```
114
- */
115
- invokeStream(name: string, body: Omit<AgentInvokeParams, 'stream'>, options?: RequestOptions): Promise<Stream<StreamChunk>>;
84
+ invoke(name: string, body: AgentInvokeParamsNonStreaming, options?: RequestOptions): APIPromise<AgentInvokeResponse>;
85
+ invoke(name: string, body: AgentInvokeParamsStreaming, options?: RequestOptions): APIPromise<Stream<StreamChunk>>;
86
+ invoke(name: string, body: AgentInvokeParamsBase, options?: RequestOptions): APIPromise<Stream<StreamChunk> | AgentInvokeResponse>;
116
87
  }
117
88
  /**
118
89
  * Optional request context passed to the agent handler.
@@ -133,6 +104,12 @@ export interface Context {
133
104
  */
134
105
  user_id?: string;
135
106
  }
107
+ export interface StreamChunk {
108
+ /**
109
+ * Text chunk from the stream
110
+ */
111
+ chunk: string;
112
+ }
136
113
  export interface AgentChatResponse {
137
114
  /**
138
115
  * Full conversation history including the assistant response
@@ -183,7 +160,8 @@ export interface AgentInvokeResponse {
183
160
  */
184
161
  output?: unknown;
185
162
  }
186
- export interface AgentChatParams {
163
+ export type AgentChatParams = AgentChatParamsNonStreaming | AgentChatParamsStreaming;
164
+ export interface AgentChatParamsBase {
187
165
  /**
188
166
  * Conversation history. Must include at least one message.
189
167
  */
@@ -230,8 +208,23 @@ export declare namespace AgentChatParams {
230
208
  }
231
209
  }
232
210
  }
211
+ type AgentChatParamsNonStreaming = AgentsAPI.AgentChatParamsNonStreaming;
212
+ type AgentChatParamsStreaming = AgentsAPI.AgentChatParamsStreaming;
213
+ }
214
+ export interface AgentChatParamsNonStreaming extends AgentChatParamsBase {
215
+ /**
216
+ * Whether to stream the response as SSE.
217
+ */
218
+ stream?: false;
219
+ }
220
+ export interface AgentChatParamsStreaming extends AgentChatParamsBase {
221
+ /**
222
+ * Whether to stream the response as SSE.
223
+ */
224
+ stream: true;
233
225
  }
234
- export interface AgentInvokeParams {
226
+ export type AgentInvokeParams = AgentInvokeParamsNonStreaming | AgentInvokeParamsStreaming;
227
+ export interface AgentInvokeParamsBase {
235
228
  /**
236
229
  * Input data for the agent. Structure depends on agent implementation.
237
230
  */
@@ -247,7 +240,23 @@ export interface AgentInvokeParams {
247
240
  */
248
241
  stream?: boolean;
249
242
  }
243
+ export declare namespace AgentInvokeParams {
244
+ type AgentInvokeParamsNonStreaming = AgentsAPI.AgentInvokeParamsNonStreaming;
245
+ type AgentInvokeParamsStreaming = AgentsAPI.AgentInvokeParamsStreaming;
246
+ }
247
+ export interface AgentInvokeParamsNonStreaming extends AgentInvokeParamsBase {
248
+ /**
249
+ * Whether to stream the response as SSE.
250
+ */
251
+ stream?: false;
252
+ }
253
+ export interface AgentInvokeParamsStreaming extends AgentInvokeParamsBase {
254
+ /**
255
+ * Whether to stream the response as SSE.
256
+ */
257
+ stream: true;
258
+ }
250
259
  export declare namespace Agents {
251
- export { type Context as Context, type AgentChatResponse as AgentChatResponse, type AgentInvokeResponse as AgentInvokeResponse, type AgentChatParams as AgentChatParams, type AgentInvokeParams as AgentInvokeParams, };
260
+ export { type Context as Context, type StreamChunk as StreamChunk, type AgentChatResponse as AgentChatResponse, type AgentInvokeResponse as AgentInvokeResponse, type AgentChatParams as AgentChatParams, type AgentChatParamsNonStreaming as AgentChatParamsNonStreaming, type AgentChatParamsStreaming as AgentChatParamsStreaming, type AgentInvokeParams as AgentInvokeParams, type AgentInvokeParamsNonStreaming as AgentInvokeParamsNonStreaming, type AgentInvokeParamsStreaming as AgentInvokeParamsStreaming, };
252
261
  }
253
262
  //# sourceMappingURL=agents.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../src/resources/agents.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,EAAE,KAAK,CAAC;CAChB;AAED,MAAM,WAAW,0BAA2B,SAAQ,qBAAqB;IACvE;;OAEG;IACH,MAAM,EAAE,IAAI,CAAC;CACd;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,0BAA0B,IAAI,0BAA0B,GAC9D,CAAC;CACH"}
@@ -4,140 +4,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.Agents = void 0;
5
5
  const resource_1 = require("../core/resource.js");
6
6
  const path_1 = require("../internal/utils/path.js");
7
- // stainless-custom-start
8
- const streaming_1 = require("../streaming.js");
9
- // stainless-custom-end
10
7
  class Agents extends resource_1.APIResource {
11
- /**
12
- * Have a conversational interaction with an agent. This endpoint maintains
13
- * conversation context through the messages array, allowing for multi-turn
14
- * conversations.
15
- *
16
- * **Timeout:** Chat requests have a 60-second timeout. If the agent takes longer
17
- * to respond, you will receive a 504 Gateway Timeout error. For long-running
18
- * conversations, consider using streaming mode which does not have the same
19
- * timeout constraints.
20
- *
21
- * **Idempotency:** For non-streaming requests, send an `Idempotency-Key` header
22
- * with a unique value (e.g., UUID) to ensure duplicate requests return the same
23
- * response. Keys are valid for 24 hours. Streaming responses are not cached.
24
- *
25
- * **Use cases:**
26
- *
27
- * - Customer support chatbots
28
- * - AI assistants with memory
29
- * - Multi-step question answering
30
- * - Conversational agents that need context
31
- *
32
- * **Message format:** Follows OpenAI-compliant message structure with support for:
33
- *
34
- * - `system`, `user`, `assistant`, and `tool` roles
35
- * - Multimodal content (text + images)
36
- * - Tool/function calling
37
- *
38
- * **Streaming:** Set `stream: true` in the request body to receive Server-Sent
39
- * Events (SSE) stream with incremental chunks. Perfect for ChatGPT-like real-time
40
- * chat interfaces.
41
- *
42
- * @example
43
- * ```ts
44
- * const response = await client.agents.chat('name', {
45
- * messages: [
46
- * { role: 'user', content: 'What is the weather today?' },
47
- * ],
48
- * });
49
- * ```
50
- */
51
8
  chat(name, body, options) {
52
- return this._client.post((0, path_1.path) `/agents/${name}/chat`, { body, ...options });
53
- }
54
- /**
55
- * Execute a one-shot task with an agent. This endpoint is designed for
56
- * task-oriented operations where you provide input and receive a complete output.
57
- *
58
- * **Timeout:** Agent invocations have a 60-second timeout. If the agent takes
59
- * longer to respond, you will receive a 504 Gateway Timeout error. For
60
- * long-running tasks, consider using streaming mode which does not have the same
61
- * timeout constraints.
62
- *
63
- * **Idempotency:** For non-streaming requests, send an `Idempotency-Key` header
64
- * with a unique value (e.g., UUID) to ensure duplicate requests return the same
65
- * response. Keys are valid for 24 hours. Streaming responses are not cached.
66
- *
67
- * **Use cases:**
68
- *
69
- * - Data analysis and processing
70
- * - Content generation (with streaming for long outputs)
71
- * - One-time operations that don't require conversation history
72
- * - API-like operations
73
- *
74
- * **Streaming:** Set `stream: true` in the request body to receive Server-Sent
75
- * Events (SSE) stream with incremental chunks. Useful for long-running tasks or
76
- * real-time progress updates.
77
- *
78
- * @example
79
- * ```ts
80
- * const response = await client.agents.invoke('name', {
81
- * input: {
82
- * task: 'analyze this data',
83
- * data: { value: 123, items: ['a', 'b', 'c'] },
84
- * },
85
- * });
86
- * ```
87
- */
88
- invoke(name, body, options) {
89
- return this._client.post((0, path_1.path) `/agents/${name}/invoke`, { body, ...options });
90
- }
91
- // stainless-custom-start
92
- /**
93
- * Streaming variant of chat(). Returns an async iterable of chunks.
94
- *
95
- * Have a conversational interaction with an agent with real-time streaming.
96
- * Each chunk contains a portion of the response as it's generated.
97
- *
98
- * @example
99
- * ```ts
100
- * const stream = await client.agents.chatStream('my-agent', {
101
- * messages: [{ role: 'user', content: 'Tell me a story' }],
102
- * });
103
- * for await (const chunk of stream) {
104
- * process.stdout.write(chunk.chunk);
105
- * }
106
- * ```
107
- */
108
- async chatStream(name, body, options) {
109
- const response = await this._client.post((0, path_1.path) `/agents/${name}/chat`, {
110
- body: { ...body, stream: true },
9
+ return this._client.post((0, path_1.path) `/agents/${name}/chat`, {
10
+ body,
111
11
  ...options,
112
- headers: { Accept: 'text/event-stream', ...options?.headers },
113
- __binaryResponse: true,
12
+ stream: body.stream ?? false,
114
13
  });
115
- return new streaming_1.Stream(response);
116
14
  }
117
- /**
118
- * Streaming variant of invoke(). Returns an async iterable of chunks.
119
- *
120
- * Execute a one-shot task with an agent with real-time streaming.
121
- * Each chunk contains a portion of the response as it's generated.
122
- *
123
- * @example
124
- * ```ts
125
- * const stream = await client.agents.invokeStream('my-agent', {
126
- * input: { task: 'generate', prompt: 'Write a poem' },
127
- * });
128
- * for await (const chunk of stream) {
129
- * process.stdout.write(chunk.chunk);
130
- * }
131
- * ```
132
- */
133
- async invokeStream(name, body, options) {
134
- const response = await this._client.post((0, path_1.path) `/agents/${name}/invoke`, {
135
- body: { ...body, stream: true },
15
+ invoke(name, body, options) {
16
+ return this._client.post((0, path_1.path) `/agents/${name}/invoke`, {
17
+ body,
136
18
  ...options,
137
- headers: { Accept: 'text/event-stream', ...options?.headers },
138
- __binaryResponse: true,
19
+ stream: body.stream ?? false,
139
20
  });
140
- return new streaming_1.Stream(response);
141
21
  }
142
22
  }
143
23
  exports.Agents = Agents;
@@ -1 +1 @@
1
- {"version":3,"file":"agents.js","sourceRoot":"","sources":["../src/resources/agents.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAA8C;AAE9C,yBAAyB;AACzB,+CAAmD;AACnD,uBAAuB;AAEvB,MAAa,MAAO,SAAQ,sBAAW;IACrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,mBAAmB,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;YAC7D,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;QACH,OAAO,IAAI,kBAAM,CAAc,QAA+B,CAAC,CAAC;IAClE,CAAC;CAEF;AAhJD,wBAgJC"}
1
+ {"version":3,"file":"agents.js","sourceRoot":"","sources":["../src/resources/agents.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAK/C,oDAA8C;AAE9C,MAAa,MAAO,SAAQ,sBAAW;IAwDrC,IAAI,CACF,IAAY,EACZ,IAAqB,EACrB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,WAAW,IAAI,OAAO,EAAE;YACnD,IAAI;YACJ,GAAG,OAAO;YACV,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,KAAK;SAC7B,CAAoE,CAAC;IACxE,CAAC;IAmDD,MAAM,CACJ,IAAY,EACZ,IAAuB,EACvB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,WAAW,IAAI,SAAS,EAAE;YACrD,IAAI;YACJ,GAAG,OAAO;YACV,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,KAAK;SAC7B,CAAsE,CAAC;IAC1E,CAAC;CACF;AAhID,wBAgIC"}
@@ -1,139 +1,20 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
  import { APIResource } from "../core/resource.mjs";
3
3
  import { path } from "../internal/utils/path.mjs";
4
- import { Stream } from "../streaming.mjs";
5
- // stainless-custom-end
6
4
  export class Agents extends APIResource {
7
- /**
8
- * Have a conversational interaction with an agent. This endpoint maintains
9
- * conversation context through the messages array, allowing for multi-turn
10
- * conversations.
11
- *
12
- * **Timeout:** Chat requests have a 60-second timeout. If the agent takes longer
13
- * to respond, you will receive a 504 Gateway Timeout error. For long-running
14
- * conversations, consider using streaming mode which does not have the same
15
- * timeout constraints.
16
- *
17
- * **Idempotency:** For non-streaming requests, send an `Idempotency-Key` header
18
- * with a unique value (e.g., UUID) to ensure duplicate requests return the same
19
- * response. Keys are valid for 24 hours. Streaming responses are not cached.
20
- *
21
- * **Use cases:**
22
- *
23
- * - Customer support chatbots
24
- * - AI assistants with memory
25
- * - Multi-step question answering
26
- * - Conversational agents that need context
27
- *
28
- * **Message format:** Follows OpenAI-compliant message structure with support for:
29
- *
30
- * - `system`, `user`, `assistant`, and `tool` roles
31
- * - Multimodal content (text + images)
32
- * - Tool/function calling
33
- *
34
- * **Streaming:** Set `stream: true` in the request body to receive Server-Sent
35
- * Events (SSE) stream with incremental chunks. Perfect for ChatGPT-like real-time
36
- * chat interfaces.
37
- *
38
- * @example
39
- * ```ts
40
- * const response = await client.agents.chat('name', {
41
- * messages: [
42
- * { role: 'user', content: 'What is the weather today?' },
43
- * ],
44
- * });
45
- * ```
46
- */
47
5
  chat(name, body, options) {
48
- return this._client.post(path `/agents/${name}/chat`, { body, ...options });
49
- }
50
- /**
51
- * Execute a one-shot task with an agent. This endpoint is designed for
52
- * task-oriented operations where you provide input and receive a complete output.
53
- *
54
- * **Timeout:** Agent invocations have a 60-second timeout. If the agent takes
55
- * longer to respond, you will receive a 504 Gateway Timeout error. For
56
- * long-running tasks, consider using streaming mode which does not have the same
57
- * timeout constraints.
58
- *
59
- * **Idempotency:** For non-streaming requests, send an `Idempotency-Key` header
60
- * with a unique value (e.g., UUID) to ensure duplicate requests return the same
61
- * response. Keys are valid for 24 hours. Streaming responses are not cached.
62
- *
63
- * **Use cases:**
64
- *
65
- * - Data analysis and processing
66
- * - Content generation (with streaming for long outputs)
67
- * - One-time operations that don't require conversation history
68
- * - API-like operations
69
- *
70
- * **Streaming:** Set `stream: true` in the request body to receive Server-Sent
71
- * Events (SSE) stream with incremental chunks. Useful for long-running tasks or
72
- * real-time progress updates.
73
- *
74
- * @example
75
- * ```ts
76
- * const response = await client.agents.invoke('name', {
77
- * input: {
78
- * task: 'analyze this data',
79
- * data: { value: 123, items: ['a', 'b', 'c'] },
80
- * },
81
- * });
82
- * ```
83
- */
84
- invoke(name, body, options) {
85
- return this._client.post(path `/agents/${name}/invoke`, { body, ...options });
86
- }
87
- // stainless-custom-start
88
- /**
89
- * Streaming variant of chat(). Returns an async iterable of chunks.
90
- *
91
- * Have a conversational interaction with an agent with real-time streaming.
92
- * Each chunk contains a portion of the response as it's generated.
93
- *
94
- * @example
95
- * ```ts
96
- * const stream = await client.agents.chatStream('my-agent', {
97
- * messages: [{ role: 'user', content: 'Tell me a story' }],
98
- * });
99
- * for await (const chunk of stream) {
100
- * process.stdout.write(chunk.chunk);
101
- * }
102
- * ```
103
- */
104
- async chatStream(name, body, options) {
105
- const response = await this._client.post(path `/agents/${name}/chat`, {
106
- body: { ...body, stream: true },
6
+ return this._client.post(path `/agents/${name}/chat`, {
7
+ body,
107
8
  ...options,
108
- headers: { Accept: 'text/event-stream', ...options?.headers },
109
- __binaryResponse: true,
9
+ stream: body.stream ?? false,
110
10
  });
111
- return new Stream(response);
112
11
  }
113
- /**
114
- * Streaming variant of invoke(). Returns an async iterable of chunks.
115
- *
116
- * Execute a one-shot task with an agent with real-time streaming.
117
- * Each chunk contains a portion of the response as it's generated.
118
- *
119
- * @example
120
- * ```ts
121
- * const stream = await client.agents.invokeStream('my-agent', {
122
- * input: { task: 'generate', prompt: 'Write a poem' },
123
- * });
124
- * for await (const chunk of stream) {
125
- * process.stdout.write(chunk.chunk);
126
- * }
127
- * ```
128
- */
129
- async invokeStream(name, body, options) {
130
- const response = await this._client.post(path `/agents/${name}/invoke`, {
131
- body: { ...body, stream: true },
12
+ invoke(name, body, options) {
13
+ return this._client.post(path `/agents/${name}/invoke`, {
14
+ body,
132
15
  ...options,
133
- headers: { Accept: 'text/event-stream', ...options?.headers },
134
- __binaryResponse: true,
16
+ stream: body.stream ?? false,
135
17
  });
136
- return new Stream(response);
137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C;IAClE,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,YAAY,CAChB,IAAY,EACZ,IAAuC,EACvC,OAAwB;QAExB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,WAAW,IAAI,SAAS,EAAE;YACrE,IAAI,EAAE,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;YAC/B,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,mBAAmB,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;YAC7D,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;QACH,OAAO,IAAI,MAAM,CAAc,QAA+B,CAAC,CAAC;IAClE,CAAC;CAEF"}
1
+ {"version":3,"file":"agents.mjs","sourceRoot":"","sources":["../src/resources/agents.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAKf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,MAAO,SAAQ,WAAW;IAwDrC,IAAI,CACF,IAAY,EACZ,IAAqB,EACrB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,WAAW,IAAI,OAAO,EAAE;YACnD,IAAI;YACJ,GAAG,OAAO;YACV,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,KAAK;SAC7B,CAAoE,CAAC;IACxE,CAAC;IAmDD,MAAM,CACJ,IAAY,EACZ,IAAuB,EACvB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,WAAW,IAAI,SAAS,EAAE;YACrD,IAAI;YACJ,GAAG,OAAO;YACV,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,KAAK;SAC7B,CAAsE,CAAC;IAC1E,CAAC;CACF"}
@@ -1,3 +1,3 @@
1
- export { Agents, type Context, type AgentChatResponse, type AgentInvokeResponse, type AgentChatParams, type AgentInvokeParams, } from "./agents.mjs";
2
- export { Project, type ProjectRetrieveResponse } from "./project.mjs";
1
+ export { Agents, type Context, type StreamChunk, type AgentChatResponse, type AgentInvokeResponse, type AgentChatParams, type AgentChatParamsNonStreaming, type AgentChatParamsStreaming, type AgentInvokeParams, type AgentInvokeParamsNonStreaming, type AgentInvokeParamsStreaming, } from "./agents.mjs";
2
+ export { Projects, type ProjectRetrieveCurrentResponse } from "./projects.mjs";
3
3
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,MAAM,EACN,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB;OACM,EAAE,OAAO,EAAE,KAAK,uBAAuB,EAAE"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,MAAM,EACN,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,6BAA6B,EAClC,KAAK,0BAA0B,GAChC;OACM,EAAE,QAAQ,EAAE,KAAK,8BAA8B,EAAE"}
@@ -1,3 +1,3 @@
1
- export { Agents, type Context, type AgentChatResponse, type AgentInvokeResponse, type AgentChatParams, type AgentInvokeParams, } from "./agents.js";
2
- export { Project, type ProjectRetrieveResponse } from "./project.js";
1
+ export { Agents, type Context, type StreamChunk, type AgentChatResponse, type AgentInvokeResponse, type AgentChatParams, type AgentChatParamsNonStreaming, type AgentChatParamsStreaming, type AgentInvokeParams, type AgentInvokeParamsNonStreaming, type AgentInvokeParamsStreaming, } from "./agents.js";
2
+ export { Projects, type ProjectRetrieveCurrentResponse } from "./projects.js";
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,MAAM,EACN,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB;OACM,EAAE,OAAO,EAAE,KAAK,uBAAuB,EAAE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,MAAM,EACN,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EACtB,KAAK,6BAA6B,EAClC,KAAK,0BAA0B,GAChC;OACM,EAAE,QAAQ,EAAE,KAAK,8BAA8B,EAAE"}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Project = exports.Agents = void 0;
4
+ exports.Projects = exports.Agents = void 0;
5
5
  var agents_1 = require("./agents.js");
6
6
  Object.defineProperty(exports, "Agents", { enumerable: true, get: function () { return agents_1.Agents; } });
7
- var project_1 = require("./project.js");
8
- Object.defineProperty(exports, "Project", { enumerable: true, get: function () { return project_1.Project; } });
7
+ var projects_1 = require("./projects.js");
8
+ Object.defineProperty(exports, "Projects", { enumerable: true, get: function () { return projects_1.Projects; } });
9
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,sCAOkB;AANhB,gGAAA,MAAM,OAAA;AAOR,wCAAkE;AAAzD,kGAAA,OAAO,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,sCAYkB;AAXhB,gGAAA,MAAM,OAAA;AAYR,0CAA2E;AAAlE,oGAAA,QAAQ,OAAA"}
@@ -1,4 +1,4 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
  export { Agents, } from "./agents.mjs";
3
- export { Project } from "./project.mjs";
3
+ export { Projects } from "./projects.mjs";
4
4
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,MAAM,GAMP;OACM,EAAE,OAAO,EAAgC"}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,MAAM,GAWP;OACM,EAAE,QAAQ,EAAuC"}
@@ -1,23 +1,24 @@
1
1
  import { APIResource } from "../core/resource.mjs";
2
2
  import { APIPromise } from "../core/api-promise.mjs";
3
3
  import { RequestOptions } from "../internal/request-options.mjs";
4
- export declare class Project extends APIResource {
4
+ export declare class Projects extends APIResource {
5
5
  /**
6
- * Returns the project associated with the API key used for authentication.
6
+ * Returns the project associated with the API key or X-Project header.
7
7
  *
8
8
  * The project contains metadata about your organization's configuration,
9
9
  * including:
10
10
  *
11
11
  * - Project ID and organization ID
12
12
  * - Project name and slug
13
+ * - Organization details
13
14
  * - Creation and update timestamps
14
15
  *
15
16
  * This endpoint is useful for verifying your API key is valid and retrieving
16
17
  * project details.
17
18
  */
18
- retrieve(options?: RequestOptions): APIPromise<ProjectRetrieveResponse>;
19
+ retrieveCurrent(options?: RequestOptions): APIPromise<ProjectRetrieveCurrentResponse>;
19
20
  }
20
- export interface ProjectRetrieveResponse {
21
+ export interface ProjectRetrieveCurrentResponse {
21
22
  /**
22
23
  * Unique identifier for the project
23
24
  */
@@ -30,6 +31,10 @@ export interface ProjectRetrieveResponse {
30
31
  * Human-readable name of the project
31
32
  */
32
33
  name: string;
34
+ /**
35
+ * Organization that owns this project
36
+ */
37
+ organization: ProjectRetrieveCurrentResponse.Organization;
33
38
  /**
34
39
  * ID of the organization that owns this project
35
40
  */
@@ -43,7 +48,26 @@ export interface ProjectRetrieveResponse {
43
48
  */
44
49
  updatedAt: string;
45
50
  }
46
- export declare namespace Project {
47
- export { type ProjectRetrieveResponse as ProjectRetrieveResponse };
51
+ export declare namespace ProjectRetrieveCurrentResponse {
52
+ /**
53
+ * Organization that owns this project
54
+ */
55
+ interface Organization {
56
+ /**
57
+ * Unique identifier for the organization
58
+ */
59
+ id: string;
60
+ /**
61
+ * Human-readable name of the organization
62
+ */
63
+ name: string;
64
+ /**
65
+ * URL-friendly identifier for the organization
66
+ */
67
+ slug: string;
68
+ }
69
+ }
70
+ export declare namespace Projects {
71
+ export { type ProjectRetrieveCurrentResponse as ProjectRetrieveCurrentResponse };
48
72
  }
49
- //# sourceMappingURL=project.d.mts.map
73
+ //# sourceMappingURL=projects.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projects.d.mts","sourceRoot":"","sources":["../src/resources/projects.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;OAaG;IACH,eAAe,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,8BAA8B,CAAC;CAGtF;AAED,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,YAAY,EAAE,8BAA8B,CAAC,YAAY,CAAC;IAE1D;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,yBAAiB,8BAA8B,CAAC;IAC9C;;OAEG;IACH,UAAiB,YAAY;QAC3B;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;KACd;CACF;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EAAE,KAAK,8BAA8B,IAAI,8BAA8B,EAAE,CAAC;CAClF"}