Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
Datasets,
ListDatasetsResponse,
} from './resources/datasets';
import { EmbeddingCreateParams, Embeddings, EmbeddingsResponse } from './resources/embeddings';
import { CreateEmbeddingsResponse, EmbeddingCreateParams, Embeddings } from './resources/embeddings';
import {
DeleteFileResponse,
File,
Expand All @@ -45,7 +45,7 @@ import {
import {
ChatCompletionResponseStreamChunk,
CompletionResponse,
EmbeddingsResponse as InferenceAPIEmbeddingsResponse,
EmbeddingsResponse,
Inference,
InferenceBatchChatCompletionParams,
InferenceBatchChatCompletionResponse,
Expand Down Expand Up @@ -492,7 +492,7 @@ export declare namespace LlamaStackClient {
Inference as Inference,
type ChatCompletionResponseStreamChunk as ChatCompletionResponseStreamChunk,
type CompletionResponse as CompletionResponse,
type InferenceAPIEmbeddingsResponse as EmbeddingsResponse,
type EmbeddingsResponse as EmbeddingsResponse,
type TokenLogProbs as TokenLogProbs,
type InferenceBatchChatCompletionResponse as InferenceBatchChatCompletionResponse,
type InferenceBatchChatCompletionParams as InferenceBatchChatCompletionParams,
Expand All @@ -508,7 +508,7 @@ export declare namespace LlamaStackClient {

export {
Embeddings as Embeddings,
type EmbeddingsResponse as EmbeddingsResponse,
type CreateEmbeddingsResponse as CreateEmbeddingsResponse,
type EmbeddingCreateParams as EmbeddingCreateParams,
};

Expand Down
2 changes: 1 addition & 1 deletion src/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import type { LlamaStackClient } from './index';

export class APIResource {
export abstract class APIResource {
protected _client: LlamaStackClient;

constructor(client: LlamaStackClient) {
Expand Down
5 changes: 5 additions & 0 deletions src/resources/datasets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ export interface DatasetIterrowsResponse {
* Whether there are more items available after this set
*/
has_more: boolean;

/**
* The URL for accessing this list
*/
url?: string;
}

export interface DatasetRegisterResponse {
Expand Down
15 changes: 9 additions & 6 deletions src/resources/embeddings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,22 @@ export class Embeddings extends APIResource {
* Generate OpenAI-compatible embeddings for the given input using the specified
* model.
*/
create(body: EmbeddingCreateParams, options?: Core.RequestOptions): Core.APIPromise<EmbeddingsResponse> {
create(
body: EmbeddingCreateParams,
options?: Core.RequestOptions,
): Core.APIPromise<CreateEmbeddingsResponse> {
return this._client.post('/v1/openai/v1/embeddings', { body, ...options });
}
}

/**
* Response from an OpenAI-compatible embeddings request.
*/
export interface EmbeddingsResponse {
export interface CreateEmbeddingsResponse {
/**
* List of embedding data objects
*/
data: Array<EmbeddingsResponse.Data>;
data: Array<CreateEmbeddingsResponse.Data>;

/**
* The model that was used to generate the embeddings
Expand All @@ -35,10 +38,10 @@ export interface EmbeddingsResponse {
/**
* Usage information
*/
usage: EmbeddingsResponse.Usage;
usage: CreateEmbeddingsResponse.Usage;
}

export namespace EmbeddingsResponse {
export namespace CreateEmbeddingsResponse {
/**
* A single embedding data object from an OpenAI-compatible embeddings response.
*/
Expand Down Expand Up @@ -110,7 +113,7 @@ export interface EmbeddingCreateParams {

export declare namespace Embeddings {
export {
type EmbeddingsResponse as EmbeddingsResponse,
type CreateEmbeddingsResponse as CreateEmbeddingsResponse,
type EmbeddingCreateParams as EmbeddingCreateParams,
};
}
2 changes: 1 addition & 1 deletion src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export {
type DatasetIterrowsParams,
type DatasetRegisterParams,
} from './datasets';
export { Embeddings, type EmbeddingsResponse, type EmbeddingCreateParams } from './embeddings';
export { Embeddings, type CreateEmbeddingsResponse, type EmbeddingCreateParams } from './embeddings';
export {
Eval,
type BenchmarkConfig,
Expand Down