mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-03 15:01:00 +02:00
Python API implements streaming interfaces (#577)
* Tech spec * Python CLI utilities updated to use the API including streaming features * Added type safety to Python API * Completed missing auth token support in CLI
This commit is contained in:
parent
b957004db9
commit
01aeede78b
53 changed files with 4489 additions and 715 deletions
|
|
@ -10,10 +10,11 @@ import tabulate
|
|||
import textwrap
|
||||
|
||||
default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8088/')
|
||||
default_token = os.getenv("TRUSTGRAPH_TOKEN", None)
|
||||
|
||||
def set_costs(api_url, model, input_costs, output_costs):
|
||||
def set_costs(api_url, model, input_costs, output_costs, token=None):
|
||||
|
||||
api = Api(api_url).config()
|
||||
api = Api(api_url, token=token).config()
|
||||
|
||||
api.put([
|
||||
ConfigValue(
|
||||
|
|
@ -95,6 +96,12 @@ def main():
|
|||
help=f'Input costs in $ per 1M tokens',
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
'-t', '--token',
|
||||
default=default_token,
|
||||
help='Authentication token (default: $TRUSTGRAPH_TOKEN)',
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue