jorel
Version:
A unified wrapper for working with LLMs from multiple providers, including streams, images, documents & automatic tool use.
36 lines (35 loc) • 1.04 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EventStream = exports.OpenRouter = void 0;
// Mock for @openrouter/sdk to avoid ESM import issues in Jest tests
class OpenRouter {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
constructor(config) {
this.chat = {
sendChatCompletion: jest.fn(),
};
}
}
exports.OpenRouter = OpenRouter;
class EventStream {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
constructor(stream) { }
async *[Symbol.asyncIterator]() {
yield {
type: "chunk",
data: {
id: "test-id",
choices: [
{
delta: {
content: "test content",
role: "assistant",
},
finish_reason: null,
},
],
},
};
}
}
exports.EventStream = EventStream;