Compare commits

...

6 Commits

Author SHA1 Message Date
Emanuel Ferreira 6a7353f033 Trigger Build 2024-03-22 09:22:28 -03:00
Emanuel Ferreira c54bbfa5d4 changepath 2024-03-22 09:10:45 -03:00
Emanuel Ferreira 451b1a28e1 pnpm rf 2024-03-22 09:04:35 -03:00
Emanuel Ferreira 8676b6fc62 Trigger Build 2024-03-22 08:59:04 -03:00
Emanuel Ferreira 5c38e1a79a fix: assistant message 2024-03-22 08:40:42 -03:00
Marcus Schiesser e4f93486b5 feat: use claude3 with react agent 2024-03-22 10:08:40 +07:00
4 changed files with 15 additions and 4 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"llamaindex": patch
---
feat: use claude3 with react agent
+8 -2
View File
@@ -1,4 +1,4 @@
import { FunctionTool, ReActAgent } from "llamaindex";
import { Anthropic, FunctionTool, ReActAgent } from "llamaindex";
// Define a function to sum two numbers
function sumNumbers({ a, b }: { a: number; b: number }): number {
@@ -56,8 +56,14 @@ async function main() {
parameters: divideJSON,
});
// Create an OpenAIAgent with the function tools
const anthropic = new Anthropic({
apiKey: process.env.ANTHROPIC_API_KEY,
model: "claude-3-opus",
});
// Create an ReActAgent with the function tools
const agent = new ReActAgent({
llm: anthropic,
tools: [functionTool, functionTool2],
verbose: true,
});
+1 -1
View File
@@ -60,7 +60,7 @@ export class ReActChatFormatter implements BaseAgentChatFormatter {
} else {
message = {
content: reasoningStep.getContent(),
role: "system",
role: "assistant",
};
}
+1 -1
View File
@@ -79,7 +79,7 @@
"scripts": {
"copy": "cp -r ../../README.md ../../LICENSE .",
"update:deps": "node scripts/update-deps.js",
"build:core": "pnpm --filter llamaindex build && cp -r ../core/dist . && rm -fr dist/cjs",
"build:core": "pnpm --filter llamaindex build && cp -r ../core/dist . && rm -rf dist/cjs",
"build": "pnpm run update:deps && pnpm run build:core && pnpm copy"
}
}