jianghuyihei commited on
Commit
1099179
1 Parent(s): d7cf431

update api

Browse files
Files changed (2) hide show
  1. LLM.py +3 -3
  2. agents.py +4 -4
LLM.py CHANGED
@@ -56,7 +56,7 @@ class base_llm:
56
 
57
 
58
  class openai_llm(base_llm):
59
- def __init__(self,model = "gpt4o-0513") -> None:
60
  super().__init__()
61
  self.model = model
62
  if "AZURE_OPENAI_ENDPOINT" not in os.environ or os.environ["AZURE_OPENAI_ENDPOINT"] == "":
@@ -68,13 +68,13 @@ class openai_llm(base_llm):
68
  if api_version == "":
69
  api_version = None
70
  self.client = AzureOpenAI(
71
- azure_deployment= os.environ.get("AZURE_OPENAI_DEPLOYMENT",None),
72
  azure_endpoint=os.environ["AZURE_OPENAI_ENDPOINT"],
73
  api_key=os.environ["AZURE_OPENAI_KEY"],
74
  api_version= api_version
75
  )
76
  self.async_client = AsyncAzureOpenAI(
77
- azure_deployment= os.environ.get("AZURE_OPENAI_DEPLOYMENT",None),
78
  azure_endpoint=os.environ["AZURE_OPENAI_ENDPOINT"],
79
  api_key=os.environ["AZURE_OPENAI_KEY"],
80
  api_version= api_version
 
56
 
57
 
58
  class openai_llm(base_llm):
59
+ def __init__(self,model = "gpt4o-0513",deployment = "gpt-4o-0806") -> None:
60
  super().__init__()
61
  self.model = model
62
  if "AZURE_OPENAI_ENDPOINT" not in os.environ or os.environ["AZURE_OPENAI_ENDPOINT"] == "":
 
68
  if api_version == "":
69
  api_version = None
70
  self.client = AzureOpenAI(
71
+ azure_deployment= deployment,
72
  azure_endpoint=os.environ["AZURE_OPENAI_ENDPOINT"],
73
  api_key=os.environ["AZURE_OPENAI_KEY"],
74
  api_version= api_version
75
  )
76
  self.async_client = AsyncAzureOpenAI(
77
+ azure_deployment= deployment,
78
  azure_endpoint=os.environ["AZURE_OPENAI_ENDPOINT"],
79
  api_key=os.environ["AZURE_OPENAI_KEY"],
80
  api_version= api_version
agents.py CHANGED
@@ -6,12 +6,12 @@ from prompts import *
6
  from utils import extract
7
 
8
 
9
- def get_llm(model = "gpt-4o-0806"):
10
- return openai_llm(model)
11
 
12
  def get_llms():
13
- main_llm = get_llm("gpt4o (08-06)")
14
- cheap_llm = get_llm("gpt-4o-mini (0718)")
15
  return main_llm,cheap_llm
16
 
17
  def judge_idea(i,j,idea0,idea1,topic,llm):
 
6
  from utils import extract
7
 
8
 
9
+ def get_llm(model = "gpt-4o-0806",deployment = "gpt-4o-0806"):
10
+ return openai_llm(model,deployment)
11
 
12
  def get_llms():
13
+ main_llm = get_llm("gpt4o (08-06)","gpt-4o-0806")
14
+ cheap_llm = get_llm("gpt-4o-mini (0718)","gpt-4o-mini-0718")
15
  return main_llm,cheap_llm
16
 
17
  def judge_idea(i,j,idea0,idea1,topic,llm):