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

Rename methods and tweak API #738

Merged
merged 11 commits into from
Oct 31, 2024
Merged

Rename methods and tweak API #738

merged 11 commits into from
Oct 31, 2024

Conversation

ahuang11
Copy link
Contributor

@ahuang11 ahuang11 commented Oct 29, 2024

  1. Renames answer -> step_through
  2. Renames Agent().invoke -> respond
  3. Improve typing (messages: list)
  4. Use only step.stream in step_through, and interface.stream in respond
  5. Wrap output from step_through in AgentStepResults parameterized
  6. Migrate agent chain tuples into AgentChainLink parameterized
  7. Make LLM generate a short title for steps (I was confused why the LLM was doing consecutive SQLAgent calls) and widen the default min_width
  8. Prevent plan step from flashing (due to empty string replace=True)
image image

Copy link

codecov bot commented Oct 29, 2024

Codecov Report

Attention: Patch coverage is 33.02752% with 73 lines in your changes missing coverage. Please review.

Project coverage is 61.18%. Comparing base (049a997) to head (ff9a545).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
lumen/ai/assistant.py 22.00% 39 Missing ⚠️
lumen/ai/agents.py 35.84% 34 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #738      +/-   ##
==========================================
- Coverage   61.22%   61.18%   -0.04%     
==========================================
  Files         101      101              
  Lines       12352    12371      +19     
==========================================
+ Hits         7562     7569       +7     
- Misses       4790     4802      +12     

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

@ahuang11 ahuang11 changed the base branch from main to fix_messages_typing October 29, 2024 20:41
@ahuang11 ahuang11 changed the base branch from fix_messages_typing to main October 29, 2024 20:42
@ahuang11 ahuang11 marked this pull request as ready for review October 29, 2024 22:40
@philippjfr
Copy link
Member

Looking good, but thinking about it again I'm not sure I love step_through and I'm also wondering if we actually need both methods or should simplify it to one method with an argument like render_output/render_final.

@ahuang11
Copy link
Contributor Author

AgentStepResults did seem superfluous besides making the return type the same so I like that idea of merging those two methods

@ahuang11
Copy link
Contributor Author

Maybe render_output can be controlled by the LLM too, e.g. prompt

Show me the table and the plot of the data

@ahuang11
Copy link
Contributor Author

Okay, having the LLM decide on whether to render intermediate output works.
image

@ahuang11
Copy link
Contributor Author

Table + Chat example

image

@philippjfr philippjfr merged commit 31868f3 into main Oct 31, 2024
11 checks passed
@philippjfr philippjfr deleted the refactor_methods branch October 31, 2024 09:42
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