Skip to content

Commit 3e761ff

Browse files
feat(api): api update (#173)
1 parent f6b9d12 commit 3e761ff

File tree

5 files changed

+106
-6
lines changed

5 files changed

+106
-6
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 47
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/julep-ai-inc-dash%2Fjulep-24c22b6634dc442080baef2f72a130c654ad70c4f3ed565714bf6e3562a4f1a5.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/julep-ai-inc-dash%2Fjulep-954fc360f83850d5f2f30fac36f48e981a2e7687feef0525956b5d26a2980f0d.yml

src/resources/sessions.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ export class Sessions extends APIResource {
6767
params: SessionChatParams,
6868
options?: Core.RequestOptions,
6969
): Core.APIPromise<SessionChatResponse> {
70-
const { 'X-Custom-Api-Key': xCustomAPIKey, ...body } = params;
70+
const { connection_pool, 'X-Custom-Api-Key': xCustomAPIKey, ...body } = params;
7171
return this._client.post(`/sessions/${sessionId}/chat`, {
72+
query: { connection_pool },
7273
body,
7374
...options,
7475
headers: {
@@ -5005,6 +5006,11 @@ export interface SessionChatParams {
50055006
*/
50065007
messages: Array<Message>;
50075008

5009+
/**
5010+
* Query param:
5011+
*/
5012+
connection_pool?: unknown;
5013+
50085014
/**
50095015
* Body param:
50105016
*/

src/resources/users/docs.ts

Lines changed: 95 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ export class Docs extends APIResource {
2121
*/
2222
create(
2323
userId: string,
24-
body: DocCreateParams,
24+
params: DocCreateParams,
2525
options?: Core.RequestOptions,
2626
): Core.APIPromise<Shared.ResourceCreated> {
27-
return this._client.post(`/users/${userId}/docs`, { body, ...options });
27+
const { connection_pool, ...body } = params;
28+
return this._client.post(`/users/${userId}/docs`, { query: { connection_pool }, body, ...options });
2829
}
2930

3031
/**
@@ -70,10 +71,11 @@ export class Docs extends APIResource {
7071
*/
7172
search(
7273
userId: string,
73-
body: DocSearchParams,
74+
params: DocSearchParams,
7475
options?: Core.RequestOptions,
7576
): Core.APIPromise<DocSearchResponse> {
76-
return this._client.post(`/users/${userId}/search`, { body, ...options });
77+
const { connection_pool, ...body } = params;
78+
return this._client.post(`/users/${userId}/search`, { query: { connection_pool }, body, ...options });
7779
}
7880
}
7981

@@ -108,12 +110,29 @@ export namespace DocSearchResponse {
108110
}
109111

110112
export interface DocCreateParams {
113+
/**
114+
* Body param:
115+
*/
111116
content: string | Array<string>;
112117

118+
/**
119+
* Body param:
120+
*/
113121
title: string;
114122

123+
/**
124+
* Query param:
125+
*/
126+
connection_pool?: unknown;
127+
128+
/**
129+
* Body param:
130+
*/
115131
embed_instruction?: string | null;
116132

133+
/**
134+
* Body param:
135+
*/
117136
metadata?: unknown | null;
118137
}
119138

@@ -132,46 +151,118 @@ export type DocSearchParams =
132151

133152
export namespace DocSearchParams {
134153
export interface TextOnlyDocSearchRequest {
154+
/**
155+
* Body param:
156+
*/
135157
text: string;
136158

159+
/**
160+
* Query param:
161+
*/
162+
connection_pool?: unknown;
163+
164+
/**
165+
* Body param:
166+
*/
137167
lang?: 'en-US';
138168

169+
/**
170+
* Body param:
171+
*/
139172
limit?: number;
140173

174+
/**
175+
* Body param:
176+
*/
141177
metadata_filter?: unknown;
142178

179+
/**
180+
* Body param:
181+
*/
143182
mmr_strength?: number;
144183
}
145184

146185
export interface VectorDocSearchRequest {
186+
/**
187+
* Body param:
188+
*/
147189
vector: Array<number>;
148190

191+
/**
192+
* Query param:
193+
*/
194+
connection_pool?: unknown;
195+
196+
/**
197+
* Body param:
198+
*/
149199
confidence?: number;
150200

201+
/**
202+
* Body param:
203+
*/
151204
lang?: 'en-US';
152205

206+
/**
207+
* Body param:
208+
*/
153209
limit?: number;
154210

211+
/**
212+
* Body param:
213+
*/
155214
metadata_filter?: unknown;
156215

216+
/**
217+
* Body param:
218+
*/
157219
mmr_strength?: number;
158220
}
159221

160222
export interface HybridDocSearchRequest {
223+
/**
224+
* Body param:
225+
*/
161226
text: string;
162227

228+
/**
229+
* Body param:
230+
*/
163231
vector: Array<number>;
164232

233+
/**
234+
* Query param:
235+
*/
236+
connection_pool?: unknown;
237+
238+
/**
239+
* Body param:
240+
*/
165241
alpha?: number;
166242

243+
/**
244+
* Body param:
245+
*/
167246
confidence?: number;
168247

248+
/**
249+
* Body param:
250+
*/
169251
lang?: 'en-US';
170252

253+
/**
254+
* Body param:
255+
*/
171256
limit?: number;
172257

258+
/**
259+
* Body param:
260+
*/
173261
metadata_filter?: unknown;
174262

263+
/**
264+
* Body param:
265+
*/
175266
mmr_strength?: number;
176267
}
177268
}

tests/api-resources/sessions.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ describe('resource sessions', () => {
121121
],
122122
},
123123
],
124+
connection_pool: {},
124125
agent: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
125126
frequency_penalty: -2,
126127
length_penalty: 0,

tests/api-resources/users/docs.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ describe('resource docs', () => {
2727
const response = await client.users.docs.create('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
2828
content: 'string',
2929
title: 'title',
30+
connection_pool: {},
3031
embed_instruction: 'embed_instruction',
3132
metadata: {},
3233
});
@@ -102,6 +103,7 @@ describe('resource docs', () => {
102103
test('search: required and optional params', async () => {
103104
const response = await client.users.docs.search('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
104105
text: 'text',
106+
connection_pool: {},
105107
lang: 'en-US',
106108
limit: 1,
107109
metadata_filter: {},

0 commit comments

Comments
 (0)