Context Strategy API
api_delete_context_strategy(cs_id)
Deletes a context strategy identified by its ID.
This API endpoint interfaces with the ContextStrategy.delete
method to remove a context strategy from the system.
It is used to manage the available context strategies by allowing for their removal when they are no longer needed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cs_id |
str
|
The unique identifier of the context strategy to be deleted. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the context strategy was successfully deleted. |
Raises:
Type | Description |
---|---|
Exception
|
If the deletion process encounters an error. |
Source code in moonshot/src/api/api_context_strategy.py
api_get_all_context_strategies()
Retrieves and returns the names of all context strategies currently available.
This API endpoint interfaces with the ContextStrategy.get_all_context_strategy_names
method to fetch a list
of all context strategy names. It's designed for clients that need to know what context strategies are available for
use in sessions or other components of the system.
Returns:
Type | Description |
---|---|
list[str]
|
list[str]: A list of strings, each representing the name of a context strategy. |
Source code in moonshot/src/api/api_context_strategy.py
api_get_all_context_strategy_metadata()
Retrieves metadata for all context strategy modules.
This function retrieves the metadata for all available context strategies and returns a list of metadata dictionaries.
Returns:
Type | Description |
---|---|
list[dict]
|
list[dict]: A list of dictionaries, each representing the details of a context strategy metadata. |