how to pass a credntials variable to a python script

Hi - I am trying continue my journey in using our local company LLM. I can now connect using a Python script but I am struggling use the Credentials node to pass the API key to the script rather than hard coding

I think the following snippet is the call for the flow variable.

try:
api_key = knime_io.flow_variables[‘credentials’]
except KeyError:
raise ValueError(“API Key not found. Please connect a ‘Credentials Configuration’ node with a flow variable named ‘credentials’.”)

screenshots of the Credentails node and the relevant area of the Python script.



When looking at the python script config the Flow Variables input shows that the credentials is “not supported” ?

I am sure I am missing something obvious in the variable connection

Hey there,

I think you stated the answer already - in Python Script nodes you cannot use data type credentials - someone from the KNIME team confirmed it in a different context here:

4 Likes

@MartinDDDD
Thanks for the link, The python script at least proved that our local company LLM is accessible from Knime as it contained the specifc proxy details.

BUT without being able to somehow inject the proxies into the AI LLM Nodes people wont even look at Knime as a modern application. Any application without AI these days is almost redundant to most users looking in from the outside. Its going to be the same with the AI Agentics and KAI unfortunately.

Cheers though for the extra info