|
| 1 | +# Prescribing Information App |
| 2 | + |
| 3 | +This is a Python application built with [Writer Framework](https://github.com/writer/writer-framework) that provides detailed prescribing information, side effects, and related PubMed articles for medications. The app uses the OpenFDA API and PubMed database to gather comprehensive drug information and present it in an easily digestible format. This application uses [Palmyra Med](https://huggingface.co/Writer/Palmyra-Med-70B) to summarize the prescribing information and our [graph-based RAG tool](https://dev.writer.com/api-guides/kg-chat) powered by Palmyra X 004 to enable users to ask questions about the fetched information. |
| 4 | + |
| 5 | +To learn more about Writer Framework, check out our [comprehensive docs](https://dev.writer.com/framework/introduction). |
| 6 | + |
| 7 | +## Features |
| 8 | + |
| 9 | +- Fetch and display full prescribing information from OpenFDA API |
| 10 | +- Show drug side effects and adverse reactions |
| 11 | +- Search and display related PubMed articles |
| 12 | +- Automatic summarization of prescribing information using Palmyra Med |
| 13 | +- Interactive chat interface for drug-related queries using our graph-based RAG tool |
| 14 | +- Display of contributing sources for information |
| 15 | + |
| 16 | +## Prerequisites |
| 17 | + |
| 18 | +- Python 3.11 or higher |
| 19 | +- Poetry for dependency management |
| 20 | +- Writer Framework API Key (follow the [Writer Framework Quickstart guide](https://dev.writer.com/framework/quickstart) to get one) |
| 21 | +- Knowledge Graph ID (you can create a Knowledge Graph [through AI Studio](https://support.writer.com/article/242-how-to-create-and-manage-a-knowledge-graph) or [through the API](https://dev.writer.com/api-guides/knowledge-graph)) |
| 22 | + |
| 23 | +## Installation |
| 24 | + |
| 25 | +1. Clone the repository and navigate to the project directory: |
| 26 | + |
| 27 | +```sh |
| 28 | +cd prescribing-info-app |
| 29 | +``` |
| 30 | + |
| 31 | +2. Install dependencies using Poetry: |
| 32 | + |
| 33 | +```sh |
| 34 | +poetry install |
| 35 | +``` |
| 36 | + |
| 37 | +3. Create a `.env` file in the project root and add your credentials: |
| 38 | + |
| 39 | +```sh |
| 40 | +WRITER_API_KEY=your-api-key |
| 41 | +GRAPH_ID=your-graph-id |
| 42 | +``` |
| 43 | + |
| 44 | +## Usage |
| 45 | + |
| 46 | +1. Activate the Poetry virtual environment: |
| 47 | + |
| 48 | +```sh |
| 49 | +poetry shell |
| 50 | +``` |
| 51 | + |
| 52 | +2. Run the application: |
| 53 | + |
| 54 | +```sh |
| 55 | +writer run . |
| 56 | +``` |
| 57 | + |
| 58 | +3. To make changes or edit the application: |
| 59 | + |
| 60 | +```sh |
| 61 | +writer edit . |
| 62 | +``` |
| 63 | + |
| 64 | +## Project Structure |
| 65 | + |
| 66 | +- `main.py` - Core application logic and Writer Framework integration |
| 67 | +- `utils.py` - Utility functions for API interactions and data processing |
| 68 | +- `prompts.py` - Prompt templates |
| 69 | +- `static/` - Static files and CSS |
| 70 | +- `.env` - Environment variables (not tracked in git) |
| 71 | + |
| 72 | +## About Writer |
| 73 | + |
| 74 | +Writer is the full-stack generative AI platform for enterprises. Quickly and easily build and deploy generative AI apps with a suite of developer tools fully integrated with our platform of LLMs, graph-based RAG tools, AI guardrails, and more. Learn more at [writer.com](https://www.writer.com?utm_source=github&utm_medium=readme&utm_campaign=devrel). |
0 commit comments