Make endpoint url for Ollama configurable (#355)
This commit is contained in:
+10
-1
@@ -27,7 +27,8 @@ export enum CONFIG_KEYS {
|
||||
OCO_AI_PROVIDER = 'OCO_AI_PROVIDER',
|
||||
OCO_GITPUSH = 'OCO_GITPUSH',
|
||||
OCO_ONE_LINE_COMMIT = 'OCO_ONE_LINE_COMMIT',
|
||||
OCO_AZURE_ENDPOINT = 'OCO_AZURE_ENDPOINT'
|
||||
OCO_AZURE_ENDPOINT = 'OCO_AZURE_ENDPOINT',
|
||||
OCO_OLLAMA_API_URL = 'OCO_API_URL',
|
||||
}
|
||||
|
||||
export enum CONFIG_MODES {
|
||||
@@ -270,6 +271,14 @@ export const configValidators = {
|
||||
|
||||
return value;
|
||||
},
|
||||
[CONFIG_KEYS.OCO_OLLAMA_API_URL](value: any) { // add simple api validator
|
||||
validateConfig(
|
||||
CONFIG_KEYS.OCO_API_URL,
|
||||
typeof value === 'string' && value.startsWith('http'),
|
||||
`${value} is not a valid URL`
|
||||
);
|
||||
return value;
|
||||
},
|
||||
};
|
||||
|
||||
export type ConfigType = {
|
||||
|
||||
Reference in New Issue
Block a user