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

feat(js): propagate context to sub actions, expose context in prompts #1663

Merged
merged 9 commits into from
Jan 27, 2025

Conversation

pavelgj
Copy link
Collaborator

@pavelgj pavelgj commented Jan 26, 2025

Allows:

definePrompt({
  prompt: 'hello {{@auth.email}}',
})

Also changed express plugin to put auth into context.auth instead of just context.

@pavelgj pavelgj requested a review from mbleigh January 26, 2025 01:44
Copy link
Collaborator

@mbleigh mbleigh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking that GenerateOptions should actually have a context option so that context can be passed directly without needing to be embedding in a flow...WDYT?

js/ai/src/prompt.ts Outdated Show resolved Hide resolved
Base automatically changed from pj/asyncActionsAndPrompts to main January 26, 2025 15:35
@pavelgj
Copy link
Collaborator Author

pavelgj commented Jan 26, 2025

I was thinking that GenerateOptions should actually have a context option so that context can be passed directly without needing to be embedding in a flow...WDYT?

Good idea. Done.

@pavelgj pavelgj requested a review from mbleigh January 26, 2025 16:16
js/ai/src/generate.ts Outdated Show resolved Hide resolved
js/ai/src/prompt.ts Outdated Show resolved Hide resolved
@pavelgj pavelgj requested a review from mbleigh January 26, 2025 19:44
js/ai/src/generate.ts Outdated Show resolved Hide resolved
@pavelgj pavelgj merged commit 21ffd9b into main Jan 27, 2025
4 checks passed
@pavelgj pavelgj deleted the pj/propagateActionContext branch January 27, 2025 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants