Giter Site home page Giter Site logo

behuber / openai-samples Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chakkaradeep/openai-samples

0.0 0.0 0.0 60 KB

I am exploring the possibilities of OpenAI and what we can build with it. This repository has sample scripts or apps that I am using to learn OpenAI and other AI topics.

Python 100.00%

openai-samples's Introduction

openai-samples

I am exploring the possibilities of OpenAI and what we can build with it. This repository has sample scripts or apps that I am using to learn OpenAI and other AI topics.

Conversation Bot

This is a sample bot that uses Langchain to construct the prompt template, an LLM chain, and memory to store the history. The sample uses ConversationBufferMemory which allows for storing of messages in memory and then extracts the messages in a variable. Since we utilize a history, the bot is able to remember the messages and respond appropriately. You will type exit to exit the bot and you will have an option to save the entire conversation history.

Here is the demo:

chatbot_langchain_chain_memory.mp4

Question answering over docs

The simple python script uses Langchain, loads a text file, creates indexes (from OpenAI embeddings) and then allows you to ask questions on your document data. For this sample, I am using my Kindle Highlights file which you can find in your Kindle. I am using Chroma storage to persist the embeddings once created.

Here is the demo:

openai_langchain_loadtxtfile.mp4

OpenAI Python Sample

This is beginner sample on how to interact with OpenAI APIs, specifically the Completions API. It builds a simple python chat bot but does not retain or remember conversation history. You will type exit to exit the bot.

The sample was built from scratch using ChatGPT (GPT4). You can view the entire conversation here. This is a good example on how you can use chain of thought prompting so it can help you build great apps.

Here is the demo:

python-openai-chat-sample.mp4

openai-samples's People

Contributors

chakkaradeep avatar

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.