Skip to content

Commit

Permalink
chore: add typedocs for model options
Browse files Browse the repository at this point in the history
  • Loading branch information
laktek committed Apr 14, 2024
1 parent ef0b7b2 commit bc12abc
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion src/edge-runtime.d.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,44 @@
interface ModelOptions {
/**
* Pool embeddings by taking their mean. Applies only for `gte-small` model
*/
mean_pool?: boolean

/**
* Normalize the embeddings result. Applies only for `gte-small` model
*/
normalize?: boolean

/**
* Stream response from model. Applies only for LLMs like `mistral` (default: false)
*/
stream?: boolean

/**
* Automatically abort the request to the model after specified time (in seconds). Applies only for LLMs like `mistral` (default: 60)
*/
timeout?: number
}

interface Session {
/**
* Execute the given prompt in model session
*/
run(prompt: string, modelOptions?: ModelOptions): unknown
}

declare var Session: {
prototype: Session
new (modelName: string, sessionOptions?: unknown): Session
/**
* Create a new model session using given model
*/
new (model: string, sessionOptions?: unknown): Session
}

declare var Supabase: {
/**
* Provides AI related APIs
*/
readonly ai: {
readonly Session: typeof Session
}
Expand Down

0 comments on commit bc12abc

Please sign in to comment.