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

literal workaround #777

Closed
wants to merge 8 commits into from
Closed

literal workaround #777

wants to merge 8 commits into from

Conversation

ahuang11
Copy link
Contributor

@ahuang11 ahuang11 commented Nov 20, 2024

Since quotations '"table"."name"' is unconventional, the LLMs would hallucinate table names, i.e. drop quotations, and it would crash the Pydantic model, raising an invalid error. So, to workaround that, replaces everything except alphanumeric with _ which the LLM understands/copies well, then remaps it back to the original table name with all the special characters after the LLM chooses the table.

Copy link

codecov bot commented Nov 20, 2024

Codecov Report

Attention: Patch coverage is 25.00000% with 9 lines in your changes missing coverage. Please review.

Project coverage is 60.87%. Comparing base (687d54f) to head (28992cf).
Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
lumen/ai/utils.py 33.33% 4 Missing ⚠️
lumen/ai/agents.py 0.00% 3 Missing ⚠️
lumen/ai/coordinator.py 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #777      +/-   ##
==========================================
- Coverage   60.92%   60.87%   -0.06%     
==========================================
  Files         103      103              
  Lines       12556    12573      +17     
==========================================
+ Hits         7650     7654       +4     
- Misses       4906     4919      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ahuang11 ahuang11 marked this pull request as ready for review November 20, 2024 18:54
@ahuang11 ahuang11 requested a review from philippjfr November 20, 2024 18:54
lumen/ai/agents.py Outdated Show resolved Hide resolved
lumen/ai/agents.py Outdated Show resolved Hide resolved
lumen/ai/coordinator.py Outdated Show resolved Hide resolved
lumen/ai/agents.py Outdated Show resolved Hide resolved
Copy link
Member

@philippjfr philippjfr left a comment

Choose a reason for hiding this comment

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

Honestly, I believe you this works but it seems pretty hacky.

@ahuang11
Copy link
Contributor Author

ahuang11 commented Dec 4, 2024

Superseded by #799

@ahuang11 ahuang11 closed this Dec 4, 2024
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