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

Ai Log Improvements #3412

Merged
merged 4 commits into from
Oct 9, 2024
Merged

Ai Log Improvements #3412

merged 4 commits into from
Oct 9, 2024

Conversation

OAGr
Copy link
Contributor

@OAGr OAGr commented Oct 8, 2024

  • Adds the workflowID and stepNumber to Squiggle AI logs.
  • Cleans up colors and writeouts of Squiggle AI logs. Only shows the first few lines of LLM outputs, and only shows the message type in a color, instead of everything. (It was often hard to read)
  • Adds 60s timeout for LLM calls. I'm paranoid that some are dropping.
  • Adds log messages at the beginning and ending of AI steps. Trying to find where things are dropping. We can remove these later if it seems more stable.

Closes #3411

OAGr added 3 commits October 8, 2024 10:29
* main:
  more tests
  clean up whitespace handling in peggy grammar
  Trying to fix comment duplication bug
Copy link

changeset-bot bot commented Oct 8, 2024

⚠️ No Changeset found

Latest commit: 19acf40

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 Oct 8, 2024

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

Name Status Preview Updated (UTC)
quri-hub ✅ Ready (Inspect) Visit Preview Oct 8, 2024 6:03pm
3 Skipped Deployments
Name Status Preview Updated (UTC)
quri-ui ⬜️ Ignored (Inspect) Visit Preview Oct 8, 2024 6:03pm
squiggle-components ⬜️ Ignored (Inspect) Visit Preview Oct 8, 2024 6:03pm
squiggle-website ⬜️ Ignored (Inspect) Visit Preview Oct 8, 2024 6:03pm

@OAGr OAGr changed the title Ai log improvements Ai Log Improvements Oct 8, 2024
@OAGr OAGr marked this pull request as ready for review October 8, 2024 18:00
@OAGr OAGr requested a review from berekuk as a code owner October 8, 2024 18:00
@OAGr
Copy link
Contributor Author

OAGr commented Oct 9, 2024

I want to merge this to better check errors that we've been seeing. I think it's pretty safe, but comments/improvements later would be appreciated, of course.

@OAGr OAGr merged commit 8e49796 into main Oct 9, 2024
6 checks passed
@OAGr OAGr deleted the ai-log-improvements branch October 9, 2024 17:30
message: `Step "${this.template.name}" started`,
});

await this._run();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Separation of concerns between run and _run is leaking here in several ways that make me think that _run should be inlined:

  • "Step started" message above would happen even if _run decided not to run (see this.state.kind !== "PENDING" check at the start of _run)
  • I don't think this.state.kind !== "PENDING" check below, in completionMessage construction, is needed — _run always ends with non-pending state

@@ -19,8 +18,6 @@ export function getLogEntryFullName(entry: LogEntry): string {
return "⚠️ Warning";
case "error":
return "🚫 System Error";
case "codeRunError":
return "❌ Code Run Error";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Glas to see this entry type is gone

@@ -97,7 +97,7 @@ export class LLMStepInstance<const Shape extends StepShape = StepShape> {
) {
this.startTime = Date.now();
this.id = crypto.randomUUID();
this.logger = new Logger();
this.logger = new Logger(this.workflow.id, this.workflow.getStepCount());
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'll have to partially revert this for my upcoming PR - in it, LLMStepInstance is not parameterized with workflow, to avoid circular references, I pass the workflow in step.run() as a parameter instead.

But I see a way how to do that and keep the features you cared about here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Show & Log Squiggle AI Workflow IDs
2 participants