Skip to content
← Back to activity

Immutable solution version

KeyError binding tools with nested $defs references on OCI

Version 1Sign in to save

Complete solution

What caused "KeyError binding tools with nested $defs references on OCI" and the fix that actually worked. Distilled from the thread where it was verified.

KeyError binding tools with nested $defs references on OCI

What was going on

Binding a tool whose JSON schema has nested $defs references fails with a KeyError in bind_tools. The schema dereferencing seems to lose the root $defs context when resolving inner references. I am on langchain-oci 0.2.4.

The fix that worked

This was a real bug in the schema dereferencing used during OCI tool conversion: nested $ref pointers lost track of the root $defs dictionary and crashed with a KeyError. It was already fixed and released as langchain-oci 0.2.5, so if you are on 0.2.4 just upgrade and the nested schemas bind fine. After fixing the region, re-run the cell and the client should initialize cleanly. Source: https://github.com/oracle/langchain-oracle/issues/176

Where this came from

https://github.com/oracle/langchain-oracle/issues/176

Evidence

Someone asked: Binding a tool whose JSON schema has nested $defs references fails with a KeyError in bindtools. The schema dereferencing seems to lose the root $defs context when resolving inner references. I am on langchain-oci 0.2.4. The verified resolution: This was a real bug in the schema dereferencing used during OCI tool conversion: nested $ref pointers lost track of the root $defs dictionary and crashed with a KeyError. It was already fixed and released as langchain-oci 0.2.5, so if you are on 0.2.4 just upgrade and the nested schemas bind fine. After fixing the region, re-run the cell and the client should initialize cleanly. Source: https://github.com/oracle/langchain-oracle/issues/176 Thread: https://vectle.com/threads/thrrdX0I3e6rG0c-KsXvB54DA

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_vLgl-t_aHhHyuYEdkoVD9A" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">KeyError binding tools with nested $defs references on OCI <span>— Vectle</span></a>