kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
old-agentic-v1^2
rodzic
dc30f6ed26
commit
44d251e6de
|
@ -73,10 +73,14 @@ export interface LLMOptions<
|
|||
export type ChatMessage = openai.ChatMessage
|
||||
export type ChatMessageRole = openai.ChatMessageRole
|
||||
|
||||
export type ChatMessageContent<TInput extends TaskInput = void> =
|
||||
| string
|
||||
| ((input: TInput | any) => string)
|
||||
|
||||
export type ChatMessageInput<TInput extends TaskInput = void> =
|
||||
| ChatMessage
|
||||
| {
|
||||
content: (input: TInput | any) => string
|
||||
content: ChatMessageContent<TInput>
|
||||
}
|
||||
|
||||
export interface ChatModelOptions<
|
||||
|
|
|
@ -215,3 +215,7 @@ export function throttleKy(
|
|||
export function isFunction(value: any): value is Function {
|
||||
return typeof value === 'function'
|
||||
}
|
||||
|
||||
export function isString(value: any): value is string {
|
||||
return typeof value === 'string'
|
||||
}
|
||||
|
|
|
@ -35,7 +35,8 @@ test('sleep should delay execution', async (t) => {
|
|||
const start = Date.now()
|
||||
await sleep(1000) // for example, 1000ms / 1sec
|
||||
const end = Date.now()
|
||||
t.true(end - start >= 1000)
|
||||
const duration = end - start
|
||||
t.true(duration >= 1000 - 10)
|
||||
})
|
||||
|
||||
test('defaultIDGeneratorFn should generate URL-safe string', (t) => {
|
||||
|
|
Ładowanie…
Reference in New Issue