Giter VIP home page Giter VIP logo

ai-demo's Introduction

Haacked Woundrous AI Web DEMO

This is a demo of using Open AI in an ASP.NET Core application.

Setup

You'll need to create an account on https://chat.openai.com/.

Once you have an account, you'll need to create an API key.

Then you'll need to set the following user secrets:

script/user-secrets set OpenAI:ApiKey $OpenAI_ApiKey

And set up the following environment variables:

OpenAI_OrganizationId={Your org id}

This also requires setting up a GitHub OAuth App for authentication.

And to enable others to participate, I'm using ngrok: http://bit.ly/haack-ai (redirects to https://devoted-upright-bluejay.ngrok-free.app/) to expose my local web server to the internet.

This also requires setting up a GitHub OAuth App for authentication.

You can point that app to https://localhost:7047/signin-github for the callback URL.

To enable others to participate, I'm using ngrok: http://bit.ly/haack-ai (redirects to https://devoted-upright-bluejay.ngrok-free.app/) to expose my local web server to the internet. If you want to do the same, make sure to set the following environment variable:

GitHub_Host={Your ngrok host name}

Running

To run the app, you'll need to run the following command:

script/all -D
overmind connect

The -D runs it daemonized. overmind connect lets you connect to all the running services in Overmind tabs.

If you want to run it from the IDE, you'll need to run the following command to exclude starting the web server:

script/all -D -e web
overmind connect

Then run the web server from the IDE.

Notes

This project is set up using Central NuGet Package Management.

I also ran dotnet user-secrets init --project src/AIDemo.Web/AIDemo.Web.csproj from the repository root to initialize the user secrets.

ai-demo's People

Contributors

haacked avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ai-demo's Issues

Use phone number for location info in the absence of an address

I don't have an address for all my contacts. But many of them have phone numbers. In many cases, I can rely on the country code to at least know which country someone lives in. For US people, the area code tells me a lot. Of course, in many cases the area code won't match where they live since people often keep their numbers when they move, but it's good enough.

Consolidate functions

The number of GPT functions is growing. I can probably get smarter about composing functions together into "meta-functions". For example, I like how querying contacts by location, birthdays, and facts are three separate classes. Each class is nicely focused on one thing.

But as a GPT function, it would make sense to have this be a single function with a QuestionType field that could be Location, Birthday, or Other. Then I could dispatch to the class based on the type.

It might be fine to just do this all in a new function class and not worry about composing smaller functions into bigger functions. That may be my next step. But it's worth thinking about whether composing smaller functions into meta functions is worth it or not.

Handle Google refresh token

My OAuth token used to access the People API expires after some time. I then have to log out and log back in to get a new one. I should be handling the refresh token to get a new token automatically so I don't have to log out and log back in.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.