Spaces:
Sleeping
Sleeping
File size: 925 Bytes
3281c07 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import argparse
import json
import time
from openai import OpenAI
from openai.types.beta.asssitant_deleted import AsssitantDeleted
from project_settings import environment, project_path
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument(
"--openai_api_key",
default=environment.get("openai_api_key", default=None, dtype=str),
type=str
)
args = parser.parse_args()
return args
def main():
args = get_args()
client = OpenAI(
api_key=args.openai_api_key
)
result: AsssitantDeleted = client.beta.assistants.delete(assistant_id="asst_bXMHkMvMfJX2J0JgK4nIHKqc")
print(f"result: {result}")
print(result.model_dump(mode="json"))
result = json.dumps(result.model_dump(mode="json"), indent=4, ensure_ascii=False)
print(result)
return
if __name__ == '__main__':
main()
|