Skip to main content

Call Signature

op<T>(fn, options?): Op<T>
Defined in: src/op.ts:392

Type Parameters

T

T extends (…args) => any

Parameters

fn

T

options?

attributes?
Record<string, any> Default attributes applied to every call this op creates. Integrations set this to stamp attributes.integration provenance. Merged beneath kind/ color, which take precedence on key collision.
bindThis?
WeaveObject
callDisplayName?
(…args) => string
isDecorator?
boolean
name?
string
opColor?
string Custom color for the operation in the UI
opKind?
string The kind of operation (e.g., ‘llm’, ‘agent’, ‘tool’, ‘search’) for UI categorization
originalFunction?
T
parameterNames?
"useParam0Object" | string[]
shouldAdoptThis?
boolean
streamReducer?
{ finalizeFn: (state) => void; initialStateFn: () => any; reduceFn: (state, chunk) => any; }
streamReducer.finalizeFn
(state) => void
streamReducer.initialStateFn
() => any
streamReducer.reduceFn
(state, chunk) => any
summarize?
(result) => Record<string, any>

Returns

Op<T>

Call Signature

op<T>(thisArg, fn, options?): Op<T>
Defined in: src/op.ts:397

Type Parameters

T

T extends (…args) => any

Parameters

thisArg

any

fn

T

options?

attributes?
Record<string, any> Default attributes applied to every call this op creates. Integrations set this to stamp attributes.integration provenance. Merged beneath kind/ color, which take precedence on key collision.
bindThis?
WeaveObject
callDisplayName?
(…args) => string
isDecorator?
boolean
name?
string
opColor?
string Custom color for the operation in the UI
opKind?
string The kind of operation (e.g., ‘llm’, ‘agent’, ‘tool’, ‘search’) for UI categorization
originalFunction?
T
parameterNames?
"useParam0Object" | string[]
shouldAdoptThis?
boolean
streamReducer?
{ finalizeFn: (state) => void; initialStateFn: () => any; reduceFn: (state, chunk) => any; }
streamReducer.finalizeFn
(state) => void
streamReducer.initialStateFn
() => any
streamReducer.reduceFn
(state, chunk) => any
summarize?
(result) => Record<string, any>

Returns

Op<T>

Call Signature

op(target, propertyKey, descriptor): TypedPropertyDescriptor<any>
Defined in: src/op.ts:403

Parameters

target

object

propertyKey

string | symbol

descriptor

TypedPropertyDescriptor<any>

Returns

TypedPropertyDescriptor<any>

Call Signature

op<T>(value, context): Op<T>
Defined in: src/op.ts:409

Type Parameters

T

T extends (…args) => any

Parameters

value

T

context

access?
{ get: Function; has: boolean; }
access.get
access.has
class?
Function
kind
"method"
metadata?
any
name
string | symbol
private?
boolean
static?
boolean
addInitializer?

Returns

Op<T>

Call Signature

op(options): MethodDecorator
Defined in: src/op.ts:414

Parameters

options

Partial<OpOptions<any>>

Returns

MethodDecorator