vercel-ai-prediction-markets
v1.0.0
Published
Vercel AI SDK tools for prediction market data. Drop-in tools for generateText, streamText, and useChat.
Maintainers
Readme
vercel-ai-prediction-markets
Vercel AI SDK tools for prediction market data. Drop-in tools for generateText, streamText, and useChat.
Install
npm install vercel-ai-prediction-markets aiWith generateText
import { generateText } from 'ai'
import { openai } from '@ai-sdk/openai'
import { predictionMarketTools } from 'vercel-ai-prediction-markets'
const { text } = await generateText({
model: openai('gpt-4o'),
tools: predictionMarketTools(),
prompt: 'What are the key geopolitical risks right now?',
})With streamText (Next.js route)
import { streamText } from 'ai'
import { openai } from '@ai-sdk/openai'
import { predictionMarketTools } from 'vercel-ai-prediction-markets'
export async function POST(req: Request) {
const { messages } = await req.json()
const result = streamText({
model: openai('gpt-4o'),
tools: predictionMarketTools(),
messages,
})
return result.toDataStreamResponse()
}Tools
| Tool | Description |
|------|-------------|
| getWorldState | Full prediction market world state |
| getUncertaintyIndex | Four-signal uncertainty index |
| getMarketEdges | Actionable mispricings |
| getMarketDetail | Single market with orderbook |
| getWorldChanges | Incremental changes |
License
MIT — SimpleFunctions
