File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -624,8 +624,24 @@ def _validate_application(application: Application) -> None:
624624 Raises:
625625 QTypeSemanticError: If SecretReference is used but
626626 secret_manager is not configured, or if secret_manager
627- configuration is invalid
627+ configuration is invalid, or if feedback is configured
628+ without telemetry
628629 """
630+ # Check if feedback is configured without telemetry
631+ if application .telemetry is None :
632+ flows_with_feedback = [
633+ flow .id for flow in application .flows if flow .feedback is not None
634+ ]
635+ if flows_with_feedback :
636+ raise QTypeSemanticError (
637+ (
638+ f"Application '{ application .id } ' has flows with feedback "
639+ f"configured but no telemetry sink defined. "
640+ f"Flows with feedback: { ', ' .join (flows_with_feedback )} . "
641+ "Please add a telemetry configuration to the application."
642+ )
643+ )
644+
629645 if application .secret_manager is None :
630646 # Check if any SecretReference is used in the application
631647 if _has_secret_reference (application ):
Original file line number Diff line number Diff line change 1+ id : test_feedback_without_telemetry
2+ description : Test that feedback requires telemetry to be configured
3+
4+ flows :
5+ - id : chat
6+ description : Flow with feedback but no telemetry (should fail validation)
7+ interface :
8+ type : Conversational
9+ feedback :
10+ type : thumbs
11+ explanation : false
12+ variables :
13+ - id : msg
14+ type : ChatMessage
15+ steps :
16+ - type : Echo
17+ id : echo
18+ inputs :
19+ - msg
20+ outputs :
21+ - msg
22+ inputs :
23+ - msg
24+ outputs :
25+ - msg
26+
27+ # Note: No telemetry configured - this should cause validation error
Original file line number Diff line number Diff line change 105105 "invalid_secret_manager_wrong_auth_type.qtype.yaml" ,
106106 "AWSSecretManager 'my_secret_manager' requires an AWSAuthProvider" ,
107107 ),
108+ (
109+ "invalid_feedback_without_telemetry.qtype.yaml" ,
110+ "has flows with feedback configured but no telemetry sink defined" ,
111+ ),
108112 (
109113 "invalid_complete_flow_no_text_output.qtype.yaml" ,
110114 "final step 'echo_step' is of type 'Echo' which does not support streaming" ,
You can’t perform that action at this time.
0 commit comments