aiagent.controllers package
Submodules
aiagent.controllers.apidispatcher module
Copyright (C) 2024 RidgeRun, LLC (http://www.ridgerun.com) All Rights Reserved.
The contents of this software are proprietary and confidential to RidgeRun, LLC. No part of this program may be photocopied, reproduced or translated into another programming language without prior written consent of RidgeRun, LLC. The user is free to modify the source code after obtaining a software license from RidgeRun. All source code changes must be provided back to RidgeRun without any encumbrance.
aiagent.controllers.controller module
Copyright (C) 2024 RidgeRun, LLC (http://www.ridgerun.com) All Rights Reserved.
The contents of this software are proprietary and confidential to RidgeRun, LLC. No part of this program may be photocopied, reproduced or translated into another programming language without prior written consent of RidgeRun, LLC. The user is free to modify the source code after obtaining a software license from RidgeRun. All source code changes must be provided back to RidgeRun without any encumbrance.
- class aiagent.controllers.controller.Controller
Bases:
ABC
Flask server method controller
- abstract add_rules(app)
Add rules to flask server
- response(data, code: int = 200, mimetype: str = 'application/json')
Builds and returns Response for a request
- Parameters:
data – the data to be sent
code (int, optional) – HTTPStatus code. Defaults to 200.
mimetype (str, optional) – Response mimetype. Defaults to “application/json”.
- Returns:
A Flask Response object with the given data.
- Return type:
Flask.Response
aiagent.controllers.prompt module
Copyright (C) 2024 RidgeRun, LLC (http://www.ridgerun.com) All Rights Reserved.
The contents of this software are proprietary and confidential to RidgeRun, LLC. No part of this program may be photocopied, reproduced or translated into another programming language without prior written consent of RidgeRun, LLC. The user is free to modify the source code after obtaining a software license from RidgeRun. All source code changes must be provided back to RidgeRun without any encumbrance.
- class aiagent.controllers.prompt.LLMPrompt(system_prompt=None, model='Trelis/Llama-2-7b-chat-hf-function-calling-v3')
Bases:
object
A class to process a prompt request with an LLM model
- process_prompt(prompt, role='user')
Process prompt with LLM model.
Returns model reply
- start()
Load pretrained LLM model and create chat history
aiagent.controllers.promptcontroller module
Copyright (C) 2024 RidgeRun, LLC (http://www.ridgerun.com) All Rights Reserved.
The contents of this software are proprietary and confidential to RidgeRun, LLC. No part of this program may be photocopied, reproduced or translated into another programming language without prior written consent of RidgeRun, LLC. The user is free to modify the source code after obtaining a software license from RidgeRun. All source code changes must be provided back to RidgeRun without any encumbrance.
- class aiagent.controllers.promptcontroller.PromptController(system_prompt, api_map_file)
Bases:
Controller
Controller for prompt requests
- add_rules(app)
Add prompt update rule at /prompt uri
- get_prompt()
Return current prompt
- put_prompt()
Update prompt request and process it
- update_prompt()
Update prompt request and process it
aiagent.controllers.webcontroller module
Copyright (C) 2024 RidgeRun, LLC (http://www.ridgerun.com) All Rights Reserved.
The contents of this software are proprietary and confidential to RidgeRun, LLC. No part of this program may be photocopied, reproduced or translated into another programming language without prior written consent of RidgeRun, LLC. The user is free to modify the source code after obtaining a software license from RidgeRun. All source code changes must be provided back to RidgeRun without any encumbrance.
- class aiagent.controllers.webcontroller.WebController
Bases:
Controller
Controller for web interface
- add_rules(app)
Add rules for web
- home()
Renders home page