Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/conversation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ The Conversation API supports real LLM providers including:
Here we have a temporary directory with the component configurations with the API keys setup in the .env file.

```bash
dapr run --app-id test-app --dapr-http-port 3500 --dapr-grpc-port 50001 --resources-path <some temporary directory>
dapr run --app-id test-app --dapr-http-port 36001 --dapr-grpc-port 56001 --resources-path <some temporary directory>
```

For example if we have openai, anthropic, mistral, deepseek and google ai, we will have a temporary directory with the component configurations for each provider:
Expand All @@ -126,7 +126,7 @@ The Conversation API supports real LLM providers including:
/var/folders/3t/b6jkjnv970l6dd1sp81b19hw0000gn/T/dapr-llm-components-9mcpb1a3

To start the sidecar with these components:
dapr run --app-id test-app --dapr-http-port 3500 --dapr-grpc-port 50001 --resources-path /var/folders/3t/b6jkjnv970l6dd1sp81b19hw0000gn/T/dapr-llm-components-9mcpb1a3
dapr run --app-id test-app --dapr-http-port 36001 --dapr-grpc-port 56001 --resources-path /var/folders/3t/b6jkjnv970l6dd1sp81b19hw0000gn/T/dapr-llm-components-9mcpb1a3

Press Enter when Dapr sidecar is running with the component configurations...
```
Expand Down Expand Up @@ -504,7 +504,7 @@ spec:
### Running with Dapr Sidecar
```bash
# The example creates temporary component configs and shows you the command:
dapr run --app-id test-app --dapr-http-port 3500 --dapr-grpc-port 50001 --resources-path /tmp/dapr-llm-components-xyz/
dapr run --app-id test-app --dapr-http-port 36001 --dapr-grpc-port 56001 --resources-path /tmp/dapr-llm-components-xyz/
```


Expand Down
2 changes: 1 addition & 1 deletion examples/conversation/real_llm_providers_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,7 @@ def main():
print(f' {components_dir}')
print('\nTo start the sidecar with these components:')
print(
f' dapr run --app-id test-app --dapr-http-port 3500 --dapr-grpc-port 50001 --resources-path {components_dir}'
f' dapr run --app-id test-app --dapr-http-port 36001 --dapr-grpc-port 56001 --resources-path {components_dir}'
)

# Wait for user to confirm
Expand Down
2 changes: 1 addition & 1 deletion examples/demo_workflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ sleep: 15
-->

```sh
dapr run --app-id orderapp --app-protocol grpc --dapr-grpc-port 50001 --resources-path components --placement-host-address localhost:50005 -- python3 app.py
dapr run --app-id orderapp --app-protocol grpc --dapr-grpc-port 56013 --resources-path components --placement-host-address localhost:50005 -- python3 app.py
```

<!-- END_STEP -->
Expand Down
12 changes: 6 additions & 6 deletions examples/grpc_proxying/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ sleep: 5

```bash
# 1. Start Receiver (expose gRPC server receiver on port 50051)
dapr run --app-id invoke-receiver --app-protocol grpc --app-port 50051 --config config.yaml -- python invoke-receiver.py
dapr run --app-id grpc-proxying-receiver --app-protocol grpc --app-port 51056 --config config.yaml -- python invoke-receiver.py
```

<!-- END_STEP -->
Expand All @@ -50,7 +50,7 @@ sleep: 5

```bash
# 2. Start Caller
dapr run --app-id invoke-caller --dapr-grpc-port 50007 --config config.yaml -- python invoke-caller.py
dapr run --app-id grpc-proxying-caller --dapr-grpc-port 50007 --config config.yaml -- python invoke-caller.py
```

<!-- END_STEP -->
Expand All @@ -59,12 +59,12 @@ dapr run --app-id invoke-caller --dapr-grpc-port 50007 --config config.yaml --

<!-- STEP
expected_stdout_lines:
- '✅ app stopped successfully: invoke-receiver'
- '✅ app stopped successfully: grpc-proxying-receiver'
name: Shutdown dapr
-->

```bash
dapr stop --app-id invoke-receiver
dapr stop --app-id grpc-proxying-receiver
```

<!-- END_STEP -->
Expand Down Expand Up @@ -95,7 +95,7 @@ dapr stop --app-id invoke-receiver

Logs for caller sidecar:
```
dapr logs -a invoke-caller -k
dapr logs -a grpc-proxying-caller -k
```

Logs for caller app:
Expand All @@ -105,7 +105,7 @@ dapr stop --app-id invoke-receiver

Logs for receiver sidecar:
```
dapr logs -a invoke-receiver -k
dapr logs -a grpc-proxying-receiver -k
```

Logs for receiver app:
Expand Down
2 changes: 1 addition & 1 deletion examples/grpc_proxying/deploy/invoke-caller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
app: invokecaller
annotations:
dapr.io/enabled: "true"
dapr.io/app-id: "invoke-caller"
dapr.io/app-id: "grpc-proxying-caller"
dapr.io/app-protocol: "grpc"
spec:
containers:
Expand Down
4 changes: 2 additions & 2 deletions examples/grpc_proxying/deploy/invoke-receiver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ spec:
app: invokereceiver
annotations:
dapr.io/enabled: "true"
dapr.io/app-id: "invoke-receiver"
dapr.io/app-id: "grpc-proxying-receiver"
dapr.io/app-protocol: "grpc"
dapr.io/app-port: "50051"
dapr.io/app-port: "51056"
spec:
containers:
- name: invokereceiver
Expand Down
2 changes: 1 addition & 1 deletion examples/grpc_proxying/invoke-caller.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

async def run() -> None:
async with grpc.aio.insecure_channel('127.0.0.1:50007') as channel:
metadata = (('dapr-app-id', 'invoke-receiver'),)
metadata = (('dapr-app-id', 'grpc-proxying-receiver'),)
stub = helloworld_service_pb2_grpc.HelloWorldServiceStub(channel)
response = await stub.SayHello(request=HelloRequest(name='you'), metadata=metadata)
print('Greeter client received: ' + response.message)
Expand Down
2 changes: 1 addition & 1 deletion examples/grpc_proxying/invoke-receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ def SayHello(self, request: HelloRequest, context: grpc.aio.ServicerContext) ->
app.add_external_service(
helloworld_service_pb2_grpc.add_HelloWorldServiceServicer_to_server, HelloWorldService()
)
app.run(50051)
app.run(51056)
2 changes: 1 addition & 1 deletion examples/invoke-binding/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ sleep: 5
2. Start Receiver (expose gRPC server receiver on port 50051)

```bash
dapr run --app-id receiver --app-protocol grpc --app-port 50051 --resources-path ./components python3 invoke-input-binding.py
dapr run --app-id receiver --app-protocol grpc --app-port 51053 --resources-path ./components python3 invoke-input-binding.py
```

<!-- END_STEP -->
Expand Down
2 changes: 1 addition & 1 deletion examples/invoke-binding/invoke-input-binding.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ def binding(request: BindingRequest):
print(request.text(), flush=True)


app.run(50051)
app.run(51053)
8 changes: 4 additions & 4 deletions examples/invoke-custom-data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ sleep: 5
-->

```bash
dapr run --app-id invoke-receiver --app-protocol grpc --app-port 50051 python3 invoke-receiver.py
dapr run --app-id invoke-custom-data-receiver --app-protocol grpc --app-port 51052 python3 invoke-receiver.py
```

<!-- END_STEP -->
Expand All @@ -58,7 +58,7 @@ sleep: 5
-->

```bash
dapr run --app-id invoke-caller --app-protocol grpc python3 invoke-caller.py
dapr run --app-id invoke-custom-data-caller --app-protocol grpc python3 invoke-caller.py
```

<!-- END_STEP -->
Expand All @@ -83,12 +83,12 @@ Expected output from receiver:

<!-- STEP
expected_stdout_lines:
- '✅ app stopped successfully: invoke-receiver'
- '✅ app stopped successfully: invoke-custom-data-receiver'
name: Shutdown dapr
-->

```bash
dapr stop --app-id invoke-receiver
dapr stop --app-id invoke-custom-data-receiver
```

<!-- END_STEP -->
2 changes: 1 addition & 1 deletion examples/invoke-custom-data/invoke-caller.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
with DaprClient() as d:
# Create a typed message with content type and body
resp = d.invoke_method(
app_id='invoke-receiver',
app_id='invoke-custom-data-receiver',
method_name='my_method',
data=b'SOME_DATA',
content_type='text/plain; charset=UTF-8',
Expand Down
2 changes: 1 addition & 1 deletion examples/invoke-custom-data/invoke-receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ def mymethod(request: InvokeMethodRequest):
)


app.run(50051)
app.run(51052)
8 changes: 4 additions & 4 deletions examples/invoke-http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ sleep: 5
-->

```bash
dapr run --app-id=invoke-receiver --app-port=8088 --app-protocol http -- python3 invoke-receiver.py
dapr run --app-id=invoke-http-receiver --app-port=8088 --app-protocol http -- python3 invoke-receiver.py
```
<!-- END_STEP -->

Expand All @@ -63,20 +63,20 @@ sleep: 5
-->

```bash
dapr run --app-id=invoke-caller -- python3 invoke-caller.py
dapr run --app-id=invoke-http-caller -- python3 invoke-caller.py
```
<!-- END_STEP -->

## Cleanup

<!-- STEP
expected_stdout_lines:
- '✅ app stopped successfully: invoke-receiver'
- '✅ app stopped successfully: invoke-http-receiver'
name: Shutdown dapr
-->

```bash
dapr stop --app-id invoke-receiver
dapr stop --app-id invoke-http-receiver
```

<!-- END_STEP -->
4 changes: 2 additions & 2 deletions examples/invoke-http/invoke-caller.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# First message: success
# Create a typed message with content type and body
resp1 = d.invoke_method(
'invoke-receiver',
'invoke-http-receiver',
'my-method',
http_verb='POST',
data=json.dumps(req_data),
Expand All @@ -24,7 +24,7 @@
req_data = {'id': 2, 'message': 'hello world'}
try:
resp2 = d.invoke_method(
'invoke-receiver',
'invoke-http-receiver',
'my-method-err',
http_verb='POST',
data=json.dumps(req_data),
Expand Down
16 changes: 8 additions & 8 deletions examples/invoke-simple/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ sleep: 5

```bash
# 1. Start Receiver (expose gRPC server receiver on port 50051)
dapr run --app-id invoke-receiver --app-protocol grpc --app-port 50051 python3 invoke-receiver.py
dapr run --app-id invoke-simple-receiver --app-protocol grpc --app-port 51051 python3 invoke-receiver.py
```

<!-- END_STEP -->
Expand All @@ -52,7 +52,7 @@ sleep: 5

```bash
# 2. Start Caller
dapr run --app-id invoke-caller --app-protocol grpc --dapr-http-port 3500 python3 invoke-caller.py
dapr run --app-id invoke-simple-caller --app-protocol grpc --dapr-http-port 36003 python3 invoke-caller.py
```

<!-- END_STEP -->
Expand All @@ -61,14 +61,14 @@ dapr run --app-id invoke-caller --app-protocol grpc --dapr-http-port 3500 python

<!-- STEP
expected_stdout_lines:
- '✅ app stopped successfully: invoke-caller'
- '✅ app stopped successfully: invoke-receiver'
- '✅ app stopped successfully: invoke-simple-caller'
- '✅ app stopped successfully: invoke-simple-receiver'
name: Shutdown dapr
-->

```bash
dapr stop --app-id invoke-caller
dapr stop --app-id invoke-receiver
dapr stop --app-id invoke-simple-caller
dapr stop --app-id invoke-simple-receiver
```

<!-- END_STEP -->
Expand Down Expand Up @@ -99,7 +99,7 @@ dapr stop --app-id invoke-receiver

Logs for caller sidecar:
```
dapr logs -a invoke-caller -k
dapr logs -a invoke-simple-caller -k
```

Logs for caller app:
Expand All @@ -109,7 +109,7 @@ dapr stop --app-id invoke-receiver

Logs for receiver sidecar:
```
dapr logs -a invoke-receiver -k
dapr logs -a invoke-simple-receiver -k
```

Logs for receiver app:
Expand Down
2 changes: 1 addition & 1 deletion examples/invoke-simple/deploy/invoke-caller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
app: invokecaller
annotations:
dapr.io/enabled: "true"
dapr.io/app-id: "invoke-caller"
dapr.io/app-id: "invoke-simple-caller"
dapr.io/app-protocol: "grpc"
spec:
containers:
Expand Down
4 changes: 2 additions & 2 deletions examples/invoke-simple/deploy/invoke-receiver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ spec:
app: invokereceiver
annotations:
dapr.io/enabled: "true"
dapr.io/app-id: "invoke-receiver"
dapr.io/app-id: "invoke-simple-receiver"
dapr.io/app-protocol: "grpc"
dapr.io/app-port: "50051"
dapr.io/app-port: "51051"
spec:
containers:
- name: invokereceiver
Expand Down
2 changes: 1 addition & 1 deletion examples/invoke-simple/invoke-caller.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
while True:
# Create a typed message with content type and body
resp = d.invoke_method(
'invoke-receiver',
'invoke-simple-receiver',
'my-method',
data=json.dumps(req_data),
)
Expand Down
2 changes: 1 addition & 1 deletion examples/invoke-simple/invoke-receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ def mymethod(request: InvokeMethodRequest) -> InvokeMethodResponse:
return InvokeMethodResponse(b'INVOKE_RECEIVED', 'text/plain; charset=UTF-8')


app.run(50051)
app.run(51051)
4 changes: 2 additions & 2 deletions examples/jobs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ sleep: 15

```bash
# Start the complete workflow example (schedules jobs and handles job events)
dapr run --app-id jobs-workflow --app-protocol grpc --app-port 50051 python3 job_processing.py
dapr run --app-id jobs-workflow --app-protocol grpc --app-port 51054 python3 job_processing.py
```

<!-- END_STEP -->
Expand Down Expand Up @@ -238,7 +238,7 @@ def handle_my_job(job_event: JobEvent) -> None:
print(f"Job data: {data_str}")
# Process the job...

app.run(50051)
app.run(51054)
```

The callback service must:
Expand Down
2 changes: 1 addition & 1 deletion examples/jobs/job_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,4 @@ def schedule_jobs():
threading.Thread(target=schedule_jobs, daemon=True).start()

print('Starting gRPC server on port 50051...', flush=True)
app.run(50051)
app.run(51054)
8 changes: 4 additions & 4 deletions examples/pubsub-simple/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ sleep: 3

```bash
# 1. Start Subscriber (expose gRPC server receiver on port 50051)
dapr run --app-id python-subscriber --app-protocol grpc --app-port 50051 -- python3 subscriber.py
dapr run --app-id pubsub-simple-subscriber --app-protocol grpc --app-port 51055 -- python3 subscriber.py
```

<!-- END_STEP -->
Expand All @@ -79,7 +79,7 @@ sleep: 15

```bash
# 2. Start Publisher
dapr run --app-id python-publisher --app-protocol grpc --dapr-grpc-port=3500 --enable-app-health-check python3 publisher.py
dapr run --app-id pubsub-simple-publisher --app-protocol grpc --dapr-grpc-port=56010 --enable-app-health-check python3 publisher.py
```

<!-- END_STEP -->
Expand All @@ -88,12 +88,12 @@ dapr run --app-id python-publisher --app-protocol grpc --dapr-grpc-port=3500 --e

<!-- STEP
expected_stdout_lines:
- '✅ app stopped successfully: python-subscriber'
- '✅ app stopped successfully: pubsub-simple-subscriber'
name: Shutdown dapr
-->

```bash
dapr stop --app-id python-subscriber
dapr stop --app-id pubsub-simple-subscriber
```

<!-- END_STEP -->
2 changes: 1 addition & 1 deletion examples/pubsub-simple/subscriber.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,4 @@ def mytopic_wildcard(event: v1.Event) -> TopicEventResponse:

app.register_health_check(lambda: print('Healthy'))

app.run(50051)
app.run(51055)
Loading
Loading