server
¶
BaseServer
¶
Bases: ABC
The base class for all servers.
Servers are responsible for communicating with the underlying model.
close
abstractmethod
¶
create
¶
create(
args: GenArgs, gen_id: str, **kwargs: Any
) -> CompletionResponse
Create a CompletionResponse from the model with given arguments.
Parameters:
-
args
(GenArgs
) –The arguments for generating the response
-
gen_id
(str
) –The ID of the generation
-
**kwargs
(Any
, default:{}
) –Additional keyword arguments
Returns: The response from the model.
Source code in src/appl/core/server.py
DummyServer
¶
Bases: BaseServer
A dummy server for testing purposes.
create
¶
create(
args: GenArgs, gen_id: str, **kwargs: Any
) -> CompletionResponse
Create a CompletionResponse from the model with given arguments.
Parameters:
-
args
(GenArgs
) –The arguments for generating the response
-
gen_id
(str
) –The ID of the generation
-
**kwargs
(Any
, default:{}
) –Additional keyword arguments
Returns: The response from the model.
Source code in src/appl/core/server.py
GenArgs
¶
Bases: BaseModel
Common arguments for generating a response from a model.
preprocess
¶
Convert the GenArgs into a dictionary for creating the response.