Coder Social home page Coder Social logo

cyberiumabc / cyberrail Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ruvnet/guardrail

0.0 0.0 0.0 1.14 MB

Fused with Cyberium K-Graph & forked from OSS(MIT) GuardRail: Advanced tool for data analysis and AI content generation using OpenAI GPT models. Features sentiment analysis, content classification, trend analysis, and tailored GPT model usage. Ideal for content moderation, customer support, and market research.

License: MIT License

Python 100.00%

cyberrail's Introduction

CyberRail OSS - Open Source Ai Relevance, Guidance & Analysis API

CyberRail

๐Ÿงญ The CyberRail system combined with AiEQ advances responsible AI with robust data analysis and emotional intelligence, equipping AI with a moral compass.

CyberRail is an Open Source API-driven framework, designed to enhance responsible AI systems and workflows, providing advanced data analysis and dynamic conditional completions. This makes it essential for refining AI-powered outputs, increasing their quality and relevance. AiEQ, or Artificial Emotional Intelligence, complements this by equipping AI with the ability to interpret and respond to emotional contexts (EQ), adding a layer of empathy and ethical understanding. This synergy between CyberRail's technical enhancement capabilities and AiEQ's emotional intelligence introduces a new standard in AI, making it more adaptable, responsive, and attuned to human nuances.

Test API For Free (more than 50 advanced traits & guiderails)

OpenAI ChatGPT GPT

AiEQ

AiEQ infuses AI with emotional, psychological, and ethical intelligence kind of internal voice, essential for understanding and empathizing with human users.

AiEQ is a pioneering concept in AI, introducing an 'inner voice' that allows AI to perceive and interpret emotions, akin to human emotional intelligence. This model enables AI to transcend traditional data processing, allowing it to empathize with human emotions and respond accordingly. AiEQ's ability to navigate through emotional nuances and understand the subtleties of human psychology is pivotal in creating AI that is not just efficient but also emotionally attuned and ethically responsible.

CyberRails

Complementing AiEQ is the CyberRail open source guidance system. This versatile framework integrates seamlessly with AI models, including AiEQ, to provide advanced data analysis, sentiment analysis, content classification, and trend detection. CyberRail's role extends beyond mere analysis; it is instrumental in ensuring Responsible AI (RAI) practices.

It offers tools and guidelines for mitigating bias, and addressing psychological, ethical, and emotional considerations in AI development and deployment. CyberRail's adaptability makes it invaluable in various applications, from content moderation and customer support to market research and mental health, ensuring AI contributions are not only high-quality but also ethically sound and emotionally relevant.

Together, AiEQ and the CyberRail Data Analysis system embody a comprehensive approach to responsible AI development. CyberRail complements this by offering an API-driven framework that not only enhances AI capabilities but also ensures their ethical application and mitigates biases. This powerful combination guarantees that AI systems are technically advanced, ethically responsible, and emotionally attuned, setting a new standard for AI as a trusted, empathetic partner in diverse aspects of human life.

AI CyberRails

AI CyberRails, as implemented in the CyberRail Script & API, are a set of advanced mechanisms and protocols designed to regulate and oversee the performance of AI systems, particularly in generating and analyzing text. The primary purpose of these CyberRails is to ensure that the AI operates within a predefined ethical and quality framework, producing results that are not only accurate but also align with societal norms and values.

๐ŸŒŸ Key Features and Capabilities

Feature Description
๐Ÿงญ Responsible AI Ethical Framework Integrates emotional, psychological, and ethical intelligence, empowering AI with a moral compass for empathetic and ethically informed decision-making.
๐Ÿงฎ Conditional System Implements conditions based on analysis results, allowing for fine-tuned control and contextual responsiveness in output.
๐Ÿ”— API-Driven Integration Designed for easy integration with existing AI systems, enhancing chatbots, intelligent agents, and automated workflows.
โš™๏ธ Customizable GPT Model Usage Enables the tailoring of text generation and analysis to specific needs, leveraging various GPT model capabilities.
โฑ๏ธ Real-Time Data Processing Capable of handling and analyzing data in real-time, providing immediate insights and responses.
๐ŸŒ Multi-Lingual Support Offers the ability to process and analyze text in multiple languages, broadening its applicability.
๐Ÿšซ Automated Content Moderation Employs AI to automatically detect and handle inappropriate or sensitive content, ensuring safe digital environments.
๐Ÿ”„ Feedback and Improvement Mechanisms Incorporates user feedback for continuous improvement of the system, adapting to evolving requirements and standards.

Capabilities Overview

The Guiderails Script offers a wide range of capabilities, organized into various groups based on tasks or focus areas. These capabilities are designed to analyze text data comprehensively, offering insights across multiple dimensions. The /analysis_types endpoint provides a complete list of these functions, with an extensive array of over 50 different analysis types.

Feature Description
๐Ÿง  Psychological Understanding Equips AI with the ability to interpret and respond to human psychological states, enhancing user interaction and engagement.
โค๏ธ Emotional Intelligence (Emotion AI) Allows AI to recognize and respond to human emotions, facilitating more natural and empathetic interactions.
๐Ÿงญ Ethical Decision-Making Incorporates ethical guidelines into AI decision processes, ensuring actions align with moral and societal values.
๐Ÿ›ก๏ธ Bias Mitigation Implements algorithms and safeguards to reduce biases in AI processing and decision-making, promoting fairness and inclusivity.

๐Ÿ“Š Text Analysis

  • Sentiment Analysis: Determine the sentiment (positive, negative, or neutral) and provide a confidence score.
  • Text Summarization: Condense text, capturing key points and main ideas.
  • Topic Extraction: Identify and extract main topics or themes.
  • Emotion Detection: Detect primary emotions and their intensity.
  • Keyword Extraction: Extract central words or phrases.
  • Content Classification: Categorize text into predefined genres or categories.
  • Trend Analysis: Identify current trends, patterns, or emerging themes.
  • Grammatical Error Check: Identify and suggest corrections for grammatical errors.

๐ŸŒ Language & Cultural Analysis

  • Language Translation: Translate text into specified target languages.
  • Cultural Trend Analysis: Gain insights into cultural trends and public sentiment.
  • Cultural Analysis: Understand societal norms, values, and practices.
  • Sarcasm and Irony Detection: Differentiate between literal and figurative language.

๐Ÿ›๏ธ Political & Legal Analysis

  • Political Bias Detection: Detect political bias and ideological leanings.
  • Fake News Detection: Assess the likelihood of fake news.
  • Legal Document Analysis: Interpret legal language and document implications.

๐Ÿง  Psychological & Behavioral Analysis

  • Psychological Analysis: Understand emotions, behaviors, and mental states.
  • Behavioral Analysis: Analyze described or implied behaviors and motivations.
  • Emotional Intelligence Analysis: Evaluate aspects of emotional intelligence.
  • Cognitive Bias Identification: Detect cognitive biases and skewed perspectives.
  • Addiction Tendency Analysis: Evaluate signs of addictive behaviors.

๐Ÿ”„ Relationship & Conflict Analysis

  • Relationship Analysis: Insights into relationships and social dynamics.
  • Conflict Resolution Analysis: Understand conflict resolution strategies.
  • Conflict Tendency Analysis: Analyze conflict triggers and patterns.

๐Ÿ“ˆ Market & Brand Analysis

  • Market Research Analysis: Insights into market trends and consumer preferences.
  • Brand Sentiment Analysis: Assess public sentiment towards brands.
  • Product Review Analysis: Analyze customer opinions and satisfaction in reviews.
  • Customer Feedback Analysis: Determine overall satisfaction from customer feedback.

๐ŸŽ“ Educational & Learning Analysis

  • Learning Style Identification: Identify preferred learning styles.
  • Educational Content Analysis: Analyze educational materials and approaches.

๐ŸŒ Social Media & Communication Analysis

  • Social Media Monitoring: Monitor and analyze social media content.
  • Dialogue Analysis: Understand character interactions and conversational dynamics.

๐Ÿงฌ Health & Wellness Analysis

  • Health and Wellness Analysis: Evaluate health-related content, including medical conditions.
  • Stress Level Detection: Assess stress levels and identify triggers.
  • Sleep Quality Assessment: Analyze mentions of sleep quality and issues.
  • Psychosomatic Symptom Analysis: Assess psychosomatic symptoms and causes.

๐Ÿ“ Literary & Historical Analysis

  • Literary Analysis: Examine literary aspects like themes and narrative style.
  • Historical Data Analysis: Analyze historical events and patterns.

๐Ÿ–ฅ๏ธ User Experience & Feedback

  • User Experience Feedback Analysis: Evaluate user experience feedback, identifying usability issues.

๐Ÿง˜โ€โ™€๏ธ Mindfulness & Therapy Analysis

  • Automated Therapy Session Analysis: Analyze therapy session transcripts.
  • Mindfulness Meditation Effectiveness: Analyze mindfulness and meditation techniques.

๐Ÿ“ˆ Advanced Analytical Functions

  • Motivational Analysis: Examine motivational messages and impact.
  • Therapeutic Intervention Analysis: Evaluate relevance and effectiveness of therapeutic interventions.

Please note that the script includes over 50 distinct analysis functions. For the complete list and detailed descriptions of each type, users can query the /analysis_types endpoint.

Detailed Overview of the Conditional System

The conditional system in the Guiderail's Script is designed to execute complex analyses with conditions applied to the results. This system allows for greater control and specificity in handling AI-generated data.

Simple and Advanced Conditions

  • Simple Conditions: Basic conditions involve checking a single key-value pair in the analysis results. Example: Check if the sentiment analysis's confidence score is above a certain threshold.
  • Advanced Conditions: These involve more intricate checks, possibly over multiple keys or complex data structures. Example: Verifying that relevance scores in topic extraction meet certain criteria.

Sample JSON Formatted Conditions

Request Format

{
  "request_data": {
    "analysis_type": "sentiment_analysis",
    "messages": [
      {"role": "user", "content": "I am feeling great today!"},
      {"role": "user", "content": "The weather is sunny and pleasant."}
    ],
    "token_limit": 1000,
    "top_p": 0.1,
    "temperature": 0
  },
  "conditions": [
    {
      "analysis_type": "sentiment_analysis",
      "key": "confidence_score",
      "threshold": 0.5,
      "condition_type": "greater"
    },
    {
      "analysis_type": "topic_extraction",
      "key": "relevance_scores",
      "threshold": 0.1,
      "condition_type": "greater"
    }
  ]
}

Response Format

{
  "analysis": "All conditions met",
  "details": {
    "condition_responses": [
      {
        "condition": {
          "analysis_type": "sentiment_analysis",
          "key": "confidence_score",
          "threshold": 0.5,
          "condition_type": "greater"
        },
        "result": "Condition met",
        "total_tokens_used": 155,
        "retries": 0,
        "final_openai_response": {
          "id": "chatcmpl-8RoZaFxsQ7osZUEGcZvHPipPk0EMy",
          "object": "chat.completion",
          "created": 1701639950,
          "model": "gpt-4-1106-preview",
          "choices": [
            {
              "index": 0,
              "message": {
                "role": "assistant",
                "content": "{\n  \"sentiment\": \"positive\",\n  \"confidence_score\": 0.95,\n  \"text_snippets\": [\"feeling great\", \"sunny and pleasant\"]\n}"
              },
              "finish_reason": "stop"
            }
          ],
          "usage": {
            "prompt_tokens": 118,
            "completion_tokens": 37,
            "total_tokens": 155
          },
          "system_fingerprint": "fp_a24b4d720c"
        }
      },
      {
        "condition": {
          "analysis_type": "topic_extraction",
          "key": "relevance_scores",
          "threshold": 0.1,
          "condition_type": "greater"
        },
        "result": "Condition met",
        "total_tokens_used": 157,
        "retries": 0,
        "final_openai_response": {
          "id": "chatcmpl-8RoZcw4UY9U19tGuita6CEANw0Cq6",
          "object": "chat.completion",
          "created": 1701639952,
          "model": "gpt-4-1106-preview",
          "choices": [
            {
              "index": 0,
              "message": {
                "role": "assistant",
                "content": "{\n  \"topics\": [\"Emotions\", \"Weather\"],\n  \"relevance_scores\": [0.9, 0.8],\n  \"key_phrases\": [\"feeling great\", \"sunny and pleasant\"]\n}"
              },
              "finish_reason": "stop"
            }
          ],
          "usage": {
            "prompt_tokens": 111,
            "completion_tokens": 46,
            "total_tokens": 157
          },
          "system_fingerprint": "fp_a24b4d720c"
        }
      }
    ]
  },
  "error": null,
  "raw_openai_response": null
}

Understanding the Sample Response

  • Code 200: Indicates successful execution of the request.
  • Analysis Summary: "All conditions met" signifies that both conditions (sentiment analysis and topic extraction) passed their respective checks.
  • Details: The condition_responses array contains individual assessments for each condition, including the total tokens used, retries, and the final OpenAI response details.
  • Final OpenAI Response: Provides the raw response from the OpenAI API, including the model used, tokens details, and the content analyzed.

Installation

Requirements

  • Python 3.8 or higher
  • FastAPI
  • Uvicorn
  • Pydantic
  • Requests

How to Install

  1. Clone the repository to your local machine.
  2. Install required Python packages using pip install -r requirements.txt.
  3. Set environment variables AUTH_TOKEN and OPENAI_API_KEY.

How to Use

  1. Start the server using uvicorn main:app --reload.
  2. Access the FastAPI interface at http://127.0.0.1:8000/docs.
  3. Use the provided endpoints to send requests for data analysis or conditional completions.

Code Structure

  • main.py: Contains the FastAPI app initialization, endpoint definitions, and business logic.
  • prompts.py: Includes predefined prompts and JSON schemas for different types of analysis.
  • security.py: Manages authentication and security features. (Coming Soon)

Contributing

To contribute, please fork the repository, make changes, and submit a pull request. Contributions are welcome to improve the script's functionality and efficiency.


Version: v0.0.1
Author: @rUv

cyberrail's People

Contributors

code-ishwar avatar ruvnet 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.