Skip to content

Commit 548cce4

Browse files
authored
Allow assistantId config (#1)
1 parent e043e47 commit 548cce4

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ cd vapicon-2025-hardware-workshop
7878

7979
### 2. Configuration
8080

81-
Run the configuration menu to set up your WiFi credentials and Bearer Token:
81+
Run the configuration menu to set up your WiFi credentials and Vapi Public Key:
8282

8383
```bash
8484
idf.py menuconfig
@@ -88,13 +88,9 @@ Navigate to:
8888

8989
- `VapiCon 2025 Hardware Workshop Configuration`
9090
- Set your **WiFi Name** and **WiFi Password**
91-
- Set your **Bearer Token**
92-
93-
Press `S` to save and `Q` to quit.
94-
95-
### Config values
96-
97-
- `BEARER_TOKEN` - `b3db41dc-f62e-4ca8-89dc-550eab564212`
91+
- Set your **Vapi Public Key** to `b3db41dc-f62e-4ca8-89dc-550eab564212` and press enter
92+
- Press `S` and enter to save
93+
- Press `Q` to quit.
9894

9995
## Building the Project
10096

main/Kconfig.projbuild

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,16 @@ menu "VapiCon 2025 Hardware Workshop Configuration"
1212
help
1313
Enter your Wifi network password
1414

15-
config BEARER_TOKEN
16-
string "Bearer Token"
17-
default ""
15+
config VAPI_PUBLIC_KEY
16+
string "Vapi Public Key"
17+
default "b3db41dc-f62e-4ca8-89dc-550eab564212"
18+
help
19+
Enter your Vapi Public Key
20+
21+
config ASSISTANT_ID
22+
string "Assistant ID"
23+
default "0a46e2bc-8950-4a05-9970-cd239a47ad01"
1824
help
19-
Enter your Vapi Bearer Token
25+
Enter your Vapi Assistant ID
2026

2127
endmenu

main/http.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ static char *build_body_json(const char *sdp) {
7272
// assistant object
7373
cJSON *assistant = cJSON_AddObjectToObject(root, "assistant");
7474
assert(assistant != nullptr);
75-
cJSON_AddStringToObject(assistant, "assistantId",
76-
"0a46e2bc-8950-4a05-9970-cd239a47ad01");
75+
cJSON_AddStringToObject(assistant, "assistantId", CONFIG_ASSISTANT_ID);
7776

7877
// assistantOverrides
7978
cJSON *overrides = cJSON_AddObjectToObject(assistant, "assistantOverrides");
@@ -116,7 +115,7 @@ void do_http_request(const char *offer, char *answer) {
116115
config.user_data = answer;
117116
config.crt_bundle_attach = esp_crt_bundle_attach;
118117

119-
snprintf(answer, HTTP_BUFFER_SIZE, "Bearer %s", CONFIG_BEARER_TOKEN);
118+
snprintf(answer, HTTP_BUFFER_SIZE, "Bearer %s", CONFIG_VAPI_PUBLIC_KEY);
120119

121120
esp_http_client_handle_t client = esp_http_client_init(&config);
122121
esp_http_client_set_method(client, HTTP_METHOD_POST);

0 commit comments

Comments
 (0)