Skip to content

Commit

Permalink
Fix minor errors that prevented build
Browse files Browse the repository at this point in the history
  • Loading branch information
deepbuzin committed Feb 18, 2025
1 parent 63295fb commit 2fec3f1
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 45 deletions.
12 changes: 12 additions & 0 deletions docs/ai/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@
Gel AI
======

.. toctree::
:hidden:
:maxdepth: 3

javascript
guide_edgeql
guide_python
quickstart_fastapi_ai
reference_extai
reference_http
reference_python

:edb-alt-title: Using Gel AI

|Gel| AI is a set of tools designed to enable you to ship AI-enabled apps with
Expand Down
2 changes: 1 addition & 1 deletion docs/ai/javascript.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ model):
});
You may use any of the supported :ref:`text generation models
<ref_ai_reference_text_generation_models>`. Add your query as context:
<ref_ai_extai_reference_text_generation_models>`. Add your query as context:

.. code-block:: typescript
Expand Down
78 changes: 67 additions & 11 deletions docs/ai/reference_extai.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ Providers tab
-------------


.. _ref_ai_extai_reference_index:

Index
=====

Expand Down Expand Up @@ -105,6 +107,59 @@ Parameters:
* ``dimensions``: int64 (Optional) - Embedding dimensions
* ``truncate_to_max``: bool (Default: False)


Built-in resources
==================

.. _ref_ai_extai_reference_embedding_models:

Embedding models
----------------

**OpenAI**

* ``text-embedding-3-small``
* ``text-embedding-3-large``
* ``text-embedding-ada-002``

`Learn more about the OpenAI embedding models <https://platform.openai.com/docs/guides/embeddings/embedding-models>`__

**Mistral**

* ``mistral-embed``

`Learn more about the Mistral embedding model <https://docs.mistral.ai/capabilities/embeddings/#mistral-embeddings-api>`__


.. _ref_ai_extai_reference_text_generation_models:

Text generation models
----------------------

**OpenAI**

* ``gpt-3.5-turbo``
* ``gpt-4-turbo-preview``

`Learn more about the OpenAI text generation models <https://platform.openai.com/docs/guides/text-generation>`__

**Mistral**

* ``mistral-small-latest``
* ``mistral-medium-latest``
* ``mistral-large-latest``

`Learn more about the Mistral text generation models <https://docs.mistral.ai/getting-started/models/>`__

**Anthropic**

* ``claude-3-haiku-20240307``
* ``claude-3-sonnet-20240229``
* ``claude-3-opus-20240229``

`Learn more about the Athropic text generation models <https://docs.anthropic.com/claude/docs/models-overview>`__


Functions
=========

Expand Down Expand Up @@ -170,7 +225,8 @@ Functions
query: array<float32> \
) -> optional tuple<object: anyobject, distance: float64>
Searches objects using their :ref:`ai::index <ref_guide_ai_reference_index>`.
Searches objects using their :ref:`ai::index
<ref_ai_extai_reference_index>`.

Returns tuples of (object, distance).

Expand Down Expand Up @@ -257,18 +313,18 @@ Provider-Specific Types
Each inherits from ``ProviderConfig`` with provider-specific defaults.

Model Types
----------
-----------

ext::ai::Model
^^^^^^^^^^^^^
^^^^^^^^^^^^^^
Abstract base type for AI models.

Annotations:
* ``model_name`` - Model identifier
* ``model_provider`` - Provider identifier

ext::ai::EmbeddingModel
^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^
Abstract type for embedding models.

Annotations:
Expand All @@ -278,25 +334,25 @@ Annotations:
* ``embedding_model_supports_shortening`` - Input shortening support flag

ext::ai::TextGenerationModel
^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Abstract type for text generation models.

Annotations:
* ``text_gen_model_context_window`` - Model's context window size

Indexing Types
-------------
--------------

ext::ai::DistanceFunction
^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^
Enum for similarity metrics:

* ``Cosine``
* ``InnerProduct``
* ``L2``

ext::ai::IndexType
^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^
Enum for index implementations:

* ``HNSW``
Expand All @@ -320,7 +376,7 @@ Example custom prompt configuration:
};
ext::ai::ChatParticipantRole
^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Enum for chat participants:

* ``System``
Expand All @@ -329,7 +385,7 @@ Enum for chat participants:
* ``Tool``

ext::ai::ChatPromptMessage
^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^
Type for chat prompt messages.

Properties:
Expand All @@ -338,7 +394,7 @@ Properties:
* ``content``: str (Required)

ext::ai::ChatPrompt
^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^
Type for chat prompt configuration.

Properties:
Expand Down
33 changes: 3 additions & 30 deletions docs/ai/reference_http.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Generates text embeddings using the specified embeddings model.
Request headers
---------------

* `Content-Type: application/json` (required)
* ``Content-Type: application/json`` (required)


Request body
Expand All @@ -45,7 +45,7 @@ Request body

* ``model`` (string, required): The name of the embedding model to use. You may
use any of the supported :ref:`embedding models
<ref_ai_reference_embedding_models>`.
<ref_ai_extai_reference_embedding_models>`.


Example request
Expand Down Expand Up @@ -118,9 +118,8 @@ search.
Request headers
---------------

* `Content-Type: application/json` (required)
* ``Content-Type: application/json`` (required)

```

Request body
------------
Expand Down Expand Up @@ -163,32 +162,6 @@ Request body
* ``model`` (string, required): The name of the text generation model to use.

.. _ref_ai_reference_text_generation_models:

List of supported text generation models:

**OpenAI**

* ``gpt-3.5-turbo``
* ``gpt-4-turbo-preview``

`Learn more about the OpenAI text generation models <https://platform.openai.com/docs/guides/text-generation>`__

**Mistral**

* ``mistral-small-latest``
* ``mistral-medium-latest``
* ``mistral-large-latest``

`Learn more about the Mistral text generation models <https://docs.mistral.ai/getting-started/models/>`__

**Anthropic**

* ``claude-3-haiku-20240307``
* ``claude-3-sonnet-20240229``
* ``claude-3-opus-20240229``

`Learn more about the Athropic text generation models <https://docs.anthropic.com/claude/docs/models-overview>`__

* ``query`` (string, required): The query string use as the basis for text
generation.
Expand Down
5 changes: 3 additions & 2 deletions docs/ai/reference_python.rst
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ GelAI
Generates embeddings for input texts.

:param *inputs:
:param inputs:
Input texts.
:param model:
The embedding model to use
Expand Down Expand Up @@ -283,10 +283,11 @@ AsyncGelAI
instance.

.. py:method:: generate_embeddings(*inputs: str, model: str) -> list[float]
:noindex:

Generates embeddings for input texts.

:param *inputs:
:param inputs:
Input texts.
:param model:
The embedding model to use
Expand Down
2 changes: 1 addition & 1 deletion docs/datamodel/extensions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ There are a few built-in extensions available:
- ``edgeql_http``: enables :ref:`EdgeQL over HTTP <ref_edgeql_http>`,
- ``graphql``: enables :ref:`GraphQL <ref_graphql_index>`,
- ``auth``: enables :ref:`Gel Auth <ref_guide_auth>`,
- ``ai``: enables :ref:`ext::ai module <ref_ai_reference>`,
- ``ai``: enables :ref:`ext::ai module <ref_ai_extai_reference>`,

- ``pg_trgm``: enables ``ext::pg_trgm``, which re-exports
`pgtrgm <https://www.postgresql.org/docs/current/pgtrgm.html>`__,
Expand Down

0 comments on commit 2fec3f1

Please sign in to comment.