-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample-output.json
More file actions
122 lines (122 loc) · 4.49 KB
/
Copy pathexample-output.json
File metadata and controls
122 lines (122 loc) · 4.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Thank you for the insights! Now, could you get detailed information about this Pinterest pin I found? Here is the link: https://pinterest.com/pin/1234567890"
}
]
},
{
"role": "model",
"parts": [
{
"text": "On it—fetching the pin details now.\n\nReasoning: The user provided a valid Pinterest pin URL, so I should call the Get Pin Data tool with that URL and wait for tool signals before sharing any results."
},
{
"functionCall": {
"name": "Get Pin Data",
"args": {
"url": "https://pinterest.com/pin/1234567890"
}
}
}
]
},
{
"role": "user",
"parts": [
{
"functionResponse": {
"name": "Get Pin Data",
"response": {
"name": "Get Pin Data",
"content": "<tool_ack id=\"t1\"/>"
}
}
}
]
},
{
"role": "model",
"parts": [
{
"text": "Thanks—I’ll share the pin details as soon as they’re ready. If there’s anything specific you want me to focus on (title, creator, description, or images), let me know.\n\nReasoning: We received an ACK but no result yet, so I’m providing a neutral, result-independent follow-up and inviting any preference without inventing details."
}
]
}
],
"tools": [
{
"functionDeclarations": [
{
"name": "Hashtag Feed V2",
"description": "Retrieve a list of posts from Instagram based on a specified hashtag.",
"parameters": {
"type": "object",
"properties": {
"hashtag": {
"type": "string",
"description": "The Instagram hashtag to retrieve posts for."
},
"end_cursor": {
"type": "string",
"description": "The pagination cursor to retrieve the next batch of posts.",
"default": ""
}
},
"required": [
"hashtag"
]
}
},
{
"name": "Search Images",
"description": "Search for images on Twitter",
"parameters": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "The search query for images"
},
"cursor": {
"type": "string",
"description": "The cursor for pagination (optional)",
"default": ""
}
},
"required": [
"query"
]
}
},
{
"name": "Get Pin Data",
"description": "Retrieve detailed information about a specific Pinterest pin.",
"parameters": {
"type": "object",
"properties": {
"url": {
"type": "string",
"description": "The URL of the Pinterest pin to retrieve information about."
}
},
"required": [
"url"
]
}
}
]
}
],
"systemInstruction": {
"role": "system",
"parts": [
{
"text": "You are an expert in composing functions. You are given a question and a set of possible functions. Based on the question, you will need to make one or more function/tool calls to achieve the purpose. If none of the function can be used, point it out. If the given question lacks the parameters required by the function, also point it out. You should only return the function call in tools call sections.\n\nIMPORTANT - Async Tool Call Protocol:\n- Tools may execute asynchronously. When you call a tool, you may receive an ACK (acknowledgment) before the actual result.\n- ACK format: A tool message with content '<tool_ack id=\"tN\"/>' (where tN is the tool call id).\n- RESPONSE format: A tool message with JSON content '{\"id\":\"tN\",\"ok\":true|false,\"data\":...}' or '{\"id\":\"tN\",\"ok\":false,\"error\":...}'.\n- After making tool calls, wait for each tool's ACK or RESPONSE before proceeding with new user-facing messages.\n- While waiting for results, provide result-independent content (e.g., 'I'm fetching that information now').\n- Only present result-dependent information after receiving the actual RESPONSE, not just the ACK."
}
]
}
}