old-agentic-v1^2
Travis Fischer 2023-06-19 12:52:23 -07:00
rodzic dc30f6ed26
commit 44d251e6de
3 zmienionych plików z 11 dodań i 2 usunięć

Wyświetl plik

@ -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<

Wyświetl plik

@ -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'
}

3
test/utils.test.ts vendored
Wyświetl plik

@ -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) => {