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 {
1515 PromptToolBody
1616} from './types'
1717
18+ const BASE_URL = 'https://api.promptfoundry.ai/sdk/v1'
19+
1820export default class PromptFoundry {
1921 private client : typeof api
2022
2123 private apiKey : string
2224
23- constructor ( { apiKey } : { apiKey : string } ) {
25+ constructor ( { apiKey, baseUrl = BASE_URL } : { apiKey : string ; baseUrl ? : string } ) {
2426 // @ts -expect-error - protect against missing apiKey for js consumers
2527 if ( apiKey === '' || apiKey === undefined || apiKey === null || apiKey === 0 ) {
2628 throw new Error ( 'Prompt Foundry API Key is required!' )
2729 }
2830
2931 this . apiKey = apiKey
3032
31- this . client = createApiClient ( 'https://api.promptfoundry.ai/sdk/v1' )
33+ this . client = createApiClient ( baseUrl )
3234 }
3335
3436 public async getRawPrompt ( { id } : { id : string } ) : Promise < PromptConfiguration > {
You can’t perform that action at this time.
0 commit comments