neo4j / neo4j

Graphs for Everyone
http://neo4j.com
GNU General Public License v3.0
13.29k stars 2.38k forks source link

`genai.vector.encode` doesn't allow for changing OpenAI API endpoints #13433

Open teowz46 opened 7 months ago

teowz46 commented 7 months ago

Feature request template

Is your feature request related to a problem? Please describe. I am unable to use this function because I am on a network which has an internal OpenAI API endpoint. However, it seems like there is no way to change the endpoint to something that is not api.openai.com.

Describe the solution you'd like Add a configuration option in configuration Map to allow users to pass in custom API endpoints.

Describe alternatives you've considered Couldn't think of alternatives other than changing the source code.

Additional context NIL

parnmatt commented 7 months ago

The GenAI plugin was written with Aura in mind, and as such we are only allowing known and controlled endpoints and options.

However, we have implemented the plugin with such thoughts of extension in mind, service loading vector embedding providers. Once we finalise the interfaces we will likely expose the interface publically such that on-prem enterprise customers can configure their custom embedding providers, which of course may be private and sensitive.

Due to many exposing an OpenAI-like API endpoint, we may expose an easier way to specifically configure such providers; such as a specific base class to extend, and/or a "simple" provider with a custom URI and pass everything on, etc, as things we are considering specifically for on-prem.

Until then, if it is necessary to use your internal custom endpoint, APOC Extended has https://neo4j.com/labs/apoc/5/ml/openai/ which can be used for this purpose in the mean time.