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
* make devex a bit better when there is only one conversation component
Signed-off-by: Filinto Duran <1373693+filintod@users.noreply.github.com>
* lint
Signed-off-by: Filinto Duran <1373693+filintod@users.noreply.github.com>
* lint
Signed-off-by: Filinto Duran <1373693+filintod@users.noreply.github.com>
* move import to lazy eval to avoid issues on test
Signed-off-by: Filinto Duran <1373693+filintod@users.noreply.github.com>
* lint
Signed-off-by: Filinto Duran <1373693+filintod@users.noreply.github.com>
* lint
Signed-off-by: Filinto Duran <1373693+filintod@users.noreply.github.com>
* cleanup/refactor README.md for quickstart 01
Signed-off-by: Filinto Duran <1373693+filintod@users.noreply.github.com>
* use edge in our check function
Signed-off-by: Filinto Duran <1373693+filintod@users.noreply.github.com>
---------
Signed-off-by: Filinto Duran <1373693+filintod@users.noreply.github.com>
f"!!!!! Dapr Runtime Version {dapr_runtime_version} is not supported with Alpha2 Dapr Chat Client. Only Dapr runtime versions >=1.16.0, edge,and <2.0.0 are supported."
f"!!!!! Dapr Runtime Version {dapr_runtime_version} is not supported with Alpha2 Dapr Chat Client. Only Dapr runtime versions >=1.16.0, edge, and <2.0.0 are supported."
"Multiple LLM components found in the metadata. Please provide the component name explicitly (e.g. llm = DaprChatClient(component_name='openai')) or environment variable DAPR_LLM_COMPONENT_DEFAULT."
392
+
)
393
+
else:
394
+
raiseValueError(
395
+
"No LLM component provided and no default component found in the metadata."
Replace `your_api_key_here` with your actual OpenAI API key.
60
72
61
73
Export the environment variables from the .env file to your shell:
62
-
```bash
63
-
export$(grep -v '^#' .env | xargs)# or if .env is in the root directory, you can just run `export $(grep -v '^#' ../../.env | xargs)`
74
+
```a shell [not setting type to avoid mechanical markdown execution]
75
+
export $(grep -v '^#' .env | xargs)
76
+
77
+
# or if .env is in the root directory of the repository,
78
+
# export $(grep -v '^#' ../../.env | xargs)
79
+
```
80
+
81
+
</details>
82
+
83
+
<details>
84
+
<summary><strong>Option 2: Exporting the OpenAI API Key directly to the shell</strong></summary>
85
+
86
+
```a shell [not setting type to avoid mechanical markdown execution]
87
+
export OPENAI_API_KEY=your_api_key_here
64
88
```
65
89
90
+
Replace `your_api_key_here` with your actual OpenAI API key.
91
+
92
+
</details>
93
+
66
94
## Examples
67
95
68
96
### 1. Basic LLM Usage
69
97
70
98
Run the basic LLM example to see how to interact with OpenAI's language models:
71
99
72
-
<!-- STEP
73
-
name: Run basic LLM example
74
-
expected_stdout_lines:
75
-
- "Got response:"
76
-
timeout_seconds: 30
77
-
output_match_mode: substring
78
-
-->
79
100
```bash
80
101
python 01_ask_llm.py
81
102
```
@@ -167,6 +188,9 @@ A stateful agent that uses Dapr Workflows to ensure durability and persistence o
167
188
We are using the Dapr ChatClient to interact with the OpenAI API. In the components folder, we have a `openai.yaml` file that contains the configuration for the OpenAI API.
168
189
You need to replace the `{YOUR_OPENAI_API_KEY}` with your actual OpenAI API key.
169
190
191
+
We are using the Dapr ChatClient to interact with the OpenAI API. In the components folder, we have a `openai.yaml` file that contains the configuration for the OpenAI API.
192
+
You need to replace the `{YOUR_OPENAI_API_KEY}` with your actual OpenAI API key.
193
+
170
194
Make sure Dapr is initialized on your system:
171
195
172
196
```bash
@@ -180,14 +204,16 @@ name: Run basic LLM example
180
204
expected_stdout_lines:
181
205
- "I want to find flights to Paris"
182
206
- "TravelBuddy"
183
-
timeout_seconds: 30
207
+
timeout_seconds: 60
184
208
output_match_mode: substring
185
209
-->
186
210
187
211
188
-
We are using the `resolve_env_templates.py` script to resolve the environment variables in the components folder and substitute them with the actual values in your .env file, like the OpenAI API key.
212
+
We are using the `resolve_env_templates.py` script to resolve the environment variables in the components folder and substitute them with the actual values in your environment, like the OpenAI API key.
0 commit comments