This commit is contained in:
Enrico Ros
2023-06-29 00:06:05 -07:00
parent fca848d82f
commit 00a341ab4b
3 changed files with 7 additions and 7 deletions
@@ -115,7 +115,10 @@ const SentMessagesMenu = (props: {
{props.messages.map((item, index) =>
<MenuItem
key={'composer-sent-' + index}
onClick={() => { 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 && <span style={{ marginRight: 1 }}>({item.count})</span>} {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 ? <PsychologyIcon /> : <TelegramIcon />}
>
{isReAct ? 'ReAct' : isFollowUp ? 'Chat+' : 'Chat' }
{isReAct ? 'ReAct' : isFollowUp ? 'Chat+' : 'Chat'}
</Button>
)}
</Box>
+1 -4
View File
@@ -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<VChatMessageOut> {
const { llm, vendor } = getLLMAndVendorOrThrow(llmId);
+1 -1
View File
@@ -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<TOut extends VChatMessageOrFunctionCallOut>(llm: DLLM, messages: VChatMessageIn[], functions: VChatFunctionIn[] | null, maxTokens?: number): Promise<TOut> {
async function callChatOverloaded<TOut = VChatMessageOut | VChatMessageOrFunctionCallOut>(llm: DLLM, messages: VChatMessageIn[], functions: VChatFunctionIn[] | null, maxTokens?: number): Promise<TOut> {
// access params (source)
const partialSetup = llm._source.setup as Partial<SourceSetupOpenAI>;
const sourceSetupOpenAI = normalizeOAISetup(partialSetup);