Skip to content

Commit fc8ae67

Browse files
Ambika Joshigitbook-bot
Ambika Joshi
authored andcommitted
GITBOOK-218: No subject
1 parent d9a81fb commit fc8ae67

24 files changed

+179
-6
lines changed

.gitbook/assets/0 (14).png

351 KB
Loading

.gitbook/assets/1 (13).png

497 KB
Loading

.gitbook/assets/10 (2).png

334 KB
Loading

.gitbook/assets/11 (2).png

13.3 KB
Loading

.gitbook/assets/12 (2).png

182 KB
Loading

.gitbook/assets/13 (2).png

27 KB
Loading

.gitbook/assets/14 (2).png

294 KB
Loading

.gitbook/assets/15 (2).png

20.1 KB
Loading

.gitbook/assets/16 (2).png

186 KB
Loading

.gitbook/assets/17 (1).png

65 KB
Loading

.gitbook/assets/2 (10).png

169 KB
Loading

.gitbook/assets/3 (9).png

354 KB
Loading

.gitbook/assets/4 (7).png

157 KB
Loading

.gitbook/assets/5 (4).png

310 KB
Loading

.gitbook/assets/6 (3).png

263 KB
Loading

.gitbook/assets/7 (3).png

149 KB
Loading

.gitbook/assets/8 (2).png

151 KB
Loading

.gitbook/assets/9 (2).png

103 KB
Loading
Loading

SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
* [🧩 How to use Gooey Functions?](guides/how-to-use-gooey-functions/README.md)
4141
* [✨ LLM-enabled Functions](guides/how-to-use-gooey-functions/llm-enabled-functions.md)
4242
* [How to use SECRETS in Functions?](guides/how-to-use-gooey-functions/how-to-use-secrets-in-functions.md)
43+
* [🔥 How to connect FirebaseDB to Copilot](guides/how-to-use-gooey-functions/how-to-connect-firebasedb-to-copilot.md)
4344
* [Frequently Asked Questions about Functions](guides/how-to-use-gooey-functions/frequently-asked-questions-about-functions.md)
4445
* [🎞️ How to create AI Animations?](guides/how-to-create-ai-animations.md)
4546
* [🤳 How to make amazing AI Art QR Codes?](guides/how-to-make-amazing-ai-art-qr-codes/README.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
# 🔥 How to connect FirebaseDB to Copilot
2+
3+
## Create the Firebase Function
4+
5+
### Step 1: Create a Firebase project
6+
7+
![](<../../.gitbook/assets/0 (14).png>)
8+
9+
![](<../../.gitbook/assets/1 (13).png>)
10+
11+
### Step 2: Create a Realtime DB in Firebase
12+
13+
Once you have created the RTDB, copy the RTDB URL
14+
15+
![](<../../.gitbook/assets/2 (10).png>)
16+
17+
![](<../../.gitbook/assets/3 (9).png>)
18+
19+
![](<../../.gitbook/assets/4 (7).png>)
20+
21+
### Step 3: Duplicate the Firebase Function
22+
23+
Head to the FirebaseDB example in Gooey.AI (see the link below), duplicate the example by using the “Save as New” button and adding it to your workspace
24+
25+
{% embed url="https://gooey.ai/functions/firebase-rtdb-post-with-cryptohash-8vs0hcmv8fuz/" %}
26+
27+
![](<../../.gitbook/assets/5 (4).png>)
28+
29+
![](<../../.gitbook/assets/6 (3).png>)
30+
31+
### Step 4: Paste the RTDB URL in Gooey.AI Functions
32+
33+
Paste the RTDB URL from Step 2 and replace it in the \`firebaseURL\` as shown below
34+
35+
![](<../../.gitbook/assets/7 (3).png>)
36+
37+
### Step 5: Create a path in Firebase RTDB
38+
39+
Head back to your Firebase Realtime Database and add a name value to the RTDB, eg `data`
40+
41+
![](<../../.gitbook/assets/8 (2).png>)
42+
43+
### Step 6: Get Firebase API key
44+
45+
![](<../../.gitbook/assets/9 (2).png>)
46+
47+
![](<../../.gitbook/assets/10 (2).png>)
48+
49+
### Step 7: Add the Firebase API key to Gooey Secrets
50+
51+
Go back to Function you have created in Gooey.AI, scroll down to “Secrets” section. Click on the “Add” button
52+
53+
![](<../../.gitbook/assets/11 (2).png>)
54+
55+
Add the “name” as FIREBASE\_API\_KEY and the API key which you copied from Firebase in the “value” section, and save the key.
56+
57+
![](<../../.gitbook/assets/12 (2).png>)
58+
59+
Once its saved, select it from the drop down.
60+
61+
![](<../../.gitbook/assets/13 (2).png>)
62+
63+
[Know more about adding secrets here](how-to-use-secrets-in-functions.md)
64+
65+
### Step 8: Test function
66+
67+
#### Step 8.1: You can hit “Run” to test if the function is working.&#x20;
68+
69+
If the log shows a “successful” message. Your screen should show this message:
70+
71+
![](<../../.gitbook/assets/14 (2).png>)
72+
73+
#### Step 8.2: Please check the firebaseRTDB for data updates. Your data should have uploaded.
74+
75+
<figure><img src="../../.gitbook/assets/15 (2).png" alt=""><figcaption></figcaption></figure>
76+
77+
### Step 9: Save the workflow
78+
79+
Save the changes by clicking “Update”
80+
81+
On saving the function to your workspace, please remember to add a detailed description of what the function does, this will allow the AI Copilot to use the functions in an agentic way
82+
83+
![](<../../.gitbook/assets/16 (2).png>)
84+
85+
## Add Firebase Function to Copilot
86+
87+
### Step 1: Add function to Copilot
88+
89+
Duplicate the example by using the “Save as New” button and adding it to your workspace
90+
91+
{% embed url="https://gooey.ai/copilot/nurse-julie-health-voice-conversations-to-patient-records-cqd11cspkz4o/" %}
92+
93+
Scroll down to the “Developer Tools and Functions” section in the Copilot, toggle it on and select the Firebase Function that you saved.&#x20;
94+
95+
![](<../../.gitbook/assets/17 (1).png>)
96+
97+
### Step 2: Add prompt instruction
98+
99+
Your prompt needs to be a bit detailed to make sure that the Functions are working properly. \
100+
You need this:
101+
102+
1. To make sure Copilot knows it needs to call a Function at appropriate time,
103+
2. To ensure that LLM translates natural language conversation to JSON data structure as per your requirement
104+
105+
Your prompt could look something like this:
106+
107+
{% code overflow="wrap" %}
108+
```
109+
You are Nurse Jane - an AI bot to assist community health care workers upload medical records after their family visits to find basic demographics and history.
110+
These are the steps you need to follow:
111+
112+
1. Introduce yourself with this script as a guideline:
113+
"Hello I'm Nurse Julie - your family health care provider, I can provide guidance on creating a health record and integrating care recommendations"
114+
115+
2. Ask for the user to provide, if they miss any data point, please ask them to share that. Don't create any records until all the data is captured:
116+
117+
Community health worker's name (required)
118+
Date of case note (required)
119+
Patient's name (required)
120+
Date of Birth (required)
121+
Phone Number (required)
122+
Family members (required)
123+
Address (required)
124+
Date of visit/session (required)
125+
Purpose of visit/session (required)
126+
Observations (required)
127+
Topics discussed (required)
128+
129+
3. Don't create any records until all the data is captured. Then ask if they'd like to create medical record based on this information. Create the record as the following JSON and POST to firebase DB. Please don't run the function until user gives you approval.
130+
131+
{
132+
data: {
133+
mobile: string,
134+
patient_name: string,
135+
address: string,
136+
dateOfBirth: string,
137+
family_member: string,
138+
pid: number,
139+
health_workers_name: string,
140+
case_date: date,
141+
visit_date: date,
142+
visit_purpose: string,
143+
observations: string,
144+
topics_discussed: string
145+
}
146+
}
147+
148+
4. If you are asked to retrieve the information of a patient ask for the phone number and use the firebase RTDB Get function to retrieve it
149+
150+
Guidelines:
151+
- Avoid answering questions that don't pertain to health matters
152+
- Respond without emojis, bulleted lists or special symbols (e.g. “*”)
153+
- Respond in the same language as the user. e.g. if they ask a question in Hindi, reply in Hindi.
154+
- Use simple, direct language.
155+
```
156+
{% endcode %}
157+
158+
#### What is the prompt doing?
159+
160+
* In point 2 of the prompt, we have shared all the information the Copilot must collect to create a record.
161+
* In point 3, we provide a FIXED json format for the LLM to output. This ensures that the data pushed to the FirebaseDB is always in the same format, which is important for retrieval
162+
* In point 4, we instruct the Copilot to utilize Functions when the user requests to retrieve or push information.
163+
164+
### Step 3: Test copilot&#x20;
165+
166+
In the chatbox of the Copilot Builder, you can run a test to check whether the Copilot is working.&#x20;
167+
168+
{% embed url="https://gooey.ai/copilot/?run_id=d8igsxs87l1x&uid=fm165fOmucZlpa5YHupPBdcvDR02" %}
169+
170+
If the Function is run, you can see the widget with all the details.&#x20;
171+
172+
<figure><img src="../../.gitbook/assets/Screenshot 2025-03-11 at 1.56.29 PM.png" alt=""><figcaption></figcaption></figure>
173+
174+
You can also confirm if the data has been created and stored by logging into the Firebase RTDB like [Step 8 from above](how-to-connect-firebasedb-to-copilot.md#step-8-test-function).
175+
176+
### Step 4: Save the workflow
177+
178+
Save the changes by clicking “Update”.

guides/understanding-bulk-runner-and-evaluation/README.md

-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ Here are the **quickstart guides** for Bulk Runner and Evaluation:
3333

3434
<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-target data-type="content-ref"></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td>How to set up Bulk Runner?</td><td><a href="how-to-set-up-bulk-runner.md">how-to-set-up-bulk-runner.md</a></td><td><a href="../../.gitbook/assets/Bulk Runner.png_400x400.png">Bulk Runner.png_400x400.png</a></td></tr><tr><td>How to set up Evaluation?</td><td><a href="how-to-set-up-evaluations.md">how-to-set-up-evaluations.md</a></td><td><a href="../../.gitbook/assets/W.I.9.png_400x400.png">W.I.9.png_400x400.png</a></td></tr></tbody></table>
3535

36-
{% include "../../.gitbook/includes/bulk-run-credit-warning.md" %}
37-
3836
## How Does Bulk Runner Work? <a href="#r7so22ymyyn2" id="r7so22ymyyn2"></a>
3937

4038
### Bulk Run Overview <a href="#id-2v61ngoeupi4" id="id-2v61ngoeupi4"></a>

guides/understanding-bulk-runner-and-evaluation/how-to-set-up-bulk-runner.md

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ In this example scenario, we are setting up a simple bulk run to check regressio
44

55
<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Check out the example run here: BULK RUNNER (Regression Only)</strong></td><td><a href="https://gooey.ai/bulk/farmerchat-bulk-evaluator-regression-only-ggzy9gld1eae/">https://gooey.ai/bulk/farmerchat-bulk-evaluator-regression-only-ggzy9gld1eae/</a></td></tr><tr><td><strong>Check out the example run here: BULK RUNNER (Bulk and Evaluation)</strong></td><td><a href="https://gooey.ai/bulk/farmerchat-bulk-evaluator-gpt-4o-mixtral-claude-vs-gemini-pro-15-b0o8aos3rj8y/">https://gooey.ai/bulk/farmerchat-bulk-evaluator-gpt-4o-mixtral-claude-vs-gemini-pro-15-b0o8aos3rj8y/</a></td></tr></tbody></table>
66

7-
{% include "../../.gitbook/includes/bulk-run-credit-warning.md" %}
8-
97
### Step 1: Select Gooey Workflows <a href="#jmvc9vjmbif9" id="jmvc9vjmbif9"></a>
108

119
Choose the “SAVED” run from Gooey.AI Workflows that you would like to use.

guides/understanding-bulk-runner-and-evaluation/how-to-set-up-evaluations.md

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ In this example scenario, we are comparing and evaluating the quality of the ans
44

55
<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Check out the example run here: Evaluation only</strong> </td><td><a href="https://gooey.ai/eval/copilot-evaluator-artpuhzwvily/">https://gooey.ai/eval/copilot-evaluator-artpuhzwvily/</a></td></tr></tbody></table>
66

7-
{% include "../../.gitbook/includes/bulk-run-credit-warning.md" %}
8-
97
### Step 1: Select Gooey Workflows to evaluate <a href="#mj1hmvoaayxg" id="mj1hmvoaayxg"></a>
108

119
Choose the “SAVED” run from Gooey.AI Workflows that you would like to use.

0 commit comments

Comments
 (0)