diff --git "a/.gitbook/assets/Screenshot 2024-10-19 at 1.03.32\342\200\257AM.png" "b/.gitbook/assets/Screenshot 2024-10-19 at 1.03.32\342\200\257AM.png" new file mode 100644 index 0000000..9e04e19 Binary files /dev/null and "b/.gitbook/assets/Screenshot 2024-10-19 at 1.03.32\342\200\257AM.png" differ diff --git "a/.gitbook/assets/Screenshot 2024-10-19 at 1.15.29\342\200\257AM.png" "b/.gitbook/assets/Screenshot 2024-10-19 at 1.15.29\342\200\257AM.png" new file mode 100644 index 0000000..c6cd028 Binary files /dev/null and "b/.gitbook/assets/Screenshot 2024-10-19 at 1.15.29\342\200\257AM.png" differ diff --git a/.gitbook/assets/image (22).png b/.gitbook/assets/image (22).png new file mode 100644 index 0000000..5c6b095 Binary files /dev/null and b/.gitbook/assets/image (22).png differ diff --git a/.gitbook/assets/pako_eNptkstugzAQRX9l5HXyAywqNSEkqdIu-tgUsrDwEKxim_qhNCL59w6GJKgqYoG5Z67njt2x0ghkCTtY3tbwnhYa6HnMPxxa4O7LAYfvgPa0h_n8ARbdbvdM_x32L8gKqqBLL40m0CJoRIHiMrgsqOSc3fRBO_c2y7y3sehao4WDo_T1zYh8DkGh9m4_2Czjzml-dQLpoORNg2Io_MunkV_defzBMni86quoZ3fdog-.png b/.gitbook/assets/pako_eNptkstugzAQRX9l5HXyAywqNSEkqdIu-tgUsrDwEKxim_qhNCL59w6GJKgqYoG5Z67njt2x0ghkCTtY3tbwnhYa6HnMPxxa4O7LAYfvgPa0h_n8ARbdbvdM_x32L8gKqqBLL40m0CJoRIHiMrgsqOSc3fRBO_c2y7y3sehao4WDo_T1zYh8DkGh9m4_2Czjzml-dQLpoORNg2Io_MunkV_defzBMni86quoZ3fdog-.png new file mode 100644 index 0000000..98e4da6 Binary files /dev/null and b/.gitbook/assets/pako_eNptkstugzAQRX9l5HXyAywqNSEkqdIu-tgUsrDwEKxim_qhNCL59w6GJKgqYoG5Z67njt2x0ghkCTtY3tbwnhYa6HnMPxxa4O7LAYfvgPa0h_n8ARbdbvdM_x32L8gKqqBLL40m0CJoRIHiMrgsqOSc3fRBO_c2y7y3sehao4WDo_T1zYh8DkGh9m4_2Czjzml-dQLpoORNg2Io_MunkV_defzBMni86quoZ3fdog-.png differ diff --git a/.gitbook/assets/pako_eNptkstugzAQRX9l5HXyAywqlRCSVGkXfWwKWVh4AKtgUz-URkn-vYMhBFVFXmDfM9dzB86s0AJZxCrDuxrek1wBPY_Zh0UD3H5Z4PDt0ZwOsFw-QHze75_p3GK_QJZQelU4qRWBBkEhChTXwSWmkks66YN26W1WWW9j0HZaCQtH6erJiHwq36Jy9jDYrMLNSXZzAmmh4E2DYij8yyeBX995_MHCO7zp66Cnd92g84Y.svg b/.gitbook/assets/pako_eNptkstugzAQRX9l5HXyAywqlRCSVGkXfWwKWVh4AKtgUz-URkn-vYMhBFVFXmDfM9dzB86s0AJZxCrDuxrek1wBPY_Zh0UD3H5Z4PDt0ZwOsFw-QHze75_p3GK_QJZQelU4qRWBBkEhChTXwSWmkks66YN26W1WWW9j0HZaCQtH6erJiHwq36Jy9jDYrMLNSXZzAmmh4E2DYij8yyeBX995_MHCO7zp66Cnd92g84Y.svg new file mode 100644 index 0000000..eff46b8 --- /dev/null +++ b/.gitbook/assets/pako_eNptkstugzAQRX9l5HXyAywqlRCSVGkXfWwKWVh4AKtgUz-URkn-vYMhBFVFXmDfM9dzB86s0AJZxCrDuxrek1wBPY_Zh0UD3H5Z4PDt0ZwOsFw-QHze75_p3GK_QJZQelU4qRWBBkEhChTXwSWmkks66YN26W1WWW9j0HZaCQtH6erJiHwq36Jy9jDYrMLNSXZzAmmh4E2DYij8yyeBX995_MHCO7zp66Cnd92g84Y.svg @@ -0,0 +1 @@ +

