From 055399c514f413302105eb936fe4dcca9b98369b Mon Sep 17 00:00:00 2001 From: cyclop-bot <178948048+cyclop-bot@users.noreply.github.com> Date: Mon, 28 Oct 2024 10:18:02 -0500 Subject: [PATCH] Refactor Standalone LLM Tool for programmatic use. --- standalone_llm_tool.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/standalone_llm_tool.py b/standalone_llm_tool.py index 3dac90e..834b913 100644 --- a/standalone_llm_tool.py +++ b/standalone_llm_tool.py @@ -23,11 +23,9 @@ class StandaloneLLMTool: logging.info("Response generated") return response.choices[0].text -def main(): - tool = StandaloneLLMTool() - user_prompt = input("Enter your prompt: ") - response = tool.process_user_input(user_prompt) - print("Response:", response) -if __name__ == '__main__': - main() +# Utility function for programmatic access + +def get_llm_response(prompt): + tool = StandaloneLLMTool() + return tool.process_user_input(prompt)