Skip to content

feat: change the semantics of function calls to put the returned value in pdl_context #1075

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mandel
Copy link
Collaborator

@mandel mandel commented Jul 28, 2025

With this PR, the background context of the body of a function stays local to the function and only the result of the function is added to the context when it is called.

For example, in the following program:

defs:
  f:
    function:
    return:
      lastOf:
      - How are you?
      - Bye
lastOf:
- Hello
- call: ${f}
- ${pdl_context}

The output is

[ {'role': 'user', 'content': 'Hello'},
  {'role': 'user', 'content': 'Bye'} ]

Warning: inlining a function might change the background context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant