qianfan.resources.requestor package
Submodules
qianfan.resources.requestor.base module
API Requestor for SDK
qianfan.resources.requestor.console_requestor module
Console API Requestor
- class qianfan.resources.requestor.console_requestor.ConsoleAPIRequestor(**kwargs: Any)[source]
Bases:
BaseAPIRequestorobject to manage console API requests
qianfan.resources.requestor.openapi_requestor module
Qianfan API Requestor
- class qianfan.resources.requestor.openapi_requestor.PrivateAPIRequestor(**kwargs: Any)[source]
Bases:
QfAPIRequestorqianfan private api requestor
- llm(endpoint: str, header: ~typing.Dict[str, ~typing.Any] = {}, query: ~typing.Dict[str, ~typing.Any] = {}, body: ~typing.Dict[str, ~typing.Any] = {}, stream: bool = False, data_postprocess: ~typing.Callable[[~qianfan.resources.typing.QfResponse], ~qianfan.resources.typing.QfResponse] = <function PrivateAPIRequestor.<lambda>>, retry_config: ~qianfan.resources.typing.RetryConfig = RetryConfig(retry_count=1, timeout=10, max_wait_interval=120, backoff_factor=1, jitter=1, retry_err_codes={})) Union[QfResponse, Iterator[QfResponse]][source]
llm related api request
- class qianfan.resources.requestor.openapi_requestor.QfAPIRequestor(**kwargs: Any)[source]
Bases:
BaseAPIRequestorobject to manage Qianfan API requests
- async async_llm(endpoint: str, header: ~typing.Dict[str, ~typing.Any] = {}, query: ~typing.Dict[str, ~typing.Any] = {}, body: ~typing.Dict[str, ~typing.Any] = {}, stream: bool = False, data_postprocess: ~typing.Callable[[~qianfan.resources.typing.QfResponse], ~qianfan.resources.typing.QfResponse] = <function QfAPIRequestor.<lambda>>, retry_config: ~qianfan.resources.typing.RetryConfig = RetryConfig(retry_count=1, timeout=10, max_wait_interval=120, backoff_factor=1, jitter=1, retry_err_codes={})) Union[QfResponse, AsyncIterator[QfResponse]][source]
llm related api request
- llm(endpoint: str, header: ~typing.Dict[str, ~typing.Any] = {}, query: ~typing.Dict[str, ~typing.Any] = {}, body: ~typing.Dict[str, ~typing.Any] = {}, stream: bool = False, data_postprocess: ~typing.Callable[[~qianfan.resources.typing.QfResponse], ~qianfan.resources.typing.QfResponse] = <function QfAPIRequestor.<lambda>>, retry_config: ~qianfan.resources.typing.RetryConfig = RetryConfig(retry_count=1, timeout=10, max_wait_interval=120, backoff_factor=1, jitter=1, retry_err_codes={})) Union[QfResponse, Iterator[QfResponse]][source]
llm related api request
- qianfan.resources.requestor.openapi_requestor.create_api_requestor(*args: Any, **kwargs: Any) QfAPIRequestor[source]