GitHub
Docs
Preparing search index...
The search index is not available
Langfuse JS/TS SDKs
Langfuse JS/TS SDKs
langfuse
LangfuseGenerationClient
Class LangfuseGenerationClient
Hierarchy
LangfuseObservationClient
LangfuseGenerationClient
Index
Constructors
constructor
Properties
client
id
observation
Id
trace
Id
Methods
end
event
generation
get
Trace
Url
score
span
update
Constructors
constructor
new
Langfuse
Generation
Client
(
client
,
id
,
traceId
)
:
LangfuseGenerationClient
Parameters
client
:
LangfuseCore
id
:
string
traceId
:
string
Returns
LangfuseGenerationClient
Properties
Readonly
client
client
:
LangfuseCore
Readonly
id
id
:
string
Readonly
observation
Id
observation
Id
:
null
|
string
Readonly
trace
Id
trace
Id
:
string
Methods
end
end
(
body
?
)
:
this
Parameters
Optional
body
:
Omit
<
Omit
<
{
completionStartTime
?:
null
|
Date
;
endTime
?:
null
|
Date
;
id
:
string
;
input
?:
any
;
level
?:
|
"DEBUG"
|
"DEFAULT"
|
"WARNING"
|
"ERROR"
;
metadata
?:
any
;
model
?:
null
|
string
;
modelParameters
?:
null
|
{
[
key
:
string
]
:
components
[
"schemas"
]
[
"MapValue"
]
;
}
;
name
?:
null
|
string
;
output
?:
any
;
parentObservationId
?:
null
|
string
;
promptName
?:
null
|
string
;
promptVersion
?:
null
|
number
;
startTime
?:
null
|
Date
;
statusMessage
?:
null
|
string
;
traceId
?:
null
|
string
;
usage
?:
{
input
?:
null
|
number
;
inputCost
?:
null
|
number
;
output
?:
null
|
number
;
outputCost
?:
null
|
number
;
total
?:
null
|
number
;
totalCost
?:
null
|
number
;
unit
?:
|
"CHARACTERS"
|
"TOKENS"
|
"MILLISECONDS"
|
"SECONDS"
|
"IMAGES"
|
"REQUESTS"
;
}
|
{
completionTokens
?:
null
|
number
;
promptTokens
?:
null
|
number
;
totalTokens
?:
null
|
number
;
}
;
version
?:
null
|
string
;
}
,
"externalId"
|
"traceIdType"
>
,
|
"endTime"
|
"id"
|
"traceId"
|
"promptName"
|
"promptVersion"
>
&
PromptInput
Returns
this
event
event
(
body
)
:
LangfuseEventClient
Parameters
body
:
Omit
<
Omit
<
{
id
?:
null
|
string
;
input
?:
any
;
level
?:
|
"DEBUG"
|
"DEFAULT"
|
"WARNING"
|
"ERROR"
;
metadata
?:
any
;
name
?:
null
|
string
;
output
?:
any
;
parentObservationId
?:
null
|
string
;
startTime
?:
null
|
Date
;
statusMessage
?:
null
|
string
;
traceId
?:
null
|
string
;
version
?:
null
|
string
;
}
,
"externalId"
|
"traceIdType"
>
,
"traceId"
|
"parentObservationId"
>
Returns
LangfuseEventClient
generation
generation
(
body
)
:
LangfuseGenerationClient
Parameters
body
:
Omit
<
Omit
<
{
completionStartTime
?:
null
|
Date
;
endTime
?:
null
|
Date
;
id
?:
null
|
string
;
input
?:
any
;
level
?:
|
"DEBUG"
|
"DEFAULT"
|
"WARNING"
|
"ERROR"
;
metadata
?:
any
;
model
?:
null
|
string
;
modelParameters
?:
null
|
{
[
key
:
string
]
:
components
[
"schemas"
]
[
"MapValue"
]
;
}
;
name
?:
null
|
string
;
output
?:
any
;
parentObservationId
?:
null
|
string
;
promptName
?:
null
|
string
;
promptVersion
?:
null
|
number
;
startTime
?:
null
|
Date
;
statusMessage
?:
null
|
string
;
traceId
?:
null
|
string
;
usage
?:
{
input
?:
null
|
number
;
inputCost
?:
null
|
number
;
output
?:
null
|
number
;
outputCost
?:
null
|
number
;
total
?:
null
|
number
;
totalCost
?:
null
|
number
;
unit
?:
|
"CHARACTERS"
|
"TOKENS"
|
"MILLISECONDS"
|
"SECONDS"
|
"IMAGES"
|
"REQUESTS"
;
}
|
{
completionTokens
?:
null
|
number
;
promptTokens
?:
null
|
number
;
totalTokens
?:
null
|
number
;
}
;
version
?:
null
|
string
;
}
,
"externalId"
|
"traceIdType"
>
,
|
"traceId"
|
"parentObservationId"
|
"promptName"
|
"promptVersion"
>
&
PromptInput
Returns
LangfuseGenerationClient
get
Trace
Url
get
Trace
Url
(
)
:
string
Returns
string
score
score
(
body
)
:
this
Parameters
body
:
Omit
<
Omit
<
{
comment
?:
null
|
string
;
configId
?:
null
|
string
;
dataType
?:
"NUMERIC"
|
"BOOLEAN"
|
"CATEGORICAL"
;
id
?:
null
|
string
;
name
:
string
;
observationId
?:
null
|
string
;
traceId
:
string
;
value
:
string
|
number
;
}
,
"externalId"
|
"traceIdType"
>
,
"traceId"
|
"parentObservationId"
>
Returns
this
span
span
(
body
)
:
LangfuseSpanClient
Parameters
body
:
Omit
<
Omit
<
{
endTime
?:
null
|
Date
;
id
?:
null
|
string
;
input
?:
any
;
level
?:
|
"DEBUG"
|
"DEFAULT"
|
"WARNING"
|
"ERROR"
;
metadata
?:
any
;
name
?:
null
|
string
;
output
?:
any
;
parentObservationId
?:
null
|
string
;
startTime
?:
null
|
Date
;
statusMessage
?:
null
|
string
;
traceId
?:
null
|
string
;
version
?:
null
|
string
;
}
,
"externalId"
|
"traceIdType"
>
,
"traceId"
|
"parentObservationId"
>
Returns
LangfuseSpanClient
update
update
(
body
)
:
this
Parameters
body
:
Omit
<
Omit
<
{
completionStartTime
?:
null
|
Date
;
endTime
?:
null
|
Date
;
id
:
string
;
input
?:
any
;
level
?:
|
"DEBUG"
|
"DEFAULT"
|
"WARNING"
|
"ERROR"
;
metadata
?:
any
;
model
?:
null
|
string
;
modelParameters
?:
null
|
{
[
key
:
string
]
:
components
[
"schemas"
]
[
"MapValue"
]
;
}
;
name
?:
null
|
string
;
output
?:
any
;
parentObservationId
?:
null
|
string
;
promptName
?:
null
|
string
;
promptVersion
?:
null
|
number
;
startTime
?:
null
|
Date
;
statusMessage
?:
null
|
string
;
traceId
?:
null
|
string
;
usage
?:
{
input
?:
null
|
number
;
inputCost
?:
null
|
number
;
output
?:
null
|
number
;
outputCost
?:
null
|
number
;
total
?:
null
|
number
;
totalCost
?:
null
|
number
;
unit
?:
|
"CHARACTERS"
|
"TOKENS"
|
"MILLISECONDS"
|
"SECONDS"
|
"IMAGES"
|
"REQUESTS"
;
}
|
{
completionTokens
?:
null
|
number
;
promptTokens
?:
null
|
number
;
totalTokens
?:
null
|
number
;
}
;
version
?:
null
|
string
;
}
,
"externalId"
|
"traceIdType"
>
,
|
"id"
|
"traceId"
|
"promptName"
|
"promptVersion"
>
&
PromptInput
Returns
this
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Properties
client
id
observation
Id
trace
Id
Methods
end
event
generation
get
Trace
Url
score
span
update
GitHub
Docs
Langfuse JS/TS SDKs
Loading...