Skip to content
Open
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
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@llmops/app",
"version": "0.4.8-beta.4",
"version": "0.4.7-beta.1",
"description": "LLMOps application with server and client",
"type": "module",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@llmops/cli",
"version": "0.4.8-beta.4",
"version": "0.4.7-beta.1",
"type": "module",
"description": "LLMOps CLI - A pluggable LLMOps toolkit for TypeScript teams",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@llmops/core",
"version": "0.4.8-beta.4",
"version": "0.4.7-beta.1",
"description": "Core LLMOps functionality and utilities",
"type": "module",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/gateway/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@llmops/gateway",
"version": "0.4.8-beta.4",
"version": "0.4.7-beta.1",
"description": "AI gateway for LLMOps (forked from Portkey)",
"type": "module",
"license": "Apache-2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@ export const OpenAICreateModelResponseConfig: ProviderConfig = {
export function* OpenAIModelResponseJSONToStreamGenerator(
response: OpenAIResponse
): Generator<string, void, unknown> {
if (!response) {
yield getResponseErrorEvent({
code: 'null_response',
message: 'Model did not return a response',
});
return;
}

if (response.error?.code) {
yield getResponseErrorEvent(response.error);
return;
Expand Down
18 changes: 17 additions & 1 deletion packages/gateway/src/providers/open-ai-base/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,25 @@ export const OpenAICreateModelResponseTransformer = <
customTransformer?: CustomTransformer<OpenAIResponse, T>
) => {
const transformer: (
response: T | ErrorResponse,
response: T | ErrorResponse | null,
responseStatus: number
) => T | ErrorResponse = (response, responseStatus) => {
if (!response) {
const errorResponse: ErrorResponse = {
error: {
message: 'Model did not return a response',
type: 'null_response',
param: null,
code: 'null_response',
},
provider: provider ?? OPEN_AI,
};
if (customTransformer) {
return customTransformer(errorResponse as ErrorResponse, true);
}
return errorResponse;
}

if (responseStatus !== 200 && 'error' in response) {
const errorResponse = OpenAIErrorResponseTransform(
response as ErrorResponse,
Expand Down
12 changes: 1 addition & 11 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@llmops/sdk",
"version": "0.4.8-beta.4",
"version": "0.4.7-beta.1",
"description": "An LLMOps toolkit for TypeScript applications",
"type": "module",
"license": "Apache-2.0",
Expand Down Expand Up @@ -58,16 +58,6 @@
"default": "./dist/hono.cjs"
}
},
"./nextjs": {
"import": {
"types": "./dist/nextjs.d.mts",
"default": "./dist/nextjs.mjs"
},
"require": {
"types": "./dist/nextjs.d.cts",
"default": "./dist/nextjs.cjs"
}
},
"./*": "./*"
},
"publishConfig": {
Expand Down