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

Feature GenAI #43

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

om-khade-algobulls
Copy link
Collaborator

@om-khade-algobulls om-khade-algobulls commented Aug 16, 2023

Screenshots

  1. Customer sessions
    image
  2. Chat History
    image

`GET` v1/build/python/genai Get GenAI response
"""
endpoint = 'v1/build/python/genai'
params = {"userPrompt": user_prompt, 'sessionId': self.genai_session_id, 'openaiApiKey': self.genai_api_key, 'chat_gpt_model': chat_gpt_model}
Copy link
Contributor

Choose a reason for hiding this comment

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

all keys should be camelcase

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, will correct that

"""
assert isinstance(api_key, str), f'Argument "api_key" should be a string'
self.api.openai_key = api_key
return 'SUCCESS' or 'FAILURE'
Copy link
Contributor

Choose a reason for hiding this comment

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

need to understand this line

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, so currently we don't have a way to directly verify if the given key is valid, we won't find out till the first chat is initiated. So need to decide on logic if it's a success or failure. Will remove this later. we are still finding a way to efficiently verify the key.

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 docstrings wherever necessary

pyalgotrading/algobulls/api.py Show resolved Hide resolved
pyalgotrading/algobulls/api.py Show resolved Hide resolved
pyalgotrading/algobulls/api.py Show resolved Hide resolved
pyalgotrading/algobulls/api.py Show resolved Hide resolved
pyalgotrading/algobulls/connection.py Outdated Show resolved Hide resolved
pyalgotrading/algobulls/connection.py Show resolved Hide resolved
pyalgotrading/algobulls/connection.py Show resolved Hide resolved
pyalgotrading/algobulls/connection.py Show resolved Hide resolved
pyalgotrading/algobulls/connection.py Show resolved Hide resolved
pyalgotrading/algobulls/connection.py Show resolved Hide resolved
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.

Generative AI integration
3 participants