From 39c7d7917927ae798ae7152dd1c24f168fcdd1eb Mon Sep 17 00:00:00 2001 From: reibs Date: Fri, 23 Feb 2024 12:33:55 -0800 Subject: [PATCH] remove agentops --- requirements.txt | 3 +-- streamlit_app.py | 7 ------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/requirements.txt b/requirements.txt index 780e0c1..dbdce18 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ jq==1.6.0 openai>=1.12.0,<2.0.0 -jsonschema==4.21.1 -agentops==0.0.21 \ No newline at end of file +jsonschema==4.21.1 \ No newline at end of file diff --git a/streamlit_app.py b/streamlit_app.py index eab3189..1202fed 100644 --- a/streamlit_app.py +++ b/streamlit_app.py @@ -3,7 +3,6 @@ import jq import os from jaiqu import validate_schema, translate_schema -from agentops import Client # Set page layout to wide st.set_page_config(layout="wide", page_title="Jaiqu: AI JSON Schema to JQ Query Generator") @@ -95,16 +94,13 @@ # Validate schema if st.button('Validate Schema', key="validate_schema"): with st.spinner('Validating schema...'): - validation_session = Client(tags=["jaiqu", "schema-validation"]) schema_properties, valid = validate_schema(input_json, schema, key_hints) st.write('Schema is valid:', valid) st.json(schema_properties, expanded=False) - validation_session.end_session('Success' if valid else 'Fail', end_state_reason='Schema validation complete') # Translate schema if st.button('Translate Schema', key="translate_schema"): with st.spinner('Translating schema...'): - translation_session = Client(tags=["jaiqu", "schema-translation"]) jq_query = translate_schema(input_json, schema, key_hints=key_hints, max_retries=int(max_retries)) st.text('Finalized jq query') st.code(jq_query, language="jq") @@ -115,8 +111,5 @@ try: result = jq.compile(jq_query).input(input_json).all()[0] st.write(result) - translation_session.end_session('Success', end_state_reason='Schema translation complete') - except Exception as e: st.error(f"Error: {e}") - translation_session.end_session('Fail', end_state_reason='Schema translation failed')