Description
Describe the Bug
Many fields when used make the server return 400 status code, with a body listing the unrecognised fields. For instance,
class ExtractParams(pydantic.BaseModel):
"""
Parameters for the extract operation.
"""
prompt: Optional[str] = None
schema_: Optional[Any] = pydantic.Field(None, alias='schema')
system_prompt: Optional[str] = None
allow_external_links: Optional[bool] = False
enable_web_search: Optional[bool] = False
# Just for backwards compatibility
enableWebSearch: Optional[bool] = False
show_sources: Optional[bool] = False
I can only get schema and prompt to work.
For instance, despite system_prompt defined in the latest 1.12.0 package version:
Error during extraction: ("Unexpected error during extract: Status code 400. Bad Request - [{'code': 'unrecognized_keys', 'keys': ['system_prompt'], 'path': [], 'message': 'Unrecognized key in body -- please review the v1 API documentation for request body changes'}]", 500)
def scrape_url
does not even have a params type schema at all.
To Reproduce
Use firecrawl-py
and try to use all of the parameters defined in the package in the requests to the Firecrawl API. You will get 400 BAD REQUEST.
Expected Behavior
The API packages need to be kept up to date with the API schema. Perhaps some Swagger / OpenAPI / GraphQL introspection so that the python package can update its type definitions without having to have a new version. Perhaps there should be a check to warn when the package is no longer consistent with the API so that developers know it is time to upgrade the package.
The package should also have a stub file so that it can be used in a typesafe manner. My import of this library has an error
Method | Request Definitions | Response Definitions |
---|---|---|
search |
✅ | ✅ |
extract |
✅ | ✅ |
crawl_url |
❌ | ❌ |
scrape_url |
❌ | ❌ |
The above table shows that types are not present for crawl_url and scrape_url. And the ones that are present are out of date.
Please can you makes these changes?
Stub file not found for "firecrawl"Pylance[reportMissingTypeStubs](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#reportMissingTypeStubs)
To be honest, the state of Python development is a little horrifying because so few people enable strict type checking.
Screenshots
N/A
Logs
N/A
Additional Context
I have not checked the TypeScript API but it could well need updating too.