🛫 refactor: Move Encoding Logic to packages/api (#9182)

* refactor: move audio encode over to TS

* refactor: audio encoding now functional in LC again

* refactor: move video encode over to TS

* refactor: move document encode over to TS

* refactor: video encoding now functional in LC again

* refactor: document encoding now functional in LC again

* fix: extend file type options in AttachFileMenu to include 'google_multimodal' and update dependency array to include agent?.provider

* feat: only accept pdfs if responses api is enabled for openai convos
This commit is contained in:
Dustin Healy 2025-08-20 17:01:21 -07:00 committed by Dustin Healy
parent ccb2e031dd
commit e55264b22a
11 changed files with 408 additions and 415 deletions

View file

@ -77,7 +77,9 @@ const AttachFileMenu = ({
* */
const capabilities = useAgentCapabilities(agentsConfig?.capabilities ?? defaultAgentCapabilities);
const handleUploadClick = (fileType?: 'image' | 'document' | 'multimodal') => {
const handleUploadClick = (
fileType?: 'image' | 'document' | 'multimodal' | 'google_multimodal',
) => {
if (!inputRef.current) {
return;
}
@ -103,7 +105,14 @@ const AttachFileMenu = ({
) => {
const items: MenuItemProps[] = [];
const shouldShowDirectAttach = isDocumentSupportedEndpoint(agent?.provider ?? endpoint);
const currentProvider = agent?.provider ?? endpoint;
const isOpenAIOrAzure =
currentProvider === EModelEndpoint.openAI || currentProvider === EModelEndpoint.azureOpenAI;
const useResponsesApiEnabled = conversation?.useResponsesApi ?? false;
const shouldShowDirectAttach =
isDocumentSupportedEndpoint(currentProvider) &&
(!isOpenAIOrAzure || useResponsesApiEnabled);
if (shouldShowDirectAttach) {
items.push({
@ -194,6 +203,7 @@ const AttachFileMenu = ({
sharePointEnabled,
setIsSharePointDialogOpen,
endpoint,
agent?.provider,
]);
const menuTrigger = (