-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds simple POST endpoint at /runSquiggle, and adds open-api.json schema #2523
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
Apply Sweep Rules to your PR?
|
This is meant to close #2521 |
@@ -0,0 +1,43 @@ | |||
import { runSquiggle } from "@/graphql/queries/runSquiggle"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo: I assume I should make a helper here
import { runSquiggle } from "@/graphql/queries/runSquiggle"; | ||
import { NextRequest, NextResponse } from "next/server"; | ||
|
||
export function GET(request: NextRequest) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo: remove
@@ -21,6 +25,20 @@ export const squiggleValueToJSON = (value: SqValue) => { | |||
if (value instanceof Map) { | |||
return Object.fromEntries(value.entries()); | |||
} | |||
if (value instanceof SqLambda) { | |||
return value.toString(); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo: Also do this for calculators, and if there are any other responses that have Lambdas
* main: (533 commits) Hot fix for method scale remove import assertion Added back scale default constants Added changeset ScaleShift -> Method Added back defaults to SqScale First pass on refactoring Scale convert textmate-grammar to a public package; highlight squiggle code in markdown MarkdownViewer uses shiki instead of react-syntax-highlighter Finishing touches to Tag.doc Changing @description to @doc Fixes from CR fix version order; fix insertVersion script Fixed minor import error Refactored text size and color data to be in MarkdownViewer support decorators on exported vars Update packages/website/scripts/compileDocsForLLM.js Update tag.ts Final touches to LLMPrompt page support 0.9.0 in ModelExportPage ...
* serialization-test: Fixed some bugs that I'm surprised were ever there Merged with main Deleted unused file Minor refactors to SimpleValue Some simple JSON tests Moved JSON methods to Danger Cleaning up SimpleValue Fixed map issue Restructure to fix most tests Moving SimpleValue code Simplifying SimpleValue Fixed merge with main Experiment with adding serialization
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2523 +/- ##
==========================================
+ Coverage 70.15% 70.17% +0.02%
==========================================
Files 119 119
Lines 6748 6750 +2
Branches 1436 1436
==========================================
+ Hits 4734 4737 +3
+ Misses 2006 2005 -1
Partials 8 8 ☔ View full report in Codecov by Sentry. |
const project = SqProject.create(); | ||
const env = { | ||
sampleCount: 1000, // int | ||
xyPointLength: 1000, // int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could see making this configurable later
I'm going to merge, so I can make sure it's working with ChatGPT. Happy to make changes later on. |
This is pretty basic, but should be good enough for ChatGPT