Upload files to OpenAI
from obiguard import Obiguard
client = Obiguard(
obiguard_api_key="OBIGUARD_API_KEY", # Your Obiguard API key
)
upload_file_response = client.files.create(
purpose="batch",
file=open("file.pdf", "rb")
)
print(upload_file_response)
from obiguard import Obiguard
client = Obiguard(
obiguard_api_key="OBIGUARD_API_KEY", # Your Obiguard API key
)
upload_file_response = client.files.create(
purpose="batch",
file=open("file.pdf", "rb")
)
print(upload_file_response)
from openai import OpenAI
from obiguard import OBIGUARD_GATEWAY_URL, createHeaders
client = OpenAI(
api_key='OPENAI_API_KEY',
base_url=OBIGUARD_GATEWAY_URL,
default_headers=createHeaders(
provider="openai",
obiguard_api_key="OBIGUARD_API_KEY"
)
)
upload_file_response = client.files.create(
purpose="batch",
file=open("file.pdf", "rb")
)
print(upload_file_response)
from obiguard import Obiguard
client = Obiguard(
obiguard_api_key="OBIGUARD_API_KEY", # Your Obiguard API key
)
files = client.files.list()
print(files)
from obiguard import Obiguard
client = Obiguard(
obiguard_api_key="OBIGUARD_API_KEY", # Your Obiguard API key
)
files = client.files.list()
print(files)
from openai import OpenAI
from obiguard import OBIGUARD_GATEWAY_URL, createHeaders
client = OpenAI(
api_key='OPENAI_API_KEY',
base_url=OBIGUARD_GATEWAY_URL,
default_headers=createHeaders(
provider="openai",
obiguard_api_key="OBIGUARD_API_KEY"
)
)
files = openai.files.list()
print(files)
from obiguard import Obiguard
client = Obiguard(
obiguard_api_key="OBIGUARD_API_KEY", # Your Obiguard API key
)
file = client.files.retrieve(file_id="file_id")
print(file)
from obiguard import Obiguard
client = Obiguard(
obiguard_api_key="OBIGUARD_API_KEY", # Your Obiguard API key
)
file = client.files.retrieve(file_id="file_id")
print(file)
from openai import OpenAI
from obiguard import OBIGUARD_GATEWAY_URL, createHeaders
client = OpenAI(
api_key='OPENAI_API_KEY',
base_url=OBIGUARD_GATEWAY_URL,
default_headers=createHeaders(
provider="openai",
obiguard_api_key="OBIGUARD_API_KEY"
)
)
file = client.files.retrieve(file_id="file_id")
print(file)
from obiguard import Obiguard
client = Obiguard(
obiguard_api_key="OBIGUARD_API_KEY", # Your Obiguard API key
)
file_content = client.files.content(file_id="file_id")
print(file_content)
from obiguard import Obiguard
client = Obiguard(
obiguard_api_key="OBIGUARD_API_KEY", # Your Obiguard API key
)
file_content = client.files.content(file_id="file_id")
print(file_content)
from openai import OpenAI
from obiguard import OBIGUARD_GATEWAY_URL, createHeaders
client = OpenAI(
api_key='OPENAI_API_KEY',
base_url=OBIGUARD_GATEWAY_URL,
default_headers=createHeaders(
provider="openai",
obiguard_api_key="OBIGUARD_API_KEY"
)
)
file_content = openai.files.content(file_id="file_id")
print(file_content)
from obiguard import Obiguard
client = Obiguard(
obiguard_api_key="OBIGUARD_API_KEY", # Your Obiguard API key
)
delete_file_response = client.files.delete(file_id="file_id")
print(delete_file_response)
from obiguard import Obiguard
client = Obiguard(
obiguard_api_key="OBIGUARD_API_KEY", # Your Obiguard API key
)
delete_file_response = client.files.delete(file_id="file_id")
print(delete_file_response)
from openai import OpenAI
from openai import OpenAI
from obiguard import OBIGUARD_GATEWAY_URL, createHeaders
client = OpenAI(
api_key='OPENAI_API_KEY',
base_url=OBIGUARD_GATEWAY_URL,
default_headers=createHeaders(
provider="openai",
obiguard_api_key="OBIGUARD_API_KEY"
)
)
delete_file_response = client.files.delete(file_id="file_id")
print(delete_file_response)