Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Commit

Permalink
Update openaiHelper to import shared types from core
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Gillespie committed Sep 14, 2021
1 parent a03fabe commit 0145ac8
Showing 1 changed file with 1 addition and 34 deletions.
35 changes: 1 addition & 34 deletions client/src/utils/openaiHelper.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,5 @@

export type ModelCompletionOpts = {
model: string
prompt?: string
maxTokens?: number
temperature?: number
topP?: number
n?: number
stream?: boolean
logprobs?: number
echo?: boolean
stop?: string | string[]
presencePenalty?: number
frequencyPenalty?: number
bestOf?: number
user?: string
logitBias?: { [token: string]: number }
}

export type OpenAIResultChoice = {
text: string,
index: number,
logprobs: number[],
"top_logprobs": any[],
"text_offset": number[]
}

export type OpenAIResponse = {
id: string,
object: string,
created: number,
model: string,
choices: OpenAIResultChoice[]
"finish_reason": string
}
import { ModelCompletionOpts, OpenAIResultChoice } from "@latitudegames/thoth-core/types";

export const completion = async (body: ModelCompletionOpts) => {
const url = process.env.REACT_APP_API_URL;
Expand Down

0 comments on commit 0145ac8

Please sign in to comment.