mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-04-08 11:58:34 +02:00
Add image generation for gpt-4o
This commit is contained in:
parent
3788041115
commit
0c642f25dd
@ -36,6 +36,7 @@ import { Option } from "@/components/Dropdown";
|
||||
import { ToolSnapshot } from "@/lib/tools/interfaces";
|
||||
import { checkUserIsNoAuthUser } from "@/lib/user";
|
||||
import { addAssistantToList } from "@/lib/assistants/updateAssistantPreferences";
|
||||
import { checkLLMSupportsImageInput } from "@/lib/llm/utils";
|
||||
|
||||
function findSearchTool(tools: ToolSnapshot[]) {
|
||||
return tools.find((tool) => tool.in_code_tool_id === "SearchTool");
|
||||
@ -45,10 +46,6 @@ function findImageGenerationTool(tools: ToolSnapshot[]) {
|
||||
return tools.find((tool) => tool.in_code_tool_id === "ImageGenerationTool");
|
||||
}
|
||||
|
||||
function checkLLMSupportsImageGeneration(provider: string, model: string) {
|
||||
return provider === "openai" && model === "gpt-4-turbo";
|
||||
}
|
||||
|
||||
function Label({ children }: { children: string | JSX.Element }) {
|
||||
return (
|
||||
<div className="block font-medium text-base text-emphasis">{children}</div>
|
||||
@ -261,7 +258,7 @@ export function AssistantEditor({
|
||||
if (
|
||||
values.image_generation_tool_enabled &&
|
||||
imageGenerationTool &&
|
||||
checkLLMSupportsImageGeneration(
|
||||
checkLLMSupportsImageInput(
|
||||
providerDisplayNameToProviderName.get(
|
||||
values.llm_model_provider_override || ""
|
||||
) ||
|
||||
@ -566,7 +563,7 @@ export function AssistantEditor({
|
||||
)}
|
||||
|
||||
{imageGenerationTool &&
|
||||
checkLLMSupportsImageGeneration(
|
||||
checkLLMSupportsImageInput(
|
||||
providerDisplayNameToProviderName.get(
|
||||
values.llm_model_provider_override || ""
|
||||
) ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user