@databricks/sdk-modelservingquery 0.39.0 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.js +1 -1
- package/dist/v1/model.js +5 -1
- package/dist/v1/model.js.map +1 -1
- package/package.json +4 -4
package/dist/package.js
CHANGED
package/dist/v1/model.js
CHANGED
|
@@ -62,7 +62,11 @@ const unmarshalQueryEndpointResponseSchema = z.object({
|
|
|
62
62
|
model: z.string().optional(),
|
|
63
63
|
usage: z.lazy(() => unmarshalExternalModelUsageElementSchema).optional(),
|
|
64
64
|
id: z.string().optional(),
|
|
65
|
-
created: z.union([
|
|
65
|
+
created: z.union([
|
|
66
|
+
z.number(),
|
|
67
|
+
z.bigint(),
|
|
68
|
+
z.string()
|
|
69
|
+
]).transform((v) => BigInt(v)).optional(),
|
|
66
70
|
object: z.string().optional(),
|
|
67
71
|
predictions: z.array(jsonValueSchema).optional(),
|
|
68
72
|
outputs: z.array(jsonValueSchema).optional(),
|
package/dist/v1/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","names":[],"sources":["../../src/v1/model.ts"],"sourcesContent":["// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.\n\nimport type {JsonValue} from '@databricks/sdk-core/wkt';\nimport {z} from 'zod';\n\nconst jsonValueSchema: z.ZodType<JsonValue> = z.lazy(() =>\n z.union([\n z.null(),\n z.number(),\n z.string(),\n z.boolean(),\n z.record(z.string(), jsonValueSchema),\n z.array(jsonValueSchema),\n ])\n);\n\n/** The role of the message. One of [system, user, assistant]. */\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.\nexport const ChatMessageRole = {\n CHAT_MESSAGE_ROLE_UNSPECIFIED: 'CHAT_MESSAGE_ROLE_UNSPECIFIED',\n SYSTEM: 'system',\n USER: 'user',\n ASSISTANT: 'assistant',\n} as const;\nexport type ChatMessageRole =\n | (typeof ChatMessageRole)[keyof typeof ChatMessageRole]\n | (string & {});\n\n/** This will always be 'embedding'. */\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.\nexport const EmbeddingsV1ResponseEmbeddingElementObject = {\n EMBEDDINGS_V1_RESPONSE_EMBEDDING_ELEMENT_OBJECT_UNSPECIFIED:\n 'EMBEDDINGS_V1_RESPONSE_EMBEDDING_ELEMENT_OBJECT_UNSPECIFIED',\n EMBEDDING: 'embedding',\n} as const;\nexport type EmbeddingsV1ResponseEmbeddingElementObject =\n | (typeof EmbeddingsV1ResponseEmbeddingElementObject)[keyof typeof EmbeddingsV1ResponseEmbeddingElementObject]\n | (string & {});\n\n/**\n * The type of object returned by the __external/foundation model__ serving endpoint, one of\n * [text_completion, chat.completion, list (of embeddings)].\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.\nexport const QueryEndpointResponseObject = {\n QUERY_ENDPOINT_RESPONSE_OBJECT_UNSPECIFIED:\n 'QUERY_ENDPOINT_RESPONSE_OBJECT_UNSPECIFIED',\n TEXT_COMPLETION: 'text_completion',\n CHAT_COMPLETION: 'chat.completion',\n LIST: 'list',\n} as const;\nexport type QueryEndpointResponseObject =\n | (typeof QueryEndpointResponseObject)[keyof typeof QueryEndpointResponseObject]\n | (string & {});\n\nexport interface ChatMessage {\n /** The role of the message. One of [system, user, assistant]. */\n role?: ChatMessageRole | undefined;\n /** The content of the message. */\n content?: string | undefined;\n}\n\nexport interface DataframeSplitInput {\n /** Index array for the dataframe */\n index?: number[] | undefined;\n /** Columns array for the dataframe */\n columns?: JsonValue[] | undefined;\n /** Data array for the dataframe */\n data?: JsonValue[] | undefined;\n}\n\nexport interface EmbeddingsV1ResponseEmbeddingElement {\n /** The embedding vector */\n embedding?: number[] | undefined;\n /** The index of the embedding in the response. */\n index?: number | undefined;\n /** This will always be 'embedding'. */\n object?: EmbeddingsV1ResponseEmbeddingElementObject | undefined;\n}\n\nexport interface ExternalModelUsageElement {\n /** The number of tokens in the prompt. */\n promptTokens?: number | undefined;\n /** The number of tokens in the chat/completions response. */\n completionTokens?: number | undefined;\n /** The total number of tokens in the prompt and response. */\n totalTokens?: number | undefined;\n}\n\nexport interface QueryEndpointRequest {\n /** The name of the serving endpoint. This field is required and is provided via the path parameter. */\n name?: string | undefined;\n /**\n * The prompt string (or array of strings) field used ONLY for __completions external & foundation model__\n * serving endpoints and should only be used with other completions query fields.\n */\n prompt?: JsonValue | undefined;\n /**\n * The input string (or array of strings) field used ONLY for __embeddings external & foundation model__\n * serving endpoints and is the only field (along with extra_params if needed) used by embeddings queries.\n */\n input?: JsonValue | undefined;\n /**\n * The messages field used ONLY for __chat external & foundation model__ serving endpoints.\n * This is an array of ChatMessage objects and should only be used with other chat query fields.\n */\n messages?: ChatMessage[] | undefined;\n /**\n * The temperature field used ONLY for __completions__ and __chat external & foundation model__ serving\n * endpoints. This is a float between 0.0 and 2.0 with a default of 1.0 and should only be used with other\n * chat/completions query fields.\n */\n temperature?: number | undefined;\n /**\n * The stop sequences field used ONLY for __completions__ and __chat external & foundation model__ serving\n * endpoints. This is a list of strings and should only be used with other chat/completions query fields.\n */\n stop?: string[] | undefined;\n /**\n * The max tokens field used ONLY for __completions__ and __chat external & foundation model__ serving\n * endpoints. This is an integer and should only be used with other chat/completions query fields.\n */\n maxTokens?: number | undefined;\n /**\n * The n (number of candidates) field used ONLY for __completions__ and __chat external & foundation model__\n * serving endpoints. This is an integer between 1 and 5 with a default of 1 and should only be used with\n * other chat/completions query fields.\n */\n n?: number | undefined;\n /**\n * The stream field used ONLY for __completions__ and __chat external & foundation model__ serving endpoints.\n * This is a boolean defaulting to false and should only be used with other chat/completions query fields.\n */\n stream?: boolean | undefined;\n /**\n * The extra parameters field used ONLY for __completions, chat,__ and __embeddings external & foundation\n * model__ serving endpoints. This is a map of strings and should only be used with other external/foundation\n * model query fields.\n */\n extraParams?: Record<string, string> | undefined;\n /** Pandas Dataframe input in the records orientation. */\n dataframeRecords?: JsonValue[] | undefined;\n /** Pandas Dataframe input in the split orientation. */\n dataframeSplit?: DataframeSplitInput | undefined;\n /** Tensor-based input in row format. */\n instances?: JsonValue[] | undefined;\n /** Tensor-based input in columnar format. */\n inputs?: JsonValue | undefined;\n /** Optional user-provided request identifier that will be recorded in the inference table and the usage tracking table. */\n clientRequestId?: string | undefined;\n /** Optional user-provided context that will be recorded in the usage tracking table. */\n usageContext?: Record<string, string> | undefined;\n}\n\nexport interface QueryEndpointResponse {\n /** The list of choices returned by the __chat or completions external/foundation model__ serving endpoint. */\n choices?: V1ResponseChoiceElement[] | undefined;\n /** The list of the embeddings returned by the __embeddings external/foundation model__ serving endpoint. */\n data?: EmbeddingsV1ResponseEmbeddingElement[] | undefined;\n /**\n * The name of the __external/foundation model__ used for querying. This is the name of the model that was\n * specified in the endpoint config.\n */\n model?: string | undefined;\n /**\n * The usage object that may be returned by the __external/foundation model__ serving endpoint. This\n * contains information about the number of tokens used in the prompt and response.\n */\n usage?: ExternalModelUsageElement | undefined;\n /** The ID of the query that may be returned by a __completions or chat external/foundation model__ serving endpoint. */\n id?: string | undefined;\n /** The timestamp in seconds when the query was created in Unix time returned by a __completions or chat external/foundation model__ serving endpoint. */\n created?: bigint | undefined;\n /**\n * The type of object returned by the __external/foundation model__ serving endpoint, one of\n * [text_completion, chat.completion, list (of embeddings)].\n */\n object?: QueryEndpointResponseObject | undefined;\n /** The predictions returned by the serving endpoint. */\n predictions?: JsonValue[] | undefined;\n /** The outputs of the feature serving endpoint. */\n outputs?: JsonValue[] | undefined;\n /** The name of the served model that served the request. This is useful when there are multiple models behind the same endpoint with traffic split. */\n servedModelName?: string | undefined;\n}\n\nexport interface V1ResponseChoiceElement {\n /** The text response from the __completions__ endpoint. */\n text?: string | undefined;\n /** The message response from the __chat__ endpoint. */\n message?: ChatMessage | undefined;\n /** The index of the choice in the __chat or completions__ response. */\n index?: number | undefined;\n /** The finish reason returned by the endpoint. */\n finishReason?: string | undefined;\n /** The logprobs returned only by the __completions__ endpoint. */\n logprobs?: number | undefined;\n}\n\nexport const unmarshalChatMessageSchema: z.ZodType<ChatMessage> = z\n .object({\n role: z.string().optional(),\n content: z.string().optional(),\n })\n .transform(d => ({\n role: d.role,\n content: d.content,\n }));\n\nexport const unmarshalEmbeddingsV1ResponseEmbeddingElementSchema: z.ZodType<EmbeddingsV1ResponseEmbeddingElement> =\n z\n .object({\n embedding: z.array(z.number()).optional(),\n index: z.number().optional(),\n object: z.string().optional(),\n })\n .transform(d => ({\n embedding: d.embedding,\n index: d.index,\n object: d.object,\n }));\n\nexport const unmarshalExternalModelUsageElementSchema: z.ZodType<ExternalModelUsageElement> =\n z\n .object({\n prompt_tokens: z.number().optional(),\n completion_tokens: z.number().optional(),\n total_tokens: z.number().optional(),\n })\n .transform(d => ({\n promptTokens: d.prompt_tokens,\n completionTokens: d.completion_tokens,\n totalTokens: d.total_tokens,\n }));\n\nexport const unmarshalQueryEndpointResponseSchema: z.ZodType<QueryEndpointResponse> =\n z\n .object({\n choices: z\n .array(z.lazy(() => unmarshalV1ResponseChoiceElementSchema))\n .optional(),\n data: z\n .array(\n z.lazy(() => unmarshalEmbeddingsV1ResponseEmbeddingElementSchema)\n )\n .optional(),\n model: z.string().optional(),\n usage: z.lazy(() => unmarshalExternalModelUsageElementSchema).optional(),\n id: z.string().optional(),\n created: z\n .union([z.number(), z.bigint()])\n .transform(v => BigInt(v))\n .optional(),\n object: z.string().optional(),\n predictions: z.array(jsonValueSchema).optional(),\n outputs: z.array(jsonValueSchema).optional(),\n 'served-model-name': z.string().optional(),\n })\n .transform(d => ({\n choices: d.choices,\n data: d.data,\n model: d.model,\n usage: d.usage,\n id: d.id,\n created: d.created,\n object: d.object,\n predictions: d.predictions,\n outputs: d.outputs,\n servedModelName: d['served-model-name'],\n }));\n\nexport const unmarshalV1ResponseChoiceElementSchema: z.ZodType<V1ResponseChoiceElement> =\n z\n .object({\n text: z.string().optional(),\n message: z.lazy(() => unmarshalChatMessageSchema).optional(),\n index: z.number().optional(),\n finishReason: z.string().optional(),\n logprobs: z.number().optional(),\n })\n .transform(d => ({\n text: d.text,\n message: d.message,\n index: d.index,\n finishReason: d.finishReason,\n logprobs: d.logprobs,\n }));\n\nexport const marshalChatMessageSchema: z.ZodType = z\n .object({\n role: z.string().optional(),\n content: z.string().optional(),\n })\n .transform(d => ({\n role: d.role,\n content: d.content,\n }));\n\nexport const marshalDataframeSplitInputSchema: z.ZodType = z\n .object({\n index: z.array(z.number()).optional(),\n columns: z.array(jsonValueSchema).optional(),\n data: z.array(jsonValueSchema).optional(),\n })\n .transform(d => ({\n index: d.index,\n columns: d.columns,\n data: d.data,\n }));\n\nexport const marshalQueryEndpointRequestSchema: z.ZodType = z\n .object({\n name: z.string().optional(),\n prompt: jsonValueSchema.optional(),\n input: jsonValueSchema.optional(),\n messages: z.array(z.lazy(() => marshalChatMessageSchema)).optional(),\n temperature: z.number().optional(),\n stop: z.array(z.string()).optional(),\n maxTokens: z.number().optional(),\n n: z.number().optional(),\n stream: z.boolean().optional(),\n extraParams: z.record(z.string(), z.string()).optional(),\n dataframeRecords: z.array(jsonValueSchema).optional(),\n dataframeSplit: z.lazy(() => marshalDataframeSplitInputSchema).optional(),\n instances: z.array(jsonValueSchema).optional(),\n inputs: jsonValueSchema.optional(),\n clientRequestId: z.string().optional(),\n usageContext: z.record(z.string(), z.string()).optional(),\n })\n .transform(d => ({\n name: d.name,\n prompt: d.prompt,\n input: d.input,\n messages: d.messages,\n temperature: d.temperature,\n stop: d.stop,\n max_tokens: d.maxTokens,\n n: d.n,\n stream: d.stream,\n extra_params: d.extraParams,\n dataframe_records: d.dataframeRecords,\n dataframe_split: d.dataframeSplit,\n instances: d.instances,\n inputs: d.inputs,\n client_request_id: d.clientRequestId,\n usage_context: d.usageContext,\n }));\n"],"mappings":";;;AAKA,MAAM,kBAAwC,EAAE,WAC9C,EAAE,MAAM;CACN,EAAE,MAAM;CACR,EAAE,QAAQ;CACV,EAAE,QAAQ;CACV,EAAE,SAAS;CACX,EAAE,OAAO,EAAE,QA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f,OAAO,EAAE;CACT,SAAS,EAAE;CACX,MAAM,EAAE;CACT,EAAE;AAEL,MAAa,oCAA+C,EACzD,OAAO;CACN,MAAM,EAAE,QAAQ,CAAC,UAAU;CAC3B,QAAQ,gBAAgB,UAAU;CAClC,OAAO,gBAAgB,UAAU;CACjC,UAAU,EAAE,MAAM,EAAE,WAAW,yBAAyB,CAAC,CAAC,UAAU;CACpE,aAAa,EAAE,QAAQ,CAAC,UAAU;CAClC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,UAAU;CACpC,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,GAAG,EAAE,QAAQ,CAAC,UAAU;CACxB,QAAQ,EAAE,SAAS,CAAC,UAAU;CAC9B,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAC,UAAU;CACxD,kBAAkB,EAAE,MAAM,gBAAgB,CAAC,UAAU;CACrD,gBAAgB,EAAE,WAAW,iCAAiC,CAAC,UAAU;CACzE,WAAW,EAAE,MAAM,gBAAgB,CAAC,UAAU;CAC9C,QAAQ,gBAAgB,UAAU;CAClC,iBAAiB,EAAE,QAAQ,CAAC,UAAU;CACtC,cAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAC,UAAU;CAC1D,CAAC,CACD,WAAU,OAAM;CACf,MAAM,EAAE;CACR,QAAQ,EAAE;CACV,OAAO,EAAE;CACT,UAAU,EAAE;CACZ,aAAa,EAAE;CACf,MAAM,EAAE;CACR,YAAY,EAAE;CACd,GAAG,EAAE;CACL,QAAQ,EAAE;CACV,cAAc,EAAE;CAChB,mBAAmB,EAAE;CACrB,iBAAiB,EAAE;CACnB,WAAW,EAAE;CACb,QAAQ,EAAE;CACV,mBAAmB,EAAE;CACrB,eAAe,EAAE;CAClB,EAAE"}
|
|
1
|
+
{"version":3,"file":"model.js","names":[],"sources":["../../src/v1/model.ts"],"sourcesContent":["// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.\n\nimport type {JsonValue} from '@databricks/sdk-core/wkt';\nimport {z} from 'zod';\n\nconst jsonValueSchema: z.ZodType<JsonValue> = z.lazy(() =>\n z.union([\n z.null(),\n z.number(),\n z.string(),\n z.boolean(),\n z.record(z.string(), jsonValueSchema),\n z.array(jsonValueSchema),\n ])\n);\n\n/** The role of the message. One of [system, user, assistant]. */\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.\nexport const ChatMessageRole = {\n CHAT_MESSAGE_ROLE_UNSPECIFIED: 'CHAT_MESSAGE_ROLE_UNSPECIFIED',\n SYSTEM: 'system',\n USER: 'user',\n ASSISTANT: 'assistant',\n} as const;\nexport type ChatMessageRole =\n | (typeof ChatMessageRole)[keyof typeof ChatMessageRole]\n | (string & {});\n\n/** This will always be 'embedding'. */\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.\nexport const EmbeddingsV1ResponseEmbeddingElementObject = {\n EMBEDDINGS_V1_RESPONSE_EMBEDDING_ELEMENT_OBJECT_UNSPECIFIED:\n 'EMBEDDINGS_V1_RESPONSE_EMBEDDING_ELEMENT_OBJECT_UNSPECIFIED',\n EMBEDDING: 'embedding',\n} as const;\nexport type EmbeddingsV1ResponseEmbeddingElementObject =\n | (typeof EmbeddingsV1ResponseEmbeddingElementObject)[keyof typeof EmbeddingsV1ResponseEmbeddingElementObject]\n | (string & {});\n\n/**\n * The type of object returned by the __external/foundation model__ serving endpoint, one of\n * [text_completion, chat.completion, list (of embeddings)].\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.\nexport const QueryEndpointResponseObject = {\n QUERY_ENDPOINT_RESPONSE_OBJECT_UNSPECIFIED:\n 'QUERY_ENDPOINT_RESPONSE_OBJECT_UNSPECIFIED',\n TEXT_COMPLETION: 'text_completion',\n CHAT_COMPLETION: 'chat.completion',\n LIST: 'list',\n} as const;\nexport type QueryEndpointResponseObject =\n | (typeof QueryEndpointResponseObject)[keyof typeof QueryEndpointResponseObject]\n | (string & {});\n\nexport interface ChatMessage {\n /** The role of the message. One of [system, user, assistant]. */\n role?: ChatMessageRole | undefined;\n /** The content of the message. */\n content?: string | undefined;\n}\n\nexport interface DataframeSplitInput {\n /** Index array for the dataframe */\n index?: number[] | undefined;\n /** Columns array for the dataframe */\n columns?: JsonValue[] | undefined;\n /** Data array for the dataframe */\n data?: JsonValue[] | undefined;\n}\n\nexport interface EmbeddingsV1ResponseEmbeddingElement {\n /** The embedding vector */\n embedding?: number[] | undefined;\n /** The index of the embedding in the response. */\n index?: number | undefined;\n /** This will always be 'embedding'. */\n object?: EmbeddingsV1ResponseEmbeddingElementObject | undefined;\n}\n\nexport interface ExternalModelUsageElement {\n /** The number of tokens in the prompt. */\n promptTokens?: number | undefined;\n /** The number of tokens in the chat/completions response. */\n completionTokens?: number | undefined;\n /** The total number of tokens in the prompt and response. */\n totalTokens?: number | undefined;\n}\n\nexport interface QueryEndpointRequest {\n /** The name of the serving endpoint. This field is required and is provided via the path parameter. */\n name?: string | undefined;\n /**\n * The prompt string (or array of strings) field used ONLY for __completions external & foundation model__\n * serving endpoints and should only be used with other completions query fields.\n */\n prompt?: JsonValue | undefined;\n /**\n * The input string (or array of strings) field used ONLY for __embeddings external & foundation model__\n * serving endpoints and is the only field (along with extra_params if needed) used by embeddings queries.\n */\n input?: JsonValue | undefined;\n /**\n * The messages field used ONLY for __chat external & foundation model__ serving endpoints.\n * This is an array of ChatMessage objects and should only be used with other chat query fields.\n */\n messages?: ChatMessage[] | undefined;\n /**\n * The temperature field used ONLY for __completions__ and __chat external & foundation model__ serving\n * endpoints. This is a float between 0.0 and 2.0 with a default of 1.0 and should only be used with other\n * chat/completions query fields.\n */\n temperature?: number | undefined;\n /**\n * The stop sequences field used ONLY for __completions__ and __chat external & foundation model__ serving\n * endpoints. This is a list of strings and should only be used with other chat/completions query fields.\n */\n stop?: string[] | undefined;\n /**\n * The max tokens field used ONLY for __completions__ and __chat external & foundation model__ serving\n * endpoints. This is an integer and should only be used with other chat/completions query fields.\n */\n maxTokens?: number | undefined;\n /**\n * The n (number of candidates) field used ONLY for __completions__ and __chat external & foundation model__\n * serving endpoints. This is an integer between 1 and 5 with a default of 1 and should only be used with\n * other chat/completions query fields.\n */\n n?: number | undefined;\n /**\n * The stream field used ONLY for __completions__ and __chat external & foundation model__ serving endpoints.\n * This is a boolean defaulting to false and should only be used with other chat/completions query fields.\n */\n stream?: boolean | undefined;\n /**\n * The extra parameters field used ONLY for __completions, chat,__ and __embeddings external & foundation\n * model__ serving endpoints. This is a map of strings and should only be used with other external/foundation\n * model query fields.\n */\n extraParams?: Record<string, string> | undefined;\n /** Pandas Dataframe input in the records orientation. */\n dataframeRecords?: JsonValue[] | undefined;\n /** Pandas Dataframe input in the split orientation. */\n dataframeSplit?: DataframeSplitInput | undefined;\n /** Tensor-based input in row format. */\n instances?: JsonValue[] | undefined;\n /** Tensor-based input in columnar format. */\n inputs?: JsonValue | undefined;\n /** Optional user-provided request identifier that will be recorded in the inference table and the usage tracking table. */\n clientRequestId?: string | undefined;\n /** Optional user-provided context that will be recorded in the usage tracking table. */\n usageContext?: Record<string, string> | undefined;\n}\n\nexport interface QueryEndpointResponse {\n /** The list of choices returned by the __chat or completions external/foundation model__ serving endpoint. */\n choices?: V1ResponseChoiceElement[] | undefined;\n /** The list of the embeddings returned by the __embeddings external/foundation model__ serving endpoint. */\n data?: EmbeddingsV1ResponseEmbeddingElement[] | undefined;\n /**\n * The name of the __external/foundation model__ used for querying. This is the name of the model that was\n * specified in the endpoint config.\n */\n model?: string | undefined;\n /**\n * The usage object that may be returned by the __external/foundation model__ serving endpoint. This\n * contains information about the number of tokens used in the prompt and response.\n */\n usage?: ExternalModelUsageElement | undefined;\n /** The ID of the query that may be returned by a __completions or chat external/foundation model__ serving endpoint. */\n id?: string | undefined;\n /** The timestamp in seconds when the query was created in Unix time returned by a __completions or chat external/foundation model__ serving endpoint. */\n created?: bigint | undefined;\n /**\n * The type of object returned by the __external/foundation model__ serving endpoint, one of\n * [text_completion, chat.completion, list (of embeddings)].\n */\n object?: QueryEndpointResponseObject | undefined;\n /** The predictions returned by the serving endpoint. */\n predictions?: JsonValue[] | undefined;\n /** The outputs of the feature serving endpoint. */\n outputs?: JsonValue[] | undefined;\n /** The name of the served model that served the request. This is useful when there are multiple models behind the same endpoint with traffic split. */\n servedModelName?: string | undefined;\n}\n\nexport interface V1ResponseChoiceElement {\n /** The text response from the __completions__ endpoint. */\n text?: string | undefined;\n /** The message response from the __chat__ endpoint. */\n message?: ChatMessage | undefined;\n /** The index of the choice in the __chat or completions__ response. */\n index?: number | undefined;\n /** The finish reason returned by the endpoint. */\n finishReason?: string | undefined;\n /** The logprobs returned only by the __completions__ endpoint. */\n logprobs?: number | undefined;\n}\n\nexport const unmarshalChatMessageSchema: z.ZodType<ChatMessage> = z\n .object({\n role: z.string().optional(),\n content: z.string().optional(),\n })\n .transform(d => ({\n role: d.role,\n content: d.content,\n }));\n\nexport const unmarshalEmbeddingsV1ResponseEmbeddingElementSchema: z.ZodType<EmbeddingsV1ResponseEmbeddingElement> =\n z\n .object({\n embedding: z.array(z.number()).optional(),\n index: z.number().optional(),\n object: z.string().optional(),\n })\n .transform(d => ({\n embedding: d.embedding,\n index: d.index,\n object: d.object,\n }));\n\nexport const unmarshalExternalModelUsageElementSchema: z.ZodType<ExternalModelUsageElement> =\n z\n .object({\n prompt_tokens: z.number().optional(),\n completion_tokens: z.number().optional(),\n total_tokens: z.number().optional(),\n })\n .transform(d => ({\n promptTokens: d.prompt_tokens,\n completionTokens: d.completion_tokens,\n totalTokens: d.total_tokens,\n }));\n\nexport const unmarshalQueryEndpointResponseSchema: z.ZodType<QueryEndpointResponse> =\n z\n .object({\n choices: z\n .array(z.lazy(() => unmarshalV1ResponseChoiceElementSchema))\n .optional(),\n data: z\n .array(\n z.lazy(() => unmarshalEmbeddingsV1ResponseEmbeddingElementSchema)\n )\n .optional(),\n model: z.string().optional(),\n usage: z.lazy(() => unmarshalExternalModelUsageElementSchema).optional(),\n id: z.string().optional(),\n created: z\n .union([z.number(), z.bigint(), z.string()])\n .transform(v => BigInt(v))\n .optional(),\n object: z.string().optional(),\n predictions: z.array(jsonValueSchema).optional(),\n outputs: z.array(jsonValueSchema).optional(),\n 'served-model-name': z.string().optional(),\n })\n .transform(d => ({\n choices: d.choices,\n data: d.data,\n model: d.model,\n usage: d.usage,\n id: d.id,\n created: d.created,\n object: d.object,\n predictions: d.predictions,\n outputs: d.outputs,\n servedModelName: d['served-model-name'],\n }));\n\nexport const unmarshalV1ResponseChoiceElementSchema: z.ZodType<V1ResponseChoiceElement> =\n z\n .object({\n text: z.string().optional(),\n message: z.lazy(() => unmarshalChatMessageSchema).optional(),\n index: z.number().optional(),\n finishReason: z.string().optional(),\n logprobs: z.number().optional(),\n })\n .transform(d => ({\n text: d.text,\n message: d.message,\n index: d.index,\n finishReason: d.finishReason,\n logprobs: d.logprobs,\n }));\n\nexport const marshalChatMessageSchema: z.ZodType = z\n .object({\n role: z.string().optional(),\n content: z.string().optional(),\n })\n .transform(d => ({\n role: d.role,\n content: d.content,\n }));\n\nexport const marshalDataframeSplitInputSchema: z.ZodType = z\n .object({\n index: z.array(z.number()).optional(),\n columns: z.array(jsonValueSchema).optional(),\n data: z.array(jsonValueSchema).optional(),\n })\n .transform(d => ({\n index: d.index,\n columns: d.columns,\n data: d.data,\n }));\n\nexport const marshalQueryEndpointRequestSchema: z.ZodType = z\n .object({\n name: z.string().optional(),\n prompt: jsonValueSchema.optional(),\n input: jsonValueSchema.optional(),\n messages: z.array(z.lazy(() => marshalChatMessageSchema)).optional(),\n temperature: z.number().optional(),\n stop: z.array(z.string()).optional(),\n maxTokens: z.number().optional(),\n n: z.number().optional(),\n stream: z.boolean().optional(),\n extraParams: z.record(z.string(), z.string()).optional(),\n dataframeRecords: z.array(jsonValueSchema).optional(),\n dataframeSplit: z.lazy(() => marshalDataframeSplitInputSchema).optional(),\n instances: z.array(jsonValueSchema).optional(),\n inputs: jsonValueSchema.optional(),\n clientRequestId: z.string().optional(),\n usageContext: z.record(z.string(), z.string()).optional(),\n })\n .transform(d => ({\n name: d.name,\n prompt: d.prompt,\n input: d.input,\n messages: d.messages,\n temperature: d.temperature,\n stop: d.stop,\n max_tokens: d.maxTokens,\n n: d.n,\n stream: d.stream,\n extra_params: d.extraParams,\n dataframe_records: d.dataframeRecords,\n dataframe_split: d.dataframeSplit,\n instances: d.instances,\n inputs: d.inputs,\n client_request_id: d.clientRequestId,\n usage_context: d.usageContext,\n }));\n"],"mappings":";;;AAKA,MAAM,kBAAwC,EAAE,WAC9C,EAAE,MAAM;CACN,EAAE,MAAM;CACR,EAAE,QAAQ;CACV,EAAE,QAAQ;CACV,EAAE,SAAS;CACX,EAAE,OAAO,EAAE,QAAQ,EAAE,gBAAgB;CACrC,EAAE,MAAM,gBAAgB;CACzB,CAAC,CACH;;AAID,MAAa,kBAAkB;CAC7B,+BAA+B;CAC/B,QAAQ;CACR,MAAM;CACN,WAAW;CACZ;;AAOD,MAAa,6CAA6C;CACxD,6DACE;CACF,WAAW;CACZ;;;;;AAUD,MAAa,8BAA8B;CACzC,4CACE;CACF,iBAAiB;CACjB,iBAAiB;CACjB,MAAM;CACP;AAqJD,MAAa,6BAAqD,EAC/D,OAAO;CACN,MAAM,EAAE,QAAQ,CAAC,UAAU;CAC3B,SAAS,EAAE,QAAQ,CAAC,UAAU;CAC/B,CAAC,CACD,WAAU,OAAM;CACf,MAAM,EAAE;CACR,SAAS,EAAE;CACZ,EAAE;AAEL,MAAa,sDACX,EACG,OAAO;CACN,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,UAAU;CACzC,OAAO,EAAE,QAAQ,CAAC,UAAU;CAC5B,QAAQ,EAAE,QAAQ,CAAC,UAAU;CAC9B,CAAC,CACD,WAAU,OAAM;CACf,WAAW,EAAE;CACb,OAAO,EAAE;CACT,QAAQ,EAAE;CACX,EAAE;AAEP,MAAa,2CACX,EACG,OAAO;CACN,eAAe,EAAE,QAAQ,CAAC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,OAAO,EAAE,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAC,UAAU;CAC1D,CAAC,CACD,WAAU,OAAM;CACf,MAAM,EAAE;CACR,QAAQ,EAAE;CACV,OAAO,EAAE;CACT,UAAU,EAAE;CACZ,aAAa,EAAE;CACf,MAAM,EAAE;CACR,YAAY,EAAE;CACd,GAAG,EAAE;CACL,QAAQ,EAAE;CACV,cAAc,EAAE;CAChB,mBAAmB,EAAE;CACrB,iBAAiB,EAAE;CACnB,WAAW,EAAE;CACb,QAAQ,EAAE;CACV,mBAAmB,EAAE;CACrB,eAAe,EAAE;CAClB,EAAE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@databricks/sdk-modelservingquery",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"directory": "packages/modelservingquery"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@databricks/sdk-auth": ">=0.
|
|
37
|
-
"@databricks/sdk-core": ">=0.
|
|
38
|
-
"@databricks/sdk-options": ">=0.
|
|
36
|
+
"@databricks/sdk-auth": ">=0.40.0 <1.0.0",
|
|
37
|
+
"@databricks/sdk-core": ">=0.40.0 <1.0.0",
|
|
38
|
+
"@databricks/sdk-options": ">=0.40.0 <1.0.0",
|
|
39
39
|
"@js-temporal/polyfill": "^0.5.0",
|
|
40
40
|
"json-bigint": "^1.0.0",
|
|
41
41
|
"zod": "^4.3.6"
|