28 lines
877 B
Python
28 lines
877 B
Python
from flask import jsonify
|
|
|
|
from . import openai_bp
|
|
from ..cache import ONE_MONTH_SECONDS, flask_cache
|
|
from ...llm.openai.transform import generate_oai_string
|
|
from ..stats import server_start_time
|
|
|
|
|
|
@openai_bp.route('/organizations', methods=['GET'])
|
|
@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",
|
|
"name": "user-abcdefghijklmnopqrstuvwx",
|
|
"description": "Personal org for bobjoe@0.0.0.0",
|
|
"personal": True,
|
|
"is_default": True,
|
|
"role": "owner"
|
|
}
|
|
]
|
|
})
|