Skip to content

Commit

Permalink
fix: Update event types
Browse files Browse the repository at this point in the history
  • Loading branch information
hiro-v committed Dec 8, 2023
1 parent 750f09c commit 0c838ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion core/src/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ export enum EventName {
OnModelReady = "OnModelReady",
/** The `OnModelFail` event is emitted when a model fails loading. */
OnModelFail = "OnModelFail",
/** The `OnModelStop` event is emitted when a model fails loading. */
/** The `OnModelStop` event is emitted when a model start to stop. */
OnModelStop = "OnModelStop",
/** The `OnModelStopped` event is emitted when a model stopped ok. */
OnModelStopped = "OnModelStopped",
}

/**
Expand Down
8 changes: 6 additions & 2 deletions core/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ export type MessageRequest = {

/** Runtime parameters for constructing a chat completion request **/
parameters?: ModelRuntimeParam;

/** Settings for constructing a chat completion request **/
model?: ModelInfo
};

/**
Expand Down Expand Up @@ -154,6 +157,7 @@ export type ModelInfo = {
id: string;
settings: ModelSettingParams;
parameters: ModelRuntimeParam;
engine: InferenceEngine;
};

/**
Expand All @@ -172,7 +176,7 @@ export type ThreadState = {
*/

enum InferenceEngine {
llama_cpp = "llama_cpp",
nitro = "nitro",
openai = "openai",
nvidia_triton = "nvidia_triton",
hf_endpoint = "hf_endpoint",
Expand Down Expand Up @@ -246,7 +250,7 @@ export interface Model {
*/
metadata: ModelMetadata;
/**
* The model engine. Enum: "llamacpp" "openai"
* The model engine.
*/
engine: InferenceEngine;
}
Expand Down

0 comments on commit 0c838ce

Please sign in to comment.