Git Product home page Git Product logo

ecrivai's Introduction

blog-link auto-publish GitHub stars GitHub forks GitHub contributors GitHub last commit

🦜🔗✏️EcrivAI

EcrivAI is a fully automated AI blog writer that uses LangChain and GPT type LLMs for topic selection and content generation. The content is published to this blog

Star History Star History Chart

Usage

Prerequisites

  1. 🐍 You will need a working install of conda.
  2. 🔑 You will need an API key from OpenAI or Google. You can create one for free here:
    • OpenIA - to use models like GPT4
    • Google - to use models like Gemini

Dev Environment Setup

  1. Set up your API keys in a file called .env (see .env.example for an example)
  2. Set up and activate conda environment
    conda env create -f conda.yml
    conda activate ecrivai

If you are having trouble setting your environment variables with the .env file or you want to manually add them instead of using a .env file, you can set your environment variable in your ecrivai conda environment like this:

# set api key env var
conda env config vars set OPENAI_API_KEY="your-api-key-here"
conda env config vars set GOOGLE_API_KEY="your-api-key-here"
# re-activate env
conda activate base
conda activate ecrivai

CLI

Note: Remember to activate your ecrivai conda environment before doing this (see above)

You can quickly generate a new original blog by running:

python ecrivai/add_blog.py

This will add a blog to a Markdown file in a directory called content/. You can also specify your own output directory by running this instead:

python ecrivai/add_blog.py --out-dir path/to/dir

ecrivai's People

Contributors

eric-vai avatar ruankie avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

ecrivai's Issues

@shubham8550 I imagine this only depended on some Langchain integration once the model ran. Please feel free to share more details about how you managed to get it working if you're able.

          @shubham8550 I imagine this only depended on some Langchain integration once the model ran. Please feel free to share more details about how you managed to get it working if you're able.

Originally posted by @ruankie in #7 (comment)

there isnt much you need to doo to runn open source models

just get model from hugging face and swap this

(refer)
https://python.langchain.com/docs/integrations/llms/llamacpp

Scheduled publish fails - ImportError: cannot import name 'tracing_enabled' from 'langchain_core.tracers.context'

Overview

During the scheduled publish workflow, the Create blog post step fails with the following error message:

Run python ecrivai/ecrivai/add_blog.py --out-dir "content/posts"
Traceback (most recent call last):
  File "/home/runner/work/ecrivai-blog-hugo/ecrivai-blog-hugo/ecrivai/ecrivai/add_blog.py", line 6, in <module>
    from langchain.chains import LLMChain, SimpleSequentialChain
  File "/usr/share/miniconda/envs/ecrivai/lib/python3.12/site-packages/langchain/chains/__init__.py", line 20, in <module>
    from langchain.chains.api.base import APIChain
  File "/usr/share/miniconda/envs/ecrivai/lib/python3.12/site-packages/langchain/chains/api/base.py", line [11](https://github.com/ruankie/ecrivai-blog-hugo/actions/runs/7403998049/job/20151420379#step:6:12), in <module>
    from langchain.callbacks.manager import (
  File "/usr/share/miniconda/envs/ecrivai/lib/python3.[12](https://github.com/ruankie/ecrivai-blog-hugo/actions/runs/7403998049/job/20151420379#step:6:13)/site-packages/langchain/callbacks/__init__.py", line 45, in <module>
    from langchain_core.tracers.context import (
ImportError: cannot import name 'tracing_enabled' from 'langchain_core.tracers.context' (/usr/share/miniconda/envs/ecrivai/lib/python3.12/site-packages/langchain_core/tracers/context.py). Did you mean: 'tracing_v2_enabled'?
Error: Process completed with exit code 1.

Connection to ChatGPT required

Description

Connection to ChatGPT required for generation of topics and blog content.

TODO

  • Create a general connector class for interfacing with GPT-like models
  • Create specific connector for ChatGPT

Generating random articles

Hey,

Thanks for your script I wanted ask how to create custom own article with title I didn't see any option for that

when i run python ecrivai/add_blog.py its generating random article

Generation error

I have articles generating back to back and occasionally I will get an article with the title, "Blog Title." Sometimes the article is blank and sometimes it is written about something. I am using Gemini btw.

Running on Open source models

my plan is to run it 24/7 on my servers with some modifications
i tried som 7b ggup /llama cpp models they do work with this but somehow stops generating
(i suppose i did not configured langchain properly)
if i get work work effectively ill give some updates here till then

if anyone tries something similar please post stuff so i can refer and improve:)

Phase 1 Content Generator

The following components are still required for the content generator of phase 1:

  • Blog body generator
  • Markdown formatter and writer
  • Example to show usage

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.