From 41f085450cf798c912b8f229cf37ac810f29443e Mon Sep 17 00:00:00 2001 From: Sayo Date: Thu, 13 Feb 2025 14:15:05 +0530 Subject: [PATCH] add tests for anthropic --- packages/plugin-anthropic/src/index.ts | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/packages/plugin-anthropic/src/index.ts b/packages/plugin-anthropic/src/index.ts index 7cdde4c620..ffac2c7b5d 100644 --- a/packages/plugin-anthropic/src/index.ts +++ b/packages/plugin-anthropic/src/index.ts @@ -84,6 +84,34 @@ export const anthropicPlugin: Plugin = { return text; } }, + tests: [ + { + name: "anthropic_plugin_tests", + tests: [ + { + name: 'test_text_large', + fn: async (runtime) => { + const { text } = await runtime.generateText({ + model: runtime.models[ModelClass.TEXT_SMALL], + prompt: "What is the nature of reality?", + }); + console.log(text, ModelClass.TEXT_SMALL); + } + }, + { + name: 'test_text_large', + fn: async (runtime) => { + const { text } = await runtime.generateText({ + model: runtime.models[ModelClass.TEXT_LARGE], + prompt: "What is the nature of reality in 10 words?", + }); + console.log(text, ModelClass.TEXT_LARGE); + } + } + ] + } + ] + }; export default anthropicPlugin;