pro ref
This commit is contained in:
parent
7fcff8a628
commit
e119e310ef
|
@ -1 +1 @@
|
|||
Subproject commit 0d7fa31d4c4019690e2200323421025cdc74b89e
|
||||
Subproject commit 7b8789efd940d9f8e5be9927243b19f07361c445
|
|
@ -106,13 +106,13 @@ export async function run({
|
|||
(await features.flags.isEnabled(FeatureFlag.BUDIBASE_AI)) &&
|
||||
(await pro.features.isBudibaseAIEnabled())
|
||||
|
||||
let llm
|
||||
let llmWrapper
|
||||
if (budibaseAIEnabled || customConfigsEnabled) {
|
||||
llm = await pro.ai.LargeLanguageModel.forCurrentTenant(inputs.model)
|
||||
llmWrapper = await pro.ai.LargeLanguageModel.forCurrentTenant(inputs.model)
|
||||
}
|
||||
|
||||
response = llm?.initialised
|
||||
? await llm.run(inputs.prompt)
|
||||
response = llmWrapper?.llm
|
||||
? await llmWrapper.run(inputs.prompt)
|
||||
: await legacyOpenAIPrompt(inputs)
|
||||
|
||||
return {
|
||||
|
|
|
@ -126,7 +126,9 @@ export async function processAIColumns<T extends Row | Row[]>(
|
|||
const numRows = Array.isArray(inputRows) ? inputRows.length : 1
|
||||
span?.addTags({ table_id: table._id, numRows })
|
||||
const rows = Array.isArray(inputRows) ? inputRows : [inputRows]
|
||||
const llmWrapper = await pro.ai.LargeLanguageModel.forCurrentTenant("gpt-4o-mini")
|
||||
const llmWrapper = await pro.ai.LargeLanguageModel.forCurrentTenant(
|
||||
"gpt-4o-mini"
|
||||
)
|
||||
if (rows && llmWrapper.llm) {
|
||||
// Ensure we have snippet context
|
||||
await context.ensureSnippetContext()
|
||||
|
@ -151,14 +153,14 @@ export async function processAIColumns<T extends Row | Row[]>(
|
|||
}
|
||||
}
|
||||
|
||||
const prompt = llm.buildPromptFromAIOperation({
|
||||
const prompt = llmWrapper.buildPromptFromAIOperation({
|
||||
schema: aiSchema,
|
||||
row,
|
||||
})
|
||||
|
||||
return tracer.trace("processAIColumn", {}, async span => {
|
||||
span?.addTags({ table_id: table._id, column })
|
||||
const llmResponse = await llm.run(prompt!)
|
||||
const llmResponse = await llmWrapper.run(prompt!)
|
||||
return {
|
||||
...row,
|
||||
[column]: llmResponse,
|
||||
|
|
Loading…
Reference in New Issue