Repository navigation
feat(integrations): add Odds-API.io block and tools - #10422
odds-api-io wants to merge 2 commits into
Conversation
|
@odds-api-io is attempting to deploy a commit to the Sim Team on Vercel. A member of the Team first needs to authorize it. |
[Medium impact] The change adds a bounded set of Odds-API.io reads for Sim workflows. Fix the discarded agent filters before merging. FindingsSummaryAdds Odds-API.io with 13 read-only operations, saved API-key credentials, SDK names, icons, and catalog/docs entries.
|
| status: operation === SEARCH_EVENTS ? searchStatus : params.status, | ||
| all: operation === GET_LEAGUES ? includeInactiveLeagues === true : undefined, |
There was a problem hiding this comment.
Search Events exposes status to the model, but this mapper replaces it with searchStatus. Get Leagues exposes all, but the mapper replaces it with includeInactiveLeagues === true. When those canvas fields are unset, the model's status: 'live' or all: true is discarded. Agents can search upcoming events instead of live ones or omit leagues they asked to include.
Preserve the tool argument when its canvas counterpart is absent, or use the same parameter name on both surfaces.
There was a problem hiding this comment.
Fixed in 146ff9a. On a tool call the mapper now keeps the model's own status and all arguments and only falls back to the Search In dropdown or the Include Leagues Without Events switch when the model gave none; the canvas still uses the fields. Covered by apps/sim/blocks/blocks/odds_api_io.test.ts.
| try { | ||
| data = JSON.parse(text) | ||
| } catch { | ||
| data = null | ||
| } |
There was a problem hiding this comment.
readOddsApiIoJson returns null when JSON parsing fails. List operations turn that into an empty list with success: true; single-event operations return records filled with nulls. If the API sends an unreadable successful response, workflows mistake it for valid empty data and skip error branches and retries.
Throw a clear error for invalid or unexpectedly empty JSON instead.
There was a problem hiding this comment.
Fixed in 146ff9a. readOddsApiIoJson now throws "returned a response that is not valid JSON" for a successful response whose body is empty or unparseable instead of returning null, so list operations no longer turn it into an empty result. Covered by apps/sim/tools/odds_api_io/utils.test.ts.
Summary
Adds an Odds-API.io integration: a block with 13 read-only operations backed by
apps/sim/tools/odds_api_io, a saved API-key credential (token service account verified againstGET /v3/bookmakers/selected), the icon, the generated catalog/docs artifacts and a docs page with a hand-written intro.Operations: Get Events, Search Events, Get Event, Get Event Odds, Get Multi Odds, Get Value Bets, Get Dropping Odds, Get Arbitrage Bets, Get Historical Events, Get Closing Lines, Get Sports, Get Leagues, Get Bookmakers. Every tool maps to a documented
https://api.odds-api.io/v3endpoint (OpenAPI: https://api.odds-api.io/v3/docs/doc.json) and declareseffect: 'read'.Product update (if relevant)
Anyone building sports or betting-data workflows can now pull pre-match and live odds from 500+ bookmakers across 37 sports, compare prices across bookmakers, archive closing lines, and run the value-bet, dropping-odds and arbitrage scanners from a Sim block. Requires an Odds-API.io API key (https://odds-api.io/pricing). Docs page:
apps/docs/content/docs/integrations/odds_api_io.mdx.Type of Change
Testing
bunx tsc --noEmitinapps/sim: cleanbun run generate(bun 1.4.4) and the full generated output is committed; the docs intro survives a regeneratecheck-canvas-sentences --block=odds_api_io,check:bare-icons,check:tool-effects,check:tool-request-boundary,check:tool-param-reachability,check:sdk-names,check:integration-catalog,check:deployment-config,check:docs,check:icon-paths,check:icon-path-precision,check:fork-dependent-coverage,check:block-successors,apps/sim/scripts/check-block-registry.ts origin/staging: all passcheck:tool-registry-boundary: the 16 new modules pushed the blocks routes 2 modules past the allowed growth, so the baseline was re-recorded with--update-baseline(the only change inscripts/check-tool-registry-boundary.baseline.jsonis module counts)vitest run blocks/blocks.test.ts tools/request-transport.test.ts lib/credentials/token-service-accounts/server.test.ts: 68 passed{"error":"You need to provide a valid apiKey"}sim workflows run --dry); reviewers with an Odds-API.io key may want to exercise Get Events and Get Event Odds onceChecklist