Skip to content

Commit

Permalink
Merge pull request #32 from Mac0q/pre-release
Browse files Browse the repository at this point in the history
openai config
  • Loading branch information
vyokky authored Mar 21, 2024
2 parents a01f4f3 + 063c54e commit 71738f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
6 changes: 5 additions & 1 deletion ufo/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ def update_api_base(configs, agent):
api_version=configs[agent]["API_VERSION"]
)
configs[agent]["API_MODEL"] = configs[agent]["API_DEPLOYMENT_ID"]

elif configs[agent]["API_TYPE"].lower() == "openai":
if 'chat/completions' in configs[agent]["API_BASE"]:
configs[agent]["API_BASE"] = configs[agent]["API_BASE"][:-18] if configs[agent]["API_BASE"].endswith(
"/") else configs[agent]["API_BASE"][:-17]


def optimize_configs(configs):
update_api_base(configs,'APP_AGENT')
Expand Down
18 changes: 1 addition & 17 deletions ufo/llm/openai.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
import datetime
from typing import Any, Literal, Optional
from typing import Any, Optional
import openai
from openai import AzureOpenAI, OpenAI


available_models = Literal[ #for azure_ad
"gpt-35-turbo-20220309",
"gpt-35-turbo-16k-20230613",
"gpt-35-turbo-20230613",
"gpt-35-turbo-1106",

"gpt-4-20230321",
"gpt-4-20230613",
"gpt-4-32k-20230321",
"gpt-4-32k-20230613",
"gpt-4-1106-preview",
"gpt-4-0125-preview",

"gpt-4-visual-preview",
]


class OpenAIService:
def __init__(self, config, agent_type: str):
Expand Down

0 comments on commit 71738f6

Please sign in to comment.