Expander
Core logic controller that coordinates PromptManager and LLMClient to complete intent expansion.
Class
Expander
class Expander:
def __init__(
self,
api_key: str,
base_url: str = "https://api.deepseek.com",
model: str = "deepseek-chat",
timeout: int = 30
)
Parameters:
api_key(str): LLM API keybase_url(str): API base URL, defaults to DeepSeekmodel(str): Model name to use, defaults todeepseek-chattimeout(int): Request timeout in seconds, defaults to 30
Methods
expand
Expand search instructions based on given context.
Parameters:
context(PlanetContext): Context object containing theme and values
Returns:
SSEOutput: Output object containing search instructions
Example:
context = PlanetContext(
theme="Embodied Intelligence",
values_map={"radical": 0.8, "ethics": 0.2}
)
result = await expander.expand(context)
close
Close LLM client connection.
Exceptions
LLMParseError: Response parsing failedLLMTimeoutError: Request timeout