From 7ce610a19fe3df5961c7e6853dd16ae99e7f5e14 Mon Sep 17 00:00:00 2001 From: Scott Trinh Date: Thu, 20 Feb 2025 21:36:22 -0500 Subject: [PATCH] Reorganize AI docs Move them into the appropriate sections in the new docs structure. --- docs/ai/{reference_extai.rst => extai.rst} | 0 docs/ai/{reference_http.rst => http.rst} | 24 +++++++-------- docs/ai/index.rst | 10 ++----- docs/ai/javascript.rst | 29 ++++++++++++------- docs/ai/{reference_python.rst => python.rst} | 8 ++--- .../guides/ai_edgeql.rst} | 6 ++-- .../guides/ai_python.rst} | 6 ++-- docs/intro/guides/index.rst | 9 ++++++ docs/intro/index.rst | 2 ++ .../quickstart/ai/fastapi.rst} | 0 docs/intro/quickstart/ai/index.rst | 10 +++++++ docs/intro/quickstart/index.rst | 3 +- docs/intro/quickstart/overview/index.rst | 6 ++-- .../tutorials/ai_fastapi_searchbot.rst} | 6 ++-- docs/intro/tutorials/index.rst | 8 +++++ 15 files changed, 79 insertions(+), 48 deletions(-) rename docs/ai/{reference_extai.rst => extai.rst} (100%) rename docs/ai/{reference_http.rst => http.rst} (95%) rename docs/ai/{reference_python.rst => python.rst} (99%) rename docs/{ai/guide_edgeql.rst => intro/guides/ai_edgeql.rst} (99%) rename docs/{ai/guide_python.rst => intro/guides/ai_python.rst} (99%) create mode 100644 docs/intro/guides/index.rst rename docs/{ai/quickstart_fastapi_ai.rst => intro/quickstart/ai/fastapi.rst} (100%) create mode 100644 docs/intro/quickstart/ai/index.rst rename docs/{ai/fastapi_gelai_searchbot.rst => intro/tutorials/ai_fastapi_searchbot.rst} (99%) create mode 100644 docs/intro/tutorials/index.rst diff --git a/docs/ai/reference_extai.rst b/docs/ai/extai.rst similarity index 100% rename from docs/ai/reference_extai.rst rename to docs/ai/extai.rst diff --git a/docs/ai/reference_http.rst b/docs/ai/http.rst similarity index 95% rename from docs/ai/reference_http.rst rename to docs/ai/http.rst index e813629483e..eb9e7f101f9 100644 --- a/docs/ai/reference_http.rst +++ b/docs/ai/http.rst @@ -1,10 +1,8 @@ .. _ref_ai_http_reference: -===================== -AI HTTP API Reference -===================== - -:edb-alt-title: AI Extension HTTP API +======== +HTTP API +======== .. note:: @@ -48,9 +46,9 @@ Example request .. code-block:: bash - curl --user : --json '{ - "input": "What color is the sky on Mars?", - "model": "text-embedding-3-small" + $ curl --user : --json '{\ + "input": "What color is the sky on Mars?",\ + "model": "text-embedding-3-small"\ }' http://localhost:10931/branch/main/ai/embeddings @@ -162,12 +160,12 @@ Request body Example request --------------- -.. code-block:: +.. code-block:: bash - curl --user : --json '{ - "query": "What color is the sky on Mars?", - "model": "gpt-4-turbo-preview", - "context": {"query":"Knowledge"} + $ curl --user : --json '{\ + "query": "What color is the sky on Mars?",\ + "model": "gpt-4-turbo-preview",\ + "context": {"query":"Knowledge"}\ }' http://:/branch/main/ai/rag diff --git a/docs/ai/index.rst b/docs/ai/index.rst index d1b2af1fcbf..e8bc9f65903 100644 --- a/docs/ai/index.rst +++ b/docs/ai/index.rst @@ -8,14 +8,10 @@ Gel AI :hidden: :maxdepth: 3 - quickstart_fastapi_ai - reference_extai - reference_http - reference_python + extai + http + python javascript - guide_edgeql - guide_python - fastapi_gelai_searchbot :edb-alt-title: Using Gel AI diff --git a/docs/ai/javascript.rst b/docs/ai/javascript.rst index fc5e7f6305f..6b54192104a 100644 --- a/docs/ai/javascript.rst +++ b/docs/ai/javascript.rst @@ -1,20 +1,29 @@ .. _ref_ai_javascript: -========== -JavaScript -========== - -:edb-alt-title: Gel AI's JavaScript package +============== +JavaScript API +============== ``@gel/ai`` offers a convenient wrapper around ``ext::ai``. Install it with npm or via your package manager of choice: -.. code-block:: bash +.. tabs:: + + .. code-tab:: bash + + $ npm install @gel/ai + + .. code-tab:: bash + + $ yarn add @gel/ai + + .. code-tab:: bash + + $ pnpm add @gel/ai + + .. code-tab:: bash - $ npm install @gel/ai # or - $ yarn add @gel/ai # or - $ pnpm add @gel/ai # or - $ bun add @gel/ai + $ bun add @gel/ai Usage diff --git a/docs/ai/reference_python.rst b/docs/ai/python.rst similarity index 99% rename from docs/ai/reference_python.rst rename to docs/ai/python.rst index fc0b1cecb87..e752d9a43ca 100644 --- a/docs/ai/reference_python.rst +++ b/docs/ai/python.rst @@ -1,10 +1,8 @@ .. _ref_ai_python_reference: -============= -AI Python API -============= - -:edb-alt-title: AI Extension Python API +========== +Python API +========== The ``gel.ai`` package is an optional binding of the AI extension in |Gel|. diff --git a/docs/ai/guide_edgeql.rst b/docs/intro/guides/ai_edgeql.rst similarity index 99% rename from docs/ai/guide_edgeql.rst rename to docs/intro/guides/ai_edgeql.rst index bf4a1f356f2..940420206bc 100644 --- a/docs/ai/guide_edgeql.rst +++ b/docs/intro/guides/ai_edgeql.rst @@ -1,8 +1,8 @@ .. _ref_ai_guide_edgeql: -========================= -Guide to Gel AI in EdgeQL -========================= +================ +Gel AI in EdgeQL +================ :edb-alt-title: How to set up Gel AI in EdgeQL diff --git a/docs/ai/guide_python.rst b/docs/intro/guides/ai_python.rst similarity index 99% rename from docs/ai/guide_python.rst rename to docs/intro/guides/ai_python.rst index aed9004bd66..db4835b2cbd 100644 --- a/docs/ai/guide_python.rst +++ b/docs/intro/guides/ai_python.rst @@ -1,8 +1,8 @@ .. _ref_ai_guide_python: -========================= -Guide to Gel AI in Python -========================= +================ +Gel AI in Python +================ :edb-alt-title: How to set up Gel AI in Python diff --git a/docs/intro/guides/index.rst b/docs/intro/guides/index.rst new file mode 100644 index 00000000000..37b0019ca0c --- /dev/null +++ b/docs/intro/guides/index.rst @@ -0,0 +1,9 @@ +====== +Guides +====== + +.. toctree:: + :maxdepth: 1 + + ai_edgeql + ai_python diff --git a/docs/intro/index.rst b/docs/intro/index.rst index ef0a93f337b..0b49596345d 100644 --- a/docs/intro/index.rst +++ b/docs/intro/index.rst @@ -8,6 +8,8 @@ Get Started :hidden: quickstart/index + tutorials/index + guides/index cli instances projects diff --git a/docs/ai/quickstart_fastapi_ai.rst b/docs/intro/quickstart/ai/fastapi.rst similarity index 100% rename from docs/ai/quickstart_fastapi_ai.rst rename to docs/intro/quickstart/ai/fastapi.rst diff --git a/docs/intro/quickstart/ai/index.rst b/docs/intro/quickstart/ai/index.rst new file mode 100644 index 00000000000..09d4df0638c --- /dev/null +++ b/docs/intro/quickstart/ai/index.rst @@ -0,0 +1,10 @@ +.. edb:env-switcher:: + +========= +Adding AI +========= + +.. toctree:: + :maxdepth: 1 + + fastapi diff --git a/docs/intro/quickstart/index.rst b/docs/intro/quickstart/index.rst index 0bc81d3b904..d7fa3779302 100644 --- a/docs/intro/quickstart/index.rst +++ b/docs/intro/quickstart/index.rst @@ -11,4 +11,5 @@ Quickstart modeling/index connecting/index working/index - inheritance/index \ No newline at end of file + inheritance/index + ai/index diff --git a/docs/intro/quickstart/overview/index.rst b/docs/intro/quickstart/overview/index.rst index ce33c92eef9..4da839aa34f 100644 --- a/docs/intro/quickstart/overview/index.rst +++ b/docs/intro/quickstart/overview/index.rst @@ -1,8 +1,8 @@ .. edb:env-switcher:: -========== -Quickstart -========== +======== +Overview +======== .. toctree:: :maxdepth: 3 diff --git a/docs/ai/fastapi_gelai_searchbot.rst b/docs/intro/tutorials/ai_fastapi_searchbot.rst similarity index 99% rename from docs/ai/fastapi_gelai_searchbot.rst rename to docs/intro/tutorials/ai_fastapi_searchbot.rst index ec6ccd4f7cc..5c96250f170 100644 --- a/docs/ai/fastapi_gelai_searchbot.rst +++ b/docs/intro/tutorials/ai_fastapi_searchbot.rst @@ -1,8 +1,8 @@ .. _ref_guide_fastapi_gelai_searchbot: -=================== -FastAPI (Searchbot) -=================== +=============================== +Build a Search Bot with FastAPI +=============================== :edb-alt-title: Building a search bot with memory using FastAPI and Gel AI diff --git a/docs/intro/tutorials/index.rst b/docs/intro/tutorials/index.rst new file mode 100644 index 00000000000..3229c62d63b --- /dev/null +++ b/docs/intro/tutorials/index.rst @@ -0,0 +1,8 @@ +========= +Tutorials +========= + +.. toctree:: + :maxdepth: 2 + + ai_fastapi_searchbot \ No newline at end of file