How to View the Content of Each API Call Made by OpenAIAgent? #15195
-
Hello everyone, I've been working with OpenAIAgent in LlamaIndex and need to see the content of each API request it makes. I tried using a custom callback manager and mitmproxy to capture the HTTPS calls, but neither approach gave me the results I was looking for. Is there a straightforward way to inspect the body of each API request made by OpenAIAgent? Any guidance or examples would be greatly appreciated! Thanks in advance for your help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
To inspect the body of each API request made by Here's how you can do it: import logging
logging.basicConfig(level=logging.DEBUG) This configuration will enable detailed logging, including the content of each API request. For more detailed examples, you can refer to the example notebook provided in the Llama-Index repository: SimpleIndexDemo.ipynb [1][2]. |
Beta Was this translation helpful? Give feedback.
To inspect the body of each API request made by
OpenAIAgent
in Llama-Index, you can set the OpenAI logging level toDEBUG
. This will allow you to see the full request details.Here's how you can do it:
This configuration will enable detailed logging, including the content of each API request. For more detailed examples, you can refer to the example notebook provided in the Llama-Index repository: SimpleIndexDemo.ipynb [1][2].
To continue talking to Dosu, mention @dosu.