(enableTruncation: boolean | undefined)
| 66 | * message data can be retained. `streamGenAiSpans` is opt-out (on unless explicitly set to `false`). |
| 67 | */ |
| 68 | export function shouldEnableTruncation(enableTruncation: boolean | undefined): boolean { |
| 69 | if (enableTruncation !== undefined) { |
| 70 | return enableTruncation; |
| 71 | } |
| 72 | |
| 73 | const client = getClient(); |
| 74 | if (!client) { |
| 75 | return true; |
| 76 | } |
| 77 | |
| 78 | return !hasSpanStreamingEnabled(client) && client.getOptions().streamGenAiSpans === false; |
| 79 | } |
| 80 | |
| 81 | /** |
| 82 | * Build method path from current traversal |
no test coverage detected