mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-11 06:00:15 -07:00
Bits
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user