Skip to content

sergeyKogan/PositronicPython

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PositronicPython

PositronicPython is an innovative Python framework designed to dynamically augment Python code with decision-making capabilities using Large Language Models (LLMs). It utilizes Python's inspect module to analyze code at runtime and augment it with LLM-generated code or data, enhancing the Python language with human-like decision-making capabilities.

The vision

To augment the python language with a human-like resourcefulness and decision making capabilities, making the development of gen AI agents to be more natural, repeatable, and testable.

Roadmap features:

  • Dynamic Code Augmentation: Automatically enhances Python code by injecting intelligent, context-aware snippets generated by LLMs.
  • Real-Time Analysis: Uses runtime inspection to understand and modify code behavior dynamically.
  • Seamless Integration: Easy to integrate with existing Python projects, requiring minimal changes to the codebase.
  • Customizable AI Models: Supports customization of the AI model to better fit specific use cases and requirements.

Available features:

  • Automatic population: of python data classes by analysing the source code of the class and following the user instruction

Quick Start

Here’s a simple example to get you started with PositronicPython:

Example: Enhancing a Python Class

pythonCopy code

import dataclasses
import json
import logging
from typing import List

from framework.ai_interface import ai_enhanced


@ai_enhanced
class EnglishTeacher:
    # A class representing an assignment given by an English teacher to a Hebrew-speaking student.
    # The teacher is very friendly and supportive and has a good sense of humor. He wants to make sure the student will succeed in the test
    # The teacher is very creative, and he wants to make sure the students will enjoy the learning process
    class Word:
        word_str: str
        definition_english: str
        explanation_hebrew: str
        examples: List[str]
        synonyms: List[str]

    introduction: str # in English
    words: List[Word]  # Use HTML to make it more engaging
    funny_story_containing_the_words: str # Mark important words in bold (<b>)
    exercises: List[str]  # List of exercises to practice the words structure as HTML. Make it easy for the student to test himself. Use colors to make it engaging
    solutions: List[str]


words = "Folloed by, Praced, Suited, Informed, Detected, Perspective"

logging.info("Generating the exercise")
exercise = EnglishTeacher.generate(words)
logging.info("Done generating the exercise")
exercise.to_html("Structure the page in a form of cards. Hebrew explanations should be next to the English ones (same line). It should be easy to read")
print("Done")

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages