This notebook showcases an agent interacting with large `JSON/dict` objects. This is useful when you want to answer questions about a JSON blob that’s too large to fit in the context window of an LLM. The agent is able to iteratively explore the blob to find what it needs to answer the user’s question.

In the below example, we are using the OpenAPI spec for the OpenAI API, which you can find [here](https://github.com/openai/openai-openapi/blob/master/openapi.yaml).

We will use the JSON agent to answer some questions about the API spec.

```
> Entering new AgentExecutor chain...Action: json_spec_list_keysAction Input: dataObservation: ['openapi', 'info', 'servers', 'tags', 'paths', 'components', 'x-oaiMeta']Thought: I should look at the paths key to see what endpoints existAction: json_spec_list_keysAction Input: data["paths"]Observation: ['/engines', '/engines/{engine_id}', '/completions', '/edits', '/images/generations', '/images/edits', '/images/variations', '/embeddings', '/engines/{engine_id}/search', '/files', '/files/{file_id}', '/files/{file_id}/content', '/answers', '/classifications', '/fine-tunes', '/fine-tunes/{fine_tune_id}', '/fine-tunes/{fine_tune_id}/cancel', '/fine-tunes/{fine_tune_id}/events', '/models', '/models/{model}', '/moderations']Thought: I should look at the /completions endpoint to see what parameters are requiredAction: json_spec_list_keysAction Input: data["paths"]["/completions"]Observation: ['post']Thought: I should look at the post key to see what parameters are requiredAction: json_spec_list_keysAction Input: data["paths"]["/completions"]["post"]Observation: ['operationId', 'tags', 'summary', 'requestBody', 'responses', 'x-oaiMeta']Thought: I should look at the requestBody key to see what parameters are requiredAction: json_spec_list_keysAction Input: data["paths"]["/completions"]["post"]["requestBody"]Observation: ['required', 'content']Thought: I should look at the required key to see what parameters are requiredAction: json_spec_get_valueAction Input: data["paths"]["/completions"]["post"]["requestBody"]["required"]Observation: TrueThought: I should look at the content key to see what parameters are requiredAction: json_spec_list_keysAction Input: data["paths"]["/completions"]["post"]["requestBody"]["content"]Observation: ['application/json']Thought: I should look at the application/json key to see what parameters are requiredAction: json_spec_list_keysAction Input: data["paths"]["/completions"]["post"]["requestBody"]["content"]["application/json"]Observation: ['schema']Thought: I should look at the schema key to see what parameters are requiredAction: json_spec_list_keysAction Input: data["paths"]["/completions"]["post"]["requestBody"]["content"]["application/json"]["schema"]Observation: ['$ref']Thought: I should look at the $ref key to see what parameters are requiredAction: json_spec_get_valueAction Input: data["paths"]["/completions"]["post"]["requestBody"]["content"]["application/json"]["schema"]["$ref"]Observation: #/components/schemas/CreateCompletionRequestThought: I should look at the CreateCompletionRequest schema to see what parameters are requiredAction: json_spec_list_keysAction Input: data["components"]["schemas"]["CreateCompletionRequest"]Observation: ['type', 'properties', 'required']Thought: I should look at the required key to see what parameters are requiredAction: json_spec_get_valueAction Input: data["components"]["schemas"]["CreateCompletionRequest"]["required"]Observation: ['model']Thought: I now know the final answerFinal Answer: The required parameters in the request body to the /completions endpoint are 'model'.> Finished chain.
```

```
"The required parameters in the request body to the /completions endpoint are 'model'."
```