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

Added support for synchrous Reka using the OpenAI SDK format. #624

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

TootyFrooties
Copy link

@TootyFrooties TootyFrooties commented Apr 23, 2024

Will be adding async and am testing a Reka specific json mode


🚀 This description was created by Ellipsis for commit b1f4f1e

Summary:

This PR introduces support for the Reka AI model in the Instructor library, including a new client, example usage, test case, and documentation.

Key points:

  • Added RekaClient and from_reka function in instructor module.
  • Updated client.py and utils.py to support Reka client.
  • Added new test case for Reka client in test_new_client.py.
  • Included example usage of Reka client in reka.py.
  • Added new documentation file reka.md.

Generated with ❤️ by ellipsis.dev

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. documentation Improvements or additions to documentation enhancement New feature or request labels Apr 23, 2024
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested.

  • Reviewed the entire pull request up to b1f4f1e
  • Looked at 293 lines of code in 7 files
  • Took 1 minute and 54 seconds to review
More info
  • Skipped 0 files when reviewing.
  • Skipped posting 1 additional comments because they didn't meet confidence threshold of 85%.
1. /instructor/client_reka.py:31:
  • Assessed confidence : 66%
  • Comment:
    Consider allowing more modes if the Reka-specific JSON mode testing involves other modes or if future expansions are planned. Currently, only Mode.MD_JSON is allowed, which might be too restrictive.
  • Reasoning:
    The PR description mentions that a Reka-specific JSON mode is being tested, but the code only allows for Mode.MD_JSON. This could be a limitation if other modes are intended to be supported in the future or if the testing involves other modes.

Workflow ID: wflow_CLfriM6wLxeIeIy2


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. We'll respond in a few minutes. Learn more here.

) -> instructor.Instructor: ...


def from_reka(api_key: Optional[str] =None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add an assertion or check to prevent the use of async methods with Reka since async support is not yet implemented. This will help avoid runtime errors if such methods are attempted to be used.

@@ -0,0 +1,46 @@
# Structured Outputs using Reka
Copy link
Contributor

Choose a reason for hiding this comment

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

Please update the mkdocs.yml file to include the new reka.md file in the site navigation. This ensures that the documentation is accessible and visible in the generated site.

Copy link
Owner

Choose a reason for hiding this comment

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

+1 let me know if you need help

temperature=0,
)

print(user_info.name)
Copy link
Contributor

Choose a reason for hiding this comment

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

The variable user_info is not defined in the example code. You should replace user_info with resp to match the variable that holds the response from the Reka client.

Suggested change
print(user_info.name)
print(resp.name)

Copy link
Owner

Choose a reason for hiding this comment

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

+1


print(user_info.name)
#> John Doe
print(user_info.age)
Copy link
Contributor

Choose a reason for hiding this comment

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

The variable user_info is not defined in the example code. You should replace user_info with resp to match the variable that holds the response from the Reka client.

Suggested change
print(user_info.age)
print(resp.age)

pip install instructor reka-api pydantic
```

```
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
```


def reka_chat_wrapper(default_model, **kwargs):
model = kwargs.pop('model',default_model)
kwargs['model_name']=model
Copy link
Owner

Choose a reason for hiding this comment

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

run ruff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants