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

Add chat model open ai proxy url params #3153

Conversation

thanhtung100397
Copy link
Contributor

@thanhtung100397 thanhtung100397 commented Sep 5, 2024

Add Proxy URL option for Open AI chat model

image

@HenryHengZJ
Copy link
Contributor

awesome! are you able to test is using proxy?

@wangsp188
Copy link

great, i will try

Add Proxy URL option for Open AI chat model

image

@thanhtung100397
Copy link
Contributor Author

I have setup a squid server as proxy and it's worked, hope this can help anyone got this open ai api error: unsupported_country_region_territory

@wangsp188
Copy link

I have setup a squid server as proxy and it's worked, hope this can help anyone got this open ai api error: unsupported_country_region_territory

what time the commit will merge to main branch?

@thanhtung100397
Copy link
Contributor Author

I have setup a squid server as proxy and it's worked, hope this can help anyone got this open ai api error: unsupported_country_region_territory

what time the commit will merge to main branch?

i dont have any permission to merge so anyone can help?

Copy link
Contributor

@HenryHengZJ HenryHengZJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HenryHengZJ HenryHengZJ merged commit 40a1064 into FlowiseAI:main Sep 9, 2024
2 checks passed
@wangsp188
Copy link

wangsp188 commented Sep 10, 2024

thanks @thanhtung100397

what to use the param?
i have build a proxy for openai.
image

this is error log
2024-09-10 09:25:36 [INFO]: [server]: Chatflow dc4c428f-5278-465e-ad9a-bf6b3bdb5074 added into ChatflowPool
2024-09-10 09:27:01 [ERROR]: [server]: Error: Connection error.
Error: Connection error.
at OpenAI.makeRequest (/Users/dexwang/sourcecode/Flowise/node_modules/.pnpm/openai@4.51.0_encoding@0.1.13/node_modules/openai/core.js:304:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async /Users/dexwang/sourcecode/Flowise/node_modules/.pnpm/@langchain+openai@0.0.30_encoding@0.1.13_langchain@0.2.11_@aws-sdk+client-s3@3.529.1_@aws-sdk_xdehwmr5gttavnvrwzf5jjmfv4/node_modules/@langchain/openai/dist/chat_models.cjs:760:29
at async RetryOperation._fn (/Users/dexwang/sourcecode/Flowise/node_modules/.pnpm/p-retry@4.6.2/node_modules/p-retry/index.js:50:12)

@thanhtung100397
Copy link
Contributor Author

thanks @thanhtung100397

what to use the param? i have build a proxy for openai. image

this is error log 2024-09-10 09:25:36 [INFO]: [server]: Chatflow dc4c428f-5278-465e-ad9a-bf6b3bdb5074 added into ChatflowPool 2024-09-10 09:27:01 [ERROR]: [server]: Error: Connection error. Error: Connection error. at OpenAI.makeRequest (/Users/dexwang/sourcecode/Flowise/node_modules/.pnpm/openai@4.51.0_encoding@0.1.13/node_modules/openai/core.js:304:19) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async /Users/dexwang/sourcecode/Flowise/node_modules/.pnpm/@langchain+openai@0.0.30_encoding@0.1.13_langchain@0.2.11_@aws-sdk+client-s3@3.529.1_@aws-sdk_xdehwmr5gttavnvrwzf5jjmfv4/node_modules/@langchain/openai/dist/chat_models.cjs:760:29 at async RetryOperation._fn (/Users/dexwang/sourcecode/Flowise/node_modules/.pnpm/p-retry@4.6.2/node_modules/p-retry/index.js:50:12)

You can follow my step

image

image

Here is the sample input for proxy url

(proxy without user/pass): http://127.0.0.1:3128
(proxy with user/pass): http://user:pass@127.0.0.1:3128

This was referenced Sep 19, 2024
@Rrrrnnyg
Copy link

Hi, do I need to fill in the proxy URL every time I use OpenAI API?
Is there a better way to management?

@thanhtung100397
Copy link
Contributor Author

Hi, do I need to fill in the proxy URL every time I use OpenAI API? Is there a better way to management?

At the moment, you need to input proxy url for every new ChatOpenAI node added to chatflow

I know it's better if we have a new ui to manage proxy url globaly... just like api key management ui

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

Successfully merging this pull request may close these issues.

4 participants