mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 00:40:14 +01:00
👓 feat: Vision Support for Assistants (#2195)
* refactor(assistants/chat): use promises to speed up initialization, initialize shared variables, include `attachedFileIds` to streamRunManager * chore: additional typedefs * fix(OpenAIClient): handle edge case where attachments promise is resolved * feat: createVisionPrompt * feat: Vision Support for Assistants
This commit is contained in:
parent
1f0fb497f8
commit
798e8763d0
16 changed files with 376 additions and 100 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import { z } from 'zod';
|
||||
import type { TMessageContentParts } from './types/assistants';
|
||||
import { Tools } from './types/assistants';
|
||||
import type { TMessageContentParts, FunctionTool, FunctionToolCall } from './types/assistants';
|
||||
import type { TFile } from './types/files';
|
||||
|
||||
export const isUUID = z.string().uuid();
|
||||
|
|
@ -25,9 +26,26 @@ export const defaultAssistantFormValues = {
|
|||
model: '',
|
||||
functions: [],
|
||||
code_interpreter: false,
|
||||
image_vision: false,
|
||||
retrieval: false,
|
||||
};
|
||||
|
||||
export const ImageVisionTool: FunctionTool = {
|
||||
type: Tools.function,
|
||||
[Tools.function]: {
|
||||
name: 'image_vision',
|
||||
description: 'Get detailed text descriptions for all current image attachments.',
|
||||
parameters: {
|
||||
type: 'object',
|
||||
properties: {},
|
||||
required: [],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const isImageVisionTool = (tool: FunctionTool | FunctionToolCall) =>
|
||||
tool.type === 'function' && tool.function?.name === ImageVisionTool?.function?.name;
|
||||
|
||||
export const endpointSettings = {
|
||||
[EModelEndpoint.google]: {
|
||||
model: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue