You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: daprdocs/content/en/developing-applications/building-blocks/workflow/howto-author-workflow.md
+97-84Lines changed: 97 additions & 84 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,16 +36,31 @@ The Dapr sidecar doesn’t load any workflow definitions. Rather, the sidecar si
36
36
37
37
<!--python-->
38
38
39
-
Define the workflow activities you'd like your workflow to perform. Activities are a function definition and can take inputs and outputs. The following example creates a counter (activity) called `hello_act`that notifies users of the current counter value. `hello_act` is a function derived from a class called `WorkflowActivityContext`.
39
+
Define the workflow activities you'd like your workflow to perform. Activities are a function definition and can take inputs and outputs. The following example creates task chaining activities that receive input
print(f'New counter value is: {counter}!', flush=True)
42
+
@wfr.activity(name='step10')
43
+
defstep1(ctx, activity_input):
44
+
print(f'Step 1: Received input: {activity_input}.')
45
+
# Do some work
46
+
return activity_input +1
47
+
48
+
49
+
@wfr.activity
50
+
defstep2(ctx, activity_input):
51
+
print(f'Step 2: Received input: {activity_input}.')
52
+
# Do some work
53
+
return activity_input *2
54
+
55
+
56
+
@wfr.activity
57
+
defstep3(ctx, activity_input):
58
+
print(f'Step 3: Received input: {activity_input}.')
59
+
# Do some work
60
+
return activity_input ^2
46
61
```
47
62
48
-
[See the `hello_act`workflow activity in context.](https://github.com/dapr/python-sdk/blob/master/examples/demo_workflow/app.py#LL40C1-L43C59)
63
+
[See the task chaining workflow activity in context.](https://github.com/dapr/python-sdk/blob/main/examples/workflow/task_chaining.py)
49
64
50
65
51
66
{{% /codetab %}}
@@ -226,16 +241,19 @@ Next, register and call the activites in a workflow.
226
241
227
242
<!--python-->
228
243
229
-
The `hello_world_wf` function is derived from a class called `DaprWorkflowContext` with input and output parameter types. It also includes a `yield` statement that does the heavy lifting of the workflow and calls the workflow activities.
244
+
The `random_workflow` function is a task chaining workflow pattern derived from a class called `DaprWorkflowContext` with input and output parameter types. It also includes a `yield` statement that does the heavy lifting of the workflow and calls the workflow activities.
Copy file name to clipboardExpand all lines: daprdocs/content/en/getting-started/quickstarts/conversation-quickstart.md
+24-33Lines changed: 24 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,15 +10,15 @@ description: Get started with the Dapr conversation building block
10
10
The conversation building block is currently in **alpha**.
11
11
{{% /alert %}}
12
12
13
-
Let's take a look at how the [Dapr conversation building block]({{< ref conversation-overview.md >}}) makes interacting with Large Language Models (LLMs) easier. In this quickstart, you use the echo component to communicate with the mock LLM and ask it for a poem about Dapr.
13
+
Let's take a look at how the [Dapr conversation building block]({{< ref conversation-overview.md >}}) makes interacting with Large Language Models (LLMs) easier. In this quickstart, you use the echo component to communicate with the mock LLM and ask it to define Dapr.
14
14
15
15
You can try out this conversation quickstart by either:
16
16
17
17
-[Running the application in this sample with the Multi-App Run template file]({{< ref "#run-the-app-with-the-template-file" >}}), or
18
18
-[Running the application without the template]({{< ref "#run-the-app-without-the-template" >}})
19
19
20
20
{{% alert title="Note" color="primary" %}}
21
-
Currently, only the HTTP quickstart sample is available in Python and JavaScript.
21
+
Currently, you can only use JavaScript for the quickstart sample using HTTP, not the JavaScript SDK.
0 commit comments