day0n commented on code in PR #269:
URL: 
https://github.com/apache/incubator-hugegraph-ai/pull/269#discussion_r2228570995


##########
hugegraph-llm/src/hugegraph_llm/config/models/base_prompt_config.py:
##########
@@ -61,71 +69,74 @@ def ensure_yaml_file_exists(self):
                 # Load existing values from the YAML file into the class 
attributes
                 for key, value in data.items():
                     setattr(self, key, value)
+
+            # Check if the language in the .env file matches the language in 
the YAML file        
+            env_lang = self.llm_settings.language.lower() if hasattr(self, 
'llm_settings') and self.llm_settings.language else 'en'
+            yaml_lang = data.get('_language_generated', 'en').lower()
+            
+            if env_lang.strip() != yaml_lang.strip():
+                log.warning(
+                    f"Prompt was changed '.env' language is '{env_lang}', "
+                    f"but '{F_NAME}' was generated for '{yaml_lang}'. "
+                    f"Regenerating the prompt file..."
+                )
+                if self.llm_settings.language.lower() == "cn":

Review Comment:
   .lower()



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@hugegraph.apache.org
For additional commands, e-mail: issues-h...@hugegraph.apache.org

Reply via email to