KarthickAdopleAI commited on
Commit
1000f0b
·
verified ·
1 Parent(s): e0e4187

Update ContractGenerator.py

Browse files
Files changed (1) hide show
  1. ContractGenerator.py +11 -10
ContractGenerator.py CHANGED
@@ -33,22 +33,23 @@ class ContractGenerator:
33
  """
34
 
35
  # Define a prompt
 
 
 
 
 
36
  conversation = [
37
  {"role": "system", "content": "You are a helpful Contract Generator."},
38
  {"role": "user", "content": f"""Your task is to generate a contract form based on user instructions. ***Instructions:{instructions}***"""}
39
  ]
40
 
41
  # Call OpenAI GPT-3.5-turbo
42
- chat_completion = openai.ChatCompletion.create(
43
- engine="ChatGPT",
44
- messages = conversation,
45
- temperature=0.7,
46
- max_tokens=800,
47
- top_p=0.95,
48
- frequency_penalty=0,
49
- presence_penalty=0,
50
- stop=None
51
- )
52
  response = chat_completion.choices[0].message.content
53
  return response
54
 
 
33
  """
34
 
35
  # Define a prompt
36
+ client = AzureOpenAI(api_key=os.getenv("AZURE_OPENAI_KEY"),
37
+ api_version="2023-07-01-preview",
38
+ azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
39
+ )
40
+
41
  conversation = [
42
  {"role": "system", "content": "You are a helpful Contract Generator."},
43
  {"role": "user", "content": f"""Your task is to generate a contract form based on user instructions. ***Instructions:{instructions}***"""}
44
  ]
45
 
46
  # Call OpenAI GPT-3.5-turbo
47
+ chat_completion = client.chat.completions.create(
48
+ model = "ChatGPT",
49
+ messages = conversation,
50
+ max_tokens=1000,
51
+ temperature=0
52
+ )
 
 
 
 
53
  response = chat_completion.choices[0].message.content
54
  return response
55