Ver código fonte

fix/Add isModel flag to AgentTools component (#2876)

tags/0.5.10
Yeuoly 1 ano atrás
pai
commit
01108e6172
Nenhuma conta vinculada ao e-mail do autor do commit

+ 1
- 0
web/app/components/app/configuration/config/agent/agent-tools/index.tsx Ver arquivo

setting={currentTool?.tool_parameters as any} setting={currentTool?.tool_parameters as any}
collection={currentTool?.collection as Collection} collection={currentTool?.collection as Collection}
isBuiltIn={currentTool?.collection?.type === CollectionType.builtIn} isBuiltIn={currentTool?.collection?.type === CollectionType.builtIn}
isModel={currentTool?.collection?.type === CollectionType.model}
onSave={handleToolSettingChange} onSave={handleToolSettingChange}
onHide={() => setIsShowSettingTool(false)} onHide={() => setIsShowSettingTool(false)}
/>) />)

+ 10
- 5
web/app/components/app/configuration/config/agent/agent-tools/setting-built-in-tool.tsx Ver arquivo

(async () => { (async () => {
setIsLoading(true) setIsLoading(true)
try { try {
const list = isBuiltIn
? await fetchBuiltInToolList(collection.name)
: isModel
? await fetchModelToolList(collection.name)
: await fetchCustomToolList(collection.name)
const list = await new Promise<Tool[]>((resolve) => {
(async function () {
if (isModel)
resolve(await fetchModelToolList(collection.name))
else if (isBuiltIn)
resolve(await fetchBuiltInToolList(collection.name))
else
resolve(await fetchCustomToolList(collection.name))
}())
})
setTools(list) setTools(list)
const currTool = list.find(tool => tool.name === toolName) const currTool = list.find(tool => tool.name === toolName)
if (currTool) { if (currTool) {

Carregando…
Cancelar
Salvar