From 7a517ecf9ca671b74a667f32c7ce675ecb383bce Mon Sep 17 00:00:00 2001 From: Mateusz Lazanowski Date: Mon, 1 Jul 2024 12:25:17 +0200 Subject: [PATCH] Fix param names - azure_openai_pipeline.py Fixed 2 bugs, lack of import os, and wrong valves parameters names --- examples/pipelines/providers/azure_openai_pipeline.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/pipelines/providers/azure_openai_pipeline.py b/examples/pipelines/providers/azure_openai_pipeline.py index aae7581..39146e0 100644 --- a/examples/pipelines/providers/azure_openai_pipeline.py +++ b/examples/pipelines/providers/azure_openai_pipeline.py @@ -1,6 +1,7 @@ from typing import List, Union, Generator, Iterator from pydantic import BaseModel import requests +import os class Pipeline: @@ -52,7 +53,7 @@ def pipe( "Content-Type": "application/json", } - url = f"{self.valves.AZURE_OPENAI_ENDPOINT}/openai/deployments/{self.valves.DEPLOYMENT_NAME}/chat/completions?api-version={self.valves.API_VERSION}" + url = f"{self.valves.AZURE_OPENAI_ENDPOINT}/openai/deployments/{self.valves.AZURE_OPENAI_DEPLOYMENT_NAME}/chat/completions?api-version={self.valves.AZURE_OPENAI_API_VERSION}" allowed_params = {'messages', 'temperature', 'role', 'content', 'contentPart', 'contentPartImage', 'enhancements', 'dataSources', 'n', 'stream', 'stop', 'max_tokens', 'presence_penalty',