jorge-menjivar / unsaged

Open source chat kit engineered for seamless interaction with AI models.
https://unsaged.com
Apache License 2.0
243 stars 76 forks source link

No Logs in Cloudflare AI Gateway [BUG] #212

Open ufulu opened 3 months ago

ufulu commented 3 months ago

I am running unsaged via docker without problems. I love it! I now wanted to try out the new Cloudflare Gateway and have the following in my .env.local:

OPENAI_API_KEY=sk-XXX
OPENAI_API_URL=https://gateway.ai.cloudflare.com/v1/XXX/MY_GATEWAY
OPENAI_API_TYPE=openai

My issue is that no logs appear in cloudflare.

If I issue the following from the console, it appears in the logs. What am I missing?

curl -X POST https://gateway.ai.cloudflare.com/v1/XXX/MY_GATEWAY \
  -H 'Content-Type: application/json' \
  -d '[
  {
    "provider": "openai",
    "endpoint": "chat/completions",
    "headers": {
      "authorization": "Bearer sk-XXX",
      "content-type": "application/json"
    },
    "query": {
      "model": "gpt-3.5-turbo",
      "messages": [
        {
          "role": "user",
          "content": "This is a test from the console"
        }
      ]
    }
  }
]'