Skip to content

Commit

Permalink
Update get-python-api-code.tsx (langflow-ai#2130)
Browse files Browse the repository at this point in the history
  • Loading branch information
edwinjosechittilappilly authored Jun 10, 2024
1 parent 11ef216 commit 4f2e582
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ export default function getPythonApiCode(
endpointName?: string
): string {
const tweaksObject = tweaksBuildedObject[0];
const tweaksString = JSON.stringify(tweaksObject, null, 2)
.replace(/true/g, "True")
.replace(/false/g, "False");
return `import argparse
import json
from argparse import RawTextHelpFormatter
Expand All @@ -34,7 +37,7 @@ ENDPOINT = "${endpointName || ""}" ${
# You can tweak the flow by adding a tweaks dictionary
# e.g {"OpenAI-XXXXX": {"model_name": "gpt-4"}}
TWEAKS = ${JSON.stringify(tweaksObject, null, 2)}
TWEAKS = ${tweaksString}
def run_flow(message: str,
endpoint: str,
Expand Down

0 comments on commit 4f2e582

Please sign in to comment.