docs(giskard-agents): update README examples to match current API and improve clarity#2312
docs(giskard-agents): update README examples to match current API and improve clarity#2312
Conversation
… improve clarity Made-with: Cursor
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on enhancing the documentation for Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request provides several updates to the giskard-agents README file. The changes focus on improving the clarity of the documentation and ensuring the code examples are up-to-date with the current API. Key changes include updating the 'Core Concepts' section for better readability, adding necessary type hints and imports to code snippets, correcting an API usage example for parsing model output, and fixing minor grammatical errors. Overall, these changes significantly improve the quality and accuracy of the documentation. I have one suggestion to further improve a code example.
libs/giskard-agents/README.md
Outdated
| print(f"Sending {len(messages)} messages") | ||
| response = await next_fn(messages, params) | ||
| response = await next_fn(messages, params, metadata) | ||
| print(f"Got response: {response.finish_reason}") |
There was a problem hiding this comment.
For a LoggingMiddleware example, it's more idiomatic and a better practice to use the logging module instead of print(). This would make the example more realistic and showcase a better pattern for users to follow.
Here's how you could implement it:
import logging
# ... inside the code block
logging.info(f"Sending {len(messages)} messages")
response = await next_fn(messages, params, metadata)
logging.info(f"Got response: {response.finish_reason}")You would need to add import logging at the top of the code block and replace the print calls with logging.info.
kevinmessiaen
left a comment
There was a problem hiding this comment.
LGTM, would be nice to switch to logging as Gemini suggested
Replace print() with logging.info() in the README custom middleware snippet so the example matches common practice. Made-with: Cursor
Description
Related Issue
Type of Change
Checklist
CODE_OF_CONDUCT.mddocument.CONTRIBUTING.mdguide.pdm.lockrunningpdm update-lock(only applicable whenpyproject.tomlhas beenmodified)