mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-06 02:30:41 -08:00
add reka core model (vision)
This commit is contained in:
parent
431621b274
commit
2b271013fb
5 changed files with 197 additions and 2 deletions
27
etc/examples/image_chat_reka.py
Normal file
27
etc/examples/image_chat_reka.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# Image Chat with Reca
|
||||
# !! YOU NEED COOKIES / BE LOGGED IN TO chat.reka.ai
|
||||
# download an image and save it as test.png in the same folder
|
||||
|
||||
from g4f.client import Client
|
||||
from g4f.Provider import Reka
|
||||
|
||||
client = Client(
|
||||
provider = Reka # Optional if you set model name to reka-core
|
||||
)
|
||||
|
||||
completion = client.chat.completions.create(
|
||||
model = "reka-core",
|
||||
messages = [
|
||||
{
|
||||
"role": "user",
|
||||
"content": "What can you see in the image ?"
|
||||
}
|
||||
],
|
||||
stream = True,
|
||||
image = open("test.png", "rb") # open("path", "rb"), do not use .read(), etc. it must be a file object
|
||||
)
|
||||
|
||||
for message in completion:
|
||||
print(message.choices[0].delta.content or "")
|
||||
|
||||
# >>> In the image there is ...
|
||||
Loading…
Add table
Add a link
Reference in a new issue