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

Rebase MessageHistory on ChatSequence #4922

Merged
merged 4 commits into from
Jul 9, 2023
Merged

Conversation

Pwuts
Copy link
Member

@Pwuts Pwuts commented Jul 8, 2023

Background

Part of #4799

The MessageHistory was already very similar to the ChatSequence. Now they are also compatible/interoperable (up to a degree).

Changes

  • Refine ChatSequence implementation
    • Adjust methods to support subclassing
  • Rebase MessageHistory class on ChatSequence
  • Update usages of MessageHistory
  • Add overloads to count_message_tokens to allow passing a single message

Documentation

x

Test Plan

CI + manual testing ✅

PR Quality Checklist

  • My pull request is atomic and focuses on a single change.
  • I have thoroughly tested my changes with multiple different prompts.
  • I have considered potential risks and mitigations for my changes.
  • I have documented my changes clearly and comprehensively.
  • I have not snuck in any "extra" small tweaks changes.
  • I have run the following commands against my code to ensure it passes our linters:
    black .
    isort .
    mypy
    autoflake --remove-all-unused-imports --recursive --ignore-init-module-imports --ignore-pass-after-docstring autogpt tests --in-place

@Pwuts Pwuts added this to the v0.4.5 Release milestone Jul 8, 2023
@Pwuts Pwuts added the code quality ⬆️ PRs that improve code quality label Jul 8, 2023
@netlify
Copy link

netlify bot commented Jul 8, 2023

Deploy Preview for auto-gpt-docs canceled.

Name Link
🔨 Latest commit 89ebbe3
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/64aae7d286194d0008e5d55a

@github-actions github-actions bot added the size/l label Jul 8, 2023
@Pwuts Pwuts force-pushed the cq/rebase-message-history branch from 5938ea3 to 15ca341 Compare July 8, 2023 21:07
@codecov
Copy link

codecov bot commented Jul 8, 2023

Codecov Report

Patch coverage: 78.12% and project coverage change: -0.06 ⚠️

Comparison is base (f6da992) 50.55% compared to head (b6a36bd) 50.50%.

❗ Current head b6a36bd differs from pull request most recent head 89ebbe3. Consider uploading reports for the commit 89ebbe3 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4922      +/-   ##
==========================================
- Coverage   50.55%   50.50%   -0.06%     
==========================================
  Files         116      116              
  Lines        4860     4875      +15     
  Branches      657      662       +5     
==========================================
+ Hits         2457     2462       +5     
- Misses       2219     2226       +7     
- Partials      184      187       +3     
Impacted Files Coverage Δ
autogpt/llm/base.py 85.85% <65.00%> (-5.06%) ⬇️
autogpt/llm/chat.py 66.23% <71.42%> (ø)
autogpt/llm/utils/token_counter.py 82.50% <77.77%> (-1.88%) ⬇️
autogpt/memory/message_history.py 81.91% <88.88%> (-2.78%) ⬇️
autogpt/agent/agent.py 59.18% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Pwuts Pwuts force-pushed the cq/rebase-message-history branch from 15ca341 to b6a36bd Compare July 8, 2023 21:09
autogpt/llm/base.py Outdated Show resolved Hide resolved
Copy link
Contributor

@collijk collijk left a comment

Choose a reason for hiding this comment

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

Two small suggestions and a couple of questions, but otherwise in good shape.

@Auto-GPT-Bot
Copy link
Contributor

You changed AutoGPT's behaviour. The cassettes have been updated and will be merged to the submodule when this Pull Request gets merged.

@Pwuts Pwuts merged commit 1e1eff7 into master Jul 9, 2023
@Pwuts Pwuts deleted the cq/rebase-message-history branch July 9, 2023 17:53
Alaaelmziat pushed a commit to Alaaelmziat/Auto-GPT that referenced this pull request Jul 12, 2023
* Rebase `MessageHistory` on `ChatSequence`

* Process feedback & make mypy happy

---------

Co-authored-by: James Collins <[email protected]>
dayofthedave pushed a commit to dayofthedave/Auto-GPT that referenced this pull request Jul 17, 2023
* Rebase `MessageHistory` on `ChatSequence`

* Process feedback & make mypy happy

---------

Co-authored-by: James Collins <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants