This repository has been archived on 2024-10-27. You can view files and clone it, but cannot push or open issues or pull requests.
2023-09-13 20:25:56 -06:00
|
|
|
from flask import Response
|
|
|
|
|
|
|
|
from . import openai_bp
|
2023-09-28 18:40:24 -06:00
|
|
|
from llm_server.custom_redis import flask_cache
|
2023-09-13 20:25:56 -06:00
|
|
|
from ... import opts
|
|
|
|
|
|
|
|
|
|
|
|
@openai_bp.route('/prompt', methods=['GET'])
|
2023-09-26 22:09:11 -06:00
|
|
|
@flask_cache.cached(timeout=2678000, query_string=True)
|
2023-09-13 20:25:56 -06:00
|
|
|
def get_openai_info():
|
|
|
|
if opts.expose_openai_system_prompt:
|
|
|
|
resp = Response(opts.openai_system_prompt)
|
|
|
|
resp.headers['Content-Type'] = 'text/plain'
|
|
|
|
return resp, 200
|
|
|
|
else:
|
|
|
|
return '', 403
|