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

Initial change from dicts to objects #9

Merged
merged 6 commits into from May 11, 2021
Merged

Initial change from dicts to objects #9

merged 6 commits into from May 11, 2021

Conversation

jimwu6
Copy link
Contributor

@jimwu6 jimwu6 commented May 4, 2021

Don't know about how we should name objects yet.

Originally, I wanted to have one "catch all" CohereResponse object, but the names were confusing because we had "likelihood" and "likelihoods", thus designing it this way.

This should also be refactored into bzz and docs

closes #8

@@ -96,3 +96,24 @@ def __repr__(self):
self.message,
self.http_status,
)

class CohereGenerate:
Copy link
Contributor

Choose a reason for hiding this comment

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

how do these show up in debugging / errors? Sholud they just be Generation or CohereGeneration?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

took a look at twillo sdk and i think we should go with Generate. I'm going with the docs naming right now, so it won't be Generation.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah the docs name the endpoint as Generate, however the product is a Generation. Its the same reason an endpoint called Create🍌 would return a 🍌 and not a Create🍌

Copy link
Contributor

Choose a reason for hiding this comment

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

it'll be hard to come up with a name for choosebest 🤔

cohere/__init__.py Outdated Show resolved Hide resolved
cohere/__init__.py Outdated Show resolved Hide resolved
@jimwu6 jimwu6 marked this pull request as ready for review May 10, 2021 04:00
@kipply
Copy link
Contributor

kipply commented May 11, 2021

update the sanity test file as well? make sure everything runs

@jimwu6 jimwu6 merged commit 6776135 into main May 11, 2021
@jimwu6 jimwu6 deleted the object-over-dict branch May 11, 2021 20:55
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.

endpoints should return proper python objects instead of dict
2 participants