openai-agents-prediction-markets
v1.0.0
Published
OpenAI function-calling tools for prediction market data. Works with Chat Completions API and OpenAI Agents SDK.
Maintainers
Readme
openai-agents-prediction-markets
OpenAI function-calling tools for prediction market data. Works with Chat Completions API and OpenAI Agents SDK.
Install
npm install openai-agents-prediction-marketsQuick Start
import OpenAI from 'openai'
import { predictionMarketFunctions, handleFunctionCall } from 'openai-agents-prediction-markets'
const openai = new OpenAI()
const response = await openai.chat.completions.create({
model: 'gpt-4o',
messages: [{ role: 'user', content: 'What are the geopolitical risks?' }],
tools: predictionMarketFunctions,
})
for (const call of response.choices[0].message.tool_calls || []) {
const result = await handleFunctionCall(call.function.name, JSON.parse(call.function.arguments))
// Feed result back to the model...
}Functions
| Function | Description |
|----------|-------------|
| get_world_state | Full prediction market world state |
| get_uncertainty_index | Four-signal uncertainty index |
| get_market_edges | Actionable mispricings |
| get_market_detail | Single market with orderbook |
| get_world_changes | Incremental changes |
License
MIT — SimpleFunctions
