getting tools and model
This commit is contained in:
parent
f432fd6c3f
commit
9d9eab5db0
2 changed files with 14 additions and 2 deletions
|
|
@ -49,3 +49,13 @@ export async function getTools() {
|
||||||
});
|
});
|
||||||
return Promise.all(promises);
|
return Promise.all(promises);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function getModels() {
|
||||||
|
const promises = (await axios.get("http://localhost:5003/list/llms")).data.map(async (value, index) => {
|
||||||
|
const prompt = await axios.get("http://localhost:5003/templates/llm", {
|
||||||
|
params: { name: value },
|
||||||
|
});
|
||||||
|
return { name: value, type: "modelNode", ...prompt.data };
|
||||||
|
});
|
||||||
|
return Promise.all(promises);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import ChainNode from "../../CustomNodes/ChainNode";
|
||||||
import ToolsNode from "../../CustomNodes/ToolsNode";
|
import ToolsNode from "../../CustomNodes/ToolsNode";
|
||||||
import MemoryNode from "../../CustomNodes/MemoryNode";
|
import MemoryNode from "../../CustomNodes/MemoryNode";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import {getPrompts, getChains,getAgents,getMemories} from "../../controllers/NodesServices";
|
import {getPrompts, getChains,getAgents,getMemories, getModels,getTools} from "../../controllers/NodesServices";
|
||||||
import { generateUiNode } from "../../controllers/UiGenerator";
|
import { generateUiNode } from "../../controllers/UiGenerator";
|
||||||
|
|
||||||
const nodeTypes = {
|
const nodeTypes = {
|
||||||
|
|
@ -28,10 +28,12 @@ const nodeTypes = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function FlowPage() {
|
export default function FlowPage() {
|
||||||
getPrompts().then(result=>result.forEach(prompt=>console.log(generateUiNode(prompt))))
|
// getPrompts().then(result=>result.forEach(prompt=>console.log(prompt)))
|
||||||
// getChains().then(result=>console.log(result))
|
// getChains().then(result=>console.log(result))
|
||||||
// getAgents().then(result=>console.log(result))
|
// getAgents().then(result=>console.log(result))
|
||||||
// getMemories().then(result=>console.log(result))
|
// getMemories().then(result=>console.log(result))
|
||||||
|
// getModels().then(result=>result.forEach(model=>console.log(model)))
|
||||||
|
getTools().then(result=>result.forEach(tool=>console.log(tool)))
|
||||||
|
|
||||||
// outside component to avoid render trigger
|
// outside component to avoid render trigger
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue