Skip to content

Conversation

@cristian-milea
Copy link

Enhanced the fetch_container_logs tool by adding an optional filter_string parameter to filter log lines. Updated the tool description to reflect this new functionality.

Enhanced the `fetch_container_logs` tool by adding an optional `filter_string` parameter to filter log lines. Updated the tool description to reflect this new functionality.
Copy link
Owner

@ckreiling ckreiling left a comment

Choose a reason for hiding this comment

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

I'm a little worried that this implies to the caller that they will receive tail log lines when tail is an integer. Though with your current implementation it could return less than tail log lines if there are fewer logs matching filter_string

Can you help me understand a little better the problem you're looking to solve and maybe we can work together on a better solution?

@cristian-milea
Copy link
Author

Hi! Thank you for your reply 👋

I was thinking of shrinking the output for context size optimization.

I had a situation of 500 last logs and wanted about 10 of them based on a keyword.

@ckreiling
Copy link
Owner

Understood! Thinking through this I have a couple changes I'd like to be addressed before merging:

  1. Instead of filter_string, we should do filter_regex. Filtering by regex will be more flexible and can reduce the # of tool calls submitted by the LLM
  2. For the new field, let's extend the inline Pydantic description to indicate that it will return fewer log lines than what is specified in the tail option

@ckreiling
Copy link
Owner

@cristian-milea let me know if you want any further guidance to get this merged!

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