Update pydantic_ai.md

This commit is contained in:
H Lohaus 2025-02-21 10:06:35 +01:00 committed by GitHub
parent 229fc0e6e8
commit a5a7458721
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -19,9 +19,9 @@ pip install g4f pydantic_ai
## Step-by-Step Setup
### 1. Patch G4F to Use PydanticAI Models
### 1. Patch PydanticAI to Use G4F Models
In order to use PydanticAI models with G4F, you need to apply the necessary patch to the client. This can be done by importing `apply_patch` from `g4f.tools.pydantic_ai`. The `api_key` parameter is optional, so if you have one, you can provide it. If not, the system will proceed without it.
In order to use PydanticAI with G4F models, you need to apply the necessary patch to the client. This can be done by importing `apply_patch` from `g4f.tools.pydantic_ai`. The `api_key` parameter is optional, so if you have one, you can provide it. If not, the system will proceed without it.
```python
from g4f.tools.pydantic_ai import apply_patch
@ -92,4 +92,4 @@ By following these steps, you have successfully integrated PydanticAI models int
- Modify the agents `system_prompt` to suit the nature of the conversation you wish to have.
- **Tool calls within AI requests are not fully supported** at the moment. Use the agent's basic functionality for generating responses and handle external calls separately.
For further customization and advanced use cases, refer to the G4F and PydanticAI documentation.
For further customization and advanced use cases, refer to the G4F and PydanticAI documentation.