Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
starpit opened this issue Feb 10, 2025 · 3 comments
Open

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

starpit opened this issue Feb 10, 2025 · 3 comments
Labels
bug Something isn't working interpreter UI

Comments

@starpit
Copy link
Member

starpit commented Feb 10, 2025

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

@starpit starpit added the bug Something isn't working label Feb 10, 2025
@esnible
Copy link
Member

esnible commented Feb 10, 2025

@starpit , I wasn't able to run that command line, I needed to explicitly name the trace file (e.g. pdl --trace "/tmp/react-demo.trace.json" examples/react/demo.pdl).

When I loaded the trace into the viewer, the duration for the action was -55y 54d 15h 19m 51.1s.

On the command line, I saw the output

Obs: examples/react/demo.pdl:28 - Code error: ModuleNotFoundError("No module named 'wikipedia'")

which was not present in the trace. I would like to any CLI stdout errors in the trace viewer.

@starpit
Copy link
Member Author

starpit commented Feb 10, 2025

These seem like separate issues?

@vazirim
Copy link
Member

vazirim commented Feb 10, 2025

@esnible you can run pip install 'prompt-declaration-language[examples]' to install all the dependencies needed in the examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working interpreter UI
Projects
None yet
Development

No branches or pull requests

3 participants