when I call api of /chat-messages, why open-ai api is always requested? #699

Closed
opened 2026-02-21 17:28:04 -05:00 by yindo · 4 comments
Owner

Originally created by @chenlizhao on GitHub (Nov 15, 2023).

Provide a description of the help you need

我的应用是基于星火大模型接口,但是调用时一直会调用open-ai接口,日志如下:

DEBUG:openai:message='Request to OpenAI API' method=post path=https://api.openai.com/v1/chat/completions
DEBUG:openai:api_version=None data='{"messages": [{"role": "user", "content": "You need to decompose the user's input into \"subject\" and \"intention\" in order to accurately figure out what the user's input language actually is. \nNotice: the language type user use could be diverse, which can be English, Chinese, Espa\u00f1ol, Arabic, Japanese, French, and etc.\nMAKE SURE your output is the SAME language as the user's input!\nYour output is restricted only to: (Input language) Intention + Subject(short as possible)\nYour output MUST be a valid JSON.\n\nTip: When the user's question is directed at you (the language model), you can add an emoji to make it more fun.\n\n\nexample 1:\nUser Input: hi, yesterday i had some burgers.\n{\n \"Language Type\": \"The user's input is pure English\",\n \"Your Reasoning\": \"The language of my output must be pure English.\",\n \"Your Output\": \"sharing yesterday's food\"\n}\n\nexample 2:\nUser Input: hello\n{\n \"Language Type\": \"The user's input is written in pure English\",\n \"Your Reasoning\": \"The language of my output must be pure English.\",\n \"Your Output\": \"Greeting myself\u263a\ufe0f\"\n}\n\n\nexample 3:\nUser Input: why mmap file: oom\n{\n \"Language Type\": \"The user's input is written in pure English\",\n \"Your Reasoning\": \"The language of my output must be pure English.\",\n \"Your Output\": \"Asking about the reason for mmap file: oom\"\n}\n\n\nexample 4:\nUser Input: www.convinceme.yesterday-you-ate-seafood.tv\u8bb2\u4e86\u4ec0\u4e48\uff1f\n{\n \"Language Type\": \"The user's input English-Chinese mixed\",\n \"Your Reasoning\": \"The English-part is an URL, the main intention is still written in Chinese, so the language of my output must be using Chinese.\",\n \"Your Output\": \"\u8be2\u95ee\u7f51\u7ad9www.convinceme.yesterday-you-ate-seafood.tv\"\n}\n\nexample 5:\nUser Input: why\u5c0f\u7ea2\u7684\u5e74\u9f84is\u8001than\u5c0f\u660e\uff1f\n{\n \"Language Type\": \"The user's input is English-Chinese mixed\",\n \"Your Reasoning\": \"The English parts are subjective particles, the main intention is written in Chinese, besides, Chinese occupies a greater \"actual meaning\" than English, so the language of my output must be using Chinese.\",\n \"Your Output\": \"\u8be2\u95ee\u5c0f\u7ea2\u548c\u5c0f\u660e\u7684\u5e74\u9f84\"\n}\n\nexample 6:\nUser Input: yo, \u4f60\u4eca\u5929\u548b\u6837\uff1f\n{\n \"Language Type\": \"The user's input is English-Chinese mixed\",\n \"Your Reasoning\": \"The English-part is a subjective particle, the main intention is written in Chinese, so the language of my output must be using Chinese.\",\n \"Your Output\": \"\u67e5\u8be2\u4eca\u65e5\u6211\u7684\u72b6\u6001\u263a\ufe0f\"\n}\n\nUser Input: \nhey\n"}], "model": "gpt-3.5-turbo", "max_tokens": 100, "stream": false, "n": 1, "temperature": 1.0, "top_p": 1, "frequency_penalty": 0, "presence_penalty": 0}' message='Post details'
Originally created by @chenlizhao on GitHub (Nov 15, 2023). ### Provide a description of the help you need 我的应用是基于星火大模型接口,但是调用时一直会调用open-ai接口,日志如下: ``` DEBUG:openai:message='Request to OpenAI API' method=post path=https://api.openai.com/v1/chat/completions DEBUG:openai:api_version=None data='{"messages": [{"role": "user", "content": "You need to decompose the user's input into \"subject\" and \"intention\" in order to accurately figure out what the user's input language actually is. \nNotice: the language type user use could be diverse, which can be English, Chinese, Espa\u00f1ol, Arabic, Japanese, French, and etc.\nMAKE SURE your output is the SAME language as the user's input!\nYour output is restricted only to: (Input language) Intention + Subject(short as possible)\nYour output MUST be a valid JSON.\n\nTip: When the user's question is directed at you (the language model), you can add an emoji to make it more fun.\n\n\nexample 1:\nUser Input: hi, yesterday i had some burgers.\n{\n \"Language Type\": \"The user's input is pure English\",\n \"Your Reasoning\": \"The language of my output must be pure English.\",\n \"Your Output\": \"sharing yesterday's food\"\n}\n\nexample 2:\nUser Input: hello\n{\n \"Language Type\": \"The user's input is written in pure English\",\n \"Your Reasoning\": \"The language of my output must be pure English.\",\n \"Your Output\": \"Greeting myself\u263a\ufe0f\"\n}\n\n\nexample 3:\nUser Input: why mmap file: oom\n{\n \"Language Type\": \"The user's input is written in pure English\",\n \"Your Reasoning\": \"The language of my output must be pure English.\",\n \"Your Output\": \"Asking about the reason for mmap file: oom\"\n}\n\n\nexample 4:\nUser Input: www.convinceme.yesterday-you-ate-seafood.tv\u8bb2\u4e86\u4ec0\u4e48\uff1f\n{\n \"Language Type\": \"The user's input English-Chinese mixed\",\n \"Your Reasoning\": \"The English-part is an URL, the main intention is still written in Chinese, so the language of my output must be using Chinese.\",\n \"Your Output\": \"\u8be2\u95ee\u7f51\u7ad9www.convinceme.yesterday-you-ate-seafood.tv\"\n}\n\nexample 5:\nUser Input: why\u5c0f\u7ea2\u7684\u5e74\u9f84is\u8001than\u5c0f\u660e\uff1f\n{\n \"Language Type\": \"The user's input is English-Chinese mixed\",\n \"Your Reasoning\": \"The English parts are subjective particles, the main intention is written in Chinese, besides, Chinese occupies a greater \"actual meaning\" than English, so the language of my output must be using Chinese.\",\n \"Your Output\": \"\u8be2\u95ee\u5c0f\u7ea2\u548c\u5c0f\u660e\u7684\u5e74\u9f84\"\n}\n\nexample 6:\nUser Input: yo, \u4f60\u4eca\u5929\u548b\u6837\uff1f\n{\n \"Language Type\": \"The user's input is English-Chinese mixed\",\n \"Your Reasoning\": \"The English-part is a subjective particle, the main intention is written in Chinese, so the language of my output must be using Chinese.\",\n \"Your Output\": \"\u67e5\u8be2\u4eca\u65e5\u6211\u7684\u72b6\u6001\u263a\ufe0f\"\n}\n\nUser Input: \nhey\n"}], "model": "gpt-3.5-turbo", "max_tokens": 100, "stream": false, "n": 1, "temperature": 1.0, "top_p": 1, "frequency_penalty": 0, "presence_penalty": 0}' message='Post details' ```
yindo closed this issue 2026-02-21 17:28:04 -05:00
Author
Owner

