{"id":13571326,"url":"https://github.com/MicrosoftJames/streamlit-with-promptflow","last_synced_at":"2025-04-04T08:30:53.633Z","repository":{"id":213715907,"uuid":"734703377","full_name":"MicrosoftJames/streamlit-with-promptflow","owner":"MicrosoftJames","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-26T11:49:34.000Z","size":619,"stargazers_count":16,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-05T04:34:00.182Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MicrosoftJames.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-22T11:34:14.000Z","updated_at":"2024-04-29T05:38:39.000Z","dependencies_parsed_at":"2024-11-05T04:31:07.108Z","dependency_job_id":"8cce7b5d-321d-49eb-b224-0ecd93331bf3","html_url":"https://github.com/MicrosoftJames/streamlit-with-promptflow","commit_stats":null,"previous_names":["microsoftjames/streamlit_with_promptflow"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicrosoftJames%2Fstreamlit-with-promptflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicrosoftJames%2Fstreamlit-with-promptflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicrosoftJames%2Fstreamlit-with-promptflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicrosoftJames%2Fstreamlit-with-promptflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MicrosoftJames","download_url":"https://codeload.github.com/MicrosoftJames/streamlit-with-promptflow/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247146952,"owners_count":20891595,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T14:01:01.035Z","updated_at":"2025-04-04T08:30:52.983Z","avatar_url":"https://github.com/MicrosoftJames.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"\u003cp align=\"center\" style=\"background-color: transparent;\"\u003e\n  \u003cimg src=\"imgs/robot.png\" alt=\"Robot Blocks\" width=\"100%\" height=\"auto\" style=\"display: block; margin-left: auto; margin-right: auto; width: 50%;\"\u003e\n\u003c/p\u003e\n\n\n# Streamlit with Prompt flow Demo\n\u003cp align=\"center\" style=\"background-color: transparent;\"\u003e\n  \u003cimg src=\"imgs/Screenshot.png\" alt=\"Robot Blocks\" width=\"100%\" height=\"auto\" style=\"display: block; margin-left: auto; margin-right: auto; width: 70%;\"\u003e\n\u003c/p\u003e\n\n\nThis project demonstrates how to use [Streamlit](https://streamlit.io/) to build a simple chat app that uses [Prompt flow](https://microsoft.github.io/promptflow) to generate responses with a model deployed in Azure OpenAI Service. The app uses two flows:\n1. [chat](flows/chat) - for generating responses to user input given the context of the conversation\n2. [make_title](flows/make_title/) - for generating a title for a conversation using the initial user question\n\n# Install dependencies\nYou can install the dependencies using pip:\n```bash\npip install -r requirements.txt\n```\n\n# Azure OpenAI Service\nThe requires access to an existing Azure OpenAI Service deployment with API access.\n\nBy default, the app expects a deployment with name `gpt-4-turbo`.\n\nYou can change this in [flows/chat/flow.dag.yaml](flows/chat/flow.dag.yaml) and [flows/make_title/flow.dag.yaml](flows/make_title/flow.dag.yaml) by setting the `deployment_name`.\n\n# Environment variables\nYou must set the following environment variables:\n- `OPENAI_API_KEY` - The API key for your Azure OpenAI Service resource\n- `OPENAI_API_BASE` - The base URL for your Azure OpenAI Service resource in the form `https://\u003cresource-name\u003e.openai.azure.com`\n\n# Run the app locally\nYou can run the app using the following command:\n```bash\nstreamlit run app.py\n```\n\n# Deploy the app\nThe repository uses Pulumi and GitHub actions to deploy the app to Azure App Service. To run the GitHub actions workflow, you must set the following secrets:\n- `ARM_CLIENT_ID` - The client ID of the service principal used to deploy the app\n- `ARM_CLIENT_SECRET` - The client secret of the service principal used to deploy the app\n- `ARM_LOCATION_NAME` - The Azure region to deploy the app to\n- `ARM_SUBSCRIPTION_ID` - The Azure subscription ID to deploy the app to\n- `ARM_TENANT_ID` - The Azure tenant ID to deploy the app to\n- `OPENAI_API_BASE` - The base URL for your Azure OpenAI Service resource in the form `https://\u003cresource-name\u003e.openai.azure.com`\n- `OPENAI_API_KEY` - The API key for your Azure OpenAI Service resource\n- `PULUMI_ACCESS_TOKEN` - The Pulumi access token to use for deployment\n\nYour service principal must have the ability to create to app registrations and managed identities.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMicrosoftJames%2Fstreamlit-with-promptflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMicrosoftJames%2Fstreamlit-with-promptflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMicrosoftJames%2Fstreamlit-with-promptflow/lists"}