isProperlyConfigured
This commit is contained in:
parent
400df1a51a
commit
cfcbee33a4
3 changed files with 15 additions and 0 deletions
5
core/index.d.ts
vendored
5
core/index.d.ts
vendored
|
|
@ -162,6 +162,11 @@ export interface ILLM extends LLMOptions {
|
|||
otherData: Record<string, string>,
|
||||
canPutWordsInModelsMouth?: boolean,
|
||||
): string | ChatMessage[];
|
||||
|
||||
/**
|
||||
* This method should return false if the model is missing an API key or something else that would cause it to fail if called
|
||||
*/
|
||||
isProperlyConfigured(): boolean;
|
||||
}
|
||||
|
||||
export interface ModelInstaller {
|
||||
|
|
|
|||
|
|
@ -260,6 +260,12 @@ export abstract class BaseLLM implements ILLM {
|
|||
options.maxEmbeddingChunkSize ?? DEFAULT_MAX_CHUNK_SIZE;
|
||||
this.embeddingId = `${this.constructor.name}::${this.model}::${this.maxEmbeddingChunkSize}`;
|
||||
}
|
||||
isProperlyConfigured(): boolean {
|
||||
return true;
|
||||
}
|
||||
useLegacyCompletionsEndpoint?: boolean | undefined;
|
||||
modelArn?: string | undefined;
|
||||
env?: Record<string, string | number | boolean> | undefined;
|
||||
|
||||
protected createOpenAiAdapter() {
|
||||
return constructLlmApi({
|
||||
|
|
|
|||
|
|
@ -9,4 +9,8 @@ export class Relace extends OpenAI {
|
|||
apiBase: "https://instantapply.endpoint.relace.run/v1/",
|
||||
};
|
||||
protected useOpenAIAdapterFor: (LlmApiRequestType | "*")[] = ["*"];
|
||||
|
||||
isProperlyConfigured(): boolean {
|
||||
return !!this.apiKey;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue