mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-15 14:51:19 -08:00
Add .har file support for Copilot
Update provider in Vision documentation Hide
This commit is contained in:
parent
0043e0494c
commit
46038c6a20
5 changed files with 66 additions and 13 deletions
|
|
@ -154,13 +154,14 @@ import asyncio
|
|||
from g4f.client import AsyncClient
|
||||
|
||||
async def main():
|
||||
client = AsyncClient()
|
||||
|
||||
client = AsyncClient(
|
||||
provider=g4f.Provider.CopilotAccount
|
||||
)
|
||||
|
||||
image = requests.get("https://raw.githubusercontent.com/xtekky/gpt4free/refs/heads/main/docs/cat.jpeg", stream=True).raw
|
||||
|
||||
|
||||
response = await client.chat.completions.create(
|
||||
model=g4f.models.default,
|
||||
provider=g4f.Provider.Bing,
|
||||
messages=[
|
||||
{
|
||||
"role": "user",
|
||||
|
|
@ -169,7 +170,7 @@ async def main():
|
|||
],
|
||||
image=image
|
||||
)
|
||||
|
||||
|
||||
print(response.choices[0].message.content)
|
||||
|
||||
asyncio.run(main())
|
||||
|
|
|
|||
|
|
@ -265,7 +265,9 @@ from g4f.client import Client
|
|||
image = requests.get("https://raw.githubusercontent.com/xtekky/gpt4free/refs/heads/main/docs/cat.jpeg", stream=True).raw
|
||||
# Or: image = open("docs/cat.jpeg", "rb")
|
||||
|
||||
client = Client()
|
||||
client = Client(
|
||||
provider=CopilotAccount
|
||||
)
|
||||
|
||||
response = client.chat.completions.create(
|
||||
model=g4f.models.default,
|
||||
|
|
@ -275,7 +277,6 @@ response = client.chat.completions.create(
|
|||
"content": "What are on this image?"
|
||||
}
|
||||
],
|
||||
provider=g4f.Provider.Bing,
|
||||
image=image
|
||||
# Add any other necessary parameters
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue