Skip to content

Add forecast endpoint#184

Merged
dschwarz26 merged 12 commits intomainfrom
forecast-sdk
Feb 24, 2026
Merged

Add forecast endpoint#184
dschwarz26 merged 12 commits intomainfrom
forecast-sdk

Conversation

@dschwarz26
Copy link
Contributor

@dschwarz26 dschwarz26 commented Feb 22, 2026

Screenshot 2026-02-22 at 8 56 29 PM

dschwarz26 and others added 2 commits February 22, 2026 15:20
- Add forecast() and forecast_async() to everyrow.ops
- Add everyrow_forecast MCP tool with ForecastInput model
- Regenerate API client from latest engine OpenAPI spec (adds forecast
  endpoint, list sessions, cancel task)
- Add integration test for forecast operation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dschwarz26 dschwarz26 changed the title feat: add forecast operation feat: add forecast endpoint Feb 23, 2026
@dschwarz26 dschwarz26 requested a review from rgambee February 23, 2026 04:57
async def forecast(
task: str,
session: Session | None = None,
input: DataFrame | UUID | TableResult | None = None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not something to fix in this PR, but why do our blocking operations accept and default to input = None, only to raise an exception if it is in fact None? I'll look into changing that in another PR.

Then two forecasting models (Gemini + Opus Thinking) synthesize all research into
a probability (0-100%, median of both) and rationale for each row.

Output columns added: `rationale` (str) and `probability` (int, 0-100).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the field is called probability, I would expect it to be in the range 0 to 1. If we really do want to return a percentage, I'd name it probability_pct. I leave it to others with more forecasting background to choose whether 0 to 1 or 0 to 100 is the more standard range.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting point. I'm not sure.

dschwarz26 and others added 2 commits February 23, 2026 13:27
- Replace implementation-detail docstring with user-facing description
  matching SDK style (rgambee review)
- Improve input_csv field description for ForecastInput (rgambee review)
- Update manifest description to match new docstring
- Run ruff format on generated API client files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Revert unrelated formatting changes from openapi-python-client
regeneration. Keep only the genuinely new files (forecast, cancel_task,
list_sessions) and minimal __init__.py additions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
session=internal_session,
input=input,
)
result = await cohort_task.await_result(on_progress=print_progress)

This comment was marked as outdated.

dschwarz26 and others added 4 commits February 23, 2026 15:20
These endpoints were picked up by the OpenAPI client regeneration but
are not part of the forecast feature. cancel_task will be added by #186.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Prevents test from going stale when the resolution date passes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The forecast operation doesn't need a task instruction the way other ops
do — a well-formed question with resolution criteria is self-contained.
Rename to `context` to communicate that it provides optional batch-level
framing, and make it default to None.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dschwarz26 dschwarz26 changed the title feat: add forecast endpoint Add forecast endpoint Feb 23, 2026
dschwarz26 and others added 4 commits February 23, 2026 15:45
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dschwarz26 dschwarz26 merged commit 6f9ccef into main Feb 24, 2026
5 of 6 checks passed
@dschwarz26 dschwarz26 deleted the forecast-sdk branch February 24, 2026 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants