Skip to content

Commit

Permalink
remove agentops
Browse files Browse the repository at this point in the history
  • Loading branch information
areibman committed Feb 23, 2024
1 parent 0aa7a66 commit 39c7d79
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
jq==1.6.0
openai>=1.12.0,<2.0.0
jsonschema==4.21.1
agentops==0.0.21
jsonschema==4.21.1
7 changes: 0 additions & 7 deletions streamlit_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand All @@ -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')

0 comments on commit 39c7d79

Please sign in to comment.