mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
fix(ui): align SDK mocks and remaining dependency patches
(cherry picked from commit bc8305810f)
This commit is contained in:
parent
3f1c0bd573
commit
5d48c472b1
5 changed files with 25 additions and 15 deletions
|
|
@ -9,7 +9,9 @@ vi.mock("@/components/networking", () => ({
|
|||
const mockMessagesStream = vi.fn();
|
||||
|
||||
vi.mock("@anthropic-ai/sdk", () => ({
|
||||
default: vi.fn(() => ({ messages: { stream: mockMessagesStream } })),
|
||||
default: vi.fn(function () {
|
||||
return { messages: { stream: mockMessagesStream } };
|
||||
}),
|
||||
}));
|
||||
|
||||
describe("anthropic_messages prompt cache usage", () => {
|
||||
|
|
|
|||
|
|
@ -20,13 +20,15 @@ describe("audio_speech", () => {
|
|||
});
|
||||
|
||||
// Mock the OpenAI constructor and its methods
|
||||
(OpenAI as any).mockImplementation(() => ({
|
||||
audio: {
|
||||
speech: {
|
||||
create: mockCreate,
|
||||
(OpenAI as any).mockImplementation(function () {
|
||||
return {
|
||||
audio: {
|
||||
speech: {
|
||||
create: mockCreate,
|
||||
},
|
||||
},
|
||||
},
|
||||
}));
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
|
|
|||
|
|
@ -16,13 +16,15 @@ describe("audio_transcription", () => {
|
|||
});
|
||||
|
||||
// Mock the OpenAI constructor and its methods
|
||||
(OpenAI as any).mockImplementation(() => ({
|
||||
audio: {
|
||||
transcriptions: {
|
||||
create: mockCreate,
|
||||
(OpenAI as any).mockImplementation(function () {
|
||||
return {
|
||||
audio: {
|
||||
transcriptions: {
|
||||
create: mockCreate,
|
||||
},
|
||||
},
|
||||
},
|
||||
}));
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,9 @@ const mockClient = {
|
|||
|
||||
vi.mock("openai", () => ({
|
||||
default: {
|
||||
OpenAI: vi.fn(() => mockClient),
|
||||
OpenAI: vi.fn(function () {
|
||||
return mockClient;
|
||||
}),
|
||||
},
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,9 @@ const mockClient = {
|
|||
|
||||
vi.mock("openai", () => ({
|
||||
default: {
|
||||
OpenAI: vi.fn(() => mockClient),
|
||||
OpenAI: vi.fn(function () {
|
||||
return mockClient;
|
||||
}),
|
||||
},
|
||||
}));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue