Skip to content

Commit

Permalink
Format and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblee93 committed Oct 20, 2024
1 parent f2836b7 commit 9ec87a6
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions libs/langchain-community/src/experimental/llms/chrome_ai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,19 @@ export interface AILanguageModelFactory {
}

export interface AILanguageModel extends EventTarget {
prompt(input: AILanguageModelPromptInput, options?: AILanguageModelPromptOptions): Promise<String>;
promptStreaming(input: AILanguageModelPromptInput, options?: AILanguageModelPromptOptions): ReadableStream;

countPromptTokens(input: AILanguageModelPromptInput, options?: AILanguageModelPromptOptions): Promise<number>;
prompt(
input: AILanguageModelPromptInput,
options?: AILanguageModelPromptOptions
): Promise<string>;
promptStreaming(
input: AILanguageModelPromptInput,
options?: AILanguageModelPromptOptions
): ReadableStream;

countPromptTokens(
input: AILanguageModelPromptInput,
options?: AILanguageModelPromptOptions
): Promise<number>;

get maxTokens(): number;
get tokensSoFar(): number;
Expand All @@ -23,7 +32,7 @@ export interface AILanguageModel extends EventTarget {
get topK(): number;
get temperature(): number;

oncontextoverflow: ((event: Event) => void);
oncontextoverflow: (event: Event) => void;

clone(options?: AILanguageModelCloneOptions): Promise<AILanguageModel>;
destroy(): void;
Expand Down Expand Up @@ -66,17 +75,20 @@ export interface AILanguageModelCloneOptions {
signal?: AbortSignal;
}

export type AILanguageModelPromptInput = string | AILanguageModelPrompt | AILanguageModelPrompt[];
export type AILanguageModelPromptInput =
| string
| AILanguageModelPrompt
| AILanguageModelPrompt[];

enum AILanguageModelInitialPromptRole {
"system",
"user",
"assistant"
"assistant",
}

enum AILanguageModelPromptRole {
"user",
"assistant"
"assistant",
}

export type AICapabilityAvailability = "yes" | "no";
Expand Down

0 comments on commit 9ec87a6

Please sign in to comment.