Vercel AI compatibility
Heyo - just dove into Composio today. Followed quickstarts for Vercel AI Toolsets and everything is working except that im getting empty array every time I test the "list user repository" action.
When testing this action with the same username & credentials on the dashboard it works:
const tools = await toolset.getTools({
actions: ["GITHUB_LIST_REPOSITORIES_FOR_A_USER"]
});
const { text } = await streamText({
model: registry.languageModel("openai:gpt-4o-mini"),
messages: [{ role: "user", content:
What are the first 5 repos for ${username}? }],
tools,
maxSteps: 5,
onStepFinish({ toolCalls, toolResults }) {
console.log({ toolCalls, toolResults })
},
})
console.log("text: ", await text)
1 Reply
xenial-blackOP•4mo ago
Also I noticed the examples use
toolset.get_tools
w/ an entity id passed in as second param - but the latest sdk only has toolset.getTools
and doesnt take entity ID as a valid arg anymore.
Is this related to my issue or no?
figured it out - looks like I needed to manually update entity ID after calling 'setupUserConnectionIfNotExists':
// Setup entity and ensure connection
const entity = await toolset.client.getEntity(entityName);
await setupUserConnectionIfNotExists(entity.id, "github");
-> toolset.entityId = entity.id;