mgokg commited on
Commit
09e15cd
·
verified ·
1 Parent(s): cd0f9aa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -13,13 +13,22 @@ import os
13
  api_key = os.getenv('groq')
14
  client = groq.Client(api_key=api_key)
15
 
 
 
 
 
 
 
 
 
 
16
  def llm(message):
17
  try:
18
  completion = client.chat.completions.create(
19
- model="Mixtral-8x7b-32768",
20
  messages=[
21
  {"role": "system", "content": "You are a helpful assistant."},
22
- {"role": "user", "content": f"return a json object with the keys name,email,phone. fill in the values which can be found here, leave blank if information not avaiable:\n {message}. antworte immer auf deutsch"}
23
  ],
24
  )
25
  return completion.choices[0].message.content
 
13
  api_key = os.getenv('groq')
14
  client = groq.Client(api_key=api_key)
15
 
16
+ json_schema = """
17
+ {
18
+ "name": "",
19
+ "email": "",
20
+ "phone": "",
21
+ "ort": ""
22
+ }
23
+ """
24
+
25
  def llm(message):
26
  try:
27
  completion = client.chat.completions.create(
28
+ model="llama3-70b-8192",
29
  messages=[
30
  {"role": "system", "content": "You are a helpful assistant."},
31
+ {"role": "user", "content": f "return a json object. here is the schema \n {json_schema} \n fill in the avaiable values which can be found here:\n {message} \n return valid json only"}
32
  ],
33
  )
34
  return completion.choices[0].message.content