Skip to content

Commit

Permalink
feat(api): api update (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Jan 11, 2025
1 parent fb57c6c commit ceb6766
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 47
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/julep-ai-inc-dash%2Fjulep-954fc360f83850d5f2f30fac36f48e981a2e7687feef0525956b5d26a2980f0d.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/julep-ai-inc-dash%2Fjulep-87a89469a2262492355fab423c5349f0fd6a020cdd7fde8de9ec8c14bf2c57eb.yml
99 changes: 95 additions & 4 deletions src/resources/agents/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ export class Docs extends APIResource {
*/
create(
agentId: string,
body: DocCreateParams,
params: DocCreateParams,
options?: Core.RequestOptions,
): Core.APIPromise<Shared.ResourceCreated> {
return this._client.post(`/agents/${agentId}/docs`, { body, ...options });
const { connection_pool, ...body } = params;
return this._client.post(`/agents/${agentId}/docs`, { query: { connection_pool }, body, ...options });
}

/**
Expand Down Expand Up @@ -64,10 +65,11 @@ export class Docs extends APIResource {
*/
search(
agentId: string,
body: DocSearchParams,
params: DocSearchParams,
options?: Core.RequestOptions,
): Core.APIPromise<DocSearchResponse> {
return this._client.post(`/agents/${agentId}/search`, { body, ...options });
const { connection_pool, ...body } = params;
return this._client.post(`/agents/${agentId}/search`, { query: { connection_pool }, body, ...options });
}
}

Expand Down Expand Up @@ -102,12 +104,29 @@ export namespace DocSearchResponse {
}

export interface DocCreateParams {
/**
* Body param:
*/
content: string | Array<string>;

/**
* Body param:
*/
title: string;

/**
* Query param:
*/
connection_pool?: unknown;

/**
* Body param:
*/
embed_instruction?: string | null;

/**
* Body param:
*/
metadata?: unknown | null;
}

Expand All @@ -126,46 +145,118 @@ export type DocSearchParams =

export declare namespace DocSearchParams {
export interface TextOnlyDocSearchRequest {
/**
* Body param:
*/
text: string;

/**
* Query param:
*/
connection_pool?: unknown;

/**
* Body param:
*/
lang?: 'en-US';

/**
* Body param:
*/
limit?: number;

/**
* Body param:
*/
metadata_filter?: unknown;

/**
* Body param:
*/
mmr_strength?: number;
}

export interface VectorDocSearchRequest {
/**
* Body param:
*/
vector: Array<number>;

/**
* Query param:
*/
connection_pool?: unknown;

/**
* Body param:
*/
confidence?: number;

/**
* Body param:
*/
lang?: 'en-US';

/**
* Body param:
*/
limit?: number;

/**
* Body param:
*/
metadata_filter?: unknown;

/**
* Body param:
*/
mmr_strength?: number;
}

export interface HybridDocSearchRequest {
/**
* Body param:
*/
text: string;

/**
* Body param:
*/
vector: Array<number>;

/**
* Query param:
*/
connection_pool?: unknown;

/**
* Body param:
*/
alpha?: number;

/**
* Body param:
*/
confidence?: number;

/**
* Body param:
*/
lang?: 'en-US';

/**
* Body param:
*/
limit?: number;

/**
* Body param:
*/
metadata_filter?: unknown;

/**
* Body param:
*/
mmr_strength?: number;
}
}
Expand Down
2 changes: 2 additions & 0 deletions tests/api-resources/agents/docs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ describe('resource docs', () => {
const response = await client.agents.docs.create('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
content: 'string',
title: 'title',
connection_pool: {},
embed_instruction: 'embed_instruction',
metadata: {},
});
Expand Down Expand Up @@ -102,6 +103,7 @@ describe('resource docs', () => {
test('search: required and optional params', async () => {
const response = await client.agents.docs.search('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
text: 'text',
connection_pool: {},
lang: 'en-US',
limit: 1,
metadata_filter: {},
Expand Down

0 comments on commit ceb6766

Please sign in to comment.