Skip to content

Commit

Permalink
Feat/note book (#2134)
Browse files Browse the repository at this point in the history
Co-authored-by: sunshinesmilelk <[email protected]>
Co-authored-by: csunny <[email protected]>
  • Loading branch information
3 people authored Nov 21, 2024
1 parent 9566f4e commit 0bc478b
Show file tree
Hide file tree
Showing 429 changed files with 13,161 additions and 28,197 deletions.
3 changes: 3 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -327,3 +327,6 @@ DBGPT_LOG_LEVEL=INFO
#** FINANCIAL CHAT Config **#
#*******************************************************************#
# FIN_REPORT_MODEL=/app/models/bge-large-zh

## Turn off notebook display Python flow , which is enabled by default
NOTE_BOOK_ENABLE=False
4 changes: 4 additions & 0 deletions dbgpt/_private/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,10 @@ def __init__(self) -> None:
self.SCHEDULER_ENABLED = (
os.getenv("SCHEDULER_ENABLED", "True").lower() == "true"
)
self.NOTE_BOOK_ENABLE: bool = (
os.getenv("NOTE_BOOK_ENABLE", "True").lower() == "true"
)
self.NOTE_BOOK_ROOT: str = os.getenv("NOTE_BOOK_ROOT", os.path.expanduser("~"))

@property
def local_db_manager(self) -> "ConnectorManager":
Expand Down
6 changes: 6 additions & 0 deletions dbgpt/agent/core/plan/awel/agent_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ async def map(self, input_value: AgentGenerateContext) -> AgentGenerateContext:
# Default single step transfer of information
rely_messages=now_rely_messages,
silent=input_value.silent,
memory=input_value.memory.structure_clone() if input_value.memory else None,
agent_context=input_value.agent_context,
llm_client=input_value.llm_client,
begin_agent=None,
last_speaker=self.agent,
already_started=True,
)


Expand Down
38 changes: 18 additions & 20 deletions dbgpt/agent/core/plan/awel/team_awel_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,16 +165,15 @@ async def act(
)
last_message = final_generate_context.rely_messages[-1]
last_message.rounds = last_message.rounds + 1
if not final_generate_context.last_speaker:
raise ValueError("Dont have last speaker agent!")
await final_generate_context.last_speaker.send(
last_message,
sender,
start_message_context.reviewer,
False,
is_retry_chat=is_retry_chat,
last_speaker_name=last_speaker_name,
)
if final_generate_context.last_speaker:
await final_generate_context.last_speaker.send(
last_message,
sender,
start_message_context.reviewer,
False,
is_retry_chat=is_retry_chat,
last_speaker_name=last_speaker_name,
)

view_message = None
if last_message.action_report:
Expand Down Expand Up @@ -269,16 +268,15 @@ async def act(

last_message = final_generate_context.rely_messages[-1]
last_message.rounds = last_message.rounds + 1
if not final_generate_context.last_speaker:
raise ValueError("Not have last speaker!")
await final_generate_context.last_speaker.send(
last_message,
sender,
start_message_context.reviewer,
False,
is_retry_chat=is_retry_chat,
last_speaker_name=last_speaker_name,
)
if final_generate_context.last_speaker:
await final_generate_context.last_speaker.send(
last_message,
sender,
start_message_context.reviewer,
False,
is_retry_chat=is_retry_chat,
last_speaker_name=last_speaker_name,
)

view_message = None
if last_message.action_report:
Expand Down
4 changes: 1 addition & 3 deletions dbgpt/app/dbgpt_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
STATIC_MESSAGE_IMG_PATH,
)
from dbgpt.serve.core import add_exception_handler
from dbgpt.util.fastapi import create_app, replace_router
from dbgpt.util.fastapi import create_app, register_event_handler, replace_router
from dbgpt.util.i18n_utils import _, set_default_language
from dbgpt.util.parameter_utils import _get_dict_from_obj
from dbgpt.util.system_utils import get_system_info
Expand All @@ -43,7 +43,6 @@
ROOT_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(ROOT_PATH)


CFG = Config()
set_default_language(CFG.LANGUAGE)

Expand All @@ -61,7 +60,6 @@
# Use custom router to support priority
replace_router(app)


system_app = SystemApp(app)


Expand Down
Binary file added dbgpt/app/img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 8 additions & 2 deletions dbgpt/app/initialization/serve_initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,16 @@ def register_serve_apps(system_app: SystemApp, cfg: Config, webserver_port: int)

# ################################ File Serve Register End ########################################

# ################################ Evaluate Serve Register Begin #######################################
# ################################ Evaluate Serve Register Begin ##################################
from dbgpt.serve.evaluate.serve import Serve as EvaluateServe

# Register serve Evaluate
system_app.register(EvaluateServe)
# ################################ Evaluate Serve Register End ####################################

# ################################ Evaluate Serve Register End ########################################
# ################################ Libro Serve Register Begin #####################################
from dbgpt.serve.libro.serve import Serve as LibroServe

# Register serve libro
system_app.register(LibroServe)
# ################################ Libro Serve Register End #######################################
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class ValueItem(BaseModel):
name: str
type: str = None
type: Optional[str] = None
value: float

