yufeikang / raycast_api_proxy

214 stars 30 forks source link

进行Azure的部署报错了 #23

Closed ge2009 closed 2 months ago

ge2009 commented 3 months ago

用了以下内容进行Azure的部署,好像不行,提示会报错 报错内容如下

Traceback (most recent call last):
  File "/project/pkgs/uvicorn/protocols/http/h11_impl.py", line 428, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/project/pkgs/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "/project/pkgs/fastapi/applications.py", line 276, in __call__
    await super().__call__(scope, receive, send)
  File "/project/pkgs/starlette/applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/project/pkgs/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/project/pkgs/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/project/pkgs/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/project/pkgs/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/project/pkgs/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/project/pkgs/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/project/pkgs/starlette/routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "/project/pkgs/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/project/pkgs/starlette/routing.py", line 69, in app
    await response(scope, receive, send)
  File "/project/pkgs/starlette/responses.py", line 277, in __call__
    await wrap(partial(self.listen_for_disconnect, receive))
  File "/project/pkgs/anyio/_backends/_asyncio.py", line 662, in __aexit__
    raise exceptions[0]
  File "/project/pkgs/starlette/responses.py", line 273, in wrap
    await func()
  File "/project/pkgs/starlette/responses.py", line 262, in stream_response
    async for chunk in self.body_iterator:
  File "/project/app/main.py", line 113, in chat_completions
    async for choice, error in self.__chat(openai_messages, model, temperature):
  File "/project/app/main.py", line 148, in __chat
    stream = await self.openai_client.chat.completions.create(
  File "/project/pkgs/openai/resources/chat/completions.py", line 1322, in create
    return await self._post(
  File "/project/pkgs/openai/_base_client.py", line 1725, in post
    return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
  File "/project/pkgs/openai/_base_client.py", line 1428, in request
    return await self._request(
  File "/project/pkgs/openai/_base_client.py", line 1446, in _request
    await self._prepare_options(options)
  File "/project/pkgs/openai/lib/azure.py", line 518, in _prepare_options
    azure_ad_token = await self._get_azure_ad_token()
  File "/project/pkgs/openai/lib/azure.py", line 502, in _get_azure_ad_token
    token = provider()
TypeError: 'str' object is not callable
docker run --name raycast-Azuregpt4 \
    -e AZURE_OPENAI_API_KEY=310bac84*******16cc4e473 \
    -e OPENAI_AZURE_ENDPOINT=https://j*****2024.openai.azure.com \
    -e OPENAI_API_VERSION=2023-05-15 \
    -e OPENAI_API_TYPE=azure \
    -e AZURE_DEPLOYMENT_ID=gpt4 \
    -p 443:443 \
    --dns 223.5.5.5 \
    -v $PWD/cert/:/data/cert \
    -e CERT_FILE=/data/cert/backend.raycast.com.cert.pem \
    -e CERT_KEY=/data/cert/backend.raycast.com.key.pem \
    -e LOG_LEVEL=INFO \
    -d \
    ghcr.io/yufeikang/raycast_api_proxy:main