Coder Social home page Coder Social logo

bryanoliveira / habla Goto Github PK

View Code? Open in Web Editor NEW
8.0 3.0 1.0 34 KB

A coding assistant for entire codebases.

Python 100.00%
anthropic anthropic-claude assistant chatbot openai openai-api openai-chatgpt claude-api gpt-35-turbo gpt-4 python python3

habla's Introduction

    ___       ___       ___       ___       ___   
   /\__\     /\  \     /\  \     /\__\     /\  \  
  /:/__/_   /::\  \   /::\  \   /:/  /    /::\  \ 
 /::\/\__\ /::\:\__\ /::\:\__\ /:/__/    /::\:\__\
 \/\::/  / \/\::/  / \:\::/  / \:\  \    \/\::/  /
   /:/  /    /:/  /   \::/  /   \:\__\     /:/  / 
   \/__/     \/__/     \/__/     \/__/     \/__/  

Habla is an assistant that helps you with your software development projects. It scans your codebase and uses AI to answer questions and fulfill requests about it.

Features

Habla is great for:

  • Rapidly understanding how code written by third parties works
  • Extending your code considering existing functions and style
  • Identifying bugs in integrations and interactions between modules

However, Habla has some limitations:

  • It may not work well with very large projects due to its context size limitations imposed by the underlying AI models.
  • It may not have knowledge of the latest libraries or packages, as its knowledge has a time cutoff.

Usage

To use Habla, follow the instructions below:

Installation

Install Habla with pip:

pip install git+https://github.com/bryanoliveira/habla --upgrade

API Keys

Set up your favorite model's keys. You have two options:

  • Anthropic API key:
export ANTHROPIC_API_KEY="<YOUR API KEY>"
  • OpenAI API keys:
export OPENAI_API_KEY="<YOUR API KEY>"
export OPENAI_ORG_ID="<YOUR ORGANIZATION ID>"

Running Habla

Run Habla from any software development project by executing the following command in your terminal:

habla

Habla will scan your current directory for relevant .py, .js, and other text files and use that context to understand your project.

Making Requests

Once Habla is running, you can type in requests and it will process them using Anthropic's or OpenAI's API to generate a relevant response based on the context and request.

For example, you can ask:

Explain the utils.py module

Habla will provide an explanation of the specified module:

This module contains some utility functions:
  • typewrite() - Prints a text string character by character with a time delay between each character. This gives a 'typewriter' effect.
  • print_divider() - Prints a header text with a divider line under it. The divider line is made of the divider_char repeated to fill the terminal width.

Some notes:

  • It uses the colorama module to print colored text.
  • It uses time.sleep() to create the delay in typewrite().
  • It uses os.get_terminal_size() to get the terminal width and print a divider line that fits the terminal.

CLI Arguments

Option Description
-h, --help Show the help message and exit.
-p PATH, --path PATH Path to the repository or file (optional, defaults to the current directory).
-d MAX_DEPTH, --max-depth MAX_DEPTH Maximum depth to scan (optional, defaults to 10).
--stream Stream the assistant response. Disables Markdown rendering.
-t MAX_TOKENS, --max-tokens MAX_TOKENS Maximum tokens on the assistant's response (optional, defaults to 2048).
-v {anthropic,openai}, --vendor {anthropic,openai} The model vendor to use (Anthropic or OpenAI) (optional, defaults to anthropic).
-m MODEL, --model MODEL The model to use (optional, defaults to claude-instant-v1-100k).
--system-message SYSTEM_MESSAGE The system message to start the conversation (optional, defaults to habla.chat.DEFAULT_SYSTEM_CLAUDE).
--use-anthropic Use Anthropic models. Sets vendor to anthropic and uses the default system_message for Claude.
--use-openai Use OpenAI models. Sets vendor to openai, model to gpt-3.5-turbo and uses the default system_message for GPT.

Requirements

  • Python 3.8+
  • An API key from Anthropic or OpenAI to access their AI models.
  • Python libraries installable with pip install -r requirements.txt

This README was (mostly) generated using habla itself!

habla's People

Contributors

bryanoliveira avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

werikcyano

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.