{"id":"wcLpzlyp","creatorId":"anonymous","title":"#8375 dangling $ref under typeless properties in InlineDefsJsonSchemaTransformer","createdAt":1789530198573,"updatedAt":1789530198573,"latestVersionNum":1,"versions":[{"versionNum":1,"version":null,"branchName":null,"branchSha":null,"runRelease":true,"runBranch":false,"sdkDeps":{"pip":["Show Draft 2020-12 validation of the transformed schema raises a referencing error (PointerToNowhere)","Show the explicit 'type': 'object' control schema is fully inlined","Show the transformed typeless schema keeps a dangling '#/$defs/Payload'"]},"snippets":[{"id":"production_path","name":"Tool.from_schema -> model adapter keeps dangling ref (no network)","code":"import copy\nfrom pydantic_ai.tools import Tool\nfrom pydantic_ai.models import ModelRequestParameters\nfrom pydantic_ai.models.openai import OpenAIChatModel\nfrom pydantic_ai.providers.ollama import OllamaProvider\n\nTYPELESS = {\n    '$defs': {'Payload': {'type': 'object', 'properties': {'value': {'type': 'string'}}}},\n    'properties': {'payload': {'$ref': '#/$defs/Payload'}},\n}\n\ndef send_payload(a):\n    return a\n\ntool = Tool.from_schema(function=send_payload, name='send_payload', description='Send a payload.', json_schema=copy.deepcopy(TYPELESS))\nmodel = OpenAIChatModel('llama3.2', provider=OllamaProvider(base_url='http://localhost:11434/v1'))\nprint('profile transformer:', model.profile.get('json_schema_transformer'))\nparams = model.customize_request_parameters(ModelRequestParameters(function_tools=[tool.tool_def]))\nmapped = params.function_tools[0].parameters_json_schema\nwire = model._map_tool_definition(params.function_tools[0], model_settings={})\nprint('provider-bound tool param:', wire)\nassert '#/$defs/Payload' in str(wire)","primaryOutput":null,"comparisonOutput":null},{"id":"user_origin","name":"Public toolset accepts the user-supplied schema tool","code":"from pydantic_ai.toolsets.function import FunctionToolset\ntoolset = FunctionToolset(tools=[tool])\nassert toolset.tools['send_payload'].tool_def.parameters_json_schema == TYPELESS\nprint('user schema passes verbatim through public toolset API')","primaryOutput":null,"comparisonOutput":null}],"createdAt":1789530198573}]}