Skip to content

docs(giskard-agents): update README examples to match current API and improve clarity#2312

Merged
Hartorn merged 3 commits intomainfrom
docs/cleanup-agents-readme
Mar 20, 2026
Merged

docs(giskard-agents): update README examples to match current API and improve clarity#2312
Hartorn merged 3 commits intomainfrom
docs/cleanup-agents-readme

Conversation

@Hartorn
Copy link
Copy Markdown
Member

@Hartorn Hartorn commented Mar 18, 2026

Description

Related Issue

Type of Change

  • 📚 Examples / docs / tutorials / dependencies update
  • 🔧 Bug fix (non-breaking change which fixes an issue)
  • 🥂 Improvement (non-breaking change which improves an existing feature)
  • 🚀 New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 🔐 Security fix

Checklist

  • I've read the CODE_OF_CONDUCT.md document.
  • I've read the CONTRIBUTING.md guide.
  • I've written tests for all new methods and classes that I created.
  • I've written the docstring in Google format for all the methods and classes that I used.
  • I've updated the pdm.lock running pdm update-lock (only applicable when pyproject.toml has been
    modified)

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 giskard-agents by updating the README.md file. The changes aim to improve the clarity and accuracy of code examples and conceptual explanations, ensuring that the documentation correctly reflects the current API and provides a better understanding of the library's core components and usage patterns.

Highlights

  • Documentation Structure: The 'Docs' section in the giskard-agents README was renamed to 'Core Concepts' for better organization and clarity.
  • API Clarity and Descriptions: Descriptions for core elements like Generator, ChatWorkflow, and Chat were refined, and the asynchronous nature of the API was explicitly stated, clarifying that all run methods return coroutines.
  • CompletionMiddleware Example Update: The CompletionMiddleware example was updated to reflect the current call method signature, including new type hints for parameters like messages, params, metadata, and next_fn, and ensuring metadata is passed to next_fn.
  • Code Example Refinements: Several code examples were adjusted for correctness and clarity, such as adding a BaseModel import, removing an unnecessary blank line, and updating how integer parsing is performed from chat.last.parse(int) to int(chat.last.content).
  • Error Handling Example Improvement: The ErrorPolicy example was improved by adding the necessary ErrorPolicy import and clarifying the behavior of SKIP for single chat runs, along with an updated comment for the run_many example.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@Hartorn Hartorn requested a review from kevinmessiaen March 18, 2026 08:41
@Hartorn Hartorn self-assigned this Mar 18, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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.

Comment on lines 131 to 133
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}")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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.

Copy link
Copy Markdown
Member

@kevinmessiaen kevinmessiaen left a comment

Choose a reason for hiding this comment

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

LGTM, would be nice to switch to logging as Gemini suggested

kevinmessiaen and others added 2 commits March 20, 2026 15:32
Replace print() with logging.info() in the README custom middleware snippet so the example matches common practice.

Made-with: Cursor
@Hartorn Hartorn merged commit d55bf0b into main Mar 20, 2026
23 checks passed
@Hartorn Hartorn deleted the docs/cleanup-agents-readme branch March 20, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants