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

Changed to rely on litellm for computing cost #321

Merged
merged 3 commits into from
Sep 8, 2024

Conversation

whitead
Copy link
Collaborator

@whitead whitead commented Sep 8, 2024

See title

paperqa/llms.py Outdated

async def acomplete(self, prompt: str) -> str:
async def acomplete(self, prompt: str) -> tuple[str, tuple[int, int]]:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since this is sort of an abstractmethod, can you somehow document what the return type is?

Can make a NamedTuple that is sort of self-documenting, or a docstring

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK added a new class and revised code to use it

Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice, thanks

paperqa/llms.py Outdated Show resolved Hide resolved
@whitead whitead merged commit e16fb79 into september-2024-release Sep 8, 2024
2 of 4 checks passed
@whitead whitead deleted the litellm-cost branch September 8, 2024 22:23
@whitead whitead mentioned this pull request Sep 11, 2024
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.

3 participants