Refactor Standalone LLM Tool for programmatic use.
This commit is contained in:
@@ -23,11 +23,9 @@ class StandaloneLLMTool:
|
|||||||
logging.info("Response generated")
|
logging.info("Response generated")
|
||||||
return response.choices[0].text
|
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__':
|
# Utility function for programmatic access
|
||||||
main()
|
|
||||||
|
def get_llm_response(prompt):
|
||||||
|
tool = StandaloneLLMTool()
|
||||||
|
return tool.process_user_input(prompt)
|
||||||
|
|||||||
Reference in New Issue
Block a user