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

chore: remove slack from openai sample #83

Merged
merged 5 commits into from
Oct 3, 2024
Merged

chore: remove slack from openai sample #83

merged 5 commits into from
Oct 3, 2024

Conversation

pashafateev
Copy link
Contributor

The sample uses a URL parameter for input, which simplifies the implementation but might not be realistic for more complex prompts. I have two options for addressing this:

  • Option 1: Document the current approach, informing users of its limitations with URL parameters for input.
  • Option 2: Rewrite the sample to accept input through the request body, which would introduce slightly more complexity but offer greater flexibility.

Additionally, I’ve adjusted how user input influences the prompt. Previously, with the URL parameter approach, the input wasn’t impacting ChatGPT’s responses as expected. Now, users can directly enter their own prompt and see its effect on the output more clearly. If we switch to using a JSON body, we might be able to revert to the previous method of prompting ChatGPT, as longer inputs could have a more noticeable impact.

@pashafateev pashafateev requested a review from daabr October 3, 2024 17:14
Copy link
Contributor

@daabr daabr left a comment

Choose a reason for hiding this comment

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

I like your changes, and using JSON would indeed be a robust solution (i.e. passing prompts and params instead of just a single text string), but supporting HTTP POST with a text body would be easier and actually cover a simple user's needs.

Specifically, limit the trigger to POST and the relevant content type (see the HTTP sample's manifest for examples), and document in the readme and/or code how to send it with curl:

curl -X POST "webhook-URL" -H "Content-Type: text/plain" -d "text"

samples/openai_chatgpt/program.py Outdated Show resolved Hide resolved
samples/openai_chatgpt/program.py Outdated Show resolved Hide resolved
samples/openai_chatgpt/program.py Outdated Show resolved Hide resolved
samples/openai_chatgpt/program.py Outdated Show resolved Hide resolved
@pashafateev pashafateev requested a review from daabr October 3, 2024 23:41
@pashafateev pashafateev merged commit 24aa7eb into main Oct 3, 2024
1 check passed
@pashafateev pashafateev deleted the pasha/eng-1634 branch October 3, 2024 23:52
pashafateev added a commit that referenced this pull request Nov 7, 2024
The sample uses a URL parameter for input, which simplifies the
implementation but might not be realistic for more complex prompts. I
have two options for addressing this:

- **Option 1**: Document the current approach, informing users of its
limitations with URL parameters for input.
- **Option 2**: Rewrite the sample to accept input through the request
body, which would introduce slightly more complexity but offer greater
flexibility.

Additionally, I’ve adjusted how user input influences the prompt.
Previously, with the URL parameter approach, the input wasn’t impacting
ChatGPT’s responses as expected. Now, users can directly enter their own
prompt and see its effect on the output more clearly. If we switch to
using a JSON body, we might be able to revert to the previous method of
prompting ChatGPT, as longer inputs could have a more noticeable impact.

---------

Co-authored-by: Daniel Abraham <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants