diff --git a/.stats.yml b/.stats.yml index 39a1051..2802e8c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 35 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/contextual-ai%2Fsunrise-c0b9cfd71efb976777313fb342d2e31ebeb44b1b3f9bb7ddea971e6b2bc5fd19.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/contextual-ai%2Fsunrise-f12595f01023503858500b15936a1d0d38701e48552d34c98b00a41205d2b8da.yml diff --git a/src/resources/generate.ts b/src/resources/generate.ts index cb4f5db..f17dbc1 100644 --- a/src/resources/generate.ts +++ b/src/resources/generate.ts @@ -28,9 +28,9 @@ export interface GenerateCreateResponse { export interface GenerateCreateParams { /** - * Extra parameters to be passed to Contextual's GLM + * The knowledge sources the model can use when generating a response. */ - extra_body: GenerateCreateParams.ExtraBody; + knowledge: Array; /** * List of messages in the conversation so far. The last message must be from the @@ -42,25 +42,15 @@ export interface GenerateCreateParams { * The version of the Contextual's GLM to use. Currently, we just have "v1". */ model: string; -} -export namespace GenerateCreateParams { /** - * Extra parameters to be passed to Contextual's GLM + * Instructions that the model follows when generating responses. Note that we do + * not guarantee that the model follows these instructions exactly. */ - export interface ExtraBody { - /** - * The knowledge sources the model can use when generating a response. - */ - knowledge: Array; - - /** - * Instructions that the model follows when generating responses. Note that we do - * not guarantee that the model follows these instructions exactly. - */ - system_prompt?: string; - } + system_prompt?: string; +} +export namespace GenerateCreateParams { /** * Message object for a message sent or received in a /query and /generate * conversation diff --git a/tests/api-resources/generate.test.ts b/tests/api-resources/generate.test.ts index 4e89314..4c76b89 100644 --- a/tests/api-resources/generate.test.ts +++ b/tests/api-resources/generate.test.ts @@ -11,7 +11,7 @@ const client = new ContextualAI({ describe('resource generate', () => { test('create: only required params', async () => { const responsePromise = client.generate.create({ - extra_body: { knowledge: ['string'] }, + knowledge: ['string'], messages: [{ content: 'content', role: 'user' }], model: 'model', }); @@ -26,9 +26,10 @@ describe('resource generate', () => { test('create: required and optional params', async () => { const response = await client.generate.create({ - extra_body: { knowledge: ['string'], system_prompt: 'system_prompt' }, + knowledge: ['string'], messages: [{ content: 'content', role: 'user' }], model: 'model', + system_prompt: 'system_prompt', }); }); });