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 organize agent's history messages without recalculating tokens #4324

Merged
merged 3 commits into from
May 29, 2024

Conversation

zeroameli
Copy link
Contributor

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes #2932

Add token recalculation when organize agent's history messages.

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Tested locally

Suggested Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. 🐞 bug Something isn't working 🤖 feat:agent Agent related topics labels May 12, 2024
@zeroameli
Copy link
Contributor Author

@Yeuoly The code is updated, please have a review.

api/core/agent/cot_agent_runner.py Outdated Show resolved Hide resolved
api/core/agent/cot_completion_agent_runner.py Outdated Show resolved Hide resolved
api/core/agent/fc_agent_runner.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@Yeuoly Yeuoly left a comment

Choose a reason for hiding this comment

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

LGTM

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label May 29, 2024
@Yeuoly
Copy link
Collaborator

Yeuoly commented May 29, 2024

Thanks for your contributions!

@Yeuoly Yeuoly merged commit afed361 into langgenius:main May 29, 2024
7 checks passed
vicwang3 pushed a commit to vicwang3/dify that referenced this pull request May 30, 2024
* origin/main: (93 commits)
  chore: node help link (langgenius#4795)
  Add SearchApi tools (langgenius#4648)
  chore: improve node user experience (langgenius#4792)
  fix: in tool and http node of iteration can not show item var correctly (langgenius#4791)
  feat: Add logging warning when MAIL_TYPE is not set (langgenius#4771)
  fix organize agent's history messages without recalculating tokens (langgenius#4324)
  feat: support define tags in tool yaml (langgenius#4763)
  feat: update ernie model (langgenius#4756)
  fix: incorrect workflow max call depth (langgenius#4759)
  feat: support baichuan3 turbo, baichuan3 turbo 128k, and baichuan4 (langgenius#4762)
  fix: confusing chart description (langgenius#4760)
  style: fix annotation panel display misalignment (langgenius#4750)
  Add WORKFLOW_CALL_MAX_DEPTH env var. (langgenius#4713)
  Fix/4742 ollama num gpu option not consistent with allowed values (langgenius#4751)
  style: the 'all' of add tool panel should contain workflow tools (langgenius#4755)
  fix: Corrected schema link in model_runtime's README.md (langgenius#4757)
  fix: optimize sticky header styles z-index in tools - ProviderList component (langgenius#4746)
  fix: workflow run sequence number slow sql (langgenius#4737)
  Show tool i18n name on chat pannel (langgenius#4724)
  fix: Correct context size for banchuan2-53b and banchuan2-turbo (langgenius#4721)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 🤖 feat:agent Agent related topics lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Agent app got incomplete answer in a long conversation
2 participants