Equity Strategist
NewUpdated
The Equity Strategist is a public-markets analyst agent. Ask it about individual stocks — valuation, recommendations, supporting rationale — through the standard chat.responses.create entry point with model: EQUITY_MODEL.
Make your first call
import { Chaos, EQUITY_MODEL } from '@chaoslabs/ai-sdk';
const chaos = new Chaos({ apiKey: process.env.CHAOS_API_KEY! });
const response = await chaos.chat.responses.create({
model: EQUITY_MODEL,
input: [{ type: 'message', role: 'user', content: 'Is NVDA fairly valued at the current price?' }],
metadata: { user_id: 'demo-user', session_id: 'demo-session' },
});
for (const message of response.messages ?? []) {
if (message.type === 'block') {
console.log(message.data.block);
}
}Copy code
Open in Cursor
Open in VS Code
Open in v0
Open in Claude
Open in ChatGPT
What you get back
Responses are V2 message envelopes. The agent emits text messages (interim thinking) and block messages (structured payload). For Equity Strategist, the block payload is one of two shapes today:
info—{ type: 'info', content: string }— text rationale or summary.table—{ type: 'table', title?: string, tableHeaders: string[], tableRows: unknown[][] }— stock comparison grid (e.g. valuation metrics). Values arrive in wire shape — strings, numbers, or null. Cast or coerce at the consumption site.
A terminal status message with data.status === 'done' signals end of stream.
Multi-turn conversations
Equity Strategist supports multi-turn through the Conversation class:
import { Chaos, Conversation, EQUITY_MODEL } from '@chaoslabs/ai-sdk';
const chaos = new Chaos({ apiKey: process.env.CHAOS_API_KEY! });
const conversation = new Conversation(chaos, {
model: EQUITY_MODEL,
userId: 'demo-user',
});
await conversation.send('Is NVDA fairly valued?');
await conversation.send('Compare it with AMD on the same metrics.');
for (const message of conversation.messages) {
console.log(message);
}Copy code
Open in Cursor
Open in VS Code
Open in v0
Open in Claude
Open in ChatGPT
Next steps
Was this helpful?