File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -15,20 +15,22 @@ import {
15
15
PromptToolBody
16
16
} from './types'
17
17
18
+ const BASE_URL = 'https://api.promptfoundry.ai/sdk/v1'
19
+
18
20
export default class PromptFoundry {
19
21
private client : typeof api
20
22
21
23
private apiKey : string
22
24
23
- constructor ( { apiKey } : { apiKey : string } ) {
25
+ constructor ( { apiKey, baseUrl = BASE_URL } : { apiKey : string ; baseUrl ? : string } ) {
24
26
// @ts -expect-error - protect against missing apiKey for js consumers
25
27
if ( apiKey === '' || apiKey === undefined || apiKey === null || apiKey === 0 ) {
26
28
throw new Error ( 'Prompt Foundry API Key is required!' )
27
29
}
28
30
29
31
this . apiKey = apiKey
30
32
31
- this . client = createApiClient ( 'https://api.promptfoundry.ai/sdk/v1' )
33
+ this . client = createApiClient ( baseUrl )
32
34
}
33
35
34
36
public async getRawPrompt ( { id } : { id : string } ) : Promise < PromptConfiguration > {
You can’t perform that action at this time.
0 commit comments