Create a Python script

Developes a python script by creating a document and specifying what should be changed on the document.

Input

Description

The "Create a Python Script" task allows you to effortlessly generate Python scripts by providing specific instructions for document customization. This feature streamlines the process of writing Python code for various applications.

Applications

This task is particularly useful for generating small scripts that target specific problem-solving scenarios.

How to use the task

  1. Define Your Requirements: Begin by clearly specifying the desired content and functionality you want in your Python script to the task.

  2. Set Document Lifetime: You can optionally enter the Document Lifetime (in hours), which determines how long the model will store your document in memory for future processing. Additionally, provide a document name for easy reference in subsequent runs.

  3. Execute the Task: Simply run the task, and the task will generate the Python script according to your provided instructions.

  4. Receive the Output: The task will promptly generate a Python file with all the desired changes, ready for immediate use.

  5. Iterative Customization: Should you need further modifications, just rerun the task with updated instructions. The task will adapt the script accordingly, making the process of script refinement quick and effortless.

[1.0.0]:
First version
VersionAI ModelCreatedLink
1.0.023.07.2023

API

The REST API allows you to call the tool with the same costs as when running the tool. Please generate an Personal access token before using the REST API.

Parameters

  • duration_h (Document lifetime (h)): How many hours the document is stored. (less = cheaper)
  • session (Document name): Defines in which session the data is stored. you can think of it as a temporary file name.
  • task (Writer task): The task of the worker agent.
  • Call the REST API by cURL
    curl -v -H "Authorization: Bearer PERSONAL_ACCESS_TOKEN" https://api.anysolve.ai/rest/v1/u-ba835df8268fc301-create-a-python-script/1.0.0?duration_h=3&session=37b1947e-4337-47d7-9feb-c9c2d92f9659&task=Write%20a%20python%20file%20that%20asks%20for%20a%20week%20day%20and%20tells%20you%20what's%20best%20on%20that%20day.
  • Install the package with pip
    python3 -m pip install anysolve
  • Run in python3
    import os
    from anysolve import AnySolve
    anysolve_token = os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN') # Resolve your personal access token here
    client = AnySolve(anysolve_token)
    res = client.run('u-ba835df8268fc301-create-a-python-script','1.0.0', {'duration_h': '3', 'session': '37b1947e-4337-47d7-9feb-c9c2d92f9659', 'task': 'Write a python file that asks for a week day and tells you what\'s best on that day.'})
    print(res)
  • Coming soon: Within AnySolve ChatComplete prompts you can use the following command to execute the task:
    /run('u-ba835df8268fc301-create-a-python-script','1.0.0', duration_h='3', session='37b1947e-4337-47d7-9feb-c9c2d92f9659', task='Write a python file that asks for a week day and tells you what\'s best on that day.')