From 00a341ab4b80e011bb099401ebf1d7d02ca09323 Mon Sep 17 00:00:00 2001 From: Enrico Ros Date: Thu, 29 Jun 2023 00:06:05 -0700 Subject: [PATCH] Bits --- src/apps/chat/components/composer/Composer.tsx | 7 +++++-- src/modules/llms/llm.client.ts | 5 +---- src/modules/llms/openai/openai.client.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/apps/chat/components/composer/Composer.tsx b/src/apps/chat/components/composer/Composer.tsx index 357d52b86..6b7360c4d 100644 --- a/src/apps/chat/components/composer/Composer.tsx +++ b/src/apps/chat/components/composer/Composer.tsx @@ -115,7 +115,10 @@ const SentMessagesMenu = (props: { {props.messages.map((item, index) => { props.onPaste(item.text); props.onClose(); }} + onClick={() => { + props.onPaste(item.text); + props.onClose(); + }} sx={{ textOverflow: 'ellipsis', whiteSpace: 'nowrap', display: 'inline', overflow: 'hidden' }} > {item.count > 1 && ({item.count})} {item.text?.length > 70 ? item.text.slice(0, 68) + '...' : item.text} @@ -578,7 +581,7 @@ export function Composer(props: { onClick={handleSendClicked} onDoubleClick={handleShowChatMode} endDecorator={isReAct ? : } > - {isReAct ? 'ReAct' : isFollowUp ? 'Chat+' : 'Chat' } + {isReAct ? 'ReAct' : isFollowUp ? 'Chat+' : 'Chat'} )} diff --git a/src/modules/llms/llm.client.ts b/src/modules/llms/llm.client.ts index 14ee086a6..9c8117403 100644 --- a/src/modules/llms/llm.client.ts +++ b/src/modules/llms/llm.client.ts @@ -21,14 +21,11 @@ export interface VChatMessageOut { finish_reason: 'stop' | 'length' | null; } -export interface VChatFunctionCallOut { +export interface VChatMessageOrFunctionCallOut extends VChatMessageOut { function_name: string; function_arguments: object | null; } -export type VChatMessageOrFunctionCallOut = VChatMessageOut | VChatFunctionCallOut; - - export async function callChatGenerate(llmId: DLLMId, messages: VChatMessageIn[], maxTokens?: number): Promise { const { llm, vendor } = getLLMAndVendorOrThrow(llmId); diff --git a/src/modules/llms/openai/openai.client.ts b/src/modules/llms/openai/openai.client.ts index 10ee3d1de..0d94b1673 100644 --- a/src/modules/llms/openai/openai.client.ts +++ b/src/modules/llms/openai/openai.client.ts @@ -20,7 +20,7 @@ export const callChatWithFunctions = async (llm: DLLM, messages: VChatMessageIn[ /** * This function either returns the LLM message, or function calls, or throws a descriptive error string */ -async function callChatOverloaded(llm: DLLM, messages: VChatMessageIn[], functions: VChatFunctionIn[] | null, maxTokens?: number): Promise { +async function callChatOverloaded(llm: DLLM, messages: VChatMessageIn[], functions: VChatFunctionIn[] | null, maxTokens?: number): Promise { // access params (source) const partialSetup = llm._source.setup as Partial; const sourceSetupOpenAI = normalizeOAISetup(partialSetup);