|
47 | 47 | persona_options: { |
48 | 48 | "update_algorithm" => "full", |
49 | 49 | }, |
50 | | - context: { |
51 | | - post_id: post.id, |
52 | | - }, |
| 50 | + context: DiscourseAi::AiBot::BotContext.new(messages: [], post: post), |
53 | 51 | ) |
54 | 52 |
|
55 | 53 | result = tool.invoke {} |
|
93 | 91 | persona_options: { |
94 | 92 | "update_algorithm" => "full", |
95 | 93 | }, |
96 | | - context: { |
97 | | - post_id: post.id, |
98 | | - }, |
| 94 | + context: DiscourseAi::AiBot::BotContext.new(messages: [], post: post), |
99 | 95 | ) |
100 | 96 |
|
101 | 97 | result = tool.invoke {} |
|
119 | 115 | { artifact_id: artifact.id, instructions: "Invalid update" }, |
120 | 116 | bot_user: bot_user, |
121 | 117 | llm: llm_model.to_llm, |
122 | | - context: { |
123 | | - post_id: post.id, |
124 | | - }, |
| 118 | + context: DiscourseAi::AiBot::BotContext.new(messages: [], post: post), |
125 | 119 | ) |
126 | 120 |
|
127 | 121 | result = tool.invoke {} |
|
135 | 129 | { artifact_id: -1, instructions: "Update something" }, |
136 | 130 | bot_user: bot_user, |
137 | 131 | llm: llm_model.to_llm, |
138 | | - context: { |
139 | | - post_id: post.id, |
140 | | - }, |
| 132 | + context: DiscourseAi::AiBot::BotContext.new(messages: [], post: post), |
141 | 133 | ) |
142 | 134 |
|
143 | 135 | result = tool.invoke {} |
|
163 | 155 | persona_options: { |
164 | 156 | "update_algorithm" => "full", |
165 | 157 | }, |
166 | | - context: { |
167 | | - post_id: post.id, |
168 | | - }, |
| 158 | + context: DiscourseAi::AiBot::BotContext.new(messages: [], post: post), |
169 | 159 | ) |
170 | 160 |
|
171 | 161 | tool.invoke {} |
|
196 | 186 | persona_options: { |
197 | 187 | "update_algorithm" => "full", |
198 | 188 | }, |
199 | | - context: { |
200 | | - post_id: post.id, |
201 | | - }, |
| 189 | + context: DiscourseAi::AiBot::BotContext.new(messages: [], post: post), |
202 | 190 | ) |
203 | 191 | .invoke {} |
204 | 192 | end |
|
224 | 212 | persona_options: { |
225 | 213 | "update_algorithm" => "full", |
226 | 214 | }, |
227 | | - context: { |
228 | | - post_id: post.id, |
229 | | - }, |
| 215 | + context: DiscourseAi::AiBot::BotContext.new(messages: [], post: post), |
230 | 216 | ) |
231 | 217 |
|
232 | 218 | result = tool.invoke {} |
|
276 | 262 | { artifact_id: artifact.id, instructions: "Change the text to Updated and color to red" }, |
277 | 263 | bot_user: bot_user, |
278 | 264 | llm: llm_model.to_llm, |
279 | | - context: { |
280 | | - post_id: post.id, |
281 | | - }, |
| 265 | + context: DiscourseAi::AiBot::BotContext.new(messages: [], post: post), |
282 | 266 | persona_options: { |
283 | 267 | "update_algorithm" => "diff", |
284 | 268 | }, |
|
346 | 330 | { artifact_id: artifact.id, instructions: "Change the text to Updated and color to red" }, |
347 | 331 | bot_user: bot_user, |
348 | 332 | llm: llm_model.to_llm, |
349 | | - context: { |
350 | | - post_id: post.id, |
351 | | - }, |
| 333 | + context: DiscourseAi::AiBot::BotContext.new(messages: [], post: post), |
352 | 334 | persona_options: { |
353 | 335 | "update_algorithm" => "diff", |
354 | 336 | }, |
|
0 commit comments