Reference
API reference for the Composo Python package
Composo link
The Composo.link()
function is a decorator that marks the function to be linked to the Composo platform.
Parameters
api_key
(str, optional): The API key for the Composo app. Defaults to None, which autogenerates an API key when the Live Connection is instantiated.auto_bump
(bool, optional): Composo cannot detect many codebase changes, so you can choose to automatically bump the patch each time the Live Connection is instantiated. This prevents runners with different functionality being connected under the same version number.version
(str, optional): You can bring up a runner associated with a previous version of the app by manually specifying the version in major.minor.patch format.development_mode
(bool, optional): When set to true, Composo will use all resources serving the Composo Live Connection and will hold the Python program open indefinintely. When set to false, the Live Connection will run in a separate process, designed to have minimal interference with the linked application.disable
(bool, optional): Controls whether the composo package is activated. Useful for disabling the effects of the package without removing configuration from the codebase.
If Python is not running, the Live Connection is not active. If your program exits before you’ve been able to run your tests in Composo, try running in development mode.
Returns
- (function): The decorated function.
Example
import composo as cp
@cp.Composo.link()
def foo():
...
StrParam Class
The StrParam
class represents a string parameter.
Methods
__init__(self, description=None)
Initializes a new instance of the StrParam class.
Parameters
description
(str, optional): The description of the parameter.
IntParam Class
The IntParam
class represents an integer parameter.
Methods
__init__(self, description=None, min=None, max=None)
Initializes a new instance of the IntParam class.
Parameters
description
(str, optional): The description of the parameter.min
(int, optional): The minimum allowable value for the parameter.max
(int, optional): The maximum allowable value for the parameter.
FloatParam Class
The FloatParam
class represents a float parameter.
Methods
__init__(self, description=None, min=None, max=None)
Initializes a new instance of the FloatParam class.
Parameters
description
(str, optional): The description of the parameter.min
(float, optional): The minimum allowable value for the parameter.max
(float, optional): The maximum allowable value for the parameter.
MultiChoiceStrParam Class
The MultiChoiceStrParam
class represents a multi-choice string parameter.
Methods
__init__(self, choices: List[str] = None, description=None)
Initializes a new instance of the MultiChoiceStrParam class.
Parameters
choices
(list, optional): The list of allowable choices for the parameter.description
(str, optional): The description of the parameter.
ConversationHistoryParam Class
The ConversationHistoryParam
class represents a conversation history parameter.
Methods
__init__(self, description=None)
Initializes a new instance of the ConversationHistoryParam class.
Parameters
description
(str, optional): The description of the parameter.