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

api call #14200

Closed
5 tasks done
cqray1990 opened this issue Feb 22, 2025 · 3 comments
Closed
5 tasks done

api call #14200

cqray1990 opened this issue Feb 22, 2025 · 3 comments
Labels
🐞 bug Something isn't working 🌚 invalid This doesn't seem right

Comments

@cqray1990
Copy link

cqray1990 commented Feb 22, 2025

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.15

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

                                import requests
                                import json
                                
                                api_url = "http://localhost/v1/chat-messages"
                                
                                # API Key
                                #api_key = "XXXX"
                                
                                # Request headers
                                headers = {
                                    'Authorization': f'Bearer {api_key}',
                                    'Content-Type': 'application/json',
                                }
                                
                                # Request payload
                                data = {
                                    "inputs": {},
                                    "query": "识别图片",
                                    "response_mode": "blocking",
                                    "conversation_id": "",
                                    "user": "lgx",
                                    "files": [
                                          {
                                            "type": "image",
                                            "transfer_method": "local_file",
                                            "upload_file_id": "./001.jpg"
                                          }
                                        ]
                                }
                                
                                # Send the POST request
                                response = requests.post(api_url, headers=headers,data=json.dumps(data)) #
                                
                                # Check the response
                                if response.status_code == 200:
                                    print("Request successful")
                                    print("Response:", response.json())
                                else:
                                    print(f"Request failed with status code: {response.status_code}")
                                    print("Error:", response.text)

errors"

Request failed with status code: 500
Error: {"code": "internal_server_error", "message": "The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.", "status": 500}

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

@dosubot dosubot bot added the 🐞 bug Something isn't working label Feb 22, 2025
Copy link

dosubot bot commented Feb 22, 2025

I found a similar closed issue related to an "Internal Server Error" when using the Get Conversation History Messages API endpoint. This issue was resolved by a pull request that fixed a specific field handling [1].

For your specific case, ensure that the upload_file_id is correctly obtained by uploading the file through the File Upload API before making the request. The upload_file_id should not be a file path but an ID returned from the upload process. Additionally, verify that all server configurations, such as database and Redis settings, are correctly set up in your self-hosted environment [2].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@crazywoola
Copy link
Member

crazywoola commented Feb 23, 2025

Please provide the container logs instead. If you are using source code to start it, please make sure you can handle it by yourself, otherwise please do not use source code to start it.
We assume you have the ability to resolve issues, especially this backend error, you should provide the container logs.

@crazywoola crazywoola added the 🌚 invalid This doesn't seem right label Feb 23, 2025
@crazywoola
Copy link
Member

crazywoola commented Feb 23, 2025

Also duplicated #14208, please do not open the same issue for the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 🌚 invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants