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

We need to support the message which is not included in the history #647

Open
3 tasks done
weburnit opened this issue Nov 15, 2023 · 0 comments
Open
3 tasks done
Labels
enhancement New feature or request

Comments

@weburnit
Copy link

weburnit commented Nov 15, 2023

First check

  • I added a descriptive title to this issue.
  • I used the GitHub search to look for a similar issue and didn't find it.
  • I searched the Marvin documentation for this feature.

Describe the current behavior

While working with a long chain of AIApplication, the history of achain cause context overflow

    async def achain(self, **kwargs: Any) -> Conversation[T]:
        """
        Create a new Conversation object asynchronously.
        """
        with self as conversation:
            await conversation.asend(**kwargs)
            while conversation.last_turn.has_function_call():
                message = conversation.last_turn.call_function()
                await conversation.asend(
                    message if isinstance(message, list) else [message],
                )

            return conversation

Describe the proposed behavior

Ideally, we need to support the Turn class to exclude some messages in self.history to avoid context overflow.
in some cases, the last message inside While-loop doesn't need asend() to be called

Example Use

async def crawl_website(url) -> Message:
   return Message(disable_history=True, content=website_content)

Additional context

By having that, I think we can save the cost while working with large AiApplication.

@weburnit weburnit added the enhancement New feature or request label Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant