-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Instagram tool #828
Instagram tool #828
Conversation
s3 = self.create_s3_client() | ||
|
||
#getting the file path of the image generated by image generation tool | ||
file_path=self.get_file_path_from_image_generation_tool() | ||
|
||
#fetching the image from the s3 using the file_path | ||
content = self.get_image_from_s3(s3,file_path) | ||
|
||
#storing the image in a public bucket and getting the image url | ||
image_url = self.get_img_public_url(s3,file_path,content) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you refactor this into one function
response = requests.post( | ||
f"https://graph.facebook.com/v17.0/{insta_business_account_id}/media?image_url={image_url}&caption={encoded_caption}&access_token={meta_user_access_token}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
always refactor direct api calls in a function
response = requests.post( | ||
f"https://graph.facebook.com/v17.0/{insta_business_account_id}/media_publish?creation_id={container_ID}&access_token={meta_user_access_token}" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this too
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## dev #828 +/- ##
==========================================
+ Coverage 58.28% 58.42% +0.13%
==========================================
Files 156 158 +2
Lines 6305 6419 +114
Branches 656 664 +8
==========================================
+ Hits 3675 3750 +75
- Misses 2482 2520 +38
- Partials 148 149 +1
☔ View full report in Codecov by Sentry. |
Description
Instagram tool added to toolkit. Now agents will be able to post photos generated by stable diffusion along with a relevant caption directly to their instagram business accounts
Related Issues
Solution and Design
Test Plan
Type of change
Checklist