https://github.com/codingshot/rfp-ai-structured
Takes prompt in script. Structures output based on markdown template.
https://github.com/codingshot/rfp-ai-structured
Last synced: 5 months ago
JSON representation
Takes prompt in script. Structures output based on markdown template.
- Host: GitHub
- URL: https://github.com/codingshot/rfp-ai-structured
- Owner: codingshot
- License: mit
- Created: 2024-08-29T06:07:41.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-29T06:56:26.000Z (almost 2 years ago)
- Last Synced: 2025-02-02T05:44:44.668Z (over 1 year ago)
- Language: Python
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

Using Open Ai Structured Output using Markdown templates to write RFPs
Certainly! Here is a more specific example of what you might include in the `.env`, `.env.example`, and README files for the script that uses OpenAI's API to generate structured responses from a markdown template.
### **`.env` File**
This file contains sensitive information and should not be committed to version control. It includes your OpenAI API key and any other configuration settings needed for the script to function.
```plaintext
OPENAI_API_KEY=your_openai_api_key_here
```
### **`.env.example` File**
This file serves as a template to show other developers what environment variables are required. It should be included in version control.
```plaintext
OPENAI_API_KEY=
```
### **README.md**
Here's a README file tailored to the script described earlier:
```markdown
# Markdown Template Processor
This script processes markdown templates using OpenAI's Structured Output API to generate structured responses.
## Table of Contents
- [Installation](#installation)
- [Usage](#usage)
- [Environment Variables](#environment-variables)
- [Contributing](#contributing)
- [License](#license)
## Installation
1. **Clone the Repository**:
```bash
git clone https://github.com/codingshot/rfp-ai-structured/.git
cd rfp-ai-structured
```
2. **Install Dependencies**:
Ensure you have Python installed. Then, install the required packages:
```bash
pip install openai pydantic
```
3. **Set Up Environment Variables**:
- Copy the `.env.example` file to `.env`:
```bash
cp .env.example .env
```
- Fill in the `OPENAI_API_KEY` in the `.env` file.
## Usage
Run the script to process a markdown template:
```bash
python markdowntostructured.py
```
- **Markdown Template**: Modify the `markdown_template` variable in the script to change the input markdown.
- **Response**: The script will output the structured response according to the defined schema.
## Environment Variables
The script requires the following environment variables:
- `OPENAI_API_KEY`: Your OpenAI API key. This is required to authenticate requests to the OpenAI API.
# About Open AI Structured Outputs
OpenAI's Structured Outputs feature allows developers to ensure that model-generated responses adhere to a predefined JSON schema. This capability enhances the reliability and usability of AI-generated content by guaranteeing that outputs conform to specific structural requirements, addressing common challenges in AI-powered applications.
API Integration: Structured Outputs can be used via the OpenAI API by specifying the response_format parameter with your defined schema. This ensures that the model's output will conform to the schem
https://blog.mlq.ai/structured-outputs-openai/
## Contributing
1. Fork the repository.
2. Create a new branch (`git checkout -b feature-branch`).
3. Commit your changes (`git commit -m 'Add new feature'`).
4. Push to the branch (`git push origin feature-branch`).
5. Open a pull request.
## License
This project is licensed under the MIT License.
```