Skip to content

Commit

Permalink
convert main.py into installable CLI tool pragmatic
Browse files Browse the repository at this point in the history
I want to run pragmatic inside of a container, via Podman.

We need to be able to execute the pragmatic command in order
to populate the database via the ramalama rag command.

ramalama rag /tmp/mydoc.pdf https://my.web/docs.docx ~/mydocsdir quay.io/ramalama/ragdata:latest

Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Feb 7, 2025
1 parent c933c94 commit 2ac1103
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pragmatic/main.py → bin/pragmatic
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# !/bin/python3
# addressing the issue where the project structure causes pragmatic to not be on the path
import sys
import os
sys.path.insert(0, os.path.abspath(os.getcwd()))

import argparse

from api import index_path_for_rag, execute_rag_query, evaluate_rag_pipeline
from settings import DEFAULT_SETTINGS
from pragmatic.api import index_path_for_rag, execute_rag_query, evaluate_rag_pipeline
from pragmatic.settings import DEFAULT_SETTINGS


def main():
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
url='https://github.com/redhat-et/PRAGmatic'
scripts=["bin/pragmatic"],
)

0 comments on commit 2ac1103

Please sign in to comment.