Skip to content

dheerajanikar/prompt_caching

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Paper Chat Script

This Python script implements a multi-turn conversation system that allows users to interact with an AI assistant specializing in explaining the Llama 3.1 blog. The script uses the Anthropic API with Claude 3.5 Sonnet model and implements prompt caching for efficient conversation handling.

Features

•	Interactive chat interface for discussing the Llama 3.1 paper
•	Utilizes the Anthropic API with Claude 3.5 Sonnet model
•	Implements prompt caching for improved efficiency in multi-turn conversations
•	Handles potential encoding issues when reading the paper content
•	Provides error handling for API calls

Prerequisites

•	Python 3.6 or higher
•	anthropic Python library
•	An Anthropic API key

Setup

•	Clone this repository or download the script.
•	Install the required Python library:
•	Copypip install anthropic

Set up your Anthropic API key:

Option 1: Set it as an environment variable: Copyexport ANTHROPIC_API_KEY="your-api-key-here"

Option 2: Replace the placeholder in the script with your actual API key: pythonCopyos.environ["ANTHROPIC_API_KEY"] = "your-api-key-here"

Ensure you have the Llama 3.1 paper content in a file named llama3_1.txt in the same directory as the script or modify it to have the .txt or any other file of your choice

Usage

Run the script: python script_name.py

•	The AI will start by providing a brief summary of the key points in the .txt file you have
•	You can then enter your questions or comments about the blog. The AI will respond based on the blog's content.
•	To end the conversation, type 'quit'.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages