Skip to content

trace.json for a defs: data: ... has strange syntax #388

@starpit

Description

@starpit

Describe the bug
Iin the trace.json of examples/react/demo.pdl, the top-level defs (of the tools) has a bizarre result field. it kinda looks like JSON, but is a string wrapped around invalid JSON (single quotes)

"[{'type': 'function', 'function': {'name': 'Calc', 'description':
      'Calculator function', 'parameters': {'type': 'object', 'properties':
      {'expr': {'type': 'string', 'description': 'Arithmetic expression to
      calculate'}}, 'required': ['expr']}}}, {'type': 'function', 'function':
      {'name': 'Search', 'description': 'Wikipedia search', 'parameters':
      {'type': 'object', 'properties': {'topic': {'type': 'string',
      'description': 'Topic to search'}}, 'required': ['topic']}}}]"

To Reproduce

pdl --trace trace.json examples/react/demo.pdl

Expected behavior
Probably the result field should be proper JSON?

Screenshots
n/a

Desktop (please complete the following information):

  • OS: macOS
  • Browser n/a
  • Version PDL 0.2.1.dev88+g334a253.d20250131

Additional context
n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions