|
133 | 133 | end |
134 | 134 |
|
135 | 135 | it 'tracks duration and tokens' do |
136 | | - expect(ld_client).to receive(:track).with( |
137 | | - '$ld:ai:generation', |
138 | | - context, |
139 | | - tracker_flag_data, |
140 | | - 1 |
141 | | - ) |
142 | 136 | expect(ld_client).to receive(:track).with( |
143 | 137 | '$ld:ai:generation:success', |
144 | 138 | context, |
|
183 | 177 | end |
184 | 178 |
|
185 | 179 | it 'tracks error for failed operation' do |
186 | | - expect(ld_client).to receive(:track).with( |
187 | | - '$ld:ai:generation', |
188 | | - context, |
189 | | - tracker_flag_data, |
190 | | - 1 |
191 | | - ) |
192 | 180 | expect(ld_client).to receive(:track).with( |
193 | 181 | '$ld:ai:generation:error', |
194 | 182 | context, |
|
246 | 234 | tracker_flag_data, |
247 | 235 | 100 |
248 | 236 | ) |
249 | | - expect(ld_client).to receive(:track).with( |
250 | | - '$ld:ai:generation', |
251 | | - context, |
252 | | - tracker_flag_data, |
253 | | - 1 |
254 | | - ) |
255 | 237 | expect(ld_client).to receive(:track).with( |
256 | 238 | '$ld:ai:generation:success', |
257 | 239 | context, |
|
276 | 258 | tracker_flag_data, |
277 | 259 | kind_of(Integer) |
278 | 260 | ) |
279 | | - expect(ld_client).to receive(:track).with( |
280 | | - '$ld:ai:generation', |
281 | | - context, |
282 | | - tracker_flag_data, |
283 | | - 1 |
284 | | - ) |
285 | 261 | expect(ld_client).to receive(:track).with( |
286 | 262 | '$ld:ai:generation:error', |
287 | 263 | context, |
|
321 | 297 |
|
322 | 298 | describe '#track_success' do |
323 | 299 | it 'tracks generation and success events' do |
324 | | - expect(ld_client).to receive(:track).with( |
325 | | - '$ld:ai:generation', |
326 | | - context, |
327 | | - tracker_flag_data, |
328 | | - 1 |
329 | | - ) |
330 | 300 | expect(ld_client).to receive(:track).with( |
331 | 301 | '$ld:ai:generation:success', |
332 | 302 | context, |
|
340 | 310 |
|
341 | 311 | describe '#track_error' do |
342 | 312 | it 'tracks generation and error events' do |
343 | | - expect(ld_client).to receive(:track).with( |
344 | | - '$ld:ai:generation', |
345 | | - context, |
346 | | - tracker_flag_data, |
347 | | - 1 |
348 | | - ) |
349 | 313 | expect(ld_client).to receive(:track).with( |
350 | 314 | '$ld:ai:generation:error', |
351 | 315 | context, |
|
357 | 321 | end |
358 | 322 |
|
359 | 323 | it 'overwrites success with error if both are tracked' do |
360 | | - expect(ld_client).to receive(:track).with( |
361 | | - '$ld:ai:generation', |
362 | | - context, |
363 | | - tracker_flag_data, |
364 | | - 1 |
365 | | - ).twice |
366 | 324 | expect(ld_client).to receive(:track).with( |
367 | 325 | '$ld:ai:generation:success', |
368 | 326 | context, |
|
0 commit comments