transitive-bullshit / agentic

AI agent stdlib that works with any LLM and TypeScript AI SDK.
MIT License
16.07k stars 2.11k forks source link

Bug: `createAISDKTools` result in `TypeError: Cannot read properties of undefined (reading 'name')` #646

Closed nirtamir2 closed 1 month ago

nirtamir2 commented 1 month ago

I tried to run Wikipedia agent:

import { WikipediaClient } from "@agentic/stdlib";
import { createAISDKTools } from "@agentic/stdlib/ai-sdk";

const wikipedia = new WikipediaClient();
const tools = createAISDKTools(wikipedia);

And I got an error here after executing createAISDKTools(wikipedia)

TypeError: Cannot read properties of undefined (reading 'name')

Same happens with weather client too.

transitive-bullshit commented 1 month ago

Thanks for the report @nirtamir2

I was able to repro the bug, but the odd thing is that it doesn't repro on all platforms. It seems to be an issue with instanceof not working correctly for the transpiled JS classes.

Anyhow, I made AIFunctionSet more robust and added some tests to ensure this doesn't regress. This should be fixed in the latest release: https://github.com/transitive-bullshit/agentic/releases/tag/v6.2.4

Thanks!