mirror of
https://github.com/langgenius/dify.git
synced 2026-03-24 12:21:03 +08:00
for agentNode include all types like sys, env etc.
This commit is contained in:
parent
21035cfca0
commit
2468e57f52
@ -88,7 +88,7 @@ def encrypt_secret_keys(
|
||||
if secret_variables is None:
|
||||
secret_variables = set()
|
||||
|
||||
if isinstance(obj, dict):
|
||||
if isinstance(obj, Mapping):
|
||||
# recurse into dict
|
||||
return {key: encrypt_secret_keys(value, secret_variables, key) for key, value in obj.items()}
|
||||
|
||||
|
||||
@ -141,14 +141,18 @@ class AgentNode(Node):
|
||||
# get conversation id
|
||||
conversation_id = self.graph_runtime_state.variable_pool.get(["sys", SystemVariableKey.CONVERSATION_ID])
|
||||
|
||||
env_vars = self.graph_runtime_state.variable_pool.variable_dictionary.get("env", {})
|
||||
|
||||
# get secret variables used
|
||||
secret_variables = {
|
||||
var.name
|
||||
for var in env_vars.values() # iterate over the values directly
|
||||
if isinstance(var, SecretVariable)
|
||||
}
|
||||
# to store secret variables used in the Agent block.
|
||||
secret_variables = set()
|
||||
# get secret variables used.
|
||||
for section_vars in self.graph_runtime_state.variable_pool.variable_dictionary.values():
|
||||
# Iterate over all the sections. e.g. sys, env etc.
|
||||
if isinstance(section_vars, dict):
|
||||
# Iterate over each variable in the section
|
||||
for variable in section_vars.values():
|
||||
# Check if the variable is a SecretVariable
|
||||
if isinstance(variable, SecretVariable):
|
||||
# Add the variable name to the set
|
||||
secret_variables.add(variable.name)
|
||||
|
||||
try:
|
||||
message_stream = strategy.invoke(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user