Closed (fixed)
Project:
Langfuse
Version:
1.0.0-alpha1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
25 Sep 2025 at 20:42 UTC
Updated:
28 Nov 2025 at 10:02 UTC
Jump to comment: Most recent
AI logging is expecting a different object:
Error: Object of class Drupal\ai\OperationType\Chat\OpenAiTypeStreamedChatMessageIterator could not be converted to string in Drupal\langfuse_ai_logging\EventSubscriber\LangFuseAiLoggingSubscriber->completeGeneration() (line 401 of /var/www/html/docroot/modules/contrib/langfuse/modules/langfuse_ai_logging/src/EventSubscriber/LangFuseAiLoggingSubscriber.php).
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
nikro commentedAlright, after digging a bit, I realized that all my tests were NON-STREAMING and your bumped into the streaming use-case. I doesn't depend on my original assumptions that it's related to ai.module v1.2.x - but it's simply related to streaming.
Apparently the PostGeneration hook is called even for streaming events, but the contents are empty (as they are normally constructed in a later phase). Solution was to identify that we're actually using a streamed case, and bail early, and use a different event (with already properly prepared response) to track it.
I nuked (or tried nuking) 1.2.x branch, committed changes straight into the main branch.
@Niels, please pull (main, not this issue-branch), recheck - see if it works as expected.
Comment #5
nikro commentedWe talked via slack - things seem to be fine now, closing this issue.