googleapis / googleapis/python-genai

Logging of REST API calls to the Gemini service

Open
#1,914 3 comments 0 reactions 1 assignee Claimed by @Venkaiahbabuneelam View on GitHub
priority: p3 type: feature request type: question
Dominant language
Python
Stars
4k
Forks
1k
Avg merge
2d 11h
Merged PRs (30d)
40

Description

I am using the genai package and all is well. I believe it is making API calls to VertexAI at the endpoint:

aiplatform.googleapis.com

My question:

Can I log or otherwise debug the REST requests sent and received? Ideally, I would like to see the requests and responses sent from Python and received by Python. This is for education and debugging purposes.

I have tried:

```
import logging
logging.getLogger().setLevel(logging.DEBUG)
```

and that worked to an extent ... the logs did show a REST request but there was no logging of the payload and no logging of the response text. Ideally I would like to see a rich and complete set of data.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.