Merge pull request #576 from ollama-webui/rag-fix

fix: openai compatible api rag issue
This commit is contained in:
Timothy Jaeryang Baek 2024-01-25 14:38:46 -08:00 committed by GitHub
commit af34b1010e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -519,7 +519,7 @@
.filter((message) => message) .filter((message) => message)
.map((message, idx, arr) => ({ .map((message, idx, arr) => ({
role: message.role, role: message.role,
...(message.files.filter((file) => file.type === 'image') ...(message.files?.filter((file) => file.type === 'image').length > 0 ?? false
? { ? {
content: [ content: [
{ {

View File

@ -530,7 +530,7 @@
.filter((message) => message) .filter((message) => message)
.map((message, idx, arr) => ({ .map((message, idx, arr) => ({
role: message.role, role: message.role,
...(message.files.filter((file) => file.type === 'image') ...(message.files?.filter((file) => file.type === 'image').length > 0 ?? false
? { ? {
content: [ content: [
{ {