base.calls¶
A base abstract interface for calling LLMs.
BaseCall
¶
Bases: BasePrompt
, Generic[BaseCallResponseT, BaseCallResponseChunkT, BaseToolT]
, ABC
The base class abstract interface for calling LLMs.
Source code in mirascope/base/calls.py
call(retries=0, **kwargs)
abstractmethod
¶
A call to an LLM.
An implementation of this function must return a response that extends
BaseCallResponse
. This ensures a consistent API and convenience across e.g.
different model providers.
Source code in mirascope/base/calls.py
call_async(retries=0, **kwargs)
abstractmethod
async
¶
An asynchronous call to an LLM.
An implementation of this function must return a response that extends
BaseCallResponse
. This ensures a consistent API and convenience across e.g.
different model providers.
Source code in mirascope/base/calls.py
stream(retries=0, **kwargs)
abstractmethod
¶
A call to an LLM that streams the response in chunks.
An implementation of this function must yield response chunks that extend
BaseCallResponseChunk
. This ensures a consistent API and convenience across
e.g. different model providers.
Source code in mirascope/base/calls.py
stream_async(retries=0, **kwargs)
abstractmethod
async
¶
A asynchronous call to an LLM that streams the response in chunks.
An implementation of this function must yield response chunks that extend
BaseCallResponseChunk
. This ensures a consistent API and convenience across
e.g. different model providers.