def dict(self, *args, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion dbgpt/app/static/web/404.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="icon" href="/favicon.ico"/><meta name="description" content="Revolutionizing Database Interactions with Private LLM Technology"/><meta property="og:description" content="eosphoros-ai"/><meta property="og:title" content="DB-GPT"/><link rel="preload" href="/_next/static/css/56abd552837c60f9.css" as="style"/><link rel="stylesheet" href="/_next/static/css/56abd552837c60f9.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-3257fddca97289f9.js" defer=""></script><script src="/_next/static/chunks/framework-fb9c0d50ace2b075.js" defer=""></script><script src="/_next/static/chunks/main-fd0d7e13da40ad83.js" defer=""></script><script src="/_next/static/chunks/pages/_app-e3c58054813ebb2b.js" defer=""></script><script src="/_next/static/chunks/pages/_error-4fa9991a75118e6f.js" defer=""></script><script src="/_next/static/ujdCH5HCMF0OXSAWRqVTP/_buildManifest.js" defer=""></script><script src="/_next/static/ujdCH5HCMF0OXSAWRqVTP/_ssgManifest.js" defer=""></script><link rel="stylesheet" href="/_next/static/css/antd-output/antd.min.7d5365b5.css"/></head><body><div id="__next"><div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"ujdCH5HCMF0OXSAWRqVTP","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="icon" href="/favicon.ico"/><meta name="description" content="Revolutionizing Database Interactions with Private LLM Technology"/><meta property="og:description" content="eosphoros-ai"/><meta property="og:title" content="DB-GPT"/><link rel="preload" href="/_next/static/css/56abd552837c60f9.css" as="style"/><link rel="stylesheet" href="/_next/static/css/56abd552837c60f9.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-f9489bc48c5d1540.js" defer=""></script><script src="/_next/static/chunks/framework-8b06d32cbb857e0e.js" defer=""></script><script src="/_next/static/chunks/main-6c4c7f5b8c9b1320.js" defer=""></script><script src="/_next/static/chunks/pages/_app-7c76237d5662964a.js" defer=""></script><script src="/_next/static/chunks/pages/_error-8095ba9e1bf12f30.js" defer=""></script><script src="/_next/static/oyFmgKTpzOHc-wyB30CA1/_buildManifest.js" defer=""></script><script src="/_next/static/oyFmgKTpzOHc-wyB30CA1/_ssgManifest.js" defer=""></script><link rel="stylesheet" href="/_next/static/css/antd-output/antd.min.7d5365b5.css"/></head><body><div id="__next"><div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"oyFmgKTpzOHc-wyB30CA1","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
2 changes: 1 addition & 1 deletion dbgpt/app/static/web/404/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="icon" href="/favicon.ico"/><meta name="description" content="Revolutionizing Database Interactions with Private LLM Technology"/><meta property="og:description" content="eosphoros-ai"/><meta property="og:title" content="DB-GPT"/><link rel="preload" href="/_next/static/css/56abd552837c60f9.css" as="style"/><link rel="stylesheet" href="/_next/static/css/56abd552837c60f9.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-3257fddca97289f9.js" defer=""></script><script src="/_next/static/chunks/framework-fb9c0d50ace2b075.js" defer=""></script><script src="/_next/static/chunks/main-fd0d7e13da40ad83.js" defer=""></script><script src="/_next/static/chunks/pages/_app-e3c58054813ebb2b.js" defer=""></script><script src="/_next/static/chunks/pages/_error-4fa9991a75118e6f.js" defer=""></script><script src="/_next/static/ujdCH5HCMF0OXSAWRqVTP/_buildManifest.js" defer=""></script><script src="/_next/static/ujdCH5HCMF0OXSAWRqVTP/_ssgManifest.js" defer=""></script><link rel="stylesheet" href="/_next/static/css/antd-output/antd.min.7d5365b5.css"/></head><body><div id="__next"><div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"ujdCH5HCMF0OXSAWRqVTP","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="icon" href="/favicon.ico"/><meta name="description" content="Revolutionizing Database Interactions with Private LLM Technology"/><meta property="og:description" content="eosphoros-ai"/><meta property="og:title" content="DB-GPT"/><link rel="preload" href="/_next/static/css/56abd552837c60f9.css" as="style"/><link rel="stylesheet" href="/_next/static/css/56abd552837c60f9.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/_next/static/chunks/webpack-f9489bc48c5d1540.js" defer=""></script><script src="/_next/static/chunks/framework-8b06d32cbb857e0e.js" defer=""></script><script src="/_next/static/chunks/main-6c4c7f5b8c9b1320.js" defer=""></script><script src="/_next/static/chunks/pages/_app-7c76237d5662964a.js" defer=""></script><script src="/_next/static/chunks/pages/_error-8095ba9e1bf12f30.js" defer=""></script><script src="/_next/static/oyFmgKTpzOHc-wyB30CA1/_buildManifest.js" defer=""></script><script src="/_next/static/oyFmgKTpzOHc-wyB30CA1/_ssgManifest.js" defer=""></script><link rel="stylesheet" href="/_next/static/css/antd-output/antd.min.7d5365b5.css"/></head><body><div id="__next"><div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"oyFmgKTpzOHc-wyB30CA1","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>

Large diffs are not rendered by default.

Loading

0 comments on commit 0bc478b

Please sign in to comment.