|Functions needed|

|No functions needed|

User asks a query

LLM assesses if functions are needed

LLM responds with function arguments

Function is called with arguments

Function executes

Function returns result

LLM processes function result

LLM formulates final response

LLM responds with answer

Response sent to user

\ No newline at end of file diff --git a/SUMMARY.md b/SUMMARY.md index d60a7c7..08e9e5e 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -36,7 +36,8 @@ * [🔍 Generate “People Also Ask” SEO Content](guides/generate-people-also-ask-seo-content.md) * [📊 How to create language evaluation for ASR?](guides/how-to-create-language-evaluation-for-asr.md) * [How does RAG-based document search work?](guides/how-does-rag-based-document-search-work.md) -* [🧩 How to use Gooey Functions?](guides/how-to-use-gooey-functions.md) +* [🧩 How to use Gooey Functions?](guides/how-to-use-gooey-functions/README.md) + * [✨ LLM-enabled Functions](guides/how-to-use-gooey-functions/llm-enabled-functions.md) * [How to use Compare AI Translations?](guides/how-to-use-compare-ai-translations/README.md) * [Google Translate Glossary](guides/how-to-use-compare-ai-translations/google-translate-glossary.md) * [⚖️ Understanding Bulk Runner and Evaluation](guides/understanding-bulk-runner-and-evaluation/README.md) diff --git a/guides/how-to-use-gooey-functions.md b/guides/how-to-use-gooey-functions/README.md similarity index 60% rename from guides/how-to-use-gooey-functions.md rename to guides/how-to-use-gooey-functions/README.md index 85a9807..d652131 100644 --- a/guides/how-to-use-gooey-functions.md +++ b/guides/how-to-use-gooey-functions/README.md @@ -10,9 +10,9 @@ We will take the "Gooey Chat Bot Analysis Script" in this example. This LLM scri We want to push this output to our CRM so we get deeper analytics which helps us respond better to our customers. -
+
-

Gooey Support Bot's Analysis script, on the left is the LLM prompt with the incoming message and on the right is the category output

+

Gooey Support Bot's Analysis script, on the left is the LLM prompt with the incoming message and on the right is the category output

{% embed url="https://gooey.ai/compare-large-language-models/gooey-bot-chat-analysis-script-27lrilywfzmv/" %} LINK TO THE LLM ANAYLSIS SCRIPT @@ -47,19 +47,19 @@ async (variables) => { ``` {% endcode %} -

Functions workflow with the code editor to the left

+

Functions workflow with the code editor to the left

### **Step 3** Add your relevant variables. -
+
### **Step 4** Hit Submit, if your code is working fine you will get your outputs on the right side. Use the “Save as New” button and update the run name. -
+
### **Step 5** @@ -69,15 +69,15 @@ Head over to the example below: {% embed url="https://gooey.ai/compare-large-language-models/gooey-bot-chat-analysis-script-27lrilywfzmv/" %} -
+
Check the Functions, choose “AFTER” and add your Saved example. And then hit "SUBMIT! -
+
You can check your Functions output in the Workflow at the end of the page in "Details" section. -
+
### How do I find all the available functions and how can I contribute? @@ -87,8 +87,8 @@ All the functions are available here: Choose any of the Examples and Fork them! -
+
### More resources -

Read more about GOOEY.AI functions

Fun fun functions!gooey.ai - cute robot doing javascript vintage p...gazine advertisement muted colorful illustration.png

Connect API to LLM Generator

https://gooey.ai/compare-large-language-models/functions-make-a-haiku-with-iss-coordinates-k4vuehh6hhvo/gooey.ai - cute robots and aliens shaking hands ...gazine advertisement muted colorful illustration.png
+

Read more about GOOEY.AI functions

Fun fun functions!gooey.ai - cute robot doing javascript vintage p...gazine advertisement muted colorful illustration.png

Connect API to LLM Generator

https://gooey.ai/compare-large-language-models/functions-make-a-haiku-with-iss-coordinates-k4vuehh6hhvo/gooey.ai - cute robots and aliens shaking hands ...gazine advertisement muted colorful illustration.png
diff --git a/guides/how-to-use-gooey-functions/llm-enabled-functions.md b/guides/how-to-use-gooey-functions/llm-enabled-functions.md new file mode 100644 index 0000000..c1f39cf --- /dev/null +++ b/guides/how-to-use-gooey-functions/llm-enabled-functions.md @@ -0,0 +1,100 @@ +# ✨ LLM-enabled Functions + +## Where are LLM-enabled Functions useful? + +There are many scenarios where we don't need to run the Functions for every Copilot query. For example: + +* User wants to calculate data in between the conversation (like an HVAC CFM Calculation) +* LLM needs to do a Google search to respond to the query +* LLM needs to do a look-up weather API and answer the query + +

A flowchart which shows the different flows

+ +## How do LLM-enabled Functions work? + +When the user sends a query in Natural Language, the LLM determines the following: + +1. does the query require a function? +2. which part of the text should be passed as an argument in the function? + +In the example below, the query is about CFM calculations which are commonly used in HVAC installations. + +
+ +## How to use LLM-enabled Functions? + +Using LLM-enabled Functions is exactly the same as "BEFORE" and "AFTER" functions + +### **Step 1** + +Head over the [Functions workflow](https://gooey.ai/functions/) + +### **Step 2** + +Create your PROMPT Function: + +* create a basic fetch call for the weather of any location +* create a serper + +**You can find more** [**examples here**](https://gooey.ai/functions/examples) + +#### A basic Weather API call ([link here](https://gooey.ai/functions/current-weather-rxmquy60p1vq/)) + +```javascript +async ({ lat, long }) => { + // Use Open-Meteo's public API for fetching weather data + let url = `https://api.open-meteo.com/v1/forecast?latitude=${lat}&longitude=${long}¤t_weather=true`; + let response = await fetch(url); + let data = await response.json(); + return { weather: data.current_weather }; +}; +``` + +#### An API call for serper - a service for google search ([link here](https://gooey.ai/functions/google-search-without-api-key-tey6zrx2vzvm/)) + +```javascript +async ({ query }) => { + var myHeaders = new Headers(); + myHeaders.append("X-API-KEY", "your API key"); + myHeaders.append("Content-Type", "application/json"); + + var raw = JSON.stringify({ + "q": query + }); + + var requestOptions = { + method: 'POST', + headers: myHeaders, + body: raw, + redirect: 'follow' + }; + + let ret = await fetch("https://google.serper.dev/search", requestOptions); + + return { search_results: await ret.json() }; +}; + +``` + +#### **Step 3** + +Hit Submit, if your code is working fine you will get your outputs on the right side. Use the “Save as New” button and update the run name. + +#### **Step 4** + +Now head over to the Gooey workflow where you want to add the saved functions. + +Head over to the example below: + +{% embed url="https://gooey.ai/copilot/farmerchat-with-current-weather-data-qfzn662xf06v/" %} + +Check the Functions option, and choose “PROMPT” from the dropdown and add your Saved example. And then hit "SUBMIT! + +
+ +_You can check your Functions output in the Workflow at the end of the page in "Details" section._ + +
+ +
+