Skip to content

phistory

phistory(n=1)

The last model calls, as readable text: what was sent, what came back.

Parameters

Name Type Description Default
n int How many calls, most recent last. 1

Returns

Name Type Description
text Every message of each call, the reply, the finish reason and the tokens. Displays as is at a notebook prompt; print it elsewhere.

See Also

Examples

import functai
from functai import *
@ai
def capital(country: str) -> str:
    """The country's capital city."""
    ...

capital("Japan")
print(phistory())
functai: no model chosen, so using gpt-4.1-mini (environment ($OPENAI_API_KEY)). Choose one with functai.configure(lm=...).
[2026-10-02T10:34:29] capital → gpt-4.1-mini

System message:

Function: capital

The country's capital city.

Reply in exactly this form:
<result>
...
</result>


User message:

<country>
Japan
</country>


Response:

<result>
Tokyo
</result>

(finish: stop; tokens in 41, out 9)