test_poe.py
Ricky/djangob/test_poe.py
import os
import fastapi_poe as fp
from dotenv import load_dotenv
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent
load_dotenv(BASE_DIR / ".env")
print("POE_API_KEY =", os.getenv("POE_API_KEY"))
message = fp.ProtocolMessage(
role="user",
content="動畫藝術作品中的白貓,動畫風格,關鍵視覺,色彩鮮豔,動畫工作室"
)
for partial in fp.get_bot_response_sync(
messages=[message],
bot_name="nano-banana-pro",
api_key=os.getenv("POE_API_KEY")
):
print(partial)
Artigos relacionados
__init__.py
__init__.py — python source code from the Ricky learning materials (Ricky/Cat Project Final/back_web-4/app/__init__.py).
Ler artigo →auth.py
auth.py — python source code from the Ricky learning materials (Ricky/Cat Project Final/back_web-4/app/admin/auth.py).
Ler artigo →routes.py
routes.py — python source code from the Ricky learning materials (Ricky/Cat Project Final/back_web-4/app/admin/routes.py).
Ler artigo →config.py
config.py — python source code from the Ricky learning materials (Ricky/Cat Project Final/back_web-4/app/config.py).
Ler artigo →admin_ingest.py
admin_ingest.py — python source code from the Ricky learning materials (Ricky/Cat Project Final/back_web-4/app/routes/admin_ingest.py).
Ler artigo →admin_stats.py
admin_stats.py — python source code from the Ricky learning materials (Ricky/Cat Project Final/back_web-4/app/routes/admin_stats.py).
Ler artigo →