Openai-decorator

Latest version: v0.1.3

Safety actively analyzes 622389 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.1.3

Ensure pyproject files with a `python = "^3.8"` dependency constraint works. Previous version of the repo forced users to set the upper limit to `3.12`.

0.1.2

Add keywords to make the package more easily searchable on pypi

0.1.1

Openai-decorator can now be used with python versions 3.8, 3.8, 3.10. or 3.11.

0.1.0

Automated Specifications: The openai decorator automatically generates specifications from a function's signature and docstring. This specification is then used to communicate with OpenAI's API.

**Dynamic Function Calls**: With the help of OpenAI's API, the decorated function can infer arguments from the AI's response. This eliminates the need for manual input and allows seamless interaction with OpenAI's API.

**Type & Default Handling**: The decorator handles various edge cases related to function signatures, including default and optional values. It supports primitive types like int, str, bool, float and complex types like List, Dict, Tuple, Set, Optional, and custom classes. Parameters with a default value or marked as Optional are considered optional in the specification sent to OpenAI.

**Dynamic Prompts**: Users can now pass a callable function that returns a string to the prompt parameter in the decorator. This function is executed to generate a dynamic prompt every time the decorated function is called.

**Regular Function Usage**: The openai_func decorator can also be used as a regular function. It can be directly used by passing the target function as an argument, allowing dynamic decoration of functions during runtime.

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.