Dear all
I was trying to use open source LLMs (Llama3, Mistral etc) through Groq API. Groq supports POST for chat completion. In one column I'm having queries, and want to add another column (based on this) through chat completion API by following the example Groq has given (GroqCloud). This script is generating Error in OpenRefine but works fine in command prompt (python3 test3-groq.py). The error (Python/Jython) in OpenRefine is : Error: SyntaxError: mismatched input ':' expecting NEWLINE (_types.py, line 91).
The script:
from groq import Groq
client = Groq(
api_key='my-api-key-is-here',
)
chat_completion = client.chat.completions.create(
messages=[
{
"role": "system",
"content": "you are a helpful assistant."
},
{
"role": "user",
"content": value,
}
],
model="llama3-70b-8192",
)
print(chat_completion.choices[0].message.content)
What am I missing?
Regards
Parthasarathi