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-24 21:45:30 -06:00
|
|
|
from flask import jsonify
|
|
|
|
|
|
|
|
from . import openai_bp
|
2023-09-26 22:09:11 -06:00
|
|
|
from ..cache import ONE_MONTH_SECONDS, flask_cache
|
|
|
|
from ...llm.openai.transform import generate_oai_string
|
2023-09-24 21:45:30 -06:00
|
|
|
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)
|
2023-09-24 21:45:30 -06:00
|
|
|
def openai_organizations():
|
|
|
|
return jsonify({
|
|
|
|
"object": "list",
|
|
|
|
"data": [
|
|
|
|
{
|
|
|
|
"object": "organization",
|
2023-09-25 12:30:40 -06:00
|
|
|
"id": f"org-{generate_oai_string(24)}",
|
2023-09-24 21:45:30 -06:00
|
|
|
"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"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
})
|