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 AWS Bedrock support #11

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

Conversation

pospielov
Copy link
Contributor

  • I tried to keep backward compatibility, so there are no changes in UI, and it should work with OpenAI only
  • We look for the OpenAI API key first, and if we don't find it, then we try to send to AWS.

@@ -104,8 +111,18 @@ def _match_diagram(self, result):

return result.strip()

def _get_llm(self, openai_api_key: str) -> ChatOpenAI:
return ChatOpenAI(temperature=0.3, openai_api_key=openai_api_key, model="gpt-4-turbo-preview")
def _get_llm(self, openai_api_key: str) -> ChatBedrock:
Copy link
Contributor

Choose a reason for hiding this comment

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

We can use type unions here to define response: ChatOpenAI | ChatBedrock

@@ -164,5 +169,15 @@ def _match_diagram(self, result):

return result.strip()

def _get_llm(self, openai_api_key: str) -> ChatOpenAI:
return ChatOpenAI(temperature=0.3, openai_api_key=openai_api_key, model="gpt-4-turbo-preview")
def _get_llm(self, openai_api_key: str) -> ChatBedrock:
Copy link
Contributor

Choose a reason for hiding this comment

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

We can use type unions here as well to define response type: ChatOpenAI | ChatBedrock

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.

2 participants