Try nbinlineai

Run the next two code cells to set a score and define a small function. Then use Configure AI in the notebook toolbar to connect ChatGPT or an API provider. Run the first AI question with its Run button or Shift+Enter. Its answer appears directly below; run the follow-up separately to see the same function used with a new argument.

Try nbinlineai

Run the next two code cells to set a score and define a small function. Then use Configure AI in the notebook toolbar to connect ChatGPT or an API provider. Run the first AI question with its Run button or Shift+Enter. Its answer appears directly below; run the follow-up separately to see the same function used with a new argument.

score = 7
score
7
def add_bonus(value: int) -> int:
    """Return the score plus a bonus."""
    return score + value

What is $score? Call &add_bonus exactly once with value 3, then explain the result in one sentence.

7 is the score, and add_bonus(3) returns 10 by adding 3.

Observed live tool calls for the answer above (actual subscription events; private fields shortened).

Tool Result state Submitted arguments Observed result
add_bonus completed {“value”:3} 10

Use the available add_bonus function again with value 5. Explain the result in one sentence.

add_bonus(5) returns 12 because it adds 5 to the score of 7.

Observed live tool calls for the answer above (actual subscription events; private fields shortened).

Tool Result state Submitted arguments Observed result
add_bonus completed {“value”:5} 12

← Examples guide · Download this notebook