Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ahuang11
Copy link
Contributor

Since LLMs excel at coding and Panel can almost wrap anything, I think it's good to add an arbitrary code executor.

Not sure how to control the formatting though. In the first view spec, the code is properly spaced with new lines. The second view spec is condensed. Ideally, it'd use the | yaml syntax for multi line strings, but not sure how to specify that.

image

@ahuang11 ahuang11 requested a review from philippjfr December 23, 2024 21:10
@ahuang11 ahuang11 changed the title Add code agent Add PythonCodeAgent Dec 23, 2024
@codecov
Copy link

codecov bot commented Dec 23, 2024

Codecov Report

Attention: Patch coverage is 84.93151% with 22 lines in your changes missing coverage. Please review.

Project coverage is 52.01%. Comparing base (ee60b84) to head (09170f0).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
lumen/ai/agents.py 9.09% 10 Missing ⚠️
lumen/views/base.py 86.88% 8 Missing ⚠️
lumen/ai/models.py 0.00% 3 Missing ⚠️
lumen/ai/utils.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #896      +/-   ##
==========================================
+ Coverage   51.65%   52.01%   +0.35%     
==========================================
  Files         108      108              
  Lines       13700    13846     +146     
==========================================
+ Hits         7077     7202     +125     
- Misses       6623     6644      +21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@philippjfr
Copy link
Member

Seems very scary to me, what if a user asks the LLM to write code that destroys the system or exfiltrate secrets?

@ahuang11
Copy link
Contributor Author

ahuang11 commented Dec 24, 2024

Yes I thought of that which is why it's not part of the default agents, but I suppose it could add a disclaimer to use at the user's own risk. It could be useful for contained, authenticated environments.

@philippjfr
Copy link
Member

Would be nice if this could somehow be run in a sandboxed environment, e.g. pyodide or some other WASM based Python environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants