Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add a document to a request, e.g. txt, pdf #2697

Open
TishkaPon opened this issue Feb 7, 2025 · 2 comments
Open

How to add a document to a request, e.g. txt, pdf #2697

TishkaPon opened this issue Feb 7, 2025 · 2 comments
Assignees
Labels
bug Something isn't working stale

Comments

@TishkaPon
Copy link

How to add a document to a request, e.g. txt, pdf?

from g4f.client import AsyncClient
import requests
from bot.config import Provider, model

client = AsyncClient(provider=Provider, image_provider=Provider)

async def send(text=None, document=None, history=None, web_search=False):
response = await client.chat.completions.create(
model=model,
messages=[{"role": "user", "content": text}],
web_search=False,
document=document # ????
)
return response.choices

@TishkaPon TishkaPon added the bug Something isn't working label Feb 7, 2025
@hlohaus
Copy link
Collaborator

hlohaus commented Feb 7, 2025

Hey @TishkaPon , check out the File API docs here: https://github.com/xtekky/gpt4free/blob/main/docs%2Ffile.md

Copy link

Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.

@github-actions github-actions bot added the stale label Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

3 participants