mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-05 18:20:35 -08:00
Add make_chat_private function and enhance message formatting for Yupp provider @GamerReady
This commit is contained in:
parent
d322083305
commit
fe0d8e811d
4 changed files with 214 additions and 135 deletions
22
g4f_cli.py
22
g4f_cli.py
|
|
@ -4,6 +4,28 @@ Entry point for g4f CLI executable builds
|
|||
This file is used as the main entry point for building executables with Nuitka
|
||||
"""
|
||||
|
||||
import g4f.debug
|
||||
g4f.debug.enable_logging()
|
||||
|
||||
from g4f.client import Client
|
||||
from g4f.errors import ModelNotFoundError
|
||||
|
||||
import g4f.Provider
|
||||
|
||||
try:
|
||||
client = Client(provider=g4f.Provider.PollinationsAI)
|
||||
response = client.chat.completions.create(
|
||||
model="openai",
|
||||
messages=[{"role": "user", "content": "Hello!"}],
|
||||
stream=True,
|
||||
raw=True
|
||||
)
|
||||
for r in response:
|
||||
print(r)
|
||||
except ModelNotFoundError as e:
|
||||
print(f"Successfully")
|
||||
exit(0)
|
||||
|
||||
import g4f.cli
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue