diff --git a/src/index.ts b/src/index.ts index 72d8e1f..8a8a7ee 100644 --- a/src/index.ts +++ b/src/index.ts @@ -33,17 +33,16 @@ import { ListEvalTasksResponse, } from './resources/eval-tasks'; import { + ChatCompletionResponseStreamChunk, CompletionResponse, EmbeddingsResponse, Inference, InferenceChatCompletionParams, InferenceChatCompletionParamsNonStreaming, InferenceChatCompletionParamsStreaming, - InferenceChatCompletionResponse, InferenceCompletionParams, InferenceCompletionParamsNonStreaming, InferenceCompletionParamsStreaming, - InferenceCompletionResponse, InferenceEmbeddingsParams, TokenLogProbs, } from './resources/inference'; @@ -407,11 +406,10 @@ export declare namespace LlamaStackClient { export { Inference as Inference, + type ChatCompletionResponseStreamChunk as ChatCompletionResponseStreamChunk, type CompletionResponse as CompletionResponse, type EmbeddingsResponse as EmbeddingsResponse, type TokenLogProbs as TokenLogProbs, - type InferenceChatCompletionResponse as InferenceChatCompletionResponse, - type InferenceCompletionResponse as InferenceCompletionResponse, type InferenceChatCompletionParams as InferenceChatCompletionParams, type InferenceChatCompletionParamsNonStreaming as InferenceChatCompletionParamsNonStreaming, type InferenceChatCompletionParamsStreaming as InferenceChatCompletionParamsStreaming, @@ -538,6 +536,7 @@ export declare namespace LlamaStackClient { export type AgentConfig = API.AgentConfig; export type BatchCompletion = API.BatchCompletion; + export type ChatCompletionResponse = API.ChatCompletionResponse; export type CompletionMessage = API.CompletionMessage; export type ContentDelta = API.ContentDelta; export type Document = API.Document; diff --git a/src/resources/agents/agents.ts b/src/resources/agents/agents.ts index ce2ad08..633f3c9 100644 --- a/src/resources/agents/agents.ts +++ b/src/resources/agents/agents.ts @@ -15,11 +15,11 @@ import * as StepsAPI from './steps'; import { StepRetrieveResponse, Steps } from './steps'; import * as TurnAPI from './turn'; import { + AgentTurnResponseStreamChunk, Turn, TurnCreateParams, TurnCreateParamsNonStreaming, TurnCreateParamsStreaming, - TurnCreateResponse, TurnResource, TurnResponseEvent, TurnResponseEventPayload, @@ -145,10 +145,10 @@ export declare namespace Agents { export { TurnResource as TurnResource, + type AgentTurnResponseStreamChunk as AgentTurnResponseStreamChunk, type Turn as Turn, type TurnResponseEvent as TurnResponseEvent, type TurnResponseEventPayload as TurnResponseEventPayload, - type TurnCreateResponse as TurnCreateResponse, type TurnCreateParams as TurnCreateParams, type TurnCreateParamsNonStreaming as TurnCreateParamsNonStreaming, type TurnCreateParamsStreaming as TurnCreateParamsStreaming, diff --git a/src/resources/agents/index.ts b/src/resources/agents/index.ts index e02c3b6..c6053b9 100644 --- a/src/resources/agents/index.ts +++ b/src/resources/agents/index.ts @@ -20,10 +20,10 @@ export { export { Steps, type StepRetrieveResponse } from './steps'; export { TurnResource, + type AgentTurnResponseStreamChunk, type Turn, type TurnResponseEvent, type TurnResponseEventPayload, - type TurnCreateResponse, type TurnCreateParams, type TurnCreateParamsNonStreaming, type TurnCreateParamsStreaming, diff --git a/src/resources/agents/turn.ts b/src/resources/agents/turn.ts index 6f63d18..6b13388 100644 --- a/src/resources/agents/turn.ts +++ b/src/resources/agents/turn.ts @@ -14,31 +14,30 @@ export class TurnResource extends APIResource { sessionId: string, body: TurnCreateParamsNonStreaming, options?: Core.RequestOptions, - ): APIPromise; + ): APIPromise; create( agentId: string, sessionId: string, body: TurnCreateParamsStreaming, options?: Core.RequestOptions, - ): APIPromise>; + ): APIPromise>; create( agentId: string, sessionId: string, body: TurnCreateParamsBase, options?: Core.RequestOptions, - ): APIPromise | TurnCreateResponse>; + ): APIPromise | Turn>; create( agentId: string, sessionId: string, body: TurnCreateParams, options?: Core.RequestOptions, - ): APIPromise | APIPromise> { + ): APIPromise | APIPromise> { return this._client.post(`/v1/agents/${agentId}/session/${sessionId}/turn`, { body, ...options, - headers: { Accept: 'text/event-stream', ...options?.headers }, stream: body.stream ?? false, - }) as APIPromise | APIPromise>; + }) as APIPromise | APIPromise>; } retrieve( @@ -51,6 +50,10 @@ export class TurnResource extends APIResource { } } +export interface AgentTurnResponseStreamChunk { + event: TurnResponseEvent; +} + export interface Turn { input_messages: Array; @@ -88,22 +91,44 @@ export namespace Turn { export namespace OutputAttachment { export interface ImageContentItem { + /** + * Image as a base64 encoded string or an URL + */ image: ImageContentItem.Image; + /** + * Discriminator type of the content item. Always "image" + */ type: 'image'; } export namespace ImageContentItem { + /** + * Image as a base64 encoded string or an URL + */ export interface Image { + /** + * base64 encoded image data as string + */ data?: string; + /** + * A URL of the image or data URL in the format of data:image/{type};base64,{data}. + * Note that URL could have length limits. + */ url?: Shared.URL; } } export interface TextContentItem { + /** + * Text content + */ text: string; + /** + * Discriminator type of the content item. Always "text" + */ type: 'text'; } } @@ -168,14 +193,6 @@ export namespace TurnResponseEventPayload { } } -export type TurnCreateResponse = Turn | TurnCreateResponse.AgentTurnResponseStreamChunk; - -export namespace TurnCreateResponse { - export interface AgentTurnResponseStreamChunk { - event: TurnAPI.TurnResponseEvent; - } -} - export type TurnCreateParams = TurnCreateParamsNonStreaming | TurnCreateParamsStreaming; export interface TurnCreateParamsBase { @@ -202,22 +219,44 @@ export namespace TurnCreateParams { export namespace Document { export interface ImageContentItem { + /** + * Image as a base64 encoded string or an URL + */ image: ImageContentItem.Image; + /** + * Discriminator type of the content item. Always "image" + */ type: 'image'; } export namespace ImageContentItem { + /** + * Image as a base64 encoded string or an URL + */ export interface Image { + /** + * base64 encoded image data as string + */ data?: string; + /** + * A URL of the image or data URL in the format of data:image/{type};base64,{data}. + * Note that URL could have length limits. + */ url?: Shared.URL; } } export interface TextContentItem { + /** + * Text content + */ text: string; + /** + * Discriminator type of the content item. Always "text" + */ type: 'text'; } } @@ -242,10 +281,10 @@ export interface TurnCreateParamsStreaming extends TurnCreateParamsBase { export declare namespace TurnResource { export { + type AgentTurnResponseStreamChunk as AgentTurnResponseStreamChunk, type Turn as Turn, type TurnResponseEvent as TurnResponseEvent, type TurnResponseEventPayload as TurnResponseEventPayload, - type TurnCreateResponse as TurnCreateResponse, type TurnCreateParams as TurnCreateParams, type TurnCreateParamsNonStreaming as TurnCreateParamsNonStreaming, type TurnCreateParamsStreaming as TurnCreateParamsStreaming, diff --git a/src/resources/batch-inference.ts b/src/resources/batch-inference.ts index 46b89d2..9f99274 100644 --- a/src/resources/batch-inference.ts +++ b/src/resources/batch-inference.ts @@ -2,7 +2,6 @@ import { APIResource } from '../resource'; import * as Core from '../core'; -import * as InferenceAPI from './inference'; import * as Shared from './shared'; export class BatchInference extends APIResource { @@ -22,21 +21,7 @@ export class BatchInference extends APIResource { } export interface BatchInferenceChatCompletionResponse { - batch: Array; -} - -export namespace BatchInferenceChatCompletionResponse { - export interface Batch { - /** - * The complete response message - */ - completion_message: Shared.CompletionMessage; - - /** - * Optional log probabilities for generated tokens - */ - logprobs?: Array; - } + batch: Array; } export interface BatchInferenceChatCompletionParams { diff --git a/src/resources/datasets.ts b/src/resources/datasets.ts index ce9116f..7158fd4 100644 --- a/src/resources/datasets.ts +++ b/src/resources/datasets.ts @@ -35,25 +35,7 @@ export class Datasets extends APIResource { } export interface ListDatasetsResponse { - data: Array; -} - -export namespace ListDatasetsResponse { - export interface Data { - dataset_schema: Record; - - identifier: string; - - metadata: Record | unknown | null>; - - provider_id: string; - - provider_resource_id: string; - - type: 'dataset'; - - url: Shared.URL; - } + data: DatasetListResponse; } export interface DatasetRetrieveResponse { diff --git a/src/resources/eval-tasks.ts b/src/resources/eval-tasks.ts index 4bf05c6..9397dcb 100644 --- a/src/resources/eval-tasks.ts +++ b/src/resources/eval-tasks.ts @@ -40,7 +40,7 @@ export interface EvalTask { } export interface ListEvalTasksResponse { - data: Array; + data: EvalTaskListResponse; } export type EvalTaskListResponse = Array; diff --git a/src/resources/index.ts b/src/resources/index.ts index 77e90a5..b809d8c 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -48,11 +48,10 @@ export { } from './eval-tasks'; export { Inference, + type ChatCompletionResponseStreamChunk, type CompletionResponse, type EmbeddingsResponse, type TokenLogProbs, - type InferenceChatCompletionResponse, - type InferenceCompletionResponse, type InferenceChatCompletionParams, type InferenceChatCompletionParamsNonStreaming, type InferenceChatCompletionParamsStreaming, diff --git a/src/resources/inference.ts b/src/resources/inference.ts index a281f90..7dc59c7 100644 --- a/src/resources/inference.ts +++ b/src/resources/inference.ts @@ -14,25 +14,24 @@ export class Inference extends APIResource { chatCompletion( body: InferenceChatCompletionParamsNonStreaming, options?: Core.RequestOptions, - ): APIPromise; + ): APIPromise; chatCompletion( body: InferenceChatCompletionParamsStreaming, options?: Core.RequestOptions, - ): APIPromise>; + ): APIPromise>; chatCompletion( body: InferenceChatCompletionParamsBase, options?: Core.RequestOptions, - ): APIPromise | InferenceChatCompletionResponse>; + ): APIPromise | Shared.ChatCompletionResponse>; chatCompletion( body: InferenceChatCompletionParams, options?: Core.RequestOptions, - ): APIPromise | APIPromise> { + ): APIPromise | APIPromise> { return this._client.post('/v1/inference/chat-completion', { body, ...options, - headers: { Accept: 'text/event-stream', ...options?.headers }, stream: body.stream ?? false, - }) as APIPromise | APIPromise>; + }) as APIPromise | APIPromise>; } /** @@ -41,25 +40,24 @@ export class Inference extends APIResource { completion( body: InferenceCompletionParamsNonStreaming, options?: Core.RequestOptions, - ): APIPromise; + ): APIPromise; completion( body: InferenceCompletionParamsStreaming, options?: Core.RequestOptions, - ): APIPromise>; + ): APIPromise>; completion( body: InferenceCompletionParamsBase, options?: Core.RequestOptions, - ): APIPromise | InferenceCompletionResponse>; + ): APIPromise | CompletionResponse>; completion( body: InferenceCompletionParams, options?: Core.RequestOptions, - ): APIPromise | APIPromise> { + ): APIPromise | APIPromise> { return this._client.post('/v1/inference/completion', { body, ...options, - headers: { Accept: 'text/event-stream', ...options?.headers }, stream: body.stream ?? false, - }) as APIPromise | APIPromise>; + }) as APIPromise | APIPromise>; } /** @@ -73,6 +71,41 @@ export class Inference extends APIResource { } } +export interface ChatCompletionResponseStreamChunk { + /** + * The event containing the new content + */ + event: ChatCompletionResponseStreamChunk.Event; +} + +export namespace ChatCompletionResponseStreamChunk { + /** + * The event containing the new content + */ + export interface Event { + /** + * Content generated since last event. This can be one or more tokens, or a tool + * call. + */ + delta: Shared.ContentDelta; + + /** + * Type of the event + */ + event_type: 'start' | 'complete' | 'progress'; + + /** + * Optional log probabilities for generated tokens + */ + logprobs?: Array; + + /** + * Optional reason why generation stopped, if complete + */ + stop_reason?: 'end_of_turn' | 'end_of_message' | 'out_of_tokens'; + } +} + export interface CompletionResponse { /** * The generated completion text @@ -106,82 +139,6 @@ export interface TokenLogProbs { logprobs_by_token: Record; } -export type InferenceChatCompletionResponse = - | InferenceChatCompletionResponse.ChatCompletionResponse - | InferenceChatCompletionResponse.ChatCompletionResponseStreamChunk; - -export namespace InferenceChatCompletionResponse { - export interface ChatCompletionResponse { - /** - * The complete response message - */ - completion_message: Shared.CompletionMessage; - - /** - * Optional log probabilities for generated tokens - */ - logprobs?: Array; - } - - export interface ChatCompletionResponseStreamChunk { - /** - * The event containing the new content - */ - event: ChatCompletionResponseStreamChunk.Event; - } - - export namespace ChatCompletionResponseStreamChunk { - /** - * The event containing the new content - */ - export interface Event { - /** - * Content generated since last event. This can be one or more tokens, or a tool - * call. - */ - delta: Shared.ContentDelta; - - /** - * Type of the event - */ - event_type: 'start' | 'complete' | 'progress'; - - /** - * Optional log probabilities for generated tokens - */ - logprobs?: Array; - - /** - * Optional reason why generation stopped, if complete - */ - stop_reason?: 'end_of_turn' | 'end_of_message' | 'out_of_tokens'; - } - } -} - -export type InferenceCompletionResponse = - | CompletionResponse - | InferenceCompletionResponse.CompletionResponseStreamChunk; - -export namespace InferenceCompletionResponse { - export interface CompletionResponseStreamChunk { - /** - * New content generated since last chunk. This can be one or more tokens. - */ - delta: string; - - /** - * Optional log probabilities for generated tokens - */ - logprobs?: Array; - - /** - * Optional reason why generation stopped, if complete - */ - stop_reason?: 'end_of_turn' | 'end_of_message' | 'out_of_tokens'; - } -} - export type InferenceChatCompletionParams = | InferenceChatCompletionParamsNonStreaming | InferenceChatCompletionParamsStreaming; @@ -374,11 +331,10 @@ export interface InferenceEmbeddingsParams { export declare namespace Inference { export { + type ChatCompletionResponseStreamChunk as ChatCompletionResponseStreamChunk, type CompletionResponse as CompletionResponse, type EmbeddingsResponse as EmbeddingsResponse, type TokenLogProbs as TokenLogProbs, - type InferenceChatCompletionResponse as InferenceChatCompletionResponse, - type InferenceCompletionResponse as InferenceCompletionResponse, type InferenceChatCompletionParams as InferenceChatCompletionParams, type InferenceChatCompletionParamsNonStreaming as InferenceChatCompletionParamsNonStreaming, type InferenceChatCompletionParamsStreaming as InferenceChatCompletionParamsStreaming, diff --git a/src/resources/models.ts b/src/resources/models.ts index 3f849d9..2c561fe 100644 --- a/src/resources/models.ts +++ b/src/resources/models.ts @@ -27,7 +27,7 @@ export class Models extends APIResource { } export interface ListModelsResponse { - data: Array; + data: ModelListResponse; } export interface Model { diff --git a/src/resources/post-training/job.ts b/src/resources/post-training/job.ts index 1f9343f..966173a 100644 --- a/src/resources/post-training/job.ts +++ b/src/resources/post-training/job.ts @@ -4,9 +4,11 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; export class Job extends APIResource { - list(options?: Core.RequestOptions): Core.APIPromise { + list(options?: Core.RequestOptions): Core.APIPromise> { return ( - this._client.get('/v1/post-training/jobs', options) as Core.APIPromise<{ data: JobListResponse }> + this._client.get('/v1/post-training/jobs', options) as Core.APIPromise<{ + data: Array; + }> )._thenUnwrap((obj) => obj.data); } diff --git a/src/resources/providers.ts b/src/resources/providers.ts index 94ac34a..624b9da 100644 --- a/src/resources/providers.ts +++ b/src/resources/providers.ts @@ -13,7 +13,7 @@ export class Providers extends APIResource { } export interface ListProvidersResponse { - data: Array; + data: ProviderListResponse; } export type ProviderListResponse = Array; diff --git a/src/resources/routes.ts b/src/resources/routes.ts index 819a77b..3a8051d 100644 --- a/src/resources/routes.ts +++ b/src/resources/routes.ts @@ -13,7 +13,7 @@ export class Routes extends APIResource { } export interface ListRoutesResponse { - data: Array; + data: RouteListResponse; } export type RouteListResponse = Array; diff --git a/src/resources/scoring-functions.ts b/src/resources/scoring-functions.ts index d8998d0..83d6e9d 100644 --- a/src/resources/scoring-functions.ts +++ b/src/resources/scoring-functions.ts @@ -27,7 +27,7 @@ export class ScoringFunctions extends APIResource { } export interface ListScoringFunctionsResponse { - data: Array; + data: ScoringFunctionListResponse; } export interface ScoringFn { diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 4eea2de..d236d3c 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -42,6 +42,18 @@ export interface BatchCompletion { batch: Array; } +export interface ChatCompletionResponse { + /** + * The complete response message + */ + completion_message: CompletionMessage; + + /** + * Optional log probabilities for generated tokens + */ + logprobs?: Array; +} + export interface CompletionMessage { /** * The content of the model's response @@ -110,22 +122,44 @@ export interface Document { export namespace Document { export interface ImageContentItem { + /** + * Image as a base64 encoded string or an URL + */ image: ImageContentItem.Image; + /** + * Discriminator type of the content item. Always "image" + */ type: 'image'; } export namespace ImageContentItem { + /** + * Image as a base64 encoded string or an URL + */ export interface Image { + /** + * base64 encoded image data as string + */ data?: string; + /** + * A URL of the image or data URL in the format of data:image/{type};base64,{data}. + * Note that URL could have length limits. + */ url?: Shared.URL; } } export interface TextContentItem { + /** + * Text content + */ text: string; + /** + * Discriminator type of the content item. Always "text" + */ type: 'text'; } } @@ -138,22 +172,44 @@ export type InterleavedContent = export namespace InterleavedContent { export interface ImageContentItem { + /** + * Image as a base64 encoded string or an URL + */ image: ImageContentItem.Image; + /** + * Discriminator type of the content item. Always "image" + */ type: 'image'; } export namespace ImageContentItem { + /** + * Image as a base64 encoded string or an URL + */ export interface Image { + /** + * base64 encoded image data as string + */ data?: string; + /** + * A URL of the image or data URL in the format of data:image/{type};base64,{data}. + * Note that URL could have length limits. + */ url?: Shared.URL; } } export interface TextContentItem { + /** + * Text content + */ text: string; + /** + * Discriminator type of the content item. Always "text" + */ type: 'text'; } } @@ -164,22 +220,44 @@ export type InterleavedContentItem = export namespace InterleavedContentItem { export interface ImageContentItem { + /** + * Image as a base64 encoded string or an URL + */ image: ImageContentItem.Image; + /** + * Discriminator type of the content item. Always "image" + */ type: 'image'; } export namespace ImageContentItem { + /** + * Image as a base64 encoded string or an URL + */ export interface Image { + /** + * base64 encoded image data as string + */ data?: string; + /** + * A URL of the image or data URL in the format of data:image/{type};base64,{data}. + * Note that URL could have length limits. + */ url?: Shared.URL; } } export interface TextContentItem { + /** + * Text content + */ text: string; + /** + * Discriminator type of the content item. Always "text" + */ type: 'text'; } } diff --git a/src/resources/shields.ts b/src/resources/shields.ts index 72596eb..edc98de 100644 --- a/src/resources/shields.ts +++ b/src/resources/shields.ts @@ -20,7 +20,7 @@ export class Shields extends APIResource { } export interface ListShieldsResponse { - data: Array; + data: ShieldListResponse; } export interface Shield { diff --git a/src/resources/telemetry.ts b/src/resources/telemetry.ts index 33aec18..5270bce 100644 --- a/src/resources/telemetry.ts +++ b/src/resources/telemetry.ts @@ -165,25 +165,7 @@ export interface QueryCondition { } export interface QuerySpansResponse { - data: Array; -} - -export namespace QuerySpansResponse { - export interface Data { - name: string; - - span_id: string; - - start_time: string; - - trace_id: string; - - attributes?: Record | unknown | null>; - - end_time?: string; - - parent_span_id?: string; - } + data: TelemetryQuerySpansResponse; } export interface SpanWithStatus { diff --git a/src/resources/toolgroups.ts b/src/resources/toolgroups.ts index 9f0135b..f5f9038 100644 --- a/src/resources/toolgroups.ts +++ b/src/resources/toolgroups.ts @@ -41,7 +41,7 @@ export class Toolgroups extends APIResource { } export interface ListToolGroupsResponse { - data: Array; + data: ToolgroupListResponse; } export interface ToolGroup { diff --git a/src/resources/tools.ts b/src/resources/tools.ts index 861ac90..3a3e4f6 100644 --- a/src/resources/tools.ts +++ b/src/resources/tools.ts @@ -28,7 +28,7 @@ export class Tools extends APIResource { } export interface ListToolsResponse { - data: Array; + data: ToolListResponse; } export interface Tool { diff --git a/src/resources/vector-dbs.ts b/src/resources/vector-dbs.ts index e85441f..37b60c1 100644 --- a/src/resources/vector-dbs.ts +++ b/src/resources/vector-dbs.ts @@ -33,23 +33,7 @@ export class VectorDBs extends APIResource { } export interface ListVectorDBsResponse { - data: Array; -} - -export namespace ListVectorDBsResponse { - export interface Data { - embedding_dimension: number; - - embedding_model: string; - - identifier: string; - - provider_id: string; - - provider_resource_id: string; - - type: 'vector_db'; - } + data: VectorDBListResponse; } export interface VectorDBRetrieveResponse { diff --git a/tests/api-resources/agents/turn.test.ts b/tests/api-resources/agents/turn.test.ts index 6d53271..62394a9 100644 --- a/tests/api-resources/agents/turn.test.ts +++ b/tests/api-resources/agents/turn.test.ts @@ -6,8 +6,7 @@ import { Response } from 'node-fetch'; const client = new LlamaStackClient({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010' }); describe('resource turn', () => { - // skipped: currently no good way to test endpoints with content type text/event-stream, Prism mock server will fail - test.skip('create: only required params', async () => { + test('create: only required params', async () => { const responsePromise = client.agents.turn.create('agent_id', 'session_id', { messages: [{ content: 'string', role: 'user' }], }); @@ -20,8 +19,7 @@ describe('resource turn', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: currently no good way to test endpoints with content type text/event-stream, Prism mock server will fail - test.skip('create: required and optional params', async () => { + test('create: required and optional params', async () => { const response = await client.agents.turn.create('agent_id', 'session_id', { messages: [{ content: 'string', role: 'user', context: 'string' }], documents: [{ content: 'string', mime_type: 'mime_type' }], diff --git a/tests/api-resources/inference.test.ts b/tests/api-resources/inference.test.ts index 8b17494..7842628 100644 --- a/tests/api-resources/inference.test.ts +++ b/tests/api-resources/inference.test.ts @@ -6,8 +6,7 @@ import { Response } from 'node-fetch'; const client = new LlamaStackClient({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010' }); describe('resource inference', () => { - // skipped: currently no good way to test endpoints with content type text/event-stream, Prism mock server will fail - test.skip('chatCompletion: only required params', async () => { + test('chatCompletion: only required params', async () => { const responsePromise = client.inference.chatCompletion({ messages: [{ content: 'string', role: 'user' }], model_id: 'model_id', @@ -21,8 +20,7 @@ describe('resource inference', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: currently no good way to test endpoints with content type text/event-stream, Prism mock server will fail - test.skip('chatCompletion: required and optional params', async () => { + test('chatCompletion: required and optional params', async () => { const response = await client.inference.chatCompletion({ messages: [{ content: 'string', role: 'user', context: 'string' }], model_id: 'model_id', @@ -44,8 +42,7 @@ describe('resource inference', () => { }); }); - // skipped: currently no good way to test endpoints with content type text/event-stream, Prism mock server will fail - test.skip('completion: only required params', async () => { + test('completion: only required params', async () => { const responsePromise = client.inference.completion({ content: 'string', model_id: 'model_id' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -56,8 +53,7 @@ describe('resource inference', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - // skipped: currently no good way to test endpoints with content type text/event-stream, Prism mock server will fail - test.skip('completion: required and optional params', async () => { + test('completion: required and optional params', async () => { const response = await client.inference.completion({ content: 'string', model_id: 'model_id',