@crazywoola commented on GitHub (Nov 15, 2023):

没有点发布?

@crazywoola commented on GitHub (Nov 15, 2023): 没有点发布?
Author
Owner

@chenlizhao commented on GitHub (Nov 15, 2023):

@crazywoola 先调的星火接口,完整日志如下:

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): updates.dify.ai:443
DEBUG:urllib3.connectionpool:https://updates.dify.ai:443 "GET /?current_version=0.3.29 HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): weaviate:8080
DEBUG:urllib3.connectionpool:http://weaviate:8080 "GET /v1/meta HTTP/1.1" 200 64
DEBUG:urllib3.connectionpool:http://weaviate:8080 "POST /v1/graphql HTTP/1.1" 200 None
INFO:websocket:Websocket connected
DEBUG:core.model_providers.models.llm.base:model: spark-v3 price_config: {'prompt': Decimal('0.36'), 'completion': Decimal('0.36'), 'unit': Decimal('0.0001'), 'currency': 'RMB'}
DEBUG:root:unit_price=0.3600
DEBUG:core.model_providers.models.llm.base:model: spark-v3 price_config: {'prompt': Decimal('0.36'), 'completion': Decimal('0.36'), 'unit': Decimal('0.0001'), 'currency': 'RMB'}
DEBUG:root:price_unit=0.000100
DEBUG:core.model_providers.models.llm.base:model: spark-v3 price_config: {'prompt': Decimal('0.36'), 'completion': Decimal('0.36'), 'unit': Decimal('0.0001'), 'currency': 'RMB'}
DEBUG:root:unit_price=0.3600
DEBUG:core.model_providers.models.llm.base:model: spark-v3 price_config: {'prompt': Decimal('0.36'), 'completion': Decimal('0.36'), 'unit': Decimal('0.0001'), 'currency': 'RMB'}
DEBUG:root:price_unit=0.000100
DEBUG:core.model_providers.models.llm.base:model: spark-v3 price_config: {'prompt': Decimal('0.36'), 'completion': Decimal('0.36'), 'unit': Decimal('0.0001'), 'currency': 'RMB'}
DEBUG:core.model_providers.models.llm.base:model: spark-v3 price_config: {'prompt': Decimal('0.36'), 'completion': Decimal('0.36'), 'unit': Decimal('0.0001'), 'currency': 'RMB'}
DEBUG:root:price_unit=0.000100
DEBUG:root:tokens=328, unit_price=0.36, unit=0.000100, total_price:0.0118080
DEBUG:core.model_providers.models.llm.base:model: spark-v3 price_config: {'prompt': Decimal('0.36'), 'completion': Decimal('0.36'), 'unit': Decimal('0.0001'), 'currency': 'RMB'}
DEBUG:core.model_providers.models.llm.base:model: spark-v3 price_config: {'prompt': Decimal('0.36'), 'completion': Decimal('0.36'), 'unit': Decimal('0.0001'), 'currency': 'RMB'}
DEBUG:root:price_unit=0.000100
DEBUG:root:tokens=13, unit_price=0.36, unit=0.000100, total_price:0.0004680
DEBUG:openai:message='Request to OpenAI API' method=post path=https://openai.aihey.cc/openai/v1/chat/completions
DEBUG:openai:api_version=None data='{"messages": [{"role": "user", "content": "You need to decompose the user\'s input into \\"subject\\" and \\"intention\\" in order to accurately figure out what the user\'s input language actually is. \\nNotice: the language type user use could be diverse, which can be English, Chinese, Espa\\u00f1ol, Arabic, Japanese, French, and etc.\\nMAKE SURE your output is the SAME language as the user\'s input!\\nYour output is restricted only to: (Input language) Intention + Subject(short as possible)\\nYour output MUST be a valid JSON.\\n\\nTip: When the user\'s question is directed at you (the language model), you can add an emoji to make it more fun.\\n\\n\\nexample 1:\\nUser Input: hi, yesterday i had some burgers.\\n{\\n  \\"Language Type\\": \\"The user\'s input is pure English\\",\\n  \\"Your Reasoning\\": \\"The language of my output must be pure English.\\",\\n  \\"Your Output\\": \\"sharing yesterday\'s food\\"\\n}\\n\\nexample 2:\\nUser Input: hello\\n{\\n  \\"Language Type\\": \\"The user\'s input is written in pure English\\",\\n  \\"Your Reasoning\\": \\"The language of my output must be pure English.\\",\\n  \\"Your Output\\": \\"Greeting myself\\u263a\\ufe0f\\"\\n}\\n\\n\\nexample 3:\\nUser Input: why mmap file: oom\\n{\\n  \\"Language Type\\": \\"The user\'s input is written in pure English\\",\\n  \\"Your Reasoning\\": \\"The language of my output must be pure English.\\",\\n  \\"Your Output\\": \\"Asking about the reason for mmap file: oom\\"\\n}\\n\\n\\nexample 4:\\nUser Input: www.convinceme.yesterday-you-ate-seafood.tv\\u8bb2\\u4e86\\u4ec0\\u4e48\\uff1f\\n{\\n  \\"Language Type\\": \\"The user\'s input English-Chinese mixed\\",\\n  \\"Your Reasoning\\": \\"The English-part is an URL, the main intention is still written in Chinese, so the language of my output must be using Chinese.\\",\\n  \\"Your Output\\": \\"\\u8be2\\u95ee\\u7f51\\u7ad9www.convinceme.yesterday-you-ate-seafood.tv\\"\\n}\\n\\nexample 5:\\nUser Input: why\\u5c0f\\u7ea2\\u7684\\u5e74\\u9f84is\\u8001than\\u5c0f\\u660e\\uff1f\\n{\\n  \\"Language Type\\": \\"The user\'s input is English-Chinese mixed\\",\\n  \\"Your Reasoning\\": \\"The English parts are subjective particles, the main intention is written in Chinese, besides, Chinese occupies a greater \\"actual meaning\\" than English, so the language of my output must be using Chinese.\\",\\n  \\"Your Output\\": \\"\\u8be2\\u95ee\\u5c0f\\u7ea2\\u548c\\u5c0f\\u660e\\u7684\\u5e74\\u9f84\\"\\n}\\n\\nexample 6:\\nUser Input: yo, \\u4f60\\u4eca\\u5929\\u548b\\u6837\\uff1f\\n{\\n  \\"Language Type\\": \\"The user\'s input is English-Chinese mixed\\",\\n  \\"Your Reasoning\\": \\"The English-part is a subjective particle, the main intention is written in Chinese, so the language of my output must be using Chinese.\\",\\n  \\"Your Output\\": \\"\\u67e5\\u8be2\\u4eca\\u65e5\\u6211\\u7684\\u72b6\\u6001\\u263a\\ufe0f\\"\\n}\\n\\nUser Input: \\nhey\\n"}], "model": "gpt-3.5-turbo", "max_tokens": 100, "stream": false, "n": 1, "temperature": 1.0, "top_p": 1, "frequency_penalty": 0, "presence_penalty": 0}' message='Post details'
DEBUG:urllib3.util.retry:Converted retries value: 2 -> Retry(total=2, connect=None, read=None, redirect=None, status=None)
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): openai.aihey.cc:443
DEBUG:urllib3.connectionpool:https://openai.aihey.cc:443 "POST /openai/v1/chat/completions HTTP/1.1" 500 21
DEBUG:openai:message='OpenAI API response' path=https://openai.aihey.cc/openai/v1/chat/completions processing_ms=None request_id=None response_code=500
WARNING:root:OpenAI service unavailable.
@chenlizhao commented on GitHub (Nov 15, 2023): @crazywoola 先调的星火接口,完整日志如下: ``` DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): updates.dify.ai:443 DEBUG:urllib3.connectionpool:https://updates.dify.ai:443 "GET /?current_version=0.3.29 HTTP/1.1" 200 None DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): weaviate:8080 DEBUG:urllib3.connectionpool:http://weaviate:8080 "GET /v1/meta HTTP/1.1" 200 64 DEBUG:urllib3.connectionpool:http://weaviate:8080 "POST /v1/graphql HTTP/1.1" 200 None INFO:websocket:Websocket connected DEBUG:core.model_providers.models.llm.base:model: spark-v3 price_config: {'prompt': Decimal('0.36'), 'completion': Decimal('0.36'), 'unit': Decimal('0.0001'), 'currency': 'RMB'} DEBUG:root:unit_price=0.3600 DEBUG:core.model_providers.models.llm.base:model: spark-v3 price_config: {'prompt': Decimal('0.36'), 'completion': Decimal('0.36'), 'unit': Decimal('0.0001'), 'currency': 'RMB'} DEBUG:root:price_unit=0.000100 DEBUG:core.model_providers.models.llm.base:model: spark-v3 price_config: {'prompt': Decimal('0.36'), 'completion': Decimal('0.36'), 'unit': Decimal('0.0001'), 'currency': 'RMB'} DEBUG:root:unit_price=0.3600 DEBUG:core.model_providers.models.llm.base:model: spark-v3 price_config: {'prompt': Decimal('0.36'), 'completion': Decimal('0.36'), 'unit': Decimal('0.0001'), 'currency': 'RMB'} DEBUG:root:price_unit=0.000100 DEBUG:core.model_providers.models.llm.base:model: spark-v3 price_config: {'prompt': Decimal('0.36'), 'completion': Decimal('0.36'), 'unit': Decimal('0.0001'), 'currency': 'RMB'} DEBUG:core.model_providers.models.llm.base:model: spark-v3 price_config: {'prompt': Decimal('0.36'), 'completion': Decimal('0.36'), 'unit': Decimal('0.0001'), 'currency': 'RMB'} DEBUG:root:price_unit=0.000100 DEBUG:root:tokens=328, unit_price=0.36, unit=0.000100, total_price:0.0118080 DEBUG:core.model_providers.models.llm.base:model: spark-v3 price_config: {'prompt': Decimal('0.36'), 'completion': Decimal('0.36'), 'unit': Decimal('0.0001'), 'currency': 'RMB'} DEBUG:core.model_providers.models.llm.base:model: spark-v3 price_config: {'prompt': Decimal('0.36'), 'completion': Decimal('0.36'), 'unit': Decimal('0.0001'), 'currency': 'RMB'} DEBUG:root:price_unit=0.000100 DEBUG:root:tokens=13, unit_price=0.36, unit=0.000100, total_price:0.0004680 DEBUG:openai:message='Request to OpenAI API' method=post path=https://openai.aihey.cc/openai/v1/chat/completions DEBUG:openai:api_version=None data='{"messages": [{"role": "user", "content": "You need to decompose the user\'s input into \\"subject\\" and \\"intention\\" in order to accurately figure out what the user\'s input language actually is. \\nNotice: the language type user use could be diverse, which can be English, Chinese, Espa\\u00f1ol, Arabic, Japanese, French, and etc.\\nMAKE SURE your output is the SAME language as the user\'s input!\\nYour output is restricted only to: (Input language) Intention + Subject(short as possible)\\nYour output MUST be a valid JSON.\\n\\nTip: When the user\'s question is directed at you (the language model), you can add an emoji to make it more fun.\\n\\n\\nexample 1:\\nUser Input: hi, yesterday i had some burgers.\\n{\\n \\"Language Type\\": \\"The user\'s input is pure English\\",\\n \\"Your Reasoning\\": \\"The language of my output must be pure English.\\",\\n \\"Your Output\\": \\"sharing yesterday\'s food\\"\\n}\\n\\nexample 2:\\nUser Input: hello\\n{\\n \\"Language Type\\": \\"The user\'s input is written in pure English\\",\\n \\"Your Reasoning\\": \\"The language of my output must be pure English.\\",\\n \\"Your Output\\": \\"Greeting myself\\u263a\\ufe0f\\"\\n}\\n\\n\\nexample 3:\\nUser Input: why mmap file: oom\\n{\\n \\"Language Type\\": \\"The user\'s input is written in pure English\\",\\n \\"Your Reasoning\\": \\"The language of my output must be pure English.\\",\\n \\"Your Output\\": \\"Asking about the reason for mmap file: oom\\"\\n}\\n\\n\\nexample 4:\\nUser Input: www.convinceme.yesterday-you-ate-seafood.tv\\u8bb2\\u4e86\\u4ec0\\u4e48\\uff1f\\n{\\n \\"Language Type\\": \\"The user\'s input English-Chinese mixed\\",\\n \\"Your Reasoning\\": \\"The English-part is an URL, the main intention is still written in Chinese, so the language of my output must be using Chinese.\\",\\n \\"Your Output\\": \\"\\u8be2\\u95ee\\u7f51\\u7ad9www.convinceme.yesterday-you-ate-seafood.tv\\"\\n}\\n\\nexample 5:\\nUser Input: why\\u5c0f\\u7ea2\\u7684\\u5e74\\u9f84is\\u8001than\\u5c0f\\u660e\\uff1f\\n{\\n \\"Language Type\\": \\"The user\'s input is English-Chinese mixed\\",\\n \\"Your Reasoning\\": \\"The English parts are subjective particles, the main intention is written in Chinese, besides, Chinese occupies a greater \\"actual meaning\\" than English, so the language of my output must be using Chinese.\\",\\n \\"Your Output\\": \\"\\u8be2\\u95ee\\u5c0f\\u7ea2\\u548c\\u5c0f\\u660e\\u7684\\u5e74\\u9f84\\"\\n}\\n\\nexample 6:\\nUser Input: yo, \\u4f60\\u4eca\\u5929\\u548b\\u6837\\uff1f\\n{\\n \\"Language Type\\": \\"The user\'s input is English-Chinese mixed\\",\\n \\"Your Reasoning\\": \\"The English-part is a subjective particle, the main intention is written in Chinese, so the language of my output must be using Chinese.\\",\\n \\"Your Output\\": \\"\\u67e5\\u8be2\\u4eca\\u65e5\\u6211\\u7684\\u72b6\\u6001\\u263a\\ufe0f\\"\\n}\\n\\nUser Input: \\nhey\\n"}], "model": "gpt-3.5-turbo", "max_tokens": 100, "stream": false, "n": 1, "temperature": 1.0, "top_p": 1, "frequency_penalty": 0, "presence_penalty": 0}' message='Post details' DEBUG:urllib3.util.retry:Converted retries value: 2 -> Retry(total=2, connect=None, read=None, redirect=None, status=None) DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): openai.aihey.cc:443 DEBUG:urllib3.connectionpool:https://openai.aihey.cc:443 "POST /openai/v1/chat/completions HTTP/1.1" 500 21 DEBUG:openai:message='OpenAI API response' path=https://openai.aihey.cc/openai/v1/chat/completions processing_ms=None request_id=None response_code=500 WARNING:root:OpenAI service unavailable. ```
Author
Owner

@chenlizhao commented on GitHub (Nov 15, 2023):

只有把open-ai的api key删除后,才不会调用open-ai接口

@chenlizhao commented on GitHub (Nov 15, 2023): 只有把open-ai的api key删除后,才不会调用open-ai接口
Author
Owner

@crazywoola commented on GitHub (Nov 15, 2023):

image 你系统推理模型也更换成星火就可以了,生成标题会用那边配置的。
@crazywoola commented on GitHub (Nov 15, 2023): <img width="830" alt="image" src="https://github.com/langgenius/dify/assets/100913391/fa701bcc-9ac8-4b92-ba57-a0152db19305"> 你系统推理模型也更换成星火就可以了,生成标题会用那边配置的。
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#699