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
Copy file name to clipboardExpand all lines: docs/intro/tutorials/ai_fastapi_searchbot.rst
+42-42Lines changed: 42 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -186,7 +186,7 @@ with semantic search-based cross-chat memory.
186
186
"response": "string",
187
187
}
188
188
189
-
1. Implement web search
189
+
3. Implement web search
190
190
=======================
191
191
192
192
Now that we have our web app infrastructure in place, let's add some substance
@@ -956,53 +956,53 @@ In this tutorial we'll write queries using :ref:`EdgeQL <ref_intro_edgeql>` and
956
956
957
957
That concludes our User-related functionality. Next, we need to handle Chats and Messages. Since the process is quite similar to what we've just covered, we won't go into detail. Instead, you can implement these endpoints yourself as an exercise or simply copy the following code if you're in a rush.
958
958
959
-
.. code-block:: txt
959
+
.. code-block:: bash
960
960
:class: collapsible
961
961
962
+
$ echo 'select Chat {
963
+
> messages: { role, body, sources },
964
+
> user := .<chats[is User],
965
+
> } filter .user.name = <str>$username;
966
+
> ' > app/queries/get_chats.edgeql &&
962
967
echo 'select Chat {
963
-
messages: { role, body, sources },
964
-
user := .<chats[is User],
965
-
} filter .user.name = <str>$username;
966
-
' > app/queries/get_chats.edgeql &&
967
-
echo 'select Chat {
968
-
messages: { role, body, sources },
969
-
user := .<chats[is User],
970
-
} filter .user.name = <str>$username and .id = <uuid>$chat_id;
971
-
' > app/queries/get_chat_by_id.edgeql &&
968
+
> messages: { role, body, sources },
969
+
> user := .<chats[is User],
970
+
> } filter .user.name = <str>$username and .id = <uuid>$chat_id;
971
+
> ' > app/queries/get_chat_by_id.edgeql &&
972
972
echo 'with new_chat := (insert Chat)
973
-
select (
974
-
update User filter .name = <str>$username
975
-
set {
976
-
chats := assert_distinct(.chats union new_chat)
977
-
}
978
-
) {
979
-
new_chat_id := new_chat.id
980
-
}' > app/queries/create_chat.edgeql &&
973
+
> select (
974
+
> update User filter .name = <str>$username
975
+
> set {
976
+
> chats := assert_distinct(.chats union new_chat)
977
+
> }
978
+
> ) {
979
+
> new_chat_id := new_chat.id
980
+
> }' > app/queries/create_chat.edgeql &&
981
981
echo 'with
982
-
user := (select User filter .name = <str>$username),
983
-
chat := (
984
-
select Chat filter .<chats[is User] = user and .id = <uuid>$chat_id
0 commit comments