mirror of https://github.com/microsoft/autogen.git
parent
d578d0dfd9
commit
2d6c8c012b
|
@ -13,13 +13,13 @@
|
|||
"api_key": "<your Azure OpenAI API key here>",
|
||||
"base_url": "<your Azure OpenAI API base here>",
|
||||
"api_type": "azure",
|
||||
"api_version": "2024-02-15-preview"
|
||||
"api_version": "2024-02-01"
|
||||
},
|
||||
{
|
||||
"model": "<your Azure OpenAI deployment name>",
|
||||
"api_key": "<your Azure OpenAI API key here>",
|
||||
"base_url": "<your Azure OpenAI API base here>",
|
||||
"api_type": "azure",
|
||||
"api_version": "2024-02-15-preview"
|
||||
"api_version": "2024-02-01"
|
||||
}
|
||||
]
|
||||
|
|
|
@ -349,7 +349,7 @@ class OpenAIWrapper:
|
|||
"api_key": os.environ.get("AZURE_OPENAI_API_KEY"),
|
||||
"api_type": "azure",
|
||||
"base_url": os.environ.get("AZURE_OPENAI_API_BASE"),
|
||||
"api_version": "2024-02-15-preview",
|
||||
"api_version": "2024-02-01",
|
||||
},
|
||||
{
|
||||
"model": "gpt-3.5-turbo",
|
||||
|
@ -559,7 +559,7 @@ class OpenAIWrapper:
|
|||
```
|
||||
|
||||
- allow_format_str_template (bool | None): Whether to allow format string template in the config. Default to false.
|
||||
- api_version (str | None): The api version. Default to None. E.g., "2024-02-15-preview".
|
||||
- api_version (str | None): The api version. Default to None. E.g., "2024-02-01".
|
||||
Raises:
|
||||
- RuntimeError: If all declared custom model clients are not registered
|
||||
- APIError: If any model client create call raises an APIError
|
||||
|
|
|
@ -741,7 +741,7 @@ class Completion(openai_Completion):
|
|||
"api_key": os.environ.get("AZURE_OPENAI_API_KEY"),
|
||||
"api_type": "azure",
|
||||
"base_url": os.environ.get("AZURE_OPENAI_API_BASE"),
|
||||
"api_version": "2024-02-15-preview",
|
||||
"api_version": "2024-02-01",
|
||||
},
|
||||
{
|
||||
"model": "gpt-3.5-turbo",
|
||||
|
|
|
@ -14,7 +14,7 @@ from openai.types.beta.assistant import Assistant
|
|||
from packaging.version import parse
|
||||
|
||||
NON_CACHE_KEY = ["api_key", "base_url", "api_type", "api_version", "azure_ad_token", "azure_ad_token_provider"]
|
||||
DEFAULT_AZURE_API_VERSION = "2024-02-15-preview"
|
||||
DEFAULT_AZURE_API_VERSION = "2024-02-01"
|
||||
OAI_PRICE1K = {
|
||||
# https://openai.com/api/pricing/
|
||||
# gpt-4o
|
||||
|
@ -127,7 +127,7 @@ def get_config_list(
|
|||
|
||||
# Optionally, define the API type and version if they are common for all keys
|
||||
api_type = 'azure'
|
||||
api_version = '2024-02-15-preview'
|
||||
api_version = '2024-02-01'
|
||||
|
||||
# Call the get_config_list function to get a list of configuration dictionaries
|
||||
config_list = get_config_list(api_keys, base_urls, api_type, api_version)
|
||||
|
|
|
@ -1 +1 @@
|
|||
__version__ = "0.2.28"
|
||||
__version__ = "0.2.29"
|
||||
|
|
|
@ -84,14 +84,14 @@
|
|||
" 'api_key': '<your Azure OpenAI API key here>',\n",
|
||||
" 'base_url': '<your Azure OpenAI API base here>',\n",
|
||||
" 'api_type': 'azure',\n",
|
||||
" 'api_version': '2024-02-15-preview',\n",
|
||||
" 'api_version': '2024-02-01',\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" 'model': 'gpt-3.5-turbo',\n",
|
||||
" 'api_key': '<your Azure OpenAI API key here>',\n",
|
||||
" 'base_url': '<your Azure OpenAI API base here>',\n",
|
||||
" 'api_type': 'azure',\n",
|
||||
" 'api_version': '2024-02-15-preview',\n",
|
||||
" 'api_version': '2024-02-01',\n",
|
||||
" },\n",
|
||||
"]\n",
|
||||
"```\n",
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
" \"model\": \"gpt-35-turbo-0613\", # 0613 or newer is needed to use functions\n",
|
||||
" \"base_url\": \"<your Azure OpenAI API base>\", \n",
|
||||
" \"api_type\": \"azure\", \n",
|
||||
" \"api_version\": \"2024-02-15-preview\", # 2023-07-01-preview or newer is needed to use functions\n",
|
||||
" \"api_version\": \"2024-02-01\", # 2023-07-01-preview or newer is needed to use functions\n",
|
||||
" \"api_key\": \"<your Azure OpenAI API key>\",\n",
|
||||
" \"tags\": [\"gpt-3.5-turbo\", \"0613\"],\n",
|
||||
" }\n",
|
||||
|
|
|
@ -226,14 +226,14 @@
|
|||
" \"api_key\": \"<your Azure OpenAI API key here>\",\n",
|
||||
" \"base_url\": \"<your Azure OpenAI API base here>\",\n",
|
||||
" \"api_type\": \"azure\",\n",
|
||||
" \"api_version\": \"2024-02-15-preview\"\n",
|
||||
" \"api_version\": \"2024-02-01\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"model\": \"gpt-4-32k\",\n",
|
||||
" \"api_key\": \"<your Azure OpenAI API key here>\",\n",
|
||||
" \"base_url\": \"<your Azure OpenAI API base here>\",\n",
|
||||
" \"api_type\": \"azure\",\n",
|
||||
" \"api_version\": \"2024-02-15-preview\"\n",
|
||||
" \"api_version\": \"2024-02-01\"\n",
|
||||
" }\n",
|
||||
"]\n",
|
||||
"```\n",
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
" {\n",
|
||||
" 'model': 'dalle',\n",
|
||||
" 'api_key': 'Your API Key here',\n",
|
||||
" 'api_version': '2024-02-15-preview'\n",
|
||||
" 'api_version': '2024-02-01'\n",
|
||||
" }\n",
|
||||
"]\n",
|
||||
" ```"
|
||||
|
|
|
@ -90,7 +90,7 @@
|
|||
" 'api_key': '<your Azure OpenAI API key here>',\n",
|
||||
" 'base_url': '<your Azure OpenAI API base here>',\n",
|
||||
" 'api_type': 'azure',\n",
|
||||
" 'api_version': '2024-02-15-preview',\n",
|
||||
" 'api_version': '2024-02-01\n",
|
||||
" 'tags': ['tool', 'gpt-3.5-turbo'],\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
|
@ -98,7 +98,7 @@
|
|||
" 'api_key': '<your Azure OpenAI API key here>',\n",
|
||||
" 'base_url': '<your Azure OpenAI API base here>',\n",
|
||||
" 'api_type': 'azure',\n",
|
||||
" 'api_version': '2024-02-15-preview',\n",
|
||||
" 'api_version': '2024-02-01\n",
|
||||
" 'tags': ['tool', 'gpt-3.5-turbo-16k'],\n",
|
||||
" },\n",
|
||||
"]\n",
|
||||
|
|
|
@ -90,7 +90,7 @@
|
|||
" 'api_key': '<your Azure OpenAI API key here>',\n",
|
||||
" 'base_url': '<your Azure OpenAI API base here>',\n",
|
||||
" 'api_type': 'azure',\n",
|
||||
" 'api_version': '2024-02-15-preview',\n",
|
||||
" 'api_version': '2024-02-01',\n",
|
||||
" 'tags': ['tool', '3.5-tool'],\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
|
@ -98,7 +98,7 @@
|
|||
" 'api_key': '<your Azure OpenAI API key here>',\n",
|
||||
" 'base_url': '<your Azure OpenAI API base here>',\n",
|
||||
" 'api_type': 'azure',\n",
|
||||
" 'api_version': '2024-02-15-preview',\n",
|
||||
" 'api_version': '2024-02-01',\n",
|
||||
" 'tags': ['tool', '3.5-tool'],\n",
|
||||
" },\n",
|
||||
"]\n",
|
||||
|
|
|
@ -90,14 +90,14 @@
|
|||
" 'api_key': '<your Azure OpenAI API key here>',\n",
|
||||
" 'base_url': '<your Azure OpenAI API base here>',\n",
|
||||
" 'api_type': 'azure',\n",
|
||||
" 'api_version': '2024-02-15-preview',\n",
|
||||
" 'api_version': '2024-02-01',\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" 'model': 'gpt-3.5-turbo-16k',\n",
|
||||
" 'api_key': '<your Azure OpenAI API key here>',\n",
|
||||
" 'base_url': '<your Azure OpenAI API base here>',\n",
|
||||
" 'api_type': 'azure',\n",
|
||||
" 'api_version': '2024-02-15-preview',\n",
|
||||
" 'api_version': '2024-02-01',\n",
|
||||
" },\n",
|
||||
"]\n",
|
||||
"```\n",
|
||||
|
|
|
@ -578,7 +578,7 @@
|
|||
" \"api_key\": access_token,\n",
|
||||
" \"base_url\": prebuilt_AI_base_url,\n",
|
||||
" \"api_type\": \"azure\",\n",
|
||||
" \"api_version\": \"2024-02-15-preview\",\n",
|
||||
" \"api_version\": \"2024-02-01\",\n",
|
||||
" },\n",
|
||||
"]"
|
||||
]
|
||||
|
|
|
@ -93,14 +93,14 @@
|
|||
" 'api_key': '<your Azure OpenAI API key here>',\n",
|
||||
" 'base_url': '<your Azure OpenAI API base here>',\n",
|
||||
" 'api_type': 'azure',\n",
|
||||
" 'api_version': '2024-02-15-preview',\n",
|
||||
" 'api_version': '2024-02-01',\n",
|
||||
" }, # Azure OpenAI API endpoint for gpt-4\n",
|
||||
" {\n",
|
||||
" 'model': 'gpt-4-32k',\n",
|
||||
" 'api_key': '<your Azure OpenAI API key here>',\n",
|
||||
" 'base_url': '<your Azure OpenAI API base here>',\n",
|
||||
" 'api_type': 'azure',\n",
|
||||
" 'api_version': '2024-02-15-preview',\n",
|
||||
" 'api_version': '2024-02-01',\n",
|
||||
" }, # Azure OpenAI API endpoint for gpt-4-32k\n",
|
||||
"]\n",
|
||||
"```\n",
|
||||
|
|
|
@ -90,14 +90,14 @@
|
|||
" 'api_key': '<your Azure OpenAI API key here>',\n",
|
||||
" 'base_url': '<your Azure OpenAI API base here>',\n",
|
||||
" 'api_type': 'azure',\n",
|
||||
" 'api_version': '2024-02-15-preview',\n",
|
||||
" 'api_version': '2024-02-01',\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" 'model': 'gpt-3.5-turbo-16k',\n",
|
||||
" 'api_key': '<your Azure OpenAI API key here>',\n",
|
||||
" 'base_url': '<your Azure OpenAI API base here>',\n",
|
||||
" 'api_type': 'azure',\n",
|
||||
" 'api_version': '2024-02-15-preview',\n",
|
||||
" 'api_version': '2024-02-01',\n",
|
||||
" },\n",
|
||||
"]\n",
|
||||
"```\n",
|
||||
|
|
|
@ -112,14 +112,14 @@
|
|||
" 'api_key': '<your Azure OpenAI API key here>',\n",
|
||||
" 'base_url': '<your Azure OpenAI API base here>',\n",
|
||||
" 'api_type': 'azure',\n",
|
||||
" 'api_version': '2024-02-15-preview',\n",
|
||||
" 'api_version': '2024-02-01',\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" 'model': 'gpt-4-32k',\n",
|
||||
" 'api_key': '<your Azure OpenAI API key here>',\n",
|
||||
" 'base_url': '<your Azure OpenAI API base here>',\n",
|
||||
" 'api_type': 'azure',\n",
|
||||
" 'api_version': '2024-02-15-preview',\n",
|
||||
" 'api_version': '2024-02-01',\n",
|
||||
" },\n",
|
||||
"]\n",
|
||||
"```\n",
|
||||
|
|
|
@ -70,14 +70,14 @@
|
|||
" \"api_key\": \"<your Azure OpenAI API key here>\",\n",
|
||||
" \"base_url\": \"<your Azure OpenAI API base here>\",\n",
|
||||
" \"api_type\": \"azure\",\n",
|
||||
" \"api_version\": \"2024-02-15-preview\"\n",
|
||||
" \"api_version\": \"2024-02-01\"\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"model\": \"gpt-4-32k\",\n",
|
||||
" \"api_key\": \"<your Azure OpenAI API key here>\",\n",
|
||||
" \"base_url\": \"<your Azure OpenAI API base here>\",\n",
|
||||
" \"api_type\": \"azure\",\n",
|
||||
" \"api_version\": \"2024-02-15-preview\"\n",
|
||||
" \"api_version\": \"2024-02-01\"\n",
|
||||
" }\n",
|
||||
"]\n",
|
||||
"```\n",
|
||||
|
|
|
@ -104,14 +104,14 @@
|
|||
" 'api_key': '<your Azure OpenAI API key here>',\n",
|
||||
" 'base_url': '<your Azure OpenAI API base here>',\n",
|
||||
" 'api_type': 'azure',\n",
|
||||
" 'api_version': '2024-02-15-preview',\n",
|
||||
" 'api_version': '2024-02-01',\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" 'model': 'gpt-4-32k-0314',\n",
|
||||
" 'api_key': '<your Azure OpenAI API key here>',\n",
|
||||
" 'base_url': '<your Azure OpenAI API base here>',\n",
|
||||
" 'api_type': 'azure',\n",
|
||||
" 'api_version': '2024-02-15-preview',\n",
|
||||
" 'api_version': '2024-02-01',\n",
|
||||
" },\n",
|
||||
"]\n",
|
||||
"```\n",
|
||||
|
|
|
@ -131,13 +131,13 @@
|
|||
" 'api_key': '<your first Azure OpenAI API key here>',\n",
|
||||
" 'base_url': '<your first Azure OpenAI API base here>',\n",
|
||||
" 'api_type': 'azure',\n",
|
||||
" 'api_version': '2024-02-15-preview',\n",
|
||||
" 'api_version': '2024-02-01',\n",
|
||||
" }, # only if at least one Azure OpenAI API key is found\n",
|
||||
" {\n",
|
||||
" 'api_key': '<your second Azure OpenAI API key here>',\n",
|
||||
" 'base_url': '<your second Azure OpenAI API base here>',\n",
|
||||
" 'api_type': 'azure',\n",
|
||||
" 'api_version': '2024-02-15-preview',\n",
|
||||
" 'api_version': '2024-02-01',\n",
|
||||
" }, # only if the second Azure OpenAI API key is found\n",
|
||||
"]\n",
|
||||
"```\n",
|
||||
|
|
|
@ -97,13 +97,13 @@
|
|||
"# 'api_key': '<your first Azure OpenAI API key here>',\n",
|
||||
"# 'base_url': '<your first Azure OpenAI API base here>',\n",
|
||||
"# 'api_type': 'azure',\n",
|
||||
"# 'api_version': '2024-02-15-preview',\n",
|
||||
"# 'api_version': '2024-02-01',\n",
|
||||
"# }, # Azure OpenAI API endpoint for gpt-4\n",
|
||||
"# {\n",
|
||||
"# 'api_key': '<your second Azure OpenAI API key here>',\n",
|
||||
"# 'base_url': '<your second Azure OpenAI API base here>',\n",
|
||||
"# 'api_type': 'azure',\n",
|
||||
"# 'api_version': '2024-02-15-preview',\n",
|
||||
"# 'api_version': '2024-02-01',\n",
|
||||
"# }, # another Azure OpenAI API endpoint for gpt-4\n",
|
||||
"# ]\n",
|
||||
"\n",
|
||||
|
@ -131,14 +131,14 @@
|
|||
"# 'api_key': '<your first Azure OpenAI API key here>',\n",
|
||||
"# 'base_url': '<your first Azure OpenAI API base here>',\n",
|
||||
"# 'api_type': 'azure',\n",
|
||||
"# 'api_version': '2024-02-15-preview',\n",
|
||||
"# 'api_version': '2024-02-01',\n",
|
||||
"# }, # Azure OpenAI API endpoint for gpt-3.5-turbo\n",
|
||||
"# {\n",
|
||||
"# 'model': 'gpt-35-turbo-v0301',\n",
|
||||
"# 'api_key': '<your second Azure OpenAI API key here>',\n",
|
||||
"# 'base_url': '<your second Azure OpenAI API base here>',\n",
|
||||
"# 'api_type': 'azure',\n",
|
||||
"# 'api_version': '2024-02-15-preview',\n",
|
||||
"# 'api_version': '2024-02-01',\n",
|
||||
"# }, # another Azure OpenAI API endpoint for gpt-3.5-turbo with deployment name gpt-35-turbo-v0301\n",
|
||||
"# ]"
|
||||
]
|
||||
|
|
|
@ -35,7 +35,7 @@ def _get_config_list() -> List[Dict[str, str]]:
|
|||
'api_key': '0123456789abcdef0123456789abcdef',
|
||||
'base_url': 'https://my-deployment.openai.azure.com/',
|
||||
'api_type': 'azure',
|
||||
'api_version': '2024-02-15-preview',
|
||||
'api_version': '2024-02-01',
|
||||
},
|
||||
{
|
||||
'model': 'gpt-4',
|
||||
|
|
|
@ -58,7 +58,7 @@ JSON_SAMPLE = """
|
|||
"api_key": "111113fc7e8a46419bfac511bb301111",
|
||||
"base_url": "https://1111.openai.azure.com",
|
||||
"api_type": "azure",
|
||||
"api_version": "2024-02-15-preview"
|
||||
"api_version": "2024-02-01"
|
||||
},
|
||||
{
|
||||
"model": "gpt",
|
||||
|
@ -83,7 +83,7 @@ FILTER_CONFIG_TEST = [
|
|||
"expected": JSON_SAMPLE_DICT[2:4],
|
||||
},
|
||||
{
|
||||
"filter_dict": {"api_type": "azure", "api_version": "2024-02-15-preview"},
|
||||
"filter_dict": {"api_type": "azure", "api_version": "2024-02-01"},
|
||||
"exclude": False,
|
||||
"expected": [JSON_SAMPLE_DICT[2]],
|
||||
},
|
||||
|
|
|
@ -202,7 +202,7 @@ def test_log_oai_client(db_connection):
|
|||
|
||||
openai_config = {
|
||||
"api_key": "some_key",
|
||||
"api_version": "2024-02-15-preview",
|
||||
"api_version": "2024-02-01",
|
||||
"azure_deployment": "gpt-4",
|
||||
"azure_endpoint": "https://foobar.openai.azure.com/",
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ llm_config = LLMConfig(
|
|||
"api_key": "<azure_api_key>",
|
||||
"base_url": "<azure api base url>",
|
||||
"api_type": "azure",
|
||||
"api_version": "2024-02-15-preview"
|
||||
"api_version": "2024-02-01"
|
||||
}],
|
||||
temperature=0,
|
||||
)
|
||||
|
|
|
@ -183,7 +183,7 @@ client = OpenAIWrapper(
|
|||
"api_key": os.environ.get("AZURE_OPENAI_API_KEY"),
|
||||
"api_type": "azure",
|
||||
"base_url": os.environ.get("AZURE_OPENAI_API_BASE"),
|
||||
"api_version": "2024-02-15-preview",
|
||||
"api_version": "2024-02-01",
|
||||
},
|
||||
{
|
||||
"model": "gpt-3.5-turbo",
|
||||
|
|
|
@ -92,7 +92,7 @@
|
|||
" \"api_type\": \"azure\",\n",
|
||||
" \"api_key\": os.environ['AZURE_OPENAI_API_KEY'],\n",
|
||||
" \"base_url\": \"https://ENDPOINT.openai.azure.com/\",\n",
|
||||
" \"api_version\": \"2024-02-15-preview\"\n",
|
||||
" \"api_version\": \"2024-02-01\"\n",
|
||||
" }\n",
|
||||
" ]\n",
|
||||
" ```\n",
|
||||
|
@ -328,7 +328,7 @@
|
|||
" \"api_key\": os.environ.get(\"AZURE_OPENAI_API_KEY\"),\n",
|
||||
" \"api_type\": \"azure\",\n",
|
||||
" \"base_url\": os.environ.get(\"AZURE_OPENAI_API_BASE\"),\n",
|
||||
" \"api_version\": \"2024-02-15-preview\",\n",
|
||||
" \"api_version\": \"2024-02-01\",\n",
|
||||
" },\n",
|
||||
" {\n",
|
||||
" \"model\": \"llama-7B\",\n",
|
||||
|
|
Loading…
Reference in New Issue