1
0
Fork 0
mirror of https://github.com/kou029w/_.git synced 2025-01-30 22:08:02 +00:00

create groq

This commit is contained in:
Nebel 2024-10-17 14:48:26 +09:00
parent 2794034e55
commit 3ef34e52e2
Signed by: nebel
GPG key ID: 79807D08C6EF6460
2 changed files with 33 additions and 0 deletions

3
groq/README.md Normal file
View file

@ -0,0 +1,3 @@
```
$ uv run main.py
```

30
groq/main.py Normal file
View file

@ -0,0 +1,30 @@
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "groq",
# ]
# ///
from groq import Groq
IMAGE_DATA_URL = "..."
client = Groq()
completion = client.chat.completions.create(
model="llama-3.2-90b-vision-preview",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "これは何?"},
{"type": "image_url", "image_url": {"url": IMAGE_DATA_URL}},
],
}
],
temperature=1,
max_tokens=1024,
top_p=1,
stream=False,
stop=None,
)
print(completion.choices[0].message)