Skip to content
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

Fixing LLM generation, using JSON #2915

Merged
merged 6 commits into from
Jan 5, 2024
Merged

Fixing LLM generation, using JSON #2915

merged 6 commits into from
Jan 5, 2024

Conversation

OAGr
Copy link
Contributor

@OAGr OAGr commented Jan 3, 2024

The documentation for the LLM reads like this now:

We could definitely optimize further, but this fixes the main issue (almost all docs were lost from the recent changes, as text was taken away from the API files)

...
---
description: Point set distributions are one of the three distribution formats. They are stored as a list of x-y coordinates representing both discrete and continuous distributions.
---
import { SquiggleEditor, FnDocumentationFromName } from "@quri/squiggle-components";

# PointSet
Point set distributions are one of the three distribution formats. They are stored as a list of x-y coordinates representing both discrete and continuous distributions.

One complication is that it's possible to represent invalid probability distributions in the point set format. For example, you can represent shapes with negative values, or shapes that are not normalized.

## Constructors

{
  "name": "make",
  "nameSpace": "PointSet",
  "requiresNamespace": true,
  "examples": [
    "PointSet.make(normal(5,10))",
    "PointSet(3)"
  ],
  "signatures": [
    "(Dist) => PointSetDist",
    "(Number) => PointSetDist"
  ],
  "isUnit": false
}
{
  "name": "makeContinuous",
  "nameSpace": "PointSet",
  "requiresNamespace": true,
  "examples": [
    "PointSet.makeContinuous([\n  {x: 0, y: 0.2},\n  {x: 1, y: 0.7},\n  {x: 2, y: 0.8},\n  {x: 3, y: 0.2}\n])"
  ],
  "signatures": [
    "(List({x: Number, y: Number})) => PointSetDist"
  ],
  "isUnit": false
}
{
  "name": "makeDiscrete",
  "nameSpace": "PointSet",
  "requiresNamespace": true,
  "examples": [
    "PointSet.makeDiscrete([\n  {x: 0, y: 0.2},\n  {x: 1, y: 0.7},\n  {x: 2, y: 0.8},\n  {x: 3, y: 0.2}\n])"
  ],
  "signatures": [
    "(List({x: Number, y: Number})) => PointSetDist"
  ],
  "isUnit": f

Copy link

changeset-bot bot commented Jan 3, 2024

⚠️ No Changeset found

Latest commit: 87d7535

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Jan 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
quri-hub ✅ Ready (Inspect) Visit Preview Jan 5, 2024 7:52pm
squiggle-components ✅ Ready (Inspect) Visit Preview Jan 5, 2024 7:52pm
squiggle-website ✅ Ready (Inspect) Visit Preview Jan 5, 2024 7:52pm
1 Ignored Deployment
Name Status Preview Updated (UTC)
quri-ui ⬜️ Ignored (Inspect) Visit Preview Jan 5, 2024 7:52pm

Copy link
Contributor

sweep-ai bot commented Jan 3, 2024

Apply Sweep Rules to your PR?

  • Apply: All docstrings and comments should be up to date.
  • Apply: Ensure that all variables and functions have descriptive names.
  • Apply: Avoid using magic numbers or hard-coded values in the code.

Base automatically changed from doc-refactor to main January 4, 2024 02:31
Copy link
Contributor

sweep-ai bot commented Jan 5, 2024

Sweeping

Resolving merge conflicts: track the progress here.

I'm currently resolving the merge conflicts in this PR. I will stack a new PR once I'm done.

[!CAUTION]

An error has occurred: Cmd('git') failed due to: exit code(128)
cmdline: git commit
stderr: 'Author identity unknown

*** Please tell me who you are.

Run

git config --global user.email "[email protected]"
git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'root@1b1e655815b6.(none)')' (tracking ID: b76f10354e)

Copy link
Collaborator

@berekuk berekuk left a comment

Choose a reason for hiding this comment

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

I've converted the scripts to TS (and also fixed turbo misconfiguration).

const documentationFiles = await glob(
"./src/pages/docs/{Api,Guides}/*.{md,mdx}"
"./src/pages/docs/{Guides}/*.{md,mdx}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are all API files in templates yet? I thought there's some stuff that's still not converted, https://github.com/quantified-uncertainty/squiggle/tree/1ff759c7f7aa015dbe61d638676053fe140b5ebc/packages/website/src/pages/docs/Api

Copy link
Contributor Author

@OAGr OAGr Jan 5, 2024

Choose a reason for hiding this comment

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

You're right - not everything it converted. However, it's not that much, and will mostly get converted soon anyway. Plus, this fix is better than how it was previously.

@OAGr
Copy link
Contributor Author

OAGr commented Jan 5, 2024

I've converted the scripts to TS (and also fixed turbo misconfiguration).

Many thanks! I had a really annoying time trying to do that myself.

* main:
  Fixed isEqual for Squiggle Lists
  Addressed CR comments
  Update packages/website/templates.mjs
  Update packages/squiggle-lang/src/fr/danger.ts
  Fixed css formatting
  Fixed padding and background color issues with documentation in editor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants