Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using kwargs in CLI #787

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Allow using kwargs in CLI #787

wants to merge 2 commits into from

Conversation

ahuang11
Copy link
Contributor

@ahuang11 ahuang11 commented Nov 25, 2024

Closes #784

Allows setting kwargs like:
lumen-ai serve nino_ml.csv --agents sql hvplot --provider openai

Rendered output:

import lumen.ai as lmai
from lumen.sources.duckdb import DuckDBSource

from lumen.ai.agents import SQLAgent
from lumen.ai.agents import hvPlotAgent

llm = lmai.llm.OpenAI(
    api_key='sk-<redacted>'
)
cs = lmai.memory["current_source"] = DuckDBSource(
    tables=['nino_ml.csv'],
    uri=":memory:",
    initializers=["INSTALL httpfs;", "LOAD httpfs;"]
)

assistant = lmai.ExplorerUI(
    llm=llm,
    agents=[SQLAgent, hvPlotAgent]
)
assistant.servable("Lumen.ai")

Also renames base_url and azure_endpoint to provider_endpoint

Copy link

codecov bot commented Nov 25, 2024

Codecov Report

Attention: Patch coverage is 6.52174% with 86 lines in your changes missing coverage. Please review.

Project coverage is 60.58%. Comparing base (2c83a1b) to head (0fbdc56).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
lumen/command/ai.py 0.00% 82 Missing ⚠️
lumen/ai/llm.py 42.85% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #787      +/-   ##
==========================================
- Coverage   60.98%   60.58%   -0.40%     
==========================================
  Files         103      103              
  Lines       12544    12628      +84     
==========================================
+ Hits         7650     7651       +1     
- Misses       4894     4977      +83     

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

lumen/command/ai.py Outdated Show resolved Hide resolved
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.

Specifying agents through lumen-ai serve CLI
1 participant