update tests

This commit is contained in:
Martin McKeaveney 2024-12-04 10:35:04 +00:00
parent e119e310ef
commit 46bd790b3a
2 changed files with 4 additions and 2 deletions

View File

@ -48,7 +48,7 @@ jest.mock("@budibase/pro", () => ({
ai: { ai: {
LargeLanguageModel: { LargeLanguageModel: {
forCurrentTenant: async () => ({ forCurrentTenant: async () => ({
initialised: true, llm: {},
run: jest.fn(() => `Mock LLM Response`), run: jest.fn(() => `Mock LLM Response`),
buildPromptFromAIOperation: jest.fn(), buildPromptFromAIOperation: jest.fn(),
}), }),

View File

@ -108,7 +108,9 @@ export async function run({
let llmWrapper let llmWrapper
if (budibaseAIEnabled || customConfigsEnabled) { if (budibaseAIEnabled || customConfigsEnabled) {
llmWrapper = await pro.ai.LargeLanguageModel.forCurrentTenant(inputs.model) llmWrapper = await pro.ai.LargeLanguageModel.forCurrentTenant(
inputs.model
)
} }
response = llmWrapper?.llm response = llmWrapper?.llm