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.
local-llm-server/llm_server/routes/openai/simulated.py

28 lines
895 B
Python
Raw Normal View History

from flask import jsonify
from . import openai_bp
from llm_server.custom_redis import ONE_MONTH_SECONDS, flask_cache
2023-09-26 22:09:11 -06:00
from ...llm.openai.transform import generate_oai_string
from ..stats import server_start_time
@openai_bp.route('/organizations', methods=['GET'])
2023-09-26 22:09:11 -06:00
@flask_cache.cached(timeout=ONE_MONTH_SECONDS, query_string=True)
def openai_organizations():
return jsonify({
"object": "list",
"data": [
{
"object": "organization",
"id": f"org-{generate_oai_string(24)}",
"created": int(server_start_time.timestamp()),
"title": "Personal",
2023-10-01 14:15:01 -06:00
"name": f"user-{generate_oai_string(24)}",
"description": "Personal org for bobjoe@0.0.0.0",
"personal": True,
"is_default": True,
"role": "owner"
}
]
})