-
Notifications
You must be signed in to change notification settings - Fork 126
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
feat: add support for ttft #1161
Conversation
Hey @LastRemote it seems like you nee to sign CLA for https://github.com/deepset-ai/haystack-core-integrations - perhaps you have already? 🙏 |
No I actually haven't. But now it's done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LastRemote looks good but let's just handle this ValueError in case the time data is invalid
span._span.update(usage=meta.get("usage") or None, model=meta.get("model")) | ||
completion_start_time = meta.get("completion_start_time") | ||
if completion_start_time: | ||
completion_start_time = datetime.fromisoformat(completion_start_time) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fromisoformat
throws ValueError for irregular format provided. Let's try/catch it, log it, and skip ttft in that case, wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, will do. Normally this won't be the case though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I agree, thanks for your understanding 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated, and also added a new unit test for this.
fd80011
to
0ab5cc7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good @LastRemote - thanks for another great contribution!
Related Issues
Proposed Changes:
Support TTFT by casting isoformat to a datetime object and include it in a generation.
How did you test it?
Unit test. I also have E2E tests in my version, which is almost the same but not exactly.
Notes for the reviewer
Checklist
fix:
,feat:
,build:
,chore:
,ci:
,docs:
,style:
,refactor:
,perf:
,test:
.