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

[BUG]Doubao API fail due to potential server side issue #6

Open
NickNYU opened this issue Jun 18, 2024 · 0 comments
Open

[BUG]Doubao API fail due to potential server side issue #6

NickNYU opened this issue Jun 18, 2024 · 0 comments

Comments

@NickNYU
Copy link

NickNYU commented Jun 18, 2024

Feature

Doubao PRO - 32

Issue Code

def read(image_path):
    client = Ark(api_key=DOUBAO_API_KEY)
    print("----- standard request -----")
    base64_image = encode_image(image_path)
    completion = client.chat.completions.create(
        model="ep-20240618134341-vkc7n",
        user="user",
        messages=[
            {
                "role": "user",
                "content": [
                    {
                        "type": "text",
                        "text": "What’s in this image?"
                    },
                    {
                        "type": "image_url",
                        "image_url": {
                            "url": f"data:image/jpeg;base64,{base64_image}"
                        }
                    }
                ]
            }
        ]
    )
    print(completion.choices[0].message.content)

Issue Error

Traceback (most recent call last):
  File "/Users/nick/Develop/aigc/NickBooking/main.py", line 25, in <module>
    read_doubao()
  File "/Users/nick/Develop/aigc/NickBooking/main.py", line 18, in read_doubao
    doubao_client.read(IMAGE_PATH)
  File "/Users/nick/Develop/aigc/NickBooking/doubao/doubao_client.py", line 18, in read
    completion = client.chat.completions.create(
  File "/Users/nick/Develop/aigc/NickBooking/.venv/lib/python3.10/site-packages/volcenginesdkarkruntime/_utils/_utils.py", line 64, in wrapper
    return func(*args, **kwargs)
  File "/Users/nick/Develop/aigc/NickBooking/.venv/lib/python3.10/site-packages/volcenginesdkarkruntime/resources/chat/completions.py", line 68, in create
    return self._post(
  File "/Users/nick/Develop/aigc/NickBooking/.venv/lib/python3.10/site-packages/volcenginesdkarkruntime/_base_client.py", line 555, in post
    ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
  File "/Users/nick/Develop/aigc/NickBooking/.venv/lib/python3.10/site-packages/volcenginesdkarkruntime/_base_client.py", line 567, in request
    return self._request(
  File "/Users/nick/Develop/aigc/NickBooking/.venv/lib/python3.10/site-packages/volcenginesdkarkruntime/_base_client.py", line 453, in _request
    return self._retry_request(
  File "/Users/nick/Develop/aigc/NickBooking/.venv/lib/python3.10/site-packages/volcenginesdkarkruntime/_base_client.py", line 502, in _retry_request
    return self._request(
  File "/Users/nick/Develop/aigc/NickBooking/.venv/lib/python3.10/site-packages/volcenginesdkarkruntime/_base_client.py", line 453, in _request
    return self._retry_request(
  File "/Users/nick/Develop/aigc/NickBooking/.venv/lib/python3.10/site-packages/volcenginesdkarkruntime/_base_client.py", line 502, in _retry_request
    return self._request(
  File "/Users/nick/Develop/aigc/NickBooking/.venv/lib/python3.10/site-packages/volcenginesdkarkruntime/_base_client.py", line 468, in _request
    raise self._make_status_error_from_response(
volcenginesdkarkruntime._exceptions.ArkInternalServerError: Error code: 500 - {'error': {'code': 'InternalServiceError', 'message': 'The service encountered an unexpected internal error.', 'param': '', 'type': 'InternalServiceError'}}, request_id: 202406182215334Ynl34GqiFBsXauqeWur
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant