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

MSALOpenAI doesn't work #197

Open
yanivnaor opened this issue Jun 6, 2023 · 1 comment
Open

MSALOpenAI doesn't work #197

yanivnaor opened this issue Jun 6, 2023 · 1 comment

Comments

@yanivnaor
Copy link

The bug
Error when trying to instantiate the MSALOpenAI class:
AttributeError: 'MSALOpenAI' object has no attribute '_rest_headers'

To Reproduce

guidance.llm = guidance.llms.MSALOpenAI(model="dev-text-davinci-003", authority="SOME_AUTHORITY", endpoint="SOME_ENDPOINT", scopes=["api://SOME_GUID/access"], client_id="SOME_CLIENT_ID")

The bug seems to be the super().init() call in MSALOpenAI is missing the argument rest_call=True.
rest_call defaults to False, which means self._rest_headers is None, which causes the error.

System info (please complete the following information):

  • Windows 11
  • Guidance Version (0.0.61):
@yanivnaor yanivnaor changed the title MSALOpenAI doesn't work MSALOpenAI doesn't work - 'MSALOpenAI' object has no attribute '_rest_headers' Jun 6, 2023
@yanivnaor
Copy link
Author

yanivnaor commented Jun 6, 2023

There are more related bugs in _rest_call() func itself. for example, self.endpoint no longer exists and self.token is never called anymore

@yanivnaor yanivnaor changed the title MSALOpenAI doesn't work - 'MSALOpenAI' object has no attribute '_rest_headers' MSALOpenAI doesn't work Jun 6, 2023
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

No branches or pull requests

1 participant