feat: add __call__ in field_serializer and update body wait logic

- In g4f/client/stubs.py, add a __call__ method to the field_serializer class that returns the first positional argument.
- In g4f/requests/__init__.py, replace the wait_for call with a while loop that repeatedly evaluates "document.querySelector('body:not(.no-js)')" and sleeps until the element is found.
```
This commit is contained in:
hlohaus 2025-04-17 08:19:33 +02:00
parent 3ab36ebc64
commit 17976b93a7
2 changed files with 4 additions and 1 deletions

View file

@ -22,6 +22,8 @@ except ImportError:
class field_serializer():
def __init__(self, field_name):
self.field_name = field_name
def __call__(self, *args, **kwargs):
return args[0]
class BaseModel(BaseModel):
@classmethod