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

Instagram tool #828

Merged
merged 18 commits into from
Jul 25, 2023
Merged

Instagram tool #828

merged 18 commits into from
Jul 25, 2023

Conversation

Aryan-Singh-14
Copy link
Collaborator

@Aryan-Singh-14 Aryan-Singh-14 commented Jul 20, 2023

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Docs update

Checklist

  • My pull request is atomic and focuses on a single change.
  • I have read the contributing guide and my code conforms to the guidelines.
  • I have documented my changes clearly and comprehensively.
  • I have added the required tests.

Comment on lines 77 to 86
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)
Copy link
Contributor

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

Comment on lines 91 to 92
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}"
Copy link
Contributor

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

Comment on lines 101 to 103
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}"
)
Copy link
Contributor

Choose a reason for hiding this comment

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

this too

@codecov
Copy link

codecov bot commented Jul 25, 2023

Codecov Report

Patch coverage: 64.65% and project coverage change: +0.13% 🎉

Comparison is base (685cd00) 58.28% compared to head (bb0304f) 58.42%.

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     
Files Changed Coverage Δ
superagi/tools/instagram_tool/instagram.py 58.58% <58.58%> (ø)
...ols/image_generation/stable_diffusion_image_gen.py 84.21% <100.00%> (+1.19%) ⬆️
superagi/tools/instagram_tool/instagram_toolkit.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Aryan-Singh-14 Aryan-Singh-14 merged commit dab5ab7 into dev Jul 25, 2023
4 checks passed
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