Parameter value passing in python function call

Hey there,

We've made a OpenAI resource query that accepts a parameter "word", as shown here:

We're trying to set the value of the parameter "word", but we get an error that the resource query is not callable (correctly so), as shown here:

We would expect something like a trigger function with additionalScope parameters but it seems there isn't such an option.

The question is how do we set the value of the parameter "word".

Thank you.

The question is how do we specifyc

1 Like

Hey @gtourkas! Calling function blocks from a Python script currently isn't supported though it is a feature request that is being tracked internally. Is that what you're trying to do here?

Would you mind sharing more about the script you're trying to run? Happy to help think of workarounds! A JavaScript version of that function might look like:

async function generateRandomSentence(word) { 
  const chatCompletion = await createChatCompletion(word);
  const choices = chatCompletion.choices;
  if (choices.length > 0) {
    return choices[0].message.content;
  } else {
    return "N/A";
  } 
}
1 Like

Hi @Kabirdas, is there any update about the feature request, with which we could use functions from python code blocks? I started coding something in python, now some of the parts need to be written in javascript.. It's not the ideal solution.. Thank you

hey @Cs.Tibor I've surfaced your interest in this on the existing feature request internally for the eng team. Currently it's not planned on the roadmap, but we're still gathering interest from customers, and the team will take your +1 on this into consideration. You adding your use case for this helps the team understand the need for it :+1:

We'll keep you updated here if and when there's movement toward this getting implemented!

2 Likes

Adding another +1 for function calling from python workflow code.

Thanks!

1 Like

We added your +1 to the internal FR. :slightly_smiling_face:

1 Like

+1

I was confused to see this option available in Retool Workflows functions; but hope it will be supported soon! Thank you Team!

CleanShot 2024-08-07 at 06.59.39

1 Like