Coder Social home page Coder Social logo

aichat.el's Introduction

aichat.el

Chat with language models in Emacs.

screencap

Features

  • Everything is text! Kill and yank all over the chat buffer.
  • Supports OpenAI, Claude, Replicate, Groq, Ollama
  • Include context from other open buffers, files, and websites on the internet.
  • Save and load chat sessions locally.
  • Streaming text output.

Setup

The following API keys must be set in the environment to be able to use cloud APIs:

Ollama doesn't need any API keys since it's running locally.

You can use (setenv <provider> <api-key>) to set environment variables if they're not loaded automatically in Emacs.

Usage

M-x aichat starts a new chat session.

A chat session looks like this:

## SYSTEM:

You are a helpful assistant.

## USER:

Write a haiku about Uddevalla.

## ASSISTANT:

Here is a haiku about Uddevalla:

Harbor town by sea,
Steep hills and ancient churches,
Uddevalla's charm.

Hit M-<return> to send the chat session to the AI model.

Including files and websites in the prompt context

By using the magic <ai-context> tag, you can include any file on the file system or website on the internet in the prompt.

## USER:

<ai-context>https://bohuslansspelmansforbund.se/aktuellt/evenemang/</ai-context>

What's the next folk music event in Bohuslän?

Key bindings

  • M-<return> - Send the chat buffer to the AI and get an assistant response
  • C-; u - Insert the string "USER:"
  • C-; s - Insert the string "SYSTEM:"
  • C-; a - Insert the string "ASSISTANT:"
  • C-; f - Insert an <ai-context> tag with the name of a file on disk
  • C-; b - Insert an <ai-context> tag with the filename of an open buffer
  • C-; h - Insert an <ai-context> tag with a website URL
  • C-; m - Change AI model
  • C-; c - Copy the current code block (delimited by triple backticks)
  • C-g - While text is being generated, use C-g to interrupt generation

aichat.el's People

Contributors

andreasjansson avatar

Watchers

 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.