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}"`)
|
throw new Error(`clone not implemented for task "${this.name}"`)
|
||||||
}
|
}
|
||||||
|
|
||||||
public retryConfig(retryConfig: types.RetryConfig) {
|
public retryConfig(retryConfig: types.RetryConfig): this {
|
||||||
this._retryConfig = retryConfig
|
this._retryConfig = retryConfig
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,8 @@ export abstract class BaseTask<TInput = void, TOutput = string> {
|
||||||
attemptNumber: 0,
|
attemptNumber: 0,
|
||||||
metadata: {
|
metadata: {
|
||||||
taskName: this.name,
|
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
|
success?: boolean
|
||||||
error?: Error
|
error?: Error
|
||||||
numRetries?: number
|
numRetries?: number
|
||||||
|
callId?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface LLMTaskResponseMetadata<
|
export interface LLMTaskResponseMetadata<
|
||||||
|
|
|
@ -17,8 +17,9 @@ test('CalculatorTool', async (t) => {
|
||||||
t.is(res2.result, 1)
|
t.is(res2.result, 1)
|
||||||
expectTypeOf(res2.result).toMatchTypeOf<number>()
|
expectTypeOf(res2.result).toMatchTypeOf<number>()
|
||||||
|
|
||||||
const { taskId, ...metadata } = res2.metadata
|
const { taskId, callId, ...metadata } = res2.metadata
|
||||||
t.true(typeof taskId === 'string')
|
t.true(typeof taskId === 'string')
|
||||||
|
t.true(typeof callId === 'string')
|
||||||
t.deepEqual(metadata, {
|
t.deepEqual(metadata, {
|
||||||
success: true,
|
success: true,
|
||||||
taskName: 'calculator',
|
taskName: 'calculator',
|
||||||
|
|
Ładowanie…
Reference in New Issue