Genkit JS API reference
Preparing search index...
genkit
beta
AgentInitSchema
Variable AgentInitSchema
Const
AgentInitSchema
:
z
.
ZodObject
<
{
sessionId
:
z
.
ZodOptional
<
z
.
ZodString
>
;
snapshotId
:
z
.
ZodOptional
<
z
.
ZodString
>
;
state
:
z
.
ZodOptional
<
z
.
ZodObject
<
{
artifacts
:
z
.
ZodOptional
<
z
.
ZodArray
<
z
.
ZodObject
<
{
metadata
:
z
.
ZodOptional
<
z
.
ZodRecord
<
(...)
,
(...)
>
>
;
name
:
z
.
ZodOptional
<
z
.
ZodString
>
;
parts
:
z
.
ZodArray
<
z
.
ZodUnion
<
(...)
>
,
"many"
>
;
}
,
"strip"
,
z
.
ZodTypeAny
,
{
metadata
?:
Record
<
(...)
,
(...)
>
;
name
?:
string
;
parts
:
(...)
[]
}
,
{
metadata
?:
Record
<
(...)
,
(...)
>
;
name
?:
string
;
parts
:
(...)
[]
}
,
>
,
"many"
,
>
,
>
;
custom
:
z
.
ZodOptional
<
z
.
ZodAny
>
;
messages
:
z
.
ZodOptional
<
z
.
ZodArray
<
z
.
ZodObject
<
{
content
:
z
.
ZodArray
<
z
.
ZodUnion
<
(...)
>
,
"many"
>
;
metadata
:
z
.
ZodOptional
<
z
.
ZodRecord
<
(...)
,
(...)
>
>
;
role
:
z
.
ZodEnum
<
[
(...)
,
(...)
,
(...)
,
(...)
]
>
;
}
,
"strip"
,
z
.
ZodTypeAny
,
{
content
:
(...)
[]
;
metadata
?:
Record
<
(...)
,
(...)
>
;
role
:
"system"
|
"user"
|
"model"
|
"tool"
;
}
,
{
content
:
(...)
[]
;
metadata
?:
Record
<
(...)
,
(...)
>
;
role
:
"system"
|
"user"
|
"model"
|
"tool"
;
}
,
>
,
"many"
,
>
,
>
;
sessionId
:
z
.
ZodOptional
<
z
.
ZodString
>
;
}
,
"strip"
,
z
.
ZodTypeAny
,
{
artifacts
?:
{
metadata
?:
Record
<
string
,
any
>
;
name
?:
string
;
parts
:
((...)
|
(...)
|
(...)
|
(...)
|
(...)
|
(...)
|
(...)
|
(...))
[]
;
}
[]
;
custom
?:
any
;
messages
?:
{
content
:
(
(...)
|
(...)
|
(...)
|
(...)
|
(...)
|
(...)
|
(...)
|
(...)
)
[]
;
metadata
?:
Record
<
string
,
unknown
>
;
role
:
"system"
|
"user"
|
"model"
|
"tool"
;
}
[]
;
sessionId
?:
string
;
}
,
{
artifacts
?:
{
metadata
?:
Record
<
string
,
any
>
;
name
?:
string
;
parts
:
((...)
|
(...)
|
(...)
|
(...)
|
(...)
|
(...)
|
(...)
|
(...))
[]
;
}
[]
;
custom
?:
any
;
messages
?:
{
content
:
(
(...)
|
(...)
|
(...)
|
(...)
|
(...)
|
(...)
|
(...)
|
(...)
)
[]
;
metadata
?:
Record
<
string
,
unknown
>
;
role
:
"system"
|
"user"
|
"model"
|
"tool"
;
}
[]
;
sessionId
?:
string
;
}
,
>
,
>
;
}
,
"strip"
,
z
.
ZodTypeAny
,
{
sessionId
?:
string
;
snapshotId
?:
string
;
state
?:
{
artifacts
?:
{
metadata
?:
Record
<
string
,
any
>
;
name
?:
string
;
parts
:
(
|
{
custom
?:
...
;
data
?:
...
;
media
?:
...
;
metadata
?:
...
;
reasoning
?:
...
;
resource
?:
...
;
text
:
...
;
toolRequest
?:
...
;
toolResponse
?:
...
;
}
|
{
custom
?:
...
;
data
?:
...
;
media
:
...
;
metadata
?:
...
;
reasoning
?:
...
;
resource
?:
...
;
text
?:
...
;
toolRequest
?:
...
;
toolResponse
?:
...
;
}
|
{
custom
?:
...
;
data
?:
...
;
media
?:
...
;
metadata
?:
...
;
reasoning
?:
...
;
resource
?:
...
;
text
?:
...
;
toolRequest
:
...
;
toolResponse
?:
...
;
}
|
{
custom
?:
...
;
data
?:
...
;
media
?:
...
;
metadata
?:
...
;
reasoning
?:
...
;
resource
?:
...
;
text
?:
...
;
toolRequest
?:
...
;
toolResponse
:
...
;
}
|
{
custom
?:
...
;
data
?:
...
;
media
?:
...
;
metadata
?:
...
;
reasoning
?:
...
;
resource
?:
...
;
text
?:
...
;
toolRequest
?:
...
;
toolResponse
?:
...
;
}
|
{
custom
:
...
;
data
?:
...
;
media
?:
...
;
metadata
?:
...
;
reasoning
?:
...
;
resource
?:
...
;
text
?:
...
;
toolRequest
?:
...
;
toolResponse
?:
...
;
}
|
{
custom
?:
...
;
data
?:
...
;
media
?:
...
;
metadata
?:
...
;
reasoning
:
...
;
resource
?:
...
;
text
?:
...
;
toolRequest
?:
...
;
toolResponse
?:
...
;
}
|
{
custom
?:
...
;
data
?:
...
;
media
?:
...
;
metadata
?:
...
;
reasoning
?:
...
;
resource
:
...
;
text
?:
...
;
toolRequest
?:
...
;
toolResponse
?:
...
;
}
)
[]
;
}
[]
;
custom
?:
any
;
messages
?:
{
content
:
(
|
{
custom
?:
...
;
data
?:
...
;
media
?:
...
;
metadata
?:
...
;
reasoning
?:
...
;
resource
?:
...
;
text
:
...
;
toolRequest
?:
...
;
toolResponse
?:
...
;
}
|
{
custom
?:
...
;
data
?:
...
;
media
:
...
;
metadata
?:
...
;
reasoning
?:
...
;
resource
?:
...
;
text
?:
...
;
toolRequest
?:
...
;
toolResponse
?:
...
;
}
|
{
custom
?:
...
;
data
?:
...
;
media
?:
...
;
metadata
?:
...
;
reasoning
?:
...
;
resource
?:
...
;
text
?:
...
;
toolRequest
:
...
;
toolResponse
?:
...
;
}
|
{
custom
?:
...
;
data
?:
...
;
media
?:
...
;
metadata
?:
...
;
reasoning
?:
...
;
resource
?:
...
;
text
?:
...
;
toolRequest
?:
...
;
toolResponse
:
...
;
}
|
{
custom
?:
...
;
data
?:
...
;
media
?:
...
;
metadata
?:
...
;
reasoning
?:
...
;
resource
?:
...
;
text
?:
...
;
toolRequest
?:
...
;
toolResponse
?:
...
;
}
|
{
custom
:
...
;
data
?:
...
;
media
?:
...
;
metadata
?:
...
;
reasoning
?:
...
;
resource
?:
...
;
text
?:
...
;
toolRequest
?:
...
;
toolResponse
?:
...
;
}
|
{
custom
?:
...
;
data
?:
...
;
media
?:
...
;
metadata
?:
...
;
reasoning
:
...
;
resource
?:
...
;
text
?:
...
;
toolRequest
?:
...
;
toolResponse
?:
...
;
}
|
{
custom
?:
...
;
data
?:
...
;
media
?:
...
;
metadata
?:
...
;
reasoning
?:
...
;
resource
:
...
;
text
?:
...
;
toolRequest
?:
...
;
toolResponse
?:
...
;
}
)
[]
;
metadata
?:
Record
<
string
,
unknown
>
;
role
:
"system"
|
"user"
|
"model"
|
"tool"
;
}
[]
;
sessionId
?:
string
;
}
;
}
,
{
sessionId
?:
string
;
snapshotId
?:
string
;
state
?:
{
artifacts
?:
{
metadata
?:
Record
<
string
,
any
>
;
name
?:
string
;
parts
:
(
|
{
custom
?:
...
;
data
?:
...
;
media
?:
...
;
metadata
?:
...
;
reasoning
?:
...
;
resource
?:
...
;
text
:
...
;
toolRequest
?:
...
;
toolResponse
?:
...
;
}
|
{
custom
?:
...
;
data
?:
...
;
media
:
...
;
metadata
?:
...
;
reasoning
?:
...
;
resource
?:
...
;
text
?:
...
;
toolRequest
?:
...
;
toolResponse
?:
...
;
}
|
{
custom
?:
...
;
data
?:
...
;
media
?:
...
;
metadata
?:
...
;
reasoning
?:
...
;
resource
?:
...
;
text
?:
...
;
toolRequest
:
...
;
toolResponse
?:
...
;
}
|
{
custom
?:
...
;
data
?:
...
;
media
?:
...
;
metadata
?:
...
;
reasoning
?:
...
;
resource
?:
...
;
text
?:
...
;
toolRequest
?:
...
;
toolResponse
:
...
;
}
|
{
custom
?:
...
;
data
?:
...
;
media
?:
...
;
metadata
?:
...
;
reasoning
?:
...
;
resource
?:
...
;
text
?:
...
;
toolRequest
?:
...
;
toolResponse
?:
...
;
}
|
{
custom
:
...
;
data
?:
...
;
media
?:
...
;
metadata
?:
...
;
reasoning
?:
...
;
resource
?:
...
;
text
?:
...
;
toolRequest
?:
...
;
toolResponse
?:
...
;
}
|
{
custom
?:
...
;
data
?:
...
;
media
?:
...
;
metadata
?:
...
;
reasoning
:
...
;
resource
?:
...
;
text
?:
...
;
toolRequest
?:
...
;
toolResponse
?:
...
;
}
|
{
custom
?:
...
;
data
?:
...
;
media
?:
...
;
metadata
?:
...
;
reasoning
?:
...
;
resource
:
...
;
text
?:
...
;
toolRequest
?:
...
;
toolResponse
?:
...
;
}
)
[]
;
}
[]
;
custom
?:
any
;
messages
?:
{
content
:
(
|
{
custom
?:
...
;
data
?:
...
;
media
?:
...
;
metadata
?:
...
;
reasoning
?:
...
;
resource
?:
...
;
text
:
...
;
toolRequest
?:
...
;
toolResponse
?:
...
;
}
|
{
custom
?:
...
;
data
?:
...
;
media
:
...
;
metadata
?:
...
;
reasoning
?:
...
;
resource
?:
...
;
text
?:
...
;
toolRequest
?:
...
;
toolResponse
?:
...
;
}
|
{
custom
?:
...
;
data
?:
...
;
media
?:
...
;
metadata
?:
...
;
reasoning
?:
...
;
resource
?:
...
;
text
?:
...
;
toolRequest
:
...
;
toolResponse
?:
...
;
}
|
{
custom
?:
...
;
data
?:
...
;
media
?:
...
;
metadata
?:
...
;
reasoning
?:
...
;
resource
?:
...
;
text
?:
...
;
toolRequest
?:
...
;
toolResponse
:
...
;
}
|
{
custom
?:
...
;
data
?:
...
;
media
?:
...
;
metadata
?:
...
;
reasoning
?:
...
;
resource
?:
...
;
text
?:
...
;
toolRequest
?:
...
;
toolResponse
?:
...
;
}
|
{
custom
:
...
;
data
?:
...
;
media
?:
...
;
metadata
?:
...
;
reasoning
?:
...
;
resource
?:
...
;
text
?:
...
;
toolRequest
?:
...
;
toolResponse
?:
...
;
}
|
{
custom
?:
...
;
data
?:
...
;
media
?:
...
;
metadata
?:
...
;
reasoning
:
...
;
resource
?:
...
;
text
?:
...
;
toolRequest
?:
...
;
toolResponse
?:
...
;
}
|
{
custom
?:
...
;
data
?:
...
;
media
?:
...
;
metadata
?:
...
;
reasoning
?:
...
;
resource
:
...
;
text
?:
...
;
toolRequest
?:
...
;
toolResponse
?:
...
;
}
)
[]
;
metadata
?:
Record
<
string
,
unknown
>
;
role
:
"system"
|
"user"
|
"model"
|
"tool"
;
}
[]
;
sessionId
?:
string
;
}
;
}
,
>
Schema for initializing an agent turn.
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
Genkit JS API reference
Loading...
Schema for initializing an agent turn.