azure openai features and bugs solve - openai_version, docs (#1425)
This commit is contained in:
@@ -103,6 +103,7 @@ class BaseLlmConfig(BaseConfig):
|
||||
http_async_client: Optional[Any] = None,
|
||||
local: Optional[bool] = False,
|
||||
default_headers: Optional[Mapping[str, str]] = None,
|
||||
api_version: Optional[str] = None,
|
||||
):
|
||||
"""
|
||||
Initializes a configuration class instance for the LLM.
|
||||
@@ -185,6 +186,7 @@ class BaseLlmConfig(BaseConfig):
|
||||
self.local = local
|
||||
self.default_headers = default_headers
|
||||
self.online = online
|
||||
self.api_version = api_version
|
||||
|
||||
if isinstance(prompt, str):
|
||||
prompt = Template(prompt)
|
||||
|
||||
@@ -25,7 +25,7 @@ class AzureOpenAILlm(BaseLlm):
|
||||
|
||||
chat = AzureChatOpenAI(
|
||||
deployment_name=config.deployment_name,
|
||||
openai_api_version="2023-05-15",
|
||||
openai_api_version=str(config.api_version) if config.api_version else "2023-05-15",
|
||||
model_name=config.model or "gpt-3.5-turbo",
|
||||
temperature=config.temperature,
|
||||
max_tokens=config.max_tokens,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import datetime
|
||||
import itertools
|
||||
import json
|
||||
import logging
|
||||
@@ -439,6 +440,7 @@ def validate_config(config_data):
|
||||
Optional("local"): bool,
|
||||
Optional("base_url"): str,
|
||||
Optional("default_headers"): dict,
|
||||
Optional("api_version"): Or(str, datetime.date)
|
||||
},
|
||||
},
|
||||
Optional("vectordb"): {
|
||||
|
||||
Reference in New Issue
Block a user