NumpyAISession

class numpyai.NumpyAISession(data: list[ndarray | array], *, verbose: bool = False, model: Any = 'google:gemini-2.5-flash', max_tries: int = 3)

Bases: object

Chat with multiple NumPy arrays in a single session.

Parameters:
  • data – List of numpy.ndarray (or numpyai.array) objects. They will be exposed to the LLM as arr1, arr2, …

  • verbose – Show all intermediate LLM steps.

  • model – Any model spec accepted by pydantic-ai (default: "google:gemini-2.5-flash").

  • max_tries – Number of code-generation attempts before giving up (default: 3).

chat(query: str) Any

Handle a natural-language query across the session’s arrays.