Compare commits
3 commits
70194de64c
...
98660d372b
Author | SHA1 | Date | |
---|---|---|---|
|
98660d372b | ||
|
ed86a269c1 | ||
|
74e940c45d |
|
@ -42,6 +42,7 @@ You can manipulate the main abstractions of the OpenAI model:
|
||||||
| `list_items.py` | `conversation_id` | | | List all Items (inputs or Responses) in a Conversation |
|
| `list_items.py` | `conversation_id` | | | List all Items (inputs or Responses) in a Conversation |
|
||||||
| `list_vector_store_files.py` | `vector_store_id` | | | List all Files in a Vector Store |
|
| `list_vector_store_files.py` | `vector_store_id` | | | List all Files in a Vector Store |
|
||||||
| `list_vector_stores.py` | | | | List all Vector Stores |
|
| `list_vector_stores.py` | | | | List all Vector Stores |
|
||||||
|
| `modify_vector_store.py` | `vector_store_id` | `metadata` | | Update a Vector Store metadata |
|
||||||
| `retrieve_conversation.py` | `conversation_id` | | | Retrieve a Conversation |
|
| `retrieve_conversation.py` | `conversation_id` | | | Retrieve a Conversation |
|
||||||
| `retrieve_file.py` | `file_id` | | | Retrieve a File |
|
| `retrieve_file.py` | `file_id` | | | Retrieve a File |
|
||||||
| `retrieve_file_content.py` | `file_id` | | | Retrieve the content of File |
|
| `retrieve_file_content.py` | `file_id` | | | Retrieve the content of File |
|
||||||
|
@ -51,6 +52,7 @@ You can manipulate the main abstractions of the OpenAI model:
|
||||||
| `retrieve_vector_store_file.py` | `vector_store_id` | `file_id` | | Retrieve a File from a Vector Store |
|
| `retrieve_vector_store_file.py` | `vector_store_id` | `file_id` | | Retrieve a File from a Vector Store |
|
||||||
| `retrieve_vector_store_file_content.py` | `vector_store_id` | `file_id` | | Retrieve the content of a File from a Vector Store |
|
| `retrieve_vector_store_file_content.py` | `vector_store_id` | `file_id` | | Retrieve the content of a File from a Vector Store |
|
||||||
| `update_conversation.py` | `conversation_id` | `metadata` | | Update a Conversation metadata |
|
| `update_conversation.py` | `conversation_id` | `metadata` | | Update a Conversation metadata |
|
||||||
|
| `update_vector_store_file.py` | `vector_store_id` | `file_id` | `attributes` | Update a File attributes |
|
||||||
| `upload_file.py` | `filename` | `path-to-file` | | Upload a File to the OpenAI platform |
|
| `upload_file.py` | `filename` | `path-to-file` | | Upload a File to the OpenAI platform |
|
||||||
|
|
||||||
* To execute these scripts run `python3 <script.py> <parameter_1> ...`.
|
* To execute these scripts run `python3 <script.py> <parameter_1> ...`.
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
| Version | Supported |
|
| Version | Supported |
|
||||||
| ------- | ------------------ |
|
| ------- | ------------------ |
|
||||||
|
| 0.3.x | :heavy_check_mark: |
|
||||||
| 0.2.x | :heavy_check_mark: |
|
| 0.2.x | :heavy_check_mark: |
|
||||||
| 0.1.x | :heavy_check_mark: |
|
| 0.1.x | :heavy_check_mark: |
|
||||||
|
|
||||||
|
|
22
modify_vector_store.py
Normal file
22
modify_vector_store.py
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
from config import *
|
||||||
|
import requests
|
||||||
|
import json
|
||||||
|
import sys
|
||||||
|
|
||||||
|
def modify_vector_store(vector_store_id,metadata):
|
||||||
|
url = base_url+"vector_stores/"+vector_store_id
|
||||||
|
|
||||||
|
payload = json.dumps({
|
||||||
|
"metadata": json.loads(metadata)
|
||||||
|
})
|
||||||
|
headers = {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Authorization': 'Bearer '+secret_key,
|
||||||
|
}
|
||||||
|
|
||||||
|
response = requests.request("POST", url, headers=headers, data=payload)
|
||||||
|
|
||||||
|
print(response.text)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
modify_vector_store(str(sys.argv[1]),str(sys.argv[2]))
|
22
update_vector_store_file.py
Normal file
22
update_vector_store_file.py
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
from config import *
|
||||||
|
import requests
|
||||||
|
import json
|
||||||
|
import sys
|
||||||
|
|
||||||
|
def update_vector_store_file(vector_store_id,file_id,attributes):
|
||||||
|
url = base_url+"vector_stores/"+vector_store_id+"/files/"+file_id
|
||||||
|
|
||||||
|
payload = json.dumps({
|
||||||
|
"attributes": json.loads(attributes)
|
||||||
|
})
|
||||||
|
headers = {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Authorization': 'Bearer '+secret_key,
|
||||||
|
}
|
||||||
|
|
||||||
|
response = requests.request("POST", url, headers=headers, data=payload)
|
||||||
|
|
||||||
|
print(response.text)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
update_vector_store_file(str(sys.argv[1]),str(sys.argv[2]),str(sys.argv[3]))
|
Loading…
Reference in a new issue