python-lint (#14689)

# Description: _python-lint_

This agent writes Python code that is formatted and linted using
`black`, `ruff`, and `mypy`, but does not execute the code. It writes
the code to a temporary file and then runs the linters. Once these
checks pass, the code is returned.

# Dependencies

- black
- ruff
- mypy

# Demo

The functionality can be seen here:
https://huggingface.co/spaces/joshuasundance/langchain-streamlit-demo
This commit is contained in:
Joshua Sundance Bailey
2024-01-01 19:25:03 -05:00
committed by GitHub
parent cf2dd2fa25
commit cfd27b1786
7 changed files with 348 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
[tool.poetry]
name = "python-lint"
version = "0.0.1"
description = "Python code-writing agent whose work is checked by black, ruff, and mypy."
authors = ["Joshua Sundance Bailey"]
readme = "README.md"
[tool.poetry.dependencies]
ruff = ">=0.1.8"
black = ">=23.12.0"
mypy = ">=1.7.1"
python = ">=3.8.1,<4.0"
langchain = ">=0.0.313, <0.1"
openai = ">=1.3.9"
[tool.poetry.group.dev.dependencies]
langchain-cli = ">=0.0.4"
fastapi = "^0.104.0"
sse-starlette = "^1.6.5"
[tool.langserve]
export_module = "python_lint"
export_attr = "agent_executor"
[tool.templates-hub]
use-case = "code-generation"
author = "Joshua Sundance Bailey"
integrations = ["OpenAI"]
tags = ["python", "agent"]
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"