mirror of
https://github.com/Mintplex-Labs/anything-llm
synced 2026-04-25 17:15:37 +02:00
Revert "Add automatic chat mode with native tool calling support (#5140)"
- Need to support documents in agents
- Need to support images in agent mode
This reverts commit 4c69960dca.
This commit is contained in:
@@ -51,36 +51,6 @@ function restorePlaceholders(text, placeholders) {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract Trans component tags like <italic>, </italic>, <bold>, </bold>, etc.
|
||||
* These are used by react-i18next Trans component for rich text formatting.
|
||||
* @param {string} text
|
||||
* @returns {{ text: string, tags: string[] }}
|
||||
*/
|
||||
function extractTransTags(text) {
|
||||
const tags = [];
|
||||
// Match opening tags <tagName> and closing tags </tagName>
|
||||
// Also matches self-closing tags <tagName />
|
||||
const modifiedText = text.replace(/<\/?([a-zA-Z][a-zA-Z0-9]*)\s*\/?>/g, (match) => {
|
||||
const index = tags.length;
|
||||
tags.push(match);
|
||||
return `__TAG_${index}__`;
|
||||
});
|
||||
return { text: modifiedText, tags };
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore original Trans component tags from tokens.
|
||||
* @param {string} text
|
||||
* @param {string[]} tags
|
||||
* @returns {string}
|
||||
*/
|
||||
function restoreTransTags(text, tags) {
|
||||
return text.replace(/__TAG_(\d+)__/g, (_, index) => {
|
||||
return tags[parseInt(index, 10)] || `__TAG_${index}__`;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate that all placeholders from source exist in translated text.
|
||||
* @param {string} sourceText
|
||||
@@ -94,19 +64,6 @@ function validatePlaceholders(sourceText, translatedText) {
|
||||
return { valid: missing.length === 0, missing };
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate that all Trans component tags from source exist in translated text.
|
||||
* @param {string} sourceText
|
||||
* @param {string} translatedText
|
||||
* @returns {{ valid: boolean, missing: string[] }}
|
||||
*/
|
||||
function validateTransTags(sourceText, translatedText) {
|
||||
const sourceMatches = sourceText.match(/<\/?([a-zA-Z][a-zA-Z0-9]*)\s*\/?>/g) || [];
|
||||
const translatedMatches = translatedText.match(/<\/?([a-zA-Z][a-zA-Z0-9]*)\s*\/?>/g) || [];
|
||||
const missing = sourceMatches.filter(t => !translatedMatches.includes(t));
|
||||
return { valid: missing.length === 0, missing };
|
||||
}
|
||||
|
||||
class Translator {
|
||||
static modelTag = 'translategemma:4b'
|
||||
constructor() {
|
||||
@@ -130,19 +87,13 @@ class Translator {
|
||||
console.log(`\x1b[32m[Translator]\x1b[0m ${text}`, ...args);
|
||||
}
|
||||
|
||||
buildPrompt(text, sourceLangCode, targetLangCode, { hasPlaceholders = false, hasTags = false } = {}) {
|
||||
buildPrompt(text, sourceLangCode, targetLangCode, hasPlaceholders = false) {
|
||||
const sourceLanguage = this.getLanguageName(sourceLangCode);
|
||||
const targetLanguage = this.getLanguageName(targetLangCode);
|
||||
|
||||
let specialInstructions = '';
|
||||
if (hasPlaceholders || hasTags) {
|
||||
const items = [];
|
||||
if (hasPlaceholders) items.push('__PLACEHOLDER_0__, __PLACEHOLDER_1__');
|
||||
if (hasTags) items.push('__TAG_0__, __TAG_1__');
|
||||
specialInstructions = `\nIMPORTANT: The text contains tokens like ${items.join(', ')}, etc. You MUST keep these tokens exactly as they are in the translation - do not translate, modify, or remove them.`;
|
||||
}
|
||||
|
||||
return `You are a professional ${sourceLanguage} (${sourceLangCode.toLowerCase()}) to ${targetLanguage} (${targetLangCode.toLowerCase()}) translator. Your goal is to accurately convey the meaning and nuances of the original ${sourceLanguage} text while adhering to ${targetLanguage} grammar, vocabulary, and cultural sensitivities.${specialInstructions}
|
||||
const placeholderInstruction = hasPlaceholders
|
||||
? `\nIMPORTANT: The text contains placeholders like __PLACEHOLDER_0__, __PLACEHOLDER_1__, etc. You MUST keep these placeholders exactly as they are in the translation - do not translate, modify, or remove them.`
|
||||
: '';
|
||||
return `You are a professional ${sourceLanguage} (${sourceLangCode.toLowerCase()}) to ${targetLanguage} (${targetLangCode.toLowerCase()}) translator. Your goal is to accurately convey the meaning and nuances of the original ${sourceLanguage} text while adhering to ${targetLanguage} grammar, vocabulary, and cultural sensitivities.${placeholderInstruction}
|
||||
Produce only the ${targetLanguage} translation, without any additional explanations or commentary. Please translate the following ${sourceLanguage} text into ${targetLanguage}:
|
||||
|
||||
|
||||
@@ -162,15 +113,11 @@ ${text}`
|
||||
|
||||
async translate(text, sourceLangCode, targetLangCode) {
|
||||
// Extract placeholders like {{variableName}} and replace with tokens
|
||||
const { text: textWithPlaceholders, placeholders } = extractPlaceholders(text);
|
||||
const { text: textWithTokens, placeholders } = extractPlaceholders(text);
|
||||
const hasPlaceholders = placeholders.length > 0;
|
||||
|
||||
// Extract Trans component tags like <italic>, </italic>, etc.
|
||||
const { text: textWithTokens, tags } = extractTransTags(textWithPlaceholders);
|
||||
const hasTags = tags.length > 0;
|
||||
|
||||
const prompt = this.buildPrompt(textWithTokens, sourceLangCode, targetLangCode, { hasPlaceholders, hasTags });
|
||||
const response = await fetch(`http://127.0.0.1:11434/api/chat`, {
|
||||
const prompt = this.buildPrompt(textWithTokens, sourceLangCode, targetLangCode, hasPlaceholders);
|
||||
const response = await fetch(`http://localhost:11434/api/chat`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
@@ -185,22 +132,6 @@ ${text}`
|
||||
const data = await response.json();
|
||||
let translatedText = this.cleanOutputText(data.message.content);
|
||||
|
||||
// Restore Trans component tags first (order matters since tags may contain placeholders)
|
||||
if (hasTags) {
|
||||
translatedText = restoreTransTags(translatedText, tags);
|
||||
|
||||
// Validate all tags were preserved
|
||||
const tagValidation = validateTransTags(text, translatedText);
|
||||
if (!tagValidation.valid) {
|
||||
console.warn(`Warning: Missing Trans tags in translation: ${tagValidation.missing.join(', ')}`);
|
||||
for (let i = 0; i < tags.length; i++) {
|
||||
if (!translatedText.includes(tags[i])) {
|
||||
console.warn(` Tag ${tags[i]} was lost in translation`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Restore original placeholders
|
||||
if (hasPlaceholders) {
|
||||
translatedText = restorePlaceholders(translatedText, placeholders);
|
||||
|
||||
@@ -34,6 +34,14 @@ export default function AvailableAgentsButton({ showing, setShowAgents }) {
|
||||
);
|
||||
}
|
||||
|
||||
function AbilityTag({ text }) {
|
||||
return (
|
||||
<div className="px-2 bg-theme-action-menu-item-hover text-theme-text-secondary text-xs w-fit rounded-sm">
|
||||
<p>{text}</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function AvailableAgents({
|
||||
showing,
|
||||
setShowing,
|
||||
@@ -101,6 +109,26 @@ export function AvailableAgents({
|
||||
<b>{t("chat_window.at_agent")}</b>
|
||||
{t("chat_window.default_agent_description")}
|
||||
</div>
|
||||
<div className="flex flex-wrap gap-2 mt-2">
|
||||
<AbilityTag text="rag-search" />
|
||||
<AbilityTag text="web-scraping" />
|
||||
<AbilityTag text="web-browsing" />
|
||||
<AbilityTag text="save-file-to-browser" />
|
||||
<AbilityTag text="list-documents" />
|
||||
<AbilityTag text="summarize-document" />
|
||||
<AbilityTag text="chart-generation" />
|
||||
</div>
|
||||
</div>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
disabled={true}
|
||||
className="w-full rounded-xl flex flex-col justify-start group"
|
||||
>
|
||||
<div className="w-full flex-col text-center flex pointer-events-none">
|
||||
<div className="text-theme-text-secondary text-xs italic">
|
||||
{t("chat_window.custom_agents_coming_soon")}
|
||||
</div>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -31,7 +31,6 @@ export const PROMPT_INPUT_EVENT = "set_prompt_input";
|
||||
const MAX_EDIT_STACK_SIZE = 100;
|
||||
|
||||
/**
|
||||
* @param {Workspace} props.workspace - workspace object
|
||||
* @param {function} props.submit - form submit handler
|
||||
* @param {boolean} props.isStreaming - disables input while streaming response
|
||||
* @param {function} props.sendCommand - handler for slash commands and agent mentions
|
||||
@@ -41,7 +40,6 @@ const MAX_EDIT_STACK_SIZE = 100;
|
||||
* @param {string} [props.threadSlug] - thread slug for home page context
|
||||
*/
|
||||
export default function PromptInput({
|
||||
workspace = {},
|
||||
submit,
|
||||
isStreaming,
|
||||
sendCommand,
|
||||
@@ -51,7 +49,6 @@ export default function PromptInput({
|
||||
threadSlug = null,
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const { showAgentCommand = true } = workspace ?? {};
|
||||
const { isDisabled } = useIsDisabled();
|
||||
const [promptInput, setPromptInput] = useState("");
|
||||
const { showAgents, setShowAgents } = useAvailableAgents();
|
||||
@@ -276,7 +273,6 @@ export default function PromptInput({
|
||||
promptRef={textareaRef}
|
||||
centered={centered}
|
||||
/>
|
||||
{showAgentCommand && (
|
||||
<AvailableAgents
|
||||
showing={showAgents}
|
||||
setShowing={setShowAgents}
|
||||
@@ -284,7 +280,6 @@ export default function PromptInput({
|
||||
promptRef={textareaRef}
|
||||
centered={centered}
|
||||
/>
|
||||
)}
|
||||
<form
|
||||
onSubmit={handleSubmit}
|
||||
className={
|
||||
@@ -330,14 +325,10 @@ export default function PromptInput({
|
||||
showing={showSlashCommand}
|
||||
setShowSlashCommand={setShowSlashCommand}
|
||||
/>
|
||||
|
||||
{showAgentCommand && (
|
||||
<AvailableAgentsButton
|
||||
showing={showAgents}
|
||||
setShowAgents={setShowAgents}
|
||||
/>
|
||||
)}
|
||||
|
||||
<TextSizeButton />
|
||||
<LLMSelectorAction workspaceSlug={workspaceSlug} />
|
||||
</div>
|
||||
|
||||
@@ -338,7 +338,6 @@ export default function ChatContainer({ workspace, knownHistory = [] }) {
|
||||
{t("main-page.greeting")}
|
||||
</h1>
|
||||
<PromptInput
|
||||
workspace={workspace}
|
||||
submit={handleSubmit}
|
||||
isStreaming={loadingResponse}
|
||||
sendCommand={sendCommand}
|
||||
@@ -389,7 +388,6 @@ export default function ChatContainer({ workspace, knownHistory = [] }) {
|
||||
/>
|
||||
</MetricsProvider>
|
||||
<PromptInput
|
||||
workspace={workspace}
|
||||
submit={handleSubmit}
|
||||
isStreaming={loadingResponse}
|
||||
sendCommand={sendCommand}
|
||||
|
||||
@@ -186,18 +186,15 @@ const TRANSLATIONS = {
|
||||
title: "وضع المحادثة",
|
||||
chat: {
|
||||
title: "المحادثة",
|
||||
description:
|
||||
'سيوفر إجابات بناءً على المعرفة العامة للنموذج اللغوي، بالإضافة إلى السياق الوثائقي المتاح.\nستحتاج إلى استخدام الأمر "@agent" لاستخدام الأدوات.',
|
||||
"desc-start": "سيقدم إجابات حسب المعرفة العامة لنموذج التعلم العميق",
|
||||
and: "and",
|
||||
"desc-end": "المستند الذي تم العثور عليه حسب السياق.",
|
||||
},
|
||||
query: {
|
||||
title: "استعلام",
|
||||
description:
|
||||
'سيوفر الإجابات <b/>فقط<b/> إذا تم العثور على سياق الوثيقة.\nستحتاج إلى استخدام الأمر "@agent" لاستخدام الأدوات.',
|
||||
},
|
||||
automatic: {
|
||||
title: "سيارة",
|
||||
description:
|
||||
'سيتم استخدام الأدوات تلقائيًا إذا كان النموذج والمزود يدعمان استدعاء الأدوات الأصلية.\nإذا لم يتم دعم الأدوات الأصلية، فسيتعين عليك استخدام الأمر "@agent" لاستخدام الأدوات.',
|
||||
"desc-start": "سوف تقدم الإجابات",
|
||||
only: "فقط",
|
||||
"desc-end": "إذا وجد المستند في السياق",
|
||||
},
|
||||
},
|
||||
history: {
|
||||
@@ -694,8 +691,7 @@ const TRANSLATIONS = {
|
||||
edit_prompt: "اقتراح التحرير",
|
||||
edit_response: "عدّل الرد",
|
||||
at_agent: "@agent",
|
||||
default_agent_description:
|
||||
"- استخدام الأدوات والبرامج المتاحة لإنجاز المهام.",
|
||||
default_agent_description: "- الوكيل الافتراضي لهذا المساحة.",
|
||||
custom_agents_coming_soon: "سيصل وكلاء مخصصون قريباً!",
|
||||
slash_reset: "/reset",
|
||||
preset_reset_description: "امسح سجل الدردشة الخاص بك وابدأ محادثة جديدة",
|
||||
|
||||
@@ -286,18 +286,15 @@ const TRANSLATIONS = {
|
||||
title: "Režim chatu",
|
||||
chat: {
|
||||
title: "Chat",
|
||||
description:
|
||||
"budou poskytovat odpovědi založené na obecných znalostech LLM a kontextu dokumentu, který je k dispozici. Pro použití nástrojů budete muset použít příkaz `@agent`.",
|
||||
"desc-start": "bude poskytovat odpovědi s obecnými znalostmi LLM",
|
||||
and: "a",
|
||||
"desc-end": "kontext dokumentu, který je nalezen.",
|
||||
},
|
||||
query: {
|
||||
title: "Dotaz",
|
||||
description:
|
||||
"budou poskytovat odpovědi <b>pouze__, pokud je nalezen kontext dokumentu.</b>Budete muset použít příkaz @agent pro použití nástrojů.",
|
||||
},
|
||||
automatic: {
|
||||
title: "Auto",
|
||||
description:
|
||||
"automaticky použije nástroje, pokud to podporují model a poskytovatel. Pokud není podporováno nativní volání nástrojů, budete muset použít příkaz `@agent` pro použití nástrojů.",
|
||||
"desc-start": "bude poskytovat odpovědi",
|
||||
only: "pouze",
|
||||
"desc-end": "pokud je nalezen kontext dokumentu.",
|
||||
},
|
||||
},
|
||||
history: {
|
||||
@@ -923,8 +920,7 @@ const TRANSLATIONS = {
|
||||
edit_prompt: "Upravit výzvu",
|
||||
edit_response: "Upravit odpověď",
|
||||
at_agent: "@agent",
|
||||
default_agent_description:
|
||||
"– využívat nástroje a metodiky (MCP) k plnění úkolů.",
|
||||
default_agent_description: " - výchozí agent pro tento pracovní prostor.",
|
||||
custom_agents_coming_soon: "vlastní agenti přicházejí brzy!",
|
||||
slash_reset: "/reset",
|
||||
preset_reset_description: "Vymazat historii chatu a začít nový chat",
|
||||
|
||||
@@ -188,18 +188,15 @@ const TRANSLATIONS = {
|
||||
title: "Chat-tilstand",
|
||||
chat: {
|
||||
title: "Chat",
|
||||
description:
|
||||
"vil give svar baseret på LLM'ens generelle viden og den dokumentkontekst, der findes.\nDu skal bruge kommandoen `@agent` for at bruge værktøjerne.",
|
||||
"desc-start": "vil give svar baseret på LLM'ens generelle viden",
|
||||
and: "og",
|
||||
"desc-end": "dokumentkontekst der findes.",
|
||||
},
|
||||
query: {
|
||||
title: "Forespørgsel",
|
||||
description:
|
||||
'vil kun give svar, hvis dokumentets kontekst er fundet.\nDu skal bruge kommandoen "@agent" for at bruge værktøjerne.',
|
||||
},
|
||||
automatic: {
|
||||
title: "Bil",
|
||||
description:
|
||||
"systemet vil automatisk bruge værktøjer, hvis modellen og leverandøren understøtter direkte kald af værktøjer.<br />Hvis direkte brug af værktøjer ikke understøttes, skal du bruge kommandoen `@agent` for at bruge værktøjerne.",
|
||||
"desc-start": "vil give svar",
|
||||
only: "kun",
|
||||
"desc-end": "hvis dokumentkontekst findes.",
|
||||
},
|
||||
},
|
||||
history: {
|
||||
@@ -704,8 +701,7 @@ const TRANSLATIONS = {
|
||||
edit_prompt: "Redigeringsanmodning",
|
||||
edit_response: "Rediger svar",
|
||||
at_agent: "@agent",
|
||||
default_agent_description:
|
||||
"- udnytte værktøjer og metoder (MCP'er) til at gennemføre opgaver.",
|
||||
default_agent_description: "- standardagenten for dette arbejdsområde.",
|
||||
custom_agents_coming_soon: "Specialagenter kommer snart!",
|
||||
slash_reset: "/reset",
|
||||
preset_reset_description:
|
||||
|
||||
@@ -280,18 +280,15 @@ const TRANSLATIONS = {
|
||||
title: "Chat-Modus",
|
||||
chat: {
|
||||
title: "Chat",
|
||||
description:
|
||||
'wird Antworten basierend auf dem allgemeinen Wissen des LLM und dem im Dokument gefundenen Kontext liefern.\nSie müssen den Befehl "@agent" verwenden, um Tools zu nutzen.',
|
||||
"desc-start": "wird Antworten mit dem allgemeinen Wissen des LLM",
|
||||
and: "und",
|
||||
"desc-end": "gefundenem Dokumentenkontext liefern.",
|
||||
},
|
||||
query: {
|
||||
title: "Abfrage",
|
||||
description:
|
||||
'wird Antworten <b/>nur dann<b/> bereitstellen, wenn der Kontext des Dokuments gefunden wurde.\nSie müssen den Befehl "@agent" verwenden, um die Tools zu nutzen.',
|
||||
},
|
||||
automatic: {
|
||||
title: "Auto",
|
||||
description:
|
||||
'wird automatisch Werkzeuge verwenden, wenn das Modell und der Anbieter die native Aufruf von Werkzeugen unterstützen.\nWenn die native Verwendung von Werkzeugen nicht unterstützt wird, müssen Sie den Befehl "@agent" verwenden, um Werkzeuge zu nutzen.',
|
||||
"desc-start": "wird Antworten",
|
||||
only: "nur",
|
||||
"desc-end": "liefern, wenn Dokumentenkontext gefunden wird.",
|
||||
},
|
||||
},
|
||||
history: {
|
||||
@@ -902,8 +899,7 @@ const TRANSLATIONS = {
|
||||
edit_prompt: "Prompt bearbeiten",
|
||||
edit_response: "Antwort bearbeiten",
|
||||
at_agent: "@agent",
|
||||
default_agent_description:
|
||||
"- Nutzung von Werkzeugen und Management-Control-Programmen (MCPs) zur Erledigung von Aufgaben.",
|
||||
default_agent_description: "– Standardagent für diesen Workspace.",
|
||||
custom_agents_coming_soon: "Eigene Agenten bald verfügbar!",
|
||||
slash_reset: "/reset",
|
||||
preset_reset_description: "Chatverlauf löschen und neuen Chat starten",
|
||||
|
||||
@@ -295,20 +295,17 @@ const TRANSLATIONS = {
|
||||
},
|
||||
mode: {
|
||||
title: "Chat mode",
|
||||
automatic: {
|
||||
title: "Auto",
|
||||
description:
|
||||
"will automatically use tools if the model and provider support native tool calling.<br />If native tooling is not supported, you will need to use the @agent command to use tools.",
|
||||
},
|
||||
chat: {
|
||||
title: "Chat",
|
||||
description:
|
||||
"will provide answers with the LLM's general knowledge <b>and</b> document context that is found.<br />You will need to use the @agent command to use tools.",
|
||||
"desc-start": "will provide answers with the LLM's general knowledge",
|
||||
and: "and",
|
||||
"desc-end": "document context that is found.",
|
||||
},
|
||||
query: {
|
||||
title: "Query",
|
||||
description:
|
||||
"will provide answers <b>only</b> if document context is found.<br />You will need to use the @agent command to use tools.",
|
||||
"desc-start": "will provide answers",
|
||||
only: "only",
|
||||
"desc-end": "if document context is found.",
|
||||
},
|
||||
},
|
||||
history: {
|
||||
@@ -964,7 +961,7 @@ const TRANSLATIONS = {
|
||||
edit_prompt: "Edit prompt",
|
||||
edit_response: "Edit response",
|
||||
at_agent: "@agent",
|
||||
default_agent_description: " - leverage tools & MCPs to complete tasks.",
|
||||
default_agent_description: " - the default agent for this workspace.",
|
||||
custom_agents_coming_soon: "custom agents are coming soon!",
|
||||
slash_reset: "/reset",
|
||||
preset_reset_description: "Clear your chat history and begin a new chat",
|
||||
|
||||
@@ -281,18 +281,16 @@ const TRANSLATIONS = {
|
||||
title: "Modo de chat",
|
||||
chat: {
|
||||
title: "Chat",
|
||||
description:
|
||||
'proporcionará respuestas basadas en el conocimiento general del LLM y en el contexto del documento que se encuentre.<br />Para utilizar las herramientas, deberá utilizar el comando "@agent".',
|
||||
"desc-start":
|
||||
"proporcionará respuestas con el conocimiento general del LLM",
|
||||
and: "y",
|
||||
"desc-end": "el contexto del documento que se encuentre.",
|
||||
},
|
||||
query: {
|
||||
title: "Consulta",
|
||||
description:
|
||||
'proporcionará respuestas **únicamente** si se encuentra el contexto del documento.\nDeberá utilizar el comando "@agent" para utilizar las herramientas.',
|
||||
},
|
||||
automatic: {
|
||||
title: "Coche",
|
||||
description:
|
||||
'utilizará automáticamente las herramientas si el modelo y el proveedor admiten la llamada nativa a herramientas.\nSi no se admite la llamada nativa a herramientas, deberá utilizar el comando "@agent" para utilizar las herramientas.',
|
||||
"desc-start": "proporcionará respuestas",
|
||||
only: "solo",
|
||||
"desc-end": "si se encuentra contexto del documento.",
|
||||
},
|
||||
},
|
||||
history: {
|
||||
@@ -911,9 +909,9 @@ const TRANSLATIONS = {
|
||||
cancel: "Cancelar",
|
||||
edit_prompt: "Editar prompt",
|
||||
edit_response: "Editar respuesta",
|
||||
at_agent: "@agent",
|
||||
at_agent: "@agente",
|
||||
default_agent_description:
|
||||
"- Utilizar herramientas y metodologías específicas para completar las tareas.",
|
||||
" - el agente predeterminado para este espacio de trabajo.",
|
||||
custom_agents_coming_soon: "¡los agentes personalizados llegarán pronto!",
|
||||
slash_reset: "/reset",
|
||||
preset_reset_description:
|
||||
|
||||
@@ -271,18 +271,15 @@ const TRANSLATIONS = {
|
||||
title: "Vestlusrežiim",
|
||||
chat: {
|
||||
title: "Vestlus",
|
||||
description:
|
||||
'teenab vastuseid, kasutades LLM-i üldist teadmist ja leida saanud dokumentide konteksti.\nEt kasutada tööriime, peate kasutama käsku "@agent".',
|
||||
"desc-start": "annab vastuseid LLM-i üldteadmistest",
|
||||
and: "ja",
|
||||
"desc-end": "leitud dokumendikontekstist.",
|
||||
},
|
||||
query: {
|
||||
title: "Päring",
|
||||
description:
|
||||
"teenab vastuseid <b/> ainult siis, kui dokumenti kontekst on leitav.<br />Kasutamiseks peate kasutama käitu @agent.",
|
||||
},
|
||||
automatic: {
|
||||
title: "Automaailm",
|
||||
description:
|
||||
'kasutab automaatselt tööriistu, kui mudel ja pakkuja toetavad native tööriistade kasutamist.<br />Kui native tööriistade kasutamine ei toeta, siis peate kasutama käsku "@agent", et tööriiste kasutada.',
|
||||
"desc-start": "annab vastuseid",
|
||||
only: "ainult",
|
||||
"desc-end": "kui leitakse dokumendikontekst.",
|
||||
},
|
||||
},
|
||||
history: {
|
||||
@@ -861,8 +858,7 @@ const TRANSLATIONS = {
|
||||
edit_prompt: "Redigeeri päringut",
|
||||
edit_response: "Redigeeri vastust",
|
||||
at_agent: "@agent",
|
||||
default_agent_description:
|
||||
"– kasutada töörimeid ja tegevuste haldamise süsteeme (MCP) ülesannete täitmiseks.",
|
||||
default_agent_description: " – selle tööruumi vaikimisi agent.",
|
||||
custom_agents_coming_soon: "kohandatud agendid tulekul!",
|
||||
slash_reset: "/reset",
|
||||
preset_reset_description: "Tühjenda vestlusajalugu ja alusta uut vestlust",
|
||||
|
||||
@@ -187,18 +187,15 @@ const TRANSLATIONS = {
|
||||
title: "حالت گفتگو",
|
||||
chat: {
|
||||
title: "گفتگو",
|
||||
description:
|
||||
"با استفاده از دانش عمومی مدل زبان بزرگ و همچنین اطلاعات موجود در مستند، پاسخها را ارائه میدهد. برای استفاده از ابزارها، باید از دستور @agent استفاده کنید.",
|
||||
"desc-start": "پاسخها را با دانش عمومی LLM",
|
||||
and: "و",
|
||||
"desc-end": "محتوای اسناد یافت شده ارائه میدهد.",
|
||||
},
|
||||
query: {
|
||||
title: "پرسوجو",
|
||||
description:
|
||||
'پاسخها را تنها در صورتی ارائه میدهد که زمینه سند مشخص باشد.\nبرای استفاده از ابزارها، باید از دستور "@agent" استفاده کنید.',
|
||||
},
|
||||
automatic: {
|
||||
title: "خودرو",
|
||||
description:
|
||||
"در صورتی که مدل و ارائه دهنده از فراخوانی ابزار به صورت داخلی پشتیبانی کنند، ابزارها به طور خودکار استفاده خواهند شد.\nاگر فراخوانی ابزار به صورت داخلی پشتیبانی نشود، شما باید از دستور @agent برای استفاده از ابزارها استفاده کنید.",
|
||||
"desc-start": "پاسخها را",
|
||||
only: "فقط",
|
||||
"desc-end": "در صورت یافتن محتوای اسناد ارائه میدهد.",
|
||||
},
|
||||
},
|
||||
history: {
|
||||
@@ -701,8 +698,7 @@ const TRANSLATIONS = {
|
||||
edit_prompt: "لطفاً دستور ویرایش را ارائه دهید.",
|
||||
edit_response: "لطفا پاسخ را ویرایش کنید.",
|
||||
at_agent: "@agent",
|
||||
default_agent_description:
|
||||
"- استفاده از ابزارها و سیستمهای مدیریت کار (MCP) برای انجام وظایف.",
|
||||
default_agent_description: "- عامل پیشفرض برای این فضای کاری.",
|
||||
custom_agents_coming_soon: "نمایندگان ویژه در حال آمدن هستند!",
|
||||
slash_reset: "/reset",
|
||||
preset_reset_description: "حذف تاریخچه چت خود و شروع یک چت جدید",
|
||||
|
||||
@@ -189,18 +189,16 @@ const TRANSLATIONS = {
|
||||
title: "Mode de chat",
|
||||
chat: {
|
||||
title: "Chat",
|
||||
description:
|
||||
'fournira des réponses basées sur les connaissances générales du LLM et sur le contexte des documents trouvés.\nVous devrez utiliser la commande "@agent" pour utiliser les outils.',
|
||||
"desc-start":
|
||||
"fournira des réponses avec les connaissances générales du LLM",
|
||||
and: "et",
|
||||
"desc-end": "le contexte du document trouvé.",
|
||||
},
|
||||
query: {
|
||||
title: "Requête",
|
||||
description:
|
||||
"fournira des réponses <b/>uniquement<b/> si le contexte du document est trouvé.\nVous devrez utiliser la commande @agent pour utiliser les outils.",
|
||||
},
|
||||
automatic: {
|
||||
title: "Voiture",
|
||||
description:
|
||||
"il utilisera automatiquement les outils si le modèle et le fournisseur prennent en charge l'appel de fonctions natives.\nSi l'appel de fonctions natives n'est pas pris en charge, vous devrez utiliser la commande \"@agent\" pour utiliser les outils.",
|
||||
"desc-start": "fournira des réponses",
|
||||
only: "uniquement",
|
||||
"desc-end": "si un contexte de document est trouvé.",
|
||||
},
|
||||
},
|
||||
history: {
|
||||
@@ -704,8 +702,7 @@ const TRANSLATIONS = {
|
||||
edit_prompt: "Modifier le prompt",
|
||||
edit_response: "Modifier la réponse",
|
||||
at_agent: "@agent",
|
||||
default_agent_description:
|
||||
"- utiliser des outils et des méthodes de gestion de projet pour mener à bien les tâches.",
|
||||
default_agent_description: "l'agent par défaut de cet espace de travail",
|
||||
custom_agents_coming_soon: "Agents personnalisés bientôt disponibles",
|
||||
slash_reset: "/reset",
|
||||
preset_reset_description:
|
||||
|
||||
@@ -271,18 +271,15 @@ const TRANSLATIONS = {
|
||||
title: "מצב צ'אט",
|
||||
chat: {
|
||||
title: "צ'אט",
|
||||
description:
|
||||
'יוכל לספק תשובות המבוססות על הידע הכללי של ה-LLM וכן על ההקשר הרלוונטי המצוי בתיעוד.\nתצטרכו להשתמש בפקודה "@agent" כדי להשתמש בכלי.',
|
||||
"desc-start": "יספק תשובות עם הידע הכללי של מודל השפה",
|
||||
and: "וכן",
|
||||
"desc-end": "מהקשר המסמכים שנמצא.",
|
||||
},
|
||||
query: {
|
||||
title: "שאילתה",
|
||||
description:
|
||||
"יוכל לספק תשובות <b/>רק אם הקשר של המסמך נמצא.<br />תצטרכו להשתמש בפקודה @agent כדי להשתמש בכלי.",
|
||||
},
|
||||
automatic: {
|
||||
title: "רכב",
|
||||
description:
|
||||
'הכלי ישתמש באופן אוטומטי בכלים אם המודל והספק תומכים בהם.\nאם אין תמיכה בכלים מקומיים, תצטרכו להשתמש בפקודה "@agent" כדי להשתמש בכלים.',
|
||||
"desc-start": "יספק תשובות",
|
||||
only: "רק",
|
||||
"desc-end": "אם נמצא הקשר במסמכים.",
|
||||
},
|
||||
},
|
||||
history: {
|
||||
@@ -868,8 +865,7 @@ const TRANSLATIONS = {
|
||||
edit_prompt: "ערוך הנחיה",
|
||||
edit_response: "ערוך תגובה",
|
||||
at_agent: "@agent",
|
||||
default_agent_description:
|
||||
"- שימוש בכלים ובכלים מיוחדים כדי להשלים משימות.",
|
||||
default_agent_description: " - סוכן ברירת המחדל עבור סביבת עבודה זו.",
|
||||
custom_agents_coming_soon: "סוכנים מותאמים אישית יגיעו בקרוב!",
|
||||
slash_reset: "/reset",
|
||||
preset_reset_description: "נקה את היסטוריית הצ'אט שלך והתחל צ'אט חדש",
|
||||
|
||||
@@ -190,18 +190,15 @@ const TRANSLATIONS = {
|
||||
title: "Modalità chat",
|
||||
chat: {
|
||||
title: "Chat",
|
||||
description:
|
||||
'fornirà risposte basate sulla conoscenza generale dell\'LLM e sul contesto del documento rilevante.\nPer utilizzare gli strumenti, sarà necessario utilizzare il comando "@agent".',
|
||||
"desc-start": "fornirà risposte con la conoscenza generale dell'LLM",
|
||||
and: "e",
|
||||
"desc-end": "contesto documentale associato.",
|
||||
},
|
||||
query: {
|
||||
title: "Query",
|
||||
description:
|
||||
'fornirà risposte solo se il contesto del documento viene identificato.\nPer utilizzare gli strumenti, sarà necessario utilizzare il comando "@agent".',
|
||||
},
|
||||
automatic: {
|
||||
title: "Auto",
|
||||
description:
|
||||
'utilizzerà automaticamente gli strumenti se il modello e il fornitore supportano le chiamate native agli strumenti.\nSe le chiamate native agli strumenti non sono supportate, sarà necessario utilizzare il comando "@agent" per utilizzare gli strumenti.',
|
||||
"desc-start": "fornirà risposte",
|
||||
only: "solo",
|
||||
"desc-end": "se sarà presente un contesto documentale",
|
||||
},
|
||||
},
|
||||
history: {
|
||||
@@ -711,7 +708,7 @@ const TRANSLATIONS = {
|
||||
edit_response: "Modifica la risposta",
|
||||
at_agent: "@agent",
|
||||
default_agent_description:
|
||||
"- utilizzare strumenti e risorse gestite centralmente per completare i compiti.",
|
||||
"- l'agente predefinito per questo spazio di lavoro.",
|
||||
custom_agents_coming_soon: "Agenti personalizzati in arrivo a breve!",
|
||||
slash_reset: "/reset",
|
||||
preset_reset_description:
|
||||
|
||||
@@ -187,18 +187,15 @@ const TRANSLATIONS = {
|
||||
title: "チャットモード",
|
||||
chat: {
|
||||
title: "チャット",
|
||||
description:
|
||||
"LLMの一般的な知識と、利用可能なドキュメントの文脈に基づいて回答を提供します。ツールを使用するには、`@agent`コマンドを使用する必要があります。",
|
||||
"desc-start": "LLMの一般知識で回答します",
|
||||
and: "および",
|
||||
"desc-end": "見つかったドキュメントコンテキストを使用します。",
|
||||
},
|
||||
query: {
|
||||
title: "クエリ",
|
||||
description:
|
||||
'回答は、ドキュメントの文脈が特定された場合にのみ提供されます。\nツールを使用するには、"@agent" コマンドを使用する必要があります。',
|
||||
},
|
||||
automatic: {
|
||||
title: "自動車",
|
||||
description:
|
||||
"ネイティブなツール呼び出しをサポートしている場合、モデルとプロバイダーが自動的にツールを使用します。\nネイティブなツール呼び出しがサポートされていない場合は、@agentコマンドを使用してツールを使用する必要があります。",
|
||||
"desc-start": "回答を提供します",
|
||||
only: "のみ",
|
||||
"desc-end": "ドキュメントコンテキストが見つかった場合のみ。",
|
||||
},
|
||||
},
|
||||
history: {
|
||||
@@ -694,8 +691,7 @@ const TRANSLATIONS = {
|
||||
edit_prompt: "編集のヒント",
|
||||
edit_response: "編集内容を保存します。",
|
||||
at_agent: "@agent",
|
||||
default_agent_description:
|
||||
"- ツールやマニュアルを活用して、タスクを完了する。",
|
||||
default_agent_description: "- このワークスペースのデフォルトエージェント。",
|
||||
custom_agents_coming_soon: "カスタムエージェントは近日公開予定です。",
|
||||
slash_reset: "/reset",
|
||||
preset_reset_description:
|
||||
|
||||
@@ -272,18 +272,15 @@ const TRANSLATIONS = {
|
||||
title: "채팅 모드",
|
||||
chat: {
|
||||
title: "채팅",
|
||||
description:
|
||||
"LLM의 일반적인 지식과 함께, 문맥에 맞는 답변을 제공합니다. 도구를 사용하려면 @agent 명령어를 사용해야 합니다.",
|
||||
"desc-start": "문서 내용을 찾습니다.",
|
||||
and: "그리고",
|
||||
"desc-end": "LLM의 일반 지식을 같이 사용하여 답변을 제공합니다",
|
||||
},
|
||||
query: {
|
||||
title: "쿼리",
|
||||
description:
|
||||
"답변은 문서의 맥락이 발견될 경우에만 제공됩니다. 도구를 사용하려면 `@agent` 명령어를 사용해야 합니다.",
|
||||
},
|
||||
automatic: {
|
||||
title: "자동",
|
||||
description:
|
||||
"모델과 제공업체가 네이티브 도구 호출을 지원하는 경우, 자동으로 도구를 사용합니다.\n\n네이티브 도구 호출이 지원되지 않는 경우, @agent 명령어를 사용하여 도구를 사용해야 합니다.",
|
||||
"desc-start": "문서 컨텍스트를 찾을 ",
|
||||
only: "때만",
|
||||
"desc-end": "답변을 제공합니다.",
|
||||
},
|
||||
},
|
||||
history: {
|
||||
@@ -877,8 +874,7 @@ const TRANSLATIONS = {
|
||||
edit_prompt: "프롬프트 수정",
|
||||
edit_response: "응답 수정",
|
||||
at_agent: "@agent",
|
||||
default_agent_description:
|
||||
"- 다양한 도구 및 MCP(관리형 서비스)를 활용하여 작업을 완료합니다.",
|
||||
default_agent_description: " - 이 워크스페이스의 기본 에이전트입니다.",
|
||||
custom_agents_coming_soon: "커스텀 에이전트 기능이 곧 제공됩니다!",
|
||||
slash_reset: "/reset",
|
||||
preset_reset_description: "채팅 기록을 초기화하고 새 채팅을 시작합니다",
|
||||
|
||||
@@ -276,18 +276,15 @@ const TRANSLATIONS = {
|
||||
title: "Sarunas režīms",
|
||||
chat: {
|
||||
title: "Saruna",
|
||||
description:
|
||||
'sniedz atbildes, izmantojot LLM (liels valodas modelis) vispārējo zināšanu un atrastos dokumentu kontekstu.\nLai izmantotu rīkus, jums būs jāizmantojat komanda "@agent".',
|
||||
"desc-start": "sniegs atbildes ar LLM vispārējām zināšanām",
|
||||
and: "un",
|
||||
"desc-end": "dokumentu kontekstu, kas tiek atrasts.",
|
||||
},
|
||||
query: {
|
||||
title: "Vaicājums",
|
||||
description:
|
||||
'sniedz atbildes tikai, ja dokumenta konteksts ir atrasts.<br />Lai izmantotu rīkus, jums jāizmantojat komandu "@agent".',
|
||||
},
|
||||
automatic: {
|
||||
title: "Automobiļs",
|
||||
description:
|
||||
'automātiski izmantos rīkus, ja modelis un sniedzējs atbalsta vietējo rīku izkļaušanu.<br />Ja vietējā rīku izkļaušana nav atbalstīta, jums būs jāizmantojat komanda "@agent", lai izmantotu rīkus.',
|
||||
"desc-start": "sniegs atbildes",
|
||||
only: "tikai",
|
||||
"desc-end": "ja tiek atrasts dokumentu konteksts.",
|
||||
},
|
||||
},
|
||||
history: {
|
||||
@@ -894,8 +891,7 @@ const TRANSLATIONS = {
|
||||
edit_prompt: "Ieslēgt",
|
||||
edit_response: "Rediģēt atbildi",
|
||||
at_agent: "@agent",
|
||||
default_agent_description:
|
||||
"– izmantot rīkus un MCP (personas darba plānus) lai pabeigtu uzdevumus.",
|
||||
default_agent_description: "- noklusējuma aģents šim darba telpai.",
|
||||
custom_agents_coming_soon:
|
||||
"Nedaudz drīzumā būs pieejami individuāli pakalpojumi!",
|
||||
slash_reset: "/reset",
|
||||
|
||||
@@ -188,18 +188,15 @@ const TRANSLATIONS = {
|
||||
title: "Chatmodus",
|
||||
chat: {
|
||||
title: "Chat",
|
||||
description:
|
||||
"zal antwoorden genereren met behulp van de algemene kennis van het LLM en de documentcontext die beschikbaar is.<br />U moet het commando `@agent` gebruiken om tools te gebruiken.",
|
||||
"desc-start": "zal antwoorden geven met de algemene kennis van de LLM",
|
||||
and: "en",
|
||||
"desc-end": "documentcontext die wordt gevonden.",
|
||||
},
|
||||
query: {
|
||||
title: "Query",
|
||||
description:
|
||||
"zal antwoorden geven <b/>alleen</b/> als de context van het document wordt gevonden.\nU moet het commando `@agent` gebruiken om de tools te gebruiken.",
|
||||
},
|
||||
automatic: {
|
||||
title: "Auto",
|
||||
description:
|
||||
"zal automatisch tools gebruiken als het model en de provider native tool-aanroepen ondersteunen.<br />Als native tooling niet wordt ondersteund, moet u het `@agent`-commando gebruiken om tools te gebruiken.",
|
||||
"desc-start": "zal antwoorden geven",
|
||||
only: "alleen",
|
||||
"desc-end": "als documentcontext wordt gevonden.",
|
||||
},
|
||||
},
|
||||
history: {
|
||||
@@ -705,8 +702,7 @@ const TRANSLATIONS = {
|
||||
edit_prompt: "Prompt bewerken",
|
||||
edit_response: "Reactie bewerken",
|
||||
at_agent: "@agent",
|
||||
default_agent_description:
|
||||
"- gebruik van tools en methoden om taken te voltooien.",
|
||||
default_agent_description: " - de standaardagent voor deze werkruimte.",
|
||||
custom_agents_coming_soon: "Aangepaste agenten komen binnenkort!",
|
||||
slash_reset: "/reset",
|
||||
preset_reset_description:
|
||||
|
||||
@@ -278,18 +278,16 @@ const TRANSLATIONS = {
|
||||
title: "Tryb czatu",
|
||||
chat: {
|
||||
title: "Czat",
|
||||
description:
|
||||
"zapewnią odpowiedzi oparte na ogólnym zasobie wiedzy LLM oraz kontekście dokumentu, w którym ta wiedza znajduje się. <br /> Będziesz musiał użyć komendy `@agent` w celu korzystania z narzędzi.",
|
||||
"desc-start": "dostarczy odpowiedzi na podstawie wiedzy ogólnej LLM",
|
||||
and: "oraz",
|
||||
"desc-end": " znalezionym kontekście (dokumenty, źródła danych)",
|
||||
},
|
||||
query: {
|
||||
title: "Zapytanie (wyszukiwanie)",
|
||||
description:
|
||||
"będzie dostarczać odpowiedzi <b>tylko</b>, jeśli zostanie zidentyfikowany kontekst dokumentu.<br />Będziesz musiał użyć polecenia `@agent` w celu korzystania z narzędzi.",
|
||||
},
|
||||
automatic: {
|
||||
title: "Samochód",
|
||||
description:
|
||||
"automatycznie będzie korzystać z narzędzi, jeśli model i dostawca obsługują natywne wywoływanie narzędzi. W przypadku, gdy natywne wywoływanie narzędzi nie jest obsługiwane, konieczne będzie użycie komendy `@agent` w celu korzystania z narzędzi.",
|
||||
"desc-start": "dostarczy odpowiedzi",
|
||||
only: "tylko",
|
||||
"desc-end":
|
||||
"na podstawie znalezionego kontekstu (dokumenty, źródła danych) - w przeciwnym razie odmówi odpowiedzi.",
|
||||
},
|
||||
},
|
||||
history: {
|
||||
@@ -895,8 +893,7 @@ const TRANSLATIONS = {
|
||||
edit_prompt: "Edytuj prompt",
|
||||
edit_response: "Edytuj odpowiedź",
|
||||
at_agent: "@agent",
|
||||
default_agent_description:
|
||||
"- wykorzystywać dostępne narzędzia i zasoby, aby wykonywać zadania.",
|
||||
default_agent_description: " - domyślny agent dla tego obszaru roboczego.",
|
||||
custom_agents_coming_soon: "niestandardowi agenci już wkrótce!",
|
||||
slash_reset: "/reset",
|
||||
preset_reset_description: "Wyczyść historię czatu i rozpocznij nowy czat",
|
||||
|
||||
@@ -274,18 +274,15 @@ const TRANSLATIONS = {
|
||||
title: "Modo de Chat",
|
||||
chat: {
|
||||
title: "Chat",
|
||||
description:
|
||||
'fornecerá respostas com base no conhecimento geral do LLM e no contexto do documento encontrado.\nVocê precisará usar o comando "@agent" para utilizar as ferramentas.',
|
||||
"desc-start": "fornecerá respostas com conhecimento geral do LLM",
|
||||
and: "e",
|
||||
"desc-end": "contexto dos documentos encontrados.",
|
||||
},
|
||||
query: {
|
||||
title: "Consulta",
|
||||
description:
|
||||
"fornecerá respostas <b/>apenas quando o contexto do documento for encontrado.<br />Você precisará usar o comando @agent para utilizar as ferramentas.",
|
||||
},
|
||||
automatic: {
|
||||
title: "Automóvel",
|
||||
description:
|
||||
'utilizará automaticamente as ferramentas, caso o modelo e o provedor suportem a chamada nativa de ferramentas.<br />Se a chamada nativa de ferramentas não for suportada, você precisará usar o comando "@agent" para utilizar as ferramentas.',
|
||||
"desc-start": "fornecerá respostas",
|
||||
only: "apenas",
|
||||
"desc-end": "se contexto for encontrado nos documentos.",
|
||||
},
|
||||
},
|
||||
history: {
|
||||
@@ -874,8 +871,7 @@ const TRANSLATIONS = {
|
||||
edit_prompt: "Editar prompt",
|
||||
edit_response: "Editar resposta",
|
||||
at_agent: "@agent",
|
||||
default_agent_description:
|
||||
"- utilizar ferramentas e processos de gerenciamento de projetos para concluir tarefas.",
|
||||
default_agent_description: " - o agente padrão deste workspace.",
|
||||
custom_agents_coming_soon: "mais agentes personalizados em breve!",
|
||||
slash_reset: "/reset",
|
||||
preset_reset_description: "Limpa o histórico do seu chat e inicia um novo",
|
||||
|
||||
@@ -280,18 +280,16 @@ const TRANSLATIONS = {
|
||||
title: "Mod chat",
|
||||
chat: {
|
||||
title: "Chat",
|
||||
description:
|
||||
'va oferi răspunsuri bazate pe cunoștințele generale ale modelului LLM și pe contextul documentului, dacă acesta este disponibil.<br />Va trebui să utilizați comanda "@agent" pentru a utiliza instrumentele.',
|
||||
"desc-start":
|
||||
"oferă răspunsuri bazate pe cunoștințele generale ale LLM-ului",
|
||||
and: "și",
|
||||
"desc-end": "context document care este găsit.",
|
||||
},
|
||||
query: {
|
||||
title: "Interogare",
|
||||
description:
|
||||
"va oferi răspunsuri doar dacă contextul documentului este găsit.<br />Veți avea nevoie să utilizați comanda @agent pentru a utiliza instrumentele.",
|
||||
},
|
||||
automatic: {
|
||||
title: "Mașină",
|
||||
description:
|
||||
'va utiliza automat instrumentele, dacă modelul și furnizorul suportă apelarea nativă a instrumentelor. Dacă apelarea nativă a instrumentelor nu este suportată, va trebui să utilizați comanda "@agent" pentru a utiliza instrumentele.',
|
||||
"desc-start": "oferă răspunsuri",
|
||||
only: "doar",
|
||||
"desc-end": "dacă contextul documentului este găsit.",
|
||||
},
|
||||
},
|
||||
history: {
|
||||
@@ -629,7 +627,7 @@ const TRANSLATIONS = {
|
||||
edit_response: "Editează răspuns",
|
||||
at_agent: "@agent",
|
||||
default_agent_description:
|
||||
"- utiliza instrumente și resurse specifice pentru a finaliza sarcinile.",
|
||||
" - agentul implicit pentru acest spațiu de lucru.",
|
||||
custom_agents_coming_soon: "agenții personalizați vin în curând!",
|
||||
slash_reset: "/reset",
|
||||
preset_reset_description:
|
||||
|
||||
@@ -188,18 +188,15 @@ const TRANSLATIONS = {
|
||||
title: "Режим чата",
|
||||
chat: {
|
||||
title: "Чат",
|
||||
description:
|
||||
"будет предоставлять ответы, основанные на общих знаниях LLM и на контексте документа, который был найден.\nДля использования инструментов необходимо использовать команду `@agent`.",
|
||||
"desc-start": "будет предоставлять ответы с общей информацией LLM",
|
||||
and: "и",
|
||||
"desc-end": "найденный контекст документов.",
|
||||
},
|
||||
query: {
|
||||
title: "Запрос",
|
||||
description:
|
||||
"будет предоставлять ответы <b/>только</b/> в случае, если будет найден контекст документа.\nДля использования инструментов вам необходимо использовать команду @agent.",
|
||||
},
|
||||
automatic: {
|
||||
title: "Авто",
|
||||
description:
|
||||
"автоматически будет использовать инструменты, если модель и провайдер поддерживают вызов инструментов напрямую.\nЕсли прямой вызов инструментов не поддерживается, вам потребуется использовать команду `@agent` для использования инструментов.",
|
||||
"desc-start": "будет предоставлять ответы",
|
||||
only: "только",
|
||||
"desc-end": "если найден контекст документов.",
|
||||
},
|
||||
},
|
||||
history: {
|
||||
@@ -703,7 +700,7 @@ const TRANSLATIONS = {
|
||||
edit_response: "Отредактируйте ответ",
|
||||
at_agent: "@agent",
|
||||
default_agent_description:
|
||||
"– использовать инструменты и средства управления проектами для выполнения задач.",
|
||||
"- это основной агент для данного рабочего пространства.",
|
||||
custom_agents_coming_soon: "Скоро появятся индивидуальные агенты!",
|
||||
slash_reset: "/reset",
|
||||
preset_reset_description: "Очистите историю чата и начните новый чат",
|
||||
|
||||
@@ -188,18 +188,15 @@ const TRANSLATIONS = {
|
||||
title: "Sohbet Modu",
|
||||
chat: {
|
||||
title: "Sohbet",
|
||||
description:
|
||||
'LLM\'nin genel bilgisi ve bulunan doküman bağlamı sayesinde sorulara cevaplar verecektir. Araçları kullanmak için "@agent" komutunu kullanmanız gerekecektir.',
|
||||
"desc-start": "LLM'nin genel bilgisiyle yanıtlar sunar",
|
||||
and: "ve",
|
||||
"desc-end": "bulunan belge bağlamını ekler.",
|
||||
},
|
||||
query: {
|
||||
title: "Sorgu",
|
||||
description:
|
||||
"Cevapları yalnızca, belgelerin bağlamı bulunduğunda sağlayacaktır. Araçları kullanmak için @agent komutunu kullanmanız gerekecektir.",
|
||||
},
|
||||
automatic: {
|
||||
title: "Otomobil",
|
||||
description:
|
||||
'Eğer model ve sağlayıcı, yerel araç çağırmayı destekliyorsa, araçlar otomatik olarak kullanılacaktır.\nEğer yerel araç kullanımı desteklenmiyorsa, araçları kullanmak için "@agent" komutunu kullanmanız gerekecektir.',
|
||||
"desc-start": "yanıtları",
|
||||
only: "sadece",
|
||||
"desc-end": "belge bağlamı bulunduğunda sunar.",
|
||||
},
|
||||
},
|
||||
history: {
|
||||
@@ -699,8 +696,7 @@ const TRANSLATIONS = {
|
||||
edit_prompt: "Promptu düzenle",
|
||||
edit_response: "Yanıtı düzenle",
|
||||
at_agent: "@agent",
|
||||
default_agent_description:
|
||||
"- Görevleri tamamlamak için araçları ve MCP'leri kullanmak.",
|
||||
default_agent_description: " - bu çalışma alanının varsayılan ajanı.",
|
||||
custom_agents_coming_soon: "özel ajanlar yakında!",
|
||||
slash_reset: "/reset",
|
||||
preset_reset_description:
|
||||
|
||||
@@ -188,18 +188,15 @@ const TRANSLATIONS = {
|
||||
title: "Chế độ trò chuyện",
|
||||
chat: {
|
||||
title: "Trò chuyện",
|
||||
description:
|
||||
'sẽ cung cấp câu trả lời dựa trên kiến thức chung của LLM và thông tin từ tài liệu được tìm thấy. Bạn cần sử dụng lệnh "@agent" để sử dụng các công cụ.',
|
||||
"desc-start": "sẽ cung cấp câu trả lời với kiến thức chung của LLM",
|
||||
and: "và",
|
||||
"desc-end": "ngữ cảnh tài liệu được tìm thấy.",
|
||||
},
|
||||
query: {
|
||||
title: "Truy vấn",
|
||||
description:
|
||||
"sẽ cung cấp câu trả lời <b/>chỉ khi<b/> thông tin trong tài liệu được tìm thấy.<br />Bạn cần sử dụng lệnh @agent để sử dụng các công cụ.",
|
||||
},
|
||||
automatic: {
|
||||
title: "Tự động",
|
||||
description:
|
||||
"hệ thống sẽ tự động sử dụng các công cụ nếu mô hình và nhà cung cấp hỗ trợ gọi công cụ gốc. Nếu không hỗ trợ công cụ gốc, bạn sẽ cần sử dụng lệnh `@agent` để sử dụng các công cụ.",
|
||||
"desc-start": "sẽ cung cấp câu trả lời",
|
||||
only: "chỉ",
|
||||
"desc-end": "khi tìm thấy ngữ cảnh tài liệu.",
|
||||
},
|
||||
},
|
||||
history: {
|
||||
@@ -697,8 +694,7 @@ const TRANSLATIONS = {
|
||||
edit_prompt: "Chỉnh sửa prompt",
|
||||
edit_response: "Chỉnh sửa phản hồi",
|
||||
at_agent: "@agent",
|
||||
default_agent_description:
|
||||
"- Sử dụng các công cụ và quy trình quản lý dự án (MCP) để hoàn thành công việc.",
|
||||
default_agent_description: " - agent mặc định cho không gian làm việc này.",
|
||||
custom_agents_coming_soon: "agent tùy chỉnh sắp ra mắt!",
|
||||
slash_reset: "/reset",
|
||||
preset_reset_description:
|
||||
|
||||
@@ -266,18 +266,15 @@ const TRANSLATIONS = {
|
||||
title: "聊天模式",
|
||||
chat: {
|
||||
title: "聊天",
|
||||
description:
|
||||
"将提供基于LLM的通用知识和文档上下文信息,以便给出答案。\n您需要使用 `@agent` 命令来使用工具。",
|
||||
"desc-start": "将提供 LLM 的一般知识",
|
||||
and: "和",
|
||||
"desc-end": "找到的文档上下文的答案。",
|
||||
},
|
||||
query: {
|
||||
title: "查询",
|
||||
description:
|
||||
"只会提供答案,前提是能够找到文档的上下文。<br />您需要使用 `@agent` 命令来使用工具。",
|
||||
},
|
||||
automatic: {
|
||||
title: "汽车",
|
||||
description:
|
||||
"如果模型和提供商支持原生工具调用,则会自动使用这些工具。<br />如果不支持原生工具调用,您需要使用 `@agent` 命令来使用工具。",
|
||||
"desc-start": "将会提供答案",
|
||||
only: "仅当",
|
||||
"desc-end": "找到文档上下文时。",
|
||||
},
|
||||
},
|
||||
history: {
|
||||
@@ -836,7 +833,7 @@ const TRANSLATIONS = {
|
||||
edit_prompt: "编辑问题",
|
||||
edit_response: "编辑回应",
|
||||
at_agent: "@agent",
|
||||
default_agent_description: "- 利用工具和管理控制平台(MCP)来完成任务。",
|
||||
default_agent_description: " - 此工作区的预设代理。",
|
||||
custom_agents_coming_soon: "自定义代理功能即将推出!",
|
||||
slash_reset: "/reset",
|
||||
preset_reset_description: "清除聊天纪录并开始新的聊天",
|
||||
|
||||
@@ -179,18 +179,15 @@ const TRANSLATIONS = {
|
||||
title: "對話模式",
|
||||
chat: {
|
||||
title: "對話",
|
||||
description:
|
||||
"將提供利用 LLM 的一般知識以及從文件中提取到的資訊來提供答案。<br />您需要使用 `@agent` 命令來使用工具。",
|
||||
"desc-start": "將會利用 LLM 的一般知識",
|
||||
and: "和",
|
||||
"desc-end": "找到的文件內容來提供答案。",
|
||||
},
|
||||
query: {
|
||||
title: "查詢",
|
||||
description:
|
||||
"僅在找到文件內容時,系統才會提供答案。<br />您需要使用 `@agent` 命令來使用工具。",
|
||||
},
|
||||
automatic: {
|
||||
title: "自動",
|
||||
description:
|
||||
"如果模型和供應商都支援原生工具呼叫,系統將自動使用這些工具。<br />如果原生工具呼叫功能未支援,您需要使用 `@agent` 命令來使用工具。",
|
||||
"desc-start": "將",
|
||||
only: "僅",
|
||||
"desc-end": "在找到文件內容時提供答案。",
|
||||
},
|
||||
},
|
||||
history: {
|
||||
@@ -658,7 +655,7 @@ const TRANSLATIONS = {
|
||||
edit_prompt: "編輯問題",
|
||||
edit_response: "編輯回應",
|
||||
at_agent: "@agent",
|
||||
default_agent_description: "- 運用工具和專案管理流程,以完成任務。",
|
||||
default_agent_description: " - 此工作區的預設代理。",
|
||||
custom_agents_coming_soon: "自訂代理功能即將推出!",
|
||||
slash_reset: "/reset",
|
||||
preset_reset_description: "清除聊天紀錄並開始新的聊天",
|
||||
|
||||
@@ -573,27 +573,6 @@ const Workspace = {
|
||||
return response;
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks if the agent command is available for a workspace
|
||||
* by checking if the workspace's agent provider supports native tool calling.
|
||||
*
|
||||
* This can be model specific or enabled via ENV flag.
|
||||
* @param {string} slug - workspace slug
|
||||
* @returns {Promise<{showAgentCommand: boolean}>}
|
||||
*/
|
||||
agentCommandAvailable: async function (slug = null) {
|
||||
if (!slug) return { showAgentCommand: true };
|
||||
return await fetch(
|
||||
`${API_BASE}/workspace/${slug}/is-agent-command-available`,
|
||||
{ headers: baseHeaders() }
|
||||
)
|
||||
.then((res) => res.json())
|
||||
.catch((e) => {
|
||||
console.error(e);
|
||||
return { showAgentCommand: true };
|
||||
});
|
||||
},
|
||||
|
||||
threads: WorkspaceThread,
|
||||
};
|
||||
|
||||
|
||||
@@ -61,13 +61,11 @@ export default function Home() {
|
||||
async function init() {
|
||||
const ws = await getTargetWorkspace();
|
||||
if (ws) {
|
||||
const [suggestedMessages, pfpUrl, { showAgentCommand }] =
|
||||
await Promise.all([
|
||||
const [suggestedMessages, pfpUrl] = await Promise.all([
|
||||
Workspace.getSuggestedMessages(ws.slug),
|
||||
Workspace.fetchPfp(ws.slug),
|
||||
Workspace.agentCommandAvailable(ws.slug),
|
||||
]);
|
||||
setWorkspace({ ...ws, suggestedMessages, pfpUrl, showAgentCommand });
|
||||
setWorkspace({ ...ws, suggestedMessages, pfpUrl });
|
||||
}
|
||||
setWorkspaceLoading(false);
|
||||
}
|
||||
@@ -280,7 +278,6 @@ function HomeContent({ workspace, setWorkspace, threadSlug, setThreadSlug }) {
|
||||
{t("main-page.greeting")}
|
||||
</h1>
|
||||
<PromptInput
|
||||
workspace={workspace}
|
||||
submit={handleSubmit}
|
||||
isStreaming={loading}
|
||||
sendCommand={sendCommand}
|
||||
|
||||
@@ -30,17 +30,12 @@ function ShowWorkspaceChat() {
|
||||
const _workspace = await Workspace.bySlug(slug);
|
||||
if (!_workspace) return setLoading(false);
|
||||
|
||||
const [suggestedMessages, pfpUrl, { showAgentCommand }] =
|
||||
await Promise.all([
|
||||
Workspace.getSuggestedMessages(slug),
|
||||
Workspace.fetchPfp(slug),
|
||||
Workspace.agentCommandAvailable(slug),
|
||||
]);
|
||||
const suggestedMessages = await Workspace.getSuggestedMessages(slug);
|
||||
const pfpUrl = await Workspace.fetchPfp(slug);
|
||||
setWorkspace({
|
||||
..._workspace,
|
||||
suggestedMessages,
|
||||
pfpUrl,
|
||||
showAgentCommand,
|
||||
});
|
||||
setLoading(false);
|
||||
localStorage.setItem(
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { useState } from "react";
|
||||
import { Trans, useTranslation } from "react-i18next";
|
||||
|
||||
import { useTranslation } from "react-i18next";
|
||||
export default function ChatModeSelection({ workspace, setHasChanges }) {
|
||||
const [chatMode, setChatMode] = useState(workspace?.chatMode || "automatic");
|
||||
const [chatMode, setChatMode] = useState(workspace?.chatMode || "chat");
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div>
|
||||
@@ -15,17 +14,6 @@ export default function ChatModeSelection({ workspace, setHasChanges }) {
|
||||
<div className="flex flex-col gap-y-1 mt-2">
|
||||
<div className="w-fit flex gap-x-1 items-center p-1 rounded-lg bg-theme-settings-input-bg ">
|
||||
<input type="hidden" name="chatMode" value={chatMode} />
|
||||
<button
|
||||
type="button"
|
||||
disabled={chatMode === "automatic"}
|
||||
onClick={() => {
|
||||
setChatMode("automatic");
|
||||
setHasChanges(true);
|
||||
}}
|
||||
className="transition-bg duration-200 px-6 py-1 text-md text-white/60 disabled:text-white bg-transparent disabled:bg-[#687280] rounded-md hover:bg-white/10"
|
||||
>
|
||||
{t("chat.mode.automatic.title")}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
disabled={chatMode === "chat"}
|
||||
@@ -33,7 +21,7 @@ export default function ChatModeSelection({ workspace, setHasChanges }) {
|
||||
setChatMode("chat");
|
||||
setHasChanges(true);
|
||||
}}
|
||||
className="transition-bg duration-200 px-6 py-1 text-md text-white/60 disabled:text-white bg-transparent disabled:bg-[#687280] rounded-md hover:bg-white/10 light:hover:bg-black/10"
|
||||
className="transition-bg duration-200 px-6 py-1 text-md text-white/60 disabled:text-white bg-transparent disabled:bg-[#687280] rounded-md"
|
||||
>
|
||||
{t("chat.mode.chat.title")}
|
||||
</button>
|
||||
@@ -44,31 +32,29 @@ export default function ChatModeSelection({ workspace, setHasChanges }) {
|
||||
setChatMode("query");
|
||||
setHasChanges(true);
|
||||
}}
|
||||
className="transition-bg duration-200 px-6 py-1 text-md text-white/60 disabled:text-white bg-transparent disabled:bg-[#687280] rounded-md hover:bg-white/10 light:hover:bg-black/10"
|
||||
className="transition-bg duration-200 px-6 py-1 text-md text-white/60 disabled:text-white bg-transparent disabled:bg-[#687280] rounded-md"
|
||||
>
|
||||
{t("chat.mode.query.title")}
|
||||
</button>
|
||||
</div>
|
||||
<ChatModeExplanation chatMode={chatMode} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A component that displays the explanation for a given chat mode.
|
||||
* @param {'automatic' | 'chat' | 'query'} chatMode - The chat mode to display the explanation for.
|
||||
* @returns {JSX.Element} The component to display the explanation for the given chat mode.
|
||||
*/
|
||||
function ChatModeExplanation({ chatMode = "chat" }) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<p className="text-sm text-white/60">
|
||||
<b>{t(`chat.mode.${chatMode}.title`)}</b>{" "}
|
||||
<Trans
|
||||
i18nKey={`chat.mode.${chatMode}.description`}
|
||||
components={{ b: <b />, br: <br /> }}
|
||||
/>
|
||||
{chatMode === "chat" ? (
|
||||
<>
|
||||
<b>{t("chat.mode.chat.title")}</b>{" "}
|
||||
{t("chat.mode.chat.desc-start")}{" "}
|
||||
<i className="font-semibold">{t("chat.mode.chat.and")}</i>{" "}
|
||||
{t("chat.mode.chat.desc-end")}
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<b>{t("chat.mode.query.title")}</b>{" "}
|
||||
{t("chat.mode.query.desc-start")}{" "}
|
||||
<i className="font-semibold">{t("chat.mode.query.only")}</i>{" "}
|
||||
{t("chat.mode.query.desc-end")}
|
||||
</>
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -11,11 +11,7 @@ const { Workspace } = require("../models/workspace");
|
||||
const { Document } = require("../models/documents");
|
||||
const { DocumentVectors } = require("../models/vectors");
|
||||
const { WorkspaceChats } = require("../models/workspaceChats");
|
||||
const {
|
||||
getVectorDbClass,
|
||||
getLLMProvider,
|
||||
getBaseLLMProviderModel,
|
||||
} = require("../utils/helpers");
|
||||
const { getVectorDbClass } = require("../utils/helpers");
|
||||
const { handleFileUpload, handlePfpUpload } = require("../utils/files/multer");
|
||||
const { validatedRequest } = require("../utils/middleware/validatedRequest");
|
||||
const { Telemetry } = require("../models/telemetry");
|
||||
@@ -42,7 +38,6 @@ const { purgeDocument } = require("../utils/files/purgeDocument");
|
||||
const { getModelTag } = require("./utils");
|
||||
const { searchWorkspaceAndThreads } = require("../utils/helpers/search");
|
||||
const { workspaceParsedFilesEndpoints } = require("./workspacesParsedFiles");
|
||||
const AIbitat = require("../utils/agents/aibitat");
|
||||
|
||||
function workspaceEndpoints(app) {
|
||||
if (!app) return;
|
||||
@@ -1064,23 +1059,6 @@ function workspaceEndpoints(app) {
|
||||
}
|
||||
);
|
||||
|
||||
app.get(
|
||||
"/workspace/:slug/is-agent-command-available",
|
||||
[validatedRequest, flexUserRoleValid([ROLES.all]), validWorkspaceSlug],
|
||||
async (_, response) => {
|
||||
try {
|
||||
response.status(200).json({
|
||||
showAgentCommand: await Workspace.isAgentCommandAvailable(
|
||||
response.locals.workspace
|
||||
),
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("Error checking if agent command is available:", error);
|
||||
response.status(500).json({ showAgentCommand: false });
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// Parsed Files in separate endpoint just to keep the workspace endpoints clean
|
||||
workspaceParsedFilesEndpoints(app);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ function isNullOrNaN(value) {
|
||||
*/
|
||||
|
||||
const Workspace = {
|
||||
VALID_CHAT_MODES: ["chat", "query", "automatic"],
|
||||
defaultPrompt: SystemSettings.saneDefaultSystemPrompt,
|
||||
|
||||
// Used for generic updates so we can validate keys in request body
|
||||
@@ -94,8 +93,7 @@ const Workspace = {
|
||||
return n;
|
||||
},
|
||||
chatMode: (value) => {
|
||||
if (!value || !Workspace.VALID_CHAT_MODES.includes(value))
|
||||
return "automatic";
|
||||
if (!value || !["chat", "query"].includes(value)) return "chat";
|
||||
return value;
|
||||
},
|
||||
chatProvider: (value) => {
|
||||
@@ -207,7 +205,6 @@ const Workspace = {
|
||||
const workspace = await prisma.workspaces.create({
|
||||
data: {
|
||||
name: this.validations.name(name),
|
||||
chatMode: "automatic",
|
||||
...this.validateFields(additionalFields),
|
||||
slug,
|
||||
},
|
||||
@@ -612,46 +609,6 @@ const Workspace = {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks if the workspace's chat provider/model waterfall supports native tool calling.
|
||||
* @param {Workspace} workspace - The workspace object to check
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
supportsNativeToolCalling: async function (workspace = {}) {
|
||||
if (!workspace) return false;
|
||||
const { getBaseLLMProviderModel } = require("../utils/helpers");
|
||||
const AIbitat = require("../utils/agents/aibitat");
|
||||
const provider =
|
||||
workspace?.agentProvider ??
|
||||
workspace?.chatProvider ??
|
||||
process.env.LLM_PROVIDER;
|
||||
const model =
|
||||
workspace?.agentModel ??
|
||||
workspace?.chatModel ??
|
||||
getBaseLLMProviderModel({ provider });
|
||||
const agentConfig = { provider, model };
|
||||
const agentProvider = new AIbitat(agentConfig).getProviderForConfig(
|
||||
agentConfig
|
||||
);
|
||||
const nativeToolCalling = await agentProvider.supportsNativeToolCalling?.();
|
||||
return nativeToolCalling;
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks if the agent command is available for a workspace
|
||||
* by checking if the workspace's agent provider supports native tool calling.
|
||||
* - If the workspaces chat provider/model supports native tool calling, then the agent command is NOT available
|
||||
* as it will be assumed the model is capable of handling tool calls.
|
||||
* Otherwise, the agent command is available and the user must opt-in to "@agent" to use tool calls.
|
||||
* @param {Workspace} workspace - The workspace object to check
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
isAgentCommandAvailable: async function (workspace) {
|
||||
if (workspace.chatMode !== "automatic") return true;
|
||||
const nativeToolCalling = await this.supportsNativeToolCalling(workspace);
|
||||
return nativeToolCalling === false;
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = { Workspace };
|
||||
|
||||
@@ -82,14 +82,6 @@ class Provider {
|
||||
return this._client;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this provider supports native OpenAI-compatible tool calling.
|
||||
* @returns {boolean|Promise<boolean>}
|
||||
*/
|
||||
supportsNativeToolCalling() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string} provider - the string key of the provider LLM being loaded.
|
||||
|
||||
@@ -26,15 +26,6 @@ class AnthropicProvider extends Provider {
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this provider supports native OpenAI-compatible tool calling.
|
||||
* - Anthropic always supports tool calling.
|
||||
* @returns {boolean}
|
||||
*/
|
||||
supportsNativeToolCalling() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses the cache control ENV variable
|
||||
*
|
||||
|
||||
@@ -25,15 +25,6 @@ class AzureOpenAiProvider extends Provider {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this provider supports native OpenAI-compatible tool calling.
|
||||
* - Azure OpenAI always supports tool calling.
|
||||
* @returns {boolean}
|
||||
*/
|
||||
supportsNativeToolCalling() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stream a chat completion from Azure OpenAI with tool calling.
|
||||
*
|
||||
|
||||
@@ -58,8 +58,7 @@ class AWSBedrockProvider extends InheritMultiple([Provider, UnTooled]) {
|
||||
supportsNativeToolCalling() {
|
||||
if (this._supportsToolCalling !== null) return this._supportsToolCalling;
|
||||
const supportsToolCalling =
|
||||
process.env.PROVIDER_SUPPORTS_NATIVE_TOOL_CALLING?.includes("bedrock") ||
|
||||
false;
|
||||
process.env.PROVIDER_SUPPORTS_NATIVE_TOOL_CALLING?.includes("bedrock");
|
||||
|
||||
if (supportsToolCalling)
|
||||
this.providerLog("AWS Bedrock native tool calling is ENABLED via ENV.");
|
||||
|
||||
@@ -35,13 +35,16 @@ class GeminiProvider extends Provider {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this provider supports native OpenAI-compatible tool calling.
|
||||
* - Gemini only supports tool calling for Gemini models.
|
||||
* @returns {boolean}
|
||||
*/
|
||||
supportsNativeToolCalling() {
|
||||
return this.supportsToolCalling;
|
||||
get supportsAgentStreaming() {
|
||||
// Tool call streaming results in a 400/503 error for all non-gemini models
|
||||
// using the compatible v1beta/openai/ endpoint
|
||||
if (!this.model.startsWith("gemini")) {
|
||||
this.providerLog(
|
||||
`Gemini: ${this.model} does not support tool call streaming.`
|
||||
);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -61,7 +61,7 @@ class GenericOpenAiProvider extends InheritMultiple([Provider, UnTooled]) {
|
||||
const supportsToolCalling =
|
||||
process.env.PROVIDER_SUPPORTS_NATIVE_TOOL_CALLING?.includes(
|
||||
"generic-openai"
|
||||
) || false;
|
||||
);
|
||||
|
||||
if (supportsToolCalling)
|
||||
this.providerLog(
|
||||
|
||||
@@ -45,8 +45,7 @@ class GroqProvider extends InheritMultiple([Provider, UnTooled]) {
|
||||
supportsNativeToolCalling() {
|
||||
if (this._supportsToolCalling !== null) return this._supportsToolCalling;
|
||||
const supportsToolCalling =
|
||||
process.env.PROVIDER_SUPPORTS_NATIVE_TOOL_CALLING?.includes("groq") ||
|
||||
false;
|
||||
process.env.PROVIDER_SUPPORTS_NATIVE_TOOL_CALLING?.includes("groq");
|
||||
|
||||
if (supportsToolCalling)
|
||||
this.providerLog("Groq supports native tool calling is ENABLED via ENV.");
|
||||
|
||||
@@ -66,8 +66,7 @@ class LemonadeProvider extends InheritMultiple([Provider, UnTooled]) {
|
||||
|
||||
// Labels can be missing for tool calling models, so we also check if ENV flag is set
|
||||
const supportsToolCallingFlag =
|
||||
process.env.PROVIDER_SUPPORTS_NATIVE_TOOL_CALLING?.includes("lemonade") ||
|
||||
false;
|
||||
process.env.PROVIDER_SUPPORTS_NATIVE_TOOL_CALLING?.includes("lemonade");
|
||||
if (supportsToolCallingFlag) {
|
||||
this.providerLog(
|
||||
"Lemonade supports native tool calling is ENABLED via ENV."
|
||||
|
||||
@@ -45,8 +45,7 @@ class LiteLLMProvider extends InheritMultiple([Provider, UnTooled]) {
|
||||
supportsNativeToolCalling() {
|
||||
if (this._supportsToolCalling !== null) return this._supportsToolCalling;
|
||||
const supportsToolCalling =
|
||||
process.env.PROVIDER_SUPPORTS_NATIVE_TOOL_CALLING?.includes("litellm") ||
|
||||
false;
|
||||
process.env.PROVIDER_SUPPORTS_NATIVE_TOOL_CALLING?.includes("litellm");
|
||||
|
||||
if (supportsToolCalling)
|
||||
this.providerLog(
|
||||
|
||||
@@ -45,8 +45,7 @@ class LocalAiProvider extends InheritMultiple([Provider, UnTooled]) {
|
||||
supportsNativeToolCalling() {
|
||||
if (this._supportsToolCalling !== null) return this._supportsToolCalling;
|
||||
const supportsToolCalling =
|
||||
process.env.PROVIDER_SUPPORTS_NATIVE_TOOL_CALLING?.includes("localai") ||
|
||||
false;
|
||||
process.env.PROVIDER_SUPPORTS_NATIVE_TOOL_CALLING?.includes("localai");
|
||||
|
||||
if (supportsToolCalling)
|
||||
this.providerLog(
|
||||
|
||||
@@ -30,15 +30,6 @@ class OpenAIProvider extends Provider {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this provider supports native OpenAI-compatible tool calling.
|
||||
* - OpenAI always supports tool calling.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
supportsNativeToolCalling() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the messages to the OpenAI API Responses format.
|
||||
* - If the message is our internal `function` type, then we need to map it to a function call + output format
|
||||
|
||||
@@ -51,9 +51,7 @@ class OpenRouterProvider extends InheritMultiple([Provider, UnTooled]) {
|
||||
supportsNativeToolCalling() {
|
||||
if (this._supportsToolCalling !== null) return this._supportsToolCalling;
|
||||
const supportsToolCalling =
|
||||
process.env.PROVIDER_SUPPORTS_NATIVE_TOOL_CALLING?.includes(
|
||||
"openrouter"
|
||||
) || false;
|
||||
process.env.PROVIDER_SUPPORTS_NATIVE_TOOL_CALLING?.includes("openrouter");
|
||||
|
||||
if (supportsToolCalling)
|
||||
this.providerLog(
|
||||
|
||||
@@ -3,7 +3,6 @@ const {
|
||||
WorkspaceAgentInvocation,
|
||||
} = require("../../models/workspaceAgentInvocation");
|
||||
const { writeResponseChunk } = require("../helpers/chat/responses");
|
||||
const { Workspace } = require("../../models/workspace");
|
||||
|
||||
async function grepAgents({
|
||||
uuid,
|
||||
@@ -13,15 +12,8 @@ async function grepAgents({
|
||||
user = null,
|
||||
thread = null,
|
||||
}) {
|
||||
let nativeToolingEnabled = false;
|
||||
|
||||
// If the workspace is in automatic mode, check if the workspace supports native tooling
|
||||
// to determine if the agent flow should be used or not.
|
||||
if (workspace?.chatMode === "automatic")
|
||||
nativeToolingEnabled = await Workspace.supportsNativeToolCalling(workspace);
|
||||
|
||||
const agentHandles = WorkspaceAgentInvocation.parseAgents(message);
|
||||
if (agentHandles.length > 0 || nativeToolingEnabled) {
|
||||
if (agentHandles.length > 0) {
|
||||
const { invocation: newInvocation } = await WorkspaceAgentInvocation.new({
|
||||
prompt: message,
|
||||
workspace: workspace,
|
||||
|
||||
@@ -13,13 +13,13 @@ const {
|
||||
sourceIdentifier,
|
||||
} = require("./index");
|
||||
|
||||
const VALID_CHAT_MODE = ["automatic", "chat", "query"];
|
||||
const VALID_CHAT_MODE = ["chat", "query"];
|
||||
|
||||
async function streamChatWithWorkspace(
|
||||
response,
|
||||
workspace,
|
||||
message,
|
||||
chatMode = "automatic",
|
||||
chatMode = "chat",
|
||||
user = null,
|
||||
thread = null,
|
||||
attachments = []
|
||||
|
||||
Reference in New Issue
Block a user