Get Context • AI Agent SDK

get_context: Build context from session memory and knowledge.

get_context

Method

</div>

This is a method of the Session class in the session module.

Build context from session memory and knowledge.

Signature

python
def get_context(query: str, max_items: int) -> str

Parameters

ParamField str

Query to build context for

ParamField int

Maximum items per section

Returns

ResponseField str

Formatted context string

Uses

  • build_context_for_task

Used By

Source

View on GitHub

praisonaiagents/session.py at line 441


Related Documentation