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

feat: Truncate context window based on session settings #381

Merged
merged 1 commit into from
Jun 1, 2024

Conversation

whiterabbit1983
Copy link
Contributor

@whiterabbit1983 whiterabbit1983 commented Jun 1, 2024

🚀 This description was created by Ellipsis for commit 9f20039

Summary:

This PR enhances session management by introducing token_budget and context_overflow settings, updating API models and database schema, and including a migration script.

Key points:

  • Introduced token_budget and context_overflow settings in session models.
  • Updated session creation, retrieval, and listing to handle new settings.
  • Enhanced session management logic to truncate or adapt context based on settings.
  • Added migration script for database schema updates.
  • Updated OpenAPI specification to include new session settings.

Generated with ❤️ by ellipsis.dev

@whiterabbit1983 whiterabbit1983 requested a review from creatorrr June 1, 2024 13:44
@whiterabbit1983 whiterabbit1983 changed the base branch from dev to f/rec-sum-experiments June 1, 2024 13:45
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Incremental review on bc8d97d in 1 minute and 23 seconds

More details
  • Looked at 557 lines of code in 13 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_xAGeybtwzxVZ5KZC


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 9f20039 in 1 minute and 15 seconds

More details
  • Looked at 572 lines of code in 13 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. openapi.yaml:1301
  • Draft comment:
    The addition of token_budget and context_overflow to the Session model in the OpenAPI specification is correctly implemented and matches the backend changes.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The token_budget and context_overflow fields are added to the Session model in the OpenAPI specification. This is consistent with the changes made in the codebase to support these new session settings. The OpenAPI specification is correctly updated to reflect these changes, ensuring that the API documentation remains accurate and up-to-date with the backend implementation.

Workflow ID: wflow_kFeO6LOhsZJYowLW


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@creatorrr creatorrr merged commit 450b7d6 into f/rec-sum-experiments Jun 1, 2024
6 checks passed
@creatorrr creatorrr deleted the f/adaptive-context branch June 1, 2024 16:01
creatorrr added a commit that referenced this pull request Jun 11, 2024
* research: Recursive summarization experiments

Signed-off-by: Diwank Singh Tomer <[email protected]>

* fix: Minor fix to rec-sum notebook

Signed-off-by: Diwank Singh Tomer <[email protected]>

* wip: Rec-sum notebook

Signed-off-by: Diwank Singh Tomer <[email protected]>

* entity and trim step prompt + notebook. summarise setup.

* summarization step added.

* wip

Signed-off-by: Diwank Singh Tomer <[email protected]>

* chore: Move rec_sum subpackage

* feat: Summarize messages recursively

* feat: Use custom model for summarization

* chore: Remove commented out code

* fix: Serialize pandas series objects

* fix: Choose correct way to generate based on model name

* fix: Add old entities message as a child for the new one instead of deleting it

* chore: Add tenacity dependency

* fix: Strip closing ct:trimmed tag

* fix: Strip closing ct:summarized-messages tag

* fix: Add a list of entries instead of only one

* fix: Convert strings to UUID

* fix: Stringify message content

* fix: Convert new entry content to a list of JSON

* fix: Strip ct:entities tag

* fix: Do not add new entry explicitly

* fix: Update assertion

* feat: Truncate context window based on session settings (#381)

* feat: Calculate tokens for image content

* feat: Update SDKs to support adaptive context options

* fix: Truncate entries

* fix: Make truncation a background task

* fix: Add truncation workflow to registry

* fix: Fix deleting query

* fix: Remove truncated entries

* fix: Convert role to string only if needed

* fix: Replace delete by rm

* fix: Fix entries deleting logic

* fix: Set name to None if absent

* fix: Make deleting query accept UUID as a string

* fix: Convert UUIDs to strings

* fix: Fix query parameter name

* fix: Convert input to array of arrays

* fix: Make entries indices zro-based

* fix: Customize summarization model via environment variable

* chore: Re-arrange operations on dialog entries

* deps: poetry lock on agents-api and python sdk

Signed-off-by: Diwank Tomer <[email protected]>

---------

Signed-off-by: Diwank Singh Tomer <[email protected]>
Signed-off-by: Diwank Tomer <[email protected]>
Co-authored-by: Siddharth Balyan <[email protected]>
Co-authored-by: Dmitry Paramonov <[email protected]>
Co-authored-by: Diwank Tomer <[email protected]>
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