How to set up the project to connect to a local proxy with a address of localhost…
- User
How to set up the project to connect to a local proxy with a address of localhost [Redacted Address]?
Assistant
Based on the provided repository code, I can help you set up the OpenAI Unity project to connect through a local proxy. There are two ways to do this:
- Through the Unity Inspector (Recommended):
- Create a new OpenAIConfiguration asset in your project by right-clicking in the Project window -> Create -> OpenAI -> OpenAIConfiguration
- In the inspector for this configuration:
- Set your API key
- Set the Proxy Domain field to:
http://localhost:1234
- Through code:
[Redactedvar settings = new OpenAISettings(domain: "http://localhost:1234"); var auth = new OpenAIAuthentication("your-api-key"); var api = new OpenAIClient(auth, settings);When using a proxy, the client will route all API requests through your local proxy server running on localhost:1234 instead of directly connecting to OpenAI's servers.
Make sure your proxy server is properly configured to forward requests to OpenAI's API and handle authentication appropriately. The proxy should maintain the necessary headers and authentication information when forwarding requests to OpenAI's servers.
Also note that if you're using Azure OpenAI, you'll want to ensure the proxy is configured to properly route to your Azure endpoint instead of OpenAI's servers.
- User
Can you write a script that uses a TMP_InputField and a button, which upon pressing the button sends the contents of the input field as the content of the message, with all other necessary data being set as the script's internal variables?
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.