Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle exceptions when invoking LLM App and retrieving JSON from URI #1320

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mmabrouk
Copy link
Member

No description provided.

Copy link
Member

@aybruhm aybruhm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, @mmabrouk! I left a comment.

Comment on lines +188 to +200
for _ in testset_data:
list_of_app_outputs.append(
InvokationResult(
result=Result(
type="error",
error=Error(
message="An error occurred while invoking the LLM App",
stacktrace=str(e),
),
)
)
)
return list_of_app_outputs
Copy link
Member

@aybruhm aybruhm Jan 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens in the case where a user has 50 data in their testset, evaluation runs for the first 10, and the eleventh fails?

Are we marking the status of that evaluation as partial fail? Or, failed?

If it's the former, I'd recommend we minus the length of list_of_app_outputs from the testset_data and only record the failed datapoint to the last. If it's the latter (marking the entire evaluation as failed), then we should clear the list_of_app_outputs so we don't end up having duplicate datapoint results.

See suggestion:

len_of_app_outputs = len(list_of_app_outputs)
for _ in testset_data[len_of_app_outputs:]:
    # continue logic

resp = await client.get(uri, timeout=timeout)
json_data = json.loads(resp.text)
return json_data
except Exception as e:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this won't be populated to the user.

except Exception as e:
logger.traceback.print_exc()
for _ in testset_data:
list_of_app_outputs.append(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this loop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants