Spaces:
Running
Running
Update app.py
Browse files
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="
|
20 |
messages=[
|
21 |
{"role": "system", "content": "You are a helpful assistant."},
|
22 |
-
{"role": "user", "content": f"return a json object
|
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
|