diff --git a/python/hal9/filetotext.py b/python/hal9/filetotext.py index e6576bcf..88399653 100644 --- a/python/hal9/filetotext.py +++ b/python/hal9/filetotext.py @@ -21,6 +21,7 @@ def extract_from_url(message): temp_file.write(response.read()) temp_file_path = temp_file.name + import textract text = textract.process(temp_file_path).decode("utf-8") os.remove(temp_file_path) return text diff --git a/python/pyproject.toml b/python/pyproject.toml index 9ce72fac..898d1c39 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "hal9" -version = "2.3.0" +version = "2.3.1" description = "" authors = ["Javier Luraschi "] readme = "README.md" diff --git a/website/learn/genapps/apps/chatbots.md b/website/learn/genapps/apps/chatbots.md index bcfd473b..d067b5da 100644 --- a/website/learn/genapps/apps/chatbots.md +++ b/website/learn/genapps/apps/chatbots.md @@ -62,3 +62,16 @@ for i in range(1, 11): ``` These concepts will prove useful to build our first generative charbot in the [LLM Apps](../llmapps/intro.md) section. + +## URLs + +Hal9 encourages uploads and links to be processed as URLs. For example, user can reference or upload a PDF as 'https://www.clickdimensions.com/links/TestPDFfile.pdf' which can be read from `input`. + +To help assist with processing references, Hal9 provides an `input` function which extracts the text contents of a URL directly as text to easily support managing uploads. + +```python +import hal9 as h9 + +contents = h9.input('Enter a URL: ') +print(f"Contents: {contents}") +```