Skip to content

Commit

Permalink
fix: image model does not work when retrieval tool is enabled (#2538)
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-jan committed Mar 29, 2024
1 parent 132487a commit 228a363
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions extensions/assistant-extension/src/tools/retrieval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class RetrievalTool extends InferenceTool {
tool?: AssistantTool
): Promise<MessageRequest> {
if (!data.model || !data.messages) {
return Promise.resolve(this.normalize(data))
return Promise.resolve(data)
}

const latestMessage = data.messages[data.messages.length - 1]
Expand All @@ -38,6 +38,8 @@ export class RetrievalTool extends InferenceTool {
docFile,
data.model?.engine
)
} else {
return Promise.resolve(data)
}
} else if (
// Check whether we need to ingest document or not
Expand All @@ -48,7 +50,7 @@ export class RetrievalTool extends InferenceTool {
) {
// No document ingested, reroute the result to inference engine

return Promise.resolve(this.normalize(data))
return Promise.resolve(data)
}
// 2. Load agent on thread changed
if (this.retrievalThreadId !== data.threadId) {
Expand Down
2 changes: 1 addition & 1 deletion web/containers/AutoLink/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const AutoLink: React.FC<Props> = ({ text }) => {
key={url}
target="blank"
href={url.startsWith('http') ? url : `http://${url}`}
className="text-blue-400"
className="text-primary dark:text-blue-400"
>
{url}
</a>
Expand Down
2 changes: 1 addition & 1 deletion web/screens/Chat/ErrorMessage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const ErrorMessage = ({ message }: { message: ThreadMessage }) => {
Model is currently unavailable. Please switch to a different
model or install the{' '}
<button
className="font-medium text-blue-500"
className="font-medium text-primary dark:text-blue-400"
onClick={() => setMainState(MainViewState.Settings)}
>
{loadModelError.split('::')[1] ?? ''}
Expand Down

0 comments on commit 228a363

Please sign in to comment.