Skip to content

Commit

Permalink
Merge pull request #1875 from n8n-io/azure_openai
Browse files Browse the repository at this point in the history
Add Azure Open AI nodes & credentials
  • Loading branch information
Deborah authored Feb 7, 2024
2 parents fad4852 + bf02073 commit 31a53f7
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: Embeddings Azure OpenAI
description: Documentation for the Embeddings Azure OpenAI node in n8n, a workflow automation platform. Includes details of operations and configuration, and links to examples and credentials information.
---

# Embeddings Azure OpenAI

Use the Embeddings Azure OpenAI node to generate embeddings for a given text.

On this page, you'll find the node parameters for the Embeddings Azure OpenAI node, and links to more resources.

/// note | Credentials
You can find authentication information for this node [here](/integrations/builtin/credentials/azureopenai/).
///

/// note | Examples and templates
For usage examples and templates to help you get started, refer to n8n's [OpenAI Embeddings integrations](https://n8n.io/integrations/embeddings-azure-openai/){:target=_blank .external-link} page.
///

--8<-- "_snippets/integrations/builtin/cluster-nodes/sub-node-expression-resolution.md"


## Node options

* **Model (Deployment) Name**: The model(deployment) to use for generating embeddings.
* **Batch Size**: maximum number of documents to send in each request.
* **Strip New Lines**: whether to remove new line characters from input text. n8n enables this by default.
* **Timeout**: maximum amount of time a request can take in seconds. Set to `-1` for no timeout.

## Related resources

View [example workflows and related content](https://n8n.io/integrations/embeddings-azure-openai/){:target=_blank .external-link} on n8n's website.

Refer to [LangChains's OpenAI embeddings documentation](https://js.langchain.com/docs/modules/data_connection/text_embedding/integrations/azure_openai){:target=_blank .external-link} for more information about the service.

--8<-- "_snippets/integrations/builtin/cluster-nodes/langchain-overview-link.md"
--8<-- "_glossary/ai-glossary.md"
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: Azure OpenAI Chat Model
description: Documentation for the OpenAI Chat Model node in n8n, a workflow automation platform. Includes details of operations and configuration, and links to examples and credentials information.
---

# Azure OpenAI Chat Model

Use the Azure OpenAI Chat Model node to use OpenAI's chat models with conversational agents.

On this page, you'll find the node parameters for the Azure OpenAI Chat Model node, and links to more resources.

/// note | Credentials
You can find authentication information for this node [here](/integrations/builtin/credentials/azureopenai/).
///

/// note | Examples and templates
For usage examples and templates to help you get started, refer to n8n's [Azure OpenAI Chat Model integrations](https://n8n.io/integrations/azure-openai-chat-model/){:target=_blank .external-link} page.
///

--8<-- "_snippets/integrations/builtin/cluster-nodes/sub-node-expression-resolution.md"

## Node parameters

**Model**: the model to use to generate the completion.

## Node options

* **Frequency Penalty**: increase this to reduce the chance of the model repeating itself.
* **Maximum Number of Tokens**: the completion length, in characters.
* **Response Format**: choose **Text** or **JSON**. **JSON** ensures the model returns valid JSON.
* **Presence Penalty**: increase this to increase the chance of the model talking about new topics.
* **Sampling Temperature**: controls the randomness of the sampling process. A higher temperature creates more diverse sampling, but increases the risk of hallucinations.
* **Timeout**: maximum request time in milliseconds.
* **Max Retries**: maximum number of times to retry a request.
* **Top P**: use a lower value to ignore less probable options.


## Related resources

View [example workflows and related content](https://n8n.io/integrations/azure-openai-chat-model/){:target=_blank .external-link} on n8n's website.

Refer to [LangChains's Azure OpenAI documentation](https://js.langchain.com/docs/integrations/chat/azure){:target=_blank .external-link} for more information about the service.

--8<-- "_snippets/integrations/builtin/cluster-nodes/langchain-overview-link.md"
--8<-- "_glossary/ai-glossary.md"
31 changes: 31 additions & 0 deletions docs/integrations/builtin/credentials/azureopenai.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: Azure OpenAI credentials
description: Documentation for Azure OpenAI credentials. Use these credentials to authenticate OpenAI in n8n, a workflow automation platform.
contentType: integration
---

# Azure OpenAI credentials

You can use these credentials to authenticate the following nodes with OpenAI.

- [Chat Azure OpenAI](/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatazureopenai)
- [Embeddings Azure OpenAI](/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.embeddingsazureopenai)


## Prerequisites

Log-in to [Azure](https://portal.azure.com/#home/) account.

## Using API Key
To get the API key, follow the steps below:

1. Open [Azure OpenAI service](https://portal.azure.com/#view/Microsoft_Azure_ProjectOxford/CognitiveServicesHub/~/OpenAIHome) in Azure portal
2. Click on **Create** button
3. Enter the name of the resource, region and select the pricing tier. Input the resource name into the **Resource name** field in the credentials in n8n
4. Click on **Next** button until you reach the **Review + create** step
5. Click on **Create** button
6. Once the resource is created, open it and click on **Keys and Endpoint** tab
7. Copy the **Key 1** value, this is your **API key**
8. Click on **Model deployments** tab followed by **Manage Deployments** button to get to Azure OpenAI Studio
9. Click on **Create new deployment** button, select the model, version and provide a name and click on **Create** button
10. Once the model is deployed, use the name as **Deployment name** as the model for the Azure OpenAI nodes
3 changes: 3 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -697,13 +697,15 @@ nav:
- integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.documentdefaultdataloader.md
- integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.documentgithubloader.md
- integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.embeddingsawsbedrock.md
- integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.embeddingsazureopenai.md
- integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.embeddingscohere.md
- integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.embeddingsgooglepalm.md
- integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.embeddingshuggingfaceinference.md
- integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.embeddingsmistralcloud.md
- integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.embeddingsopenai.md
- integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatanthropic.md
- integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatawsbedrock.md
- integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatazureopenai.md
- integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatgooglepalm.md
- integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatmistralcloud.md
- integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatollama.md
Expand Down Expand Up @@ -753,6 +755,7 @@ nav:
- integrations/builtin/credentials/automizy.md
- integrations/builtin/credentials/autopilot.md
- integrations/builtin/credentials/aws.md
- integrations/builtin/credentials/azureopenai.md
- integrations/builtin/credentials/bamboohr.md
- integrations/builtin/credentials/bannerbear.md
- integrations/builtin/credentials/baserow.md
Expand Down

0 comments on commit 31a53f7

Please sign in to comment.