-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: add WhatsApp component #226
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #226 +/- ##
==========================================
+ Coverage 40.70% 42.25% +1.55%
==========================================
Files 121 125 +4
Lines 11842 12618 +776
==========================================
+ Hits 4820 5332 +512
- Misses 6402 6620 +218
- Partials 620 666 +46
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
3912b4c
to
11c2b7b
Compare
52ca274
to
04b95df
Compare
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.
some points to be fixed.
And, some suggestions, please take a look and consider if you want to modify them
"title": "Header Type", | ||
"type": "string" | ||
}, | ||
"id-or-link": { |
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.
Just want to confirm
The id is the image id in WhatsApp platform that users uploaded in WhatsApp. right?
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.
Yes, user need to upload it through an API call. If you need more info: https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media#get-media-id
"TASK_SEND_MEDIA_MESSAGE", | ||
"TASK_SEND_LOCATION_MESSAGE", | ||
"TASK_SEND_CONTACT_MESSAGE", | ||
"TASK_SEND_INTERACTIVE_CALL_TO_ACTION_URL_BUTTON_MESSAGE" |
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.
question
I forgot the reason why we do not have read message from clients' chatroom or group chatroom. Is it related to OAuth?
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.
- We do not have read message because the only way to "read" message from clients is to actually receive those messages through the webhook endpoints we have set up. To sum it up, it is not possible to extract messages from a chatroom, and that we can only read when we receive it through webhook endpoints.
- Regarding group chatroom, it is not possible to add the phone numbers registered in WhatsApp Business API to a group.
} | ||
|
||
func (c *WhatsappClient) SendMessageAPI(req interface{}, resp interface{}, PhoneNumberID string) (interface{}, error) { | ||
httpReq := c.httpclient.R().SetBody(req).SetResult(resp) |
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.
question
you have used SetResult(resp)
, why do you still respond api_response?
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.
Oh you are right, I didn't notice it before. I will change it.
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.
lgtm
🤖 I have created a release *beep* *boop* --- ## [0.25.0-beta](v0.24.0-beta...v0.25.0-beta) (2024-08-13) ### Features * add a hook to avoid we miss make document ([#244](#244)) ([4c4531d](4c4531d)) * add elasticsearch component ([#211](#211)) ([eb492ca](eb492ca)) * add Fireworks AI component ([#237](#237)) ([0c40652](0c40652)) * add Groq component ([#269](#269)) ([1401220](1401220)) * add mongodb component ([#198](#198)) ([2cb550f](2cb550f)) * add qdrant component ([#271](#271)) ([bd2b9e6](bd2b9e6)) * add weaviate component ([#246](#246)) ([cb3e667](cb3e667)) * add WhatsApp component ([#226](#226)) ([28d0de8](28d0de8)) * **artifact:** add artifact component ([#268](#268)) ([dabf472](dabf472)) * **artifact:** add artifact component ([#275](#275)) ([15fc0d2](15fc0d2)) * **document:** integrate pdf2md in document operator ([#277](#277)) ([07360d1](07360d1)) * **groq, fireworksai:** take out the unsupported models from instill credit ([#283](#283)) ([8978acd](8978acd)) * make component ID accessible on IExecution ([#257](#257)) ([dd63656](dd63656)) * **openai:** support `gpt-4o-2024-08-06` and structured output ([#280](#280)) ([8bdaef7](8bdaef7)) * **sql:** add TASK_INSERT_MANY and fix sql query validation ([#252](#252)) ([3a93cea](3a93cea)) * **text:** add tokenizer for cohere & new gpt-4o ([#276](#276)) ([5d8cec3](5d8cec3)) * **text:** revert "add tokenizer for cohere & new gpt-4o ([#276](#276))" ([910a330](910a330)) ### Bug Fixes * **artifact:** add the description to remind users to add file extension ([#281](#281)) ([5ff5d7a](5ff5d7a)) * ignore bold case and add all line to result ([#272](#272)) ([219c77e](219c77e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Because
This commit
TODO:
For more information about sending template message, please go to: https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-message-templates )
For more information about sending messages, please go to: https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-messages
Here is a document to explain more about the component
https://docs.google.com/document/d/1mXM7GqRiTJAI-eRth5nEXpah5ADxuFmm3pz3m8Ua8ys/edit?usp=sharing