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

Python Conversation http Quickstart #1146

Closed
wants to merge 2 commits into from

Conversation

rochabr
Copy link
Contributor

@rochabr rochabr commented Jan 24, 2025

Description

Creating Conversation Quickstart for Python - HTTP

Issue reference

Please reference the issue this PR will close: #1108

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • The quickstart code compiles correctly
  • You've tested new builds of the quickstart if you changed quickstart code
  • You've updated the quickstart's README if necessary
  • If you have changed the steps for a quickstart be sure that you have updated the automated validation accordingly. All of our quickstarts have annotations that allow them to be executed automatically as code. For more information see mechanical-markdown. For user guide with examples see Examples.

Copy link

@alicejgibbons alicejgibbons left a comment

Choose a reason for hiding this comment

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

Looks good @rochabr just a couple small things. TY


This quickstart includes one app:

- `conversation.py`, responsible for sending an input to the underlying LLM and retrieving an output.

Choose a reason for hiding this comment

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

Suggested change
- `conversation.py`, responsible for sending an input to the underlying LLM and retrieving an output.
- `app.py`, responsible for sending an input to the underlying LLM and retrieving an output.

dapr stop -f .
```

<!-- END_STEP -->

Choose a reason for hiding this comment

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

@rochabr can you add a section to run the app without the mutli app run files? You can copy most of the text from the other Python one, but we should always have an option for Dapr CLI only.

base_url = os.getenv('BASE_URL', 'http://localhost') + ':' + os.getenv(
'DAPR_HTTP_PORT', '3500')

CONVERSATION_NAME = 'echo'

Choose a reason for hiding this comment

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

Can we name this something better than Conversation? Maybe CONVERSATION_COMPONENT_NAME? or something

data = result.json()
output = data["outputs"][0]["result"]

logging.info('Input sent: What is dapr?')

Choose a reason for hiding this comment

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

Would also suggest to move this printline up to just after line 26

@rochabr rochabr closed this Jan 28, 2025
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