Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

WIP: Temporal Agent#2225

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
DouweM wants to merge1 commit intomain
base:main
Choose a base branch
Loading
fromtemporal-agent
Draft

WIP: Temporal Agent#2225

DouweM wants to merge1 commit intomainfromtemporal-agent

Conversation

DouweM
Copy link
Contributor

Closes#1975

@DouweMDouweM self-assigned thisJul 17, 2025
@github-actionsGitHub Actions
Copy link

github-actionsbot commentedJul 17, 2025
edited
Loading

Docs Preview

commit:2abccad
Preview URL:https://67ad3d57-pydantic-ai-previews.pydantic.workers.dev

@mattbrandman
Copy link

I'm so excited for this to be natively supported

nir-litt, yarjor, and ofirassif-litt reacted with rocket emoji

@nir-litt
Copy link

Thank you for taking the time to look into native temporal support - this is a topic I’m really interested in seeing progress on.

One key feature I’d love to see is support for HITL (Human-in-the-Loop) during tool calls when using temporal and agents. My suggestion on how to achieve that (and not being to specific for HITL) is to pause the workflow before a tool call waiting on a condition for a signal. This will allow, among other things, to wait for human input.

Currently, tool calls are handled like this:

asyncdefcall_tool(self,name:str,tool_args:dict[str,Any],ctx:RunContext[AgentDepsT],tool:ToolsetTool[AgentDepsT])->Any:serialized_run_context=self.serialize_run_context(ctx)returnawaitworkflow.execute_activity(activity=self.call_tool_activity,arg=FunctionCallToolParams(name=name,tool_args=tool_args,serialized_run_context=serialized_run_context),**self.temporal_settings.__dict__,    )

To add the wait support, we can do something like:
(This example is a bit abstract - we will have to understand (at least):

  • how to pass theself.allow_tool_call from the workflow to this class or effect it with some callback instead of just setting it
  • pass all the data of the tool call for the handler to be able to decide which action to take)
asyncdefcall_tool(self,name:str,tool_args:dict[str,Any],ctx:RunContext[AgentDepsT],tool:ToolsetTool[AgentDepsT])->Any:# --- ADDED: tool call pause using signal and wait_condition ---awaitworkflow.wait_condition(lambda:self.allow_tool_call)# --- END ADDED CODE ---serialized_run_context=self.serialize_run_context(ctx)activity_result=awaitworkflow.execute_activity(activity=self.call_tool_activity,arg=FunctionCallToolParams(name=name,tool_args=tool_args,serialized_run_context=serialized_run_context),**self.temporal_settings.__dict__,    )# --- ADDED: tool call reset state ---self.allow_tool_call=Falsereturnactivity_result# --- END ADDED CODE ---

This will allow users to define their workflow something like:

@workflow.signaldefapprove_tool_call(self):    ...# some code to determine the tool is OK to runself.allow_tool_call=True

This way, the workflow will pause at the tool call and only continue once the signal is approved.

of course this would be optional and the default ,that can be overwritten by the user, will be to approve the request

Appreciate the ongoing work!

haim-n reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees

@DouweMDouweM

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Native temporal support
3 participants
@DouweM@mattbrandman@nir-litt

[8]ページ先頭

©2009-2025 Movatter.jp