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

fix: use llmMessage JSON schema in prompt #579

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

codeincontext
Copy link
Collaborator

@codeincontext codeincontext commented Mar 6, 2025

On a local branch I accidentally disabled structured outputs and I found that the LLM message was in the wrong structure. Specifically, the "prompt" key in the llmMessage type was this shape:

  message: "Are the learning outcome and learning cycles appropriate for...",
  type: "text"

When it should have been

  value: "Are the learning outcome and learning cycles appropriate for...",
  type: "text"

This is because we were providing the schema for old parts in the prompt:

  Patch
  Prompt
  State
  Comment
  Error

Because there wasn't a schema for LLMMessage, it tried the structure of the Prompt part

Description

  • Replace old part types in the schema with the LLMMessage part schema

Copy link

vercel bot commented Mar 6, 2025

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

Name Status Preview Comments Updated (UTC)
oak-ai-lesson-assistant ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 6, 2025 9:19am

@codeincontext codeincontext force-pushed the fix/llm-message-schema-prompt branch from 4df9547 to 82394ac Compare March 6, 2025 09:11
Copy link

sonarqubecloud bot commented Mar 6, 2025

Copy link

github-actions bot commented Mar 6, 2025

Playwright test results

passed  17 passed
skipped  2 skipped

Details

report  Open report ↗︎
stats  19 tests across 16 suites
duration  2 minutes, 36 seconds
commit  82394ac

Skipped tests

No persona › tests/auth.test.ts › authenticate through Clerk UI
No persona › tests/chat-performance.test.ts › Component renders during lesson chat › There are no unnecessary rerenders across left and right side of chat

@codeincontext codeincontext marked this pull request as ready for review March 6, 2025 16:12
@codeincontext codeincontext requested a review from stefl March 6, 2025 16:12
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