kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
old-agentic-v1^2
rodzic
d10778fae2
commit
acbcb654eb
|
@ -54,7 +54,7 @@ export abstract class BaseTask<TInput = void, TOutput = string> {
|
|||
throw new Error(`clone not implemented for task "${this.name}"`)
|
||||
}
|
||||
|
||||
public retryConfig(retryConfig: types.RetryConfig) {
|
||||
public retryConfig(retryConfig: types.RetryConfig): this {
|
||||
this._retryConfig = retryConfig
|
||||
return this
|
||||
}
|
||||
|
@ -82,7 +82,8 @@ export abstract class BaseTask<TInput = void, TOutput = string> {
|
|||
attemptNumber: 0,
|
||||
metadata: {
|
||||
taskName: this.name,
|
||||
taskId: this.id
|
||||
taskId: this.id,
|
||||
callId: this._agentic.idGeneratorFn()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -104,6 +104,7 @@ export interface TaskResponseMetadata extends Record<string, any> {
|
|||
success?: boolean
|
||||
error?: Error
|
||||
numRetries?: number
|
||||
callId?: string
|
||||
}
|
||||
|
||||
export interface LLMTaskResponseMetadata<
|
||||
|
|
|
@ -17,8 +17,9 @@ test('CalculatorTool', async (t) => {
|
|||
t.is(res2.result, 1)
|
||||
expectTypeOf(res2.result).toMatchTypeOf<number>()
|
||||
|
||||
const { taskId, ...metadata } = res2.metadata
|
||||
const { taskId, callId, ...metadata } = res2.metadata
|
||||
t.true(typeof taskId === 'string')
|
||||
t.true(typeof callId === 'string')
|
||||
t.deepEqual(metadata, {
|
||||
success: true,
|
||||
taskName: 'calculator',
|
||||
|
|
Ładowanie…
Reference in New Issue