LLMContext#
- class council.contexts.LLMContext(store: AgentContextStore, execution_context: ExecutionContext, budget: Budget)[source]#
Bases:
ContextBase
represents a context used by a
LLMBase
- property chat_history: ChatHistory#
the chat history
- static empty() LLMContext [source]#
helper function that creates a new empty instance
For test purpose only.
- execution_log_to_dict() Dict[str, Any] #
returns the execution log as a dictionary
- execution_log_to_json() str #
returns the execution as a JSON string
- static from_context(context: ContextBase, monitored: Monitored, budget: Budget | None = None) LLMContext [source]#
creates a new instance from the given context, adjusting the execution context appropriately
- property iteration_count: int#
the number of iteration for this execution
- property log_entry: ExecutionLogEntry#
the log entry
- new_for(monitored: Monitored) LLMContext [source]#
returns a new instance for the given object, adjusting the execution context appropriately
- new_log_entry(monitored: Monitored) ExecutionLogEntry #
creates a new log entry from this context