Giter Club home page Giter Club logo

twon-agents's Introduction

TWON: Agents - Generative Agent through LLMs

The repository contains a REST API to inference with generative agents in a social media thread. The agents are powered by large language models through Hugging Face and OpenAi.

Note: Currently, the work is an alpha version and will undergo breaking changes during the development.

Project Setup

# install Python requirements
make install

# update local repository and restart server
make update

# start with hot-reload for development
make dev

# start for production
make serve

# run unit tests
make test

dotenv

The API assumes a valid Hugging Face and OpenAi API token inside the project repository in a dotenv file.

HF_TOKEN="hf_XXXXXXXXXXXXXXXXX"
OPENAI_API_KEY="sk-XXXXXXXXXXXXXXXXX"

Usage

todo

twon-agents's People

Contributors

sjoerdstolwijk avatar simon-muenker avatar clarahsu avatar

Stargazers

Miriam avatar Jacqueline Höllig avatar  avatar JanSt avatar  avatar  avatar

Watchers

Kostas Georgiou avatar  avatar

twon-agents's Issues

Reply endpoint Error

Hi Simon,
Following is the error:

Request:

{"history":{"interactions":[]},"integration":{"model":"mixtral:8x7b-instruct-v0.1-q6_K","provider":"local"},"language":"German","length":"few-word","persona":["neutral"],"platform":"Twitter","thread":[]}

Response:

aborted: false,
rangeRequested: false,
timingAllowPassed: true,
requestIncludesCredentials: true,
type: 'default',
status: 422,

Unable to get the reequire results by calling like api

Request body:

{
"history": {
"interactions": [
{
"action": "liked",
"message": "Sweets make the world go round!"
},
{
"action": "wrote",
"message": "As a kid, I fell into a jar of honey."
}
]
},
"integration": {
"model": "llama2:70b",
"provider": "local"
},
"language": "English",
"persona": [
"liberal",
"expert"
],
"platform": "Twitter",
"post": {
"author": "human_user",
"message": "I like cookies!"
}
}

Response:
{
"detail": [
{
"type": "model_attributes_type",
"loc": [
"body"
],
"msg": "Input should be a valid dictionary or object to extract fields from",
"input": "{\r\n "history": {\r\n "interactions": [\r\n {\r\n "action": "liked",\r\n "message": "Sweets make the world go round!"\r\n },\r\n {\r\n "action": "wrote",\r\n "message": "As a kid, I fell into a jar of honey."\r\n }\r\n ]\r\n },\r\n "integration": {\r\n "model": "llama2:70b",\r\n "provider": "local"\r\n },\r\n "language": "English",\r\n "persona": [\r\n "liberal",\r\n "expert"\r\n ],\r\n "platform": "Twitter",\r\n "post": {\r\n "author": "human_user",\r\n "message": "I like cookies!"\r\n }\r\n}",
"url": "https://errors.pydantic.dev/2.6/v/model_attributes_type"
}
]
}

Invalid Json

Request:
{"post":{"author":"CDU","message":"Deutschland muss sich den Realitäten der veränderten Weltlage stellen und dabei auch seiner Führungsverantwortung gerecht werden. Dafür müssen wir wieder in der Lage sein, das eigene Land, die Partner in der EU und das NATO-Bündnis gemeinsam mit unseren Partnern zu verteidigen. Das fordern wir in unserem #Grundsatzprogramm, das wir auf unserem CDU-Parteitag im Mai beschließen wollen. Wir brauchen modern ausgerüstete, kampfstarke, durchhaltefähige Streitkräfte. Zur Finanzierung des Umbaus des Systems Bundeswehr und kampffähiger Streitkräfte wollen wir den NATO-Verpflichtungen umfassend entsprechen."},"history":{"interactions":[]},"integration":{"model":"llama2:70b","provider":"local"},"language":"German","persona":["neutral"],"platform":"Twitter"}

Response:
{
detail: [
{
type: 'json_invalid',
loc: [Array],
msg: 'JSON decode error',
input: {},
ctx: [Object]
}
]
}

Can you please help me fixing this issue?

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.