Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: image model does not work when retrieval tool is enabled #2538

Merged
merged 1 commit into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading