diff --git a/main.py b/main.py index 51dcd9e..ed1356a 100644 --- a/main.py +++ b/main.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + """ Entry point script for the Deer project. """ diff --git a/server.py b/server.py index 62be824..a7c424e 100644 --- a/server.py +++ b/server.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + """ Server script for running the Deer API. """ diff --git a/src/__init__.py b/src/__init__.py index e69de29..a74d8cf 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -0,0 +1,3 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + diff --git a/src/agents/__init__.py b/src/agents/__init__.py index 1c6d911..c235a05 100644 --- a/src/agents/__init__.py +++ b/src/agents/__init__.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + from .agents import research_agent, coder_agent __all__ = ["research_agent", "coder_agent"] diff --git a/src/agents/agents.py b/src/agents/agents.py index 477b7e2..2a4d330 100644 --- a/src/agents/agents.py +++ b/src/agents/agents.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + from langgraph.prebuilt import create_react_agent from src.prompts import apply_prompt_template diff --git a/src/config/__init__.py b/src/config/__init__.py index f1ad769..c4639c1 100644 --- a/src/config/__init__.py +++ b/src/config/__init__.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + from .tools import SEARCH_MAX_RESULTS, SELECTED_SEARCH_ENGINE, SearchEngine from .loader import load_yaml_config from .questions import BUILT_IN_QUESTIONS, BUILT_IN_QUESTIONS_ZH_CN diff --git a/src/config/agents.py b/src/config/agents.py index 62be2c1..df65b2a 100644 --- a/src/config/agents.py +++ b/src/config/agents.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + from typing import Literal # Define available LLM types diff --git a/src/config/configuration.py b/src/config/configuration.py index 8912b46..8df7a7f 100644 --- a/src/config/configuration.py +++ b/src/config/configuration.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + import os from dataclasses import dataclass, fields from typing import Any, Optional diff --git a/src/config/loader.py b/src/config/loader.py index dff0ed8..a6edfe5 100644 --- a/src/config/loader.py +++ b/src/config/loader.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + import os import yaml from typing import Dict, Any diff --git a/src/config/questions.py b/src/config/questions.py index 3254c13..21a906c 100644 --- a/src/config/questions.py +++ b/src/config/questions.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + """ Built-in questions for Deer. """ diff --git a/src/config/tools.py b/src/config/tools.py index 8b3e526..37ee9d6 100644 --- a/src/config/tools.py +++ b/src/config/tools.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + import os import enum from dotenv import load_dotenv diff --git a/src/crawler/__init__.py b/src/crawler/__init__.py index 5303aa0..4f6a6e7 100644 --- a/src/crawler/__init__.py +++ b/src/crawler/__init__.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + from .article import Article from .crawler import Crawler diff --git a/src/crawler/article.py b/src/crawler/article.py index ba088b4..fd0c95e 100644 --- a/src/crawler/article.py +++ b/src/crawler/article.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + import re from urllib.parse import urljoin diff --git a/src/crawler/crawler.py b/src/crawler/crawler.py index eb87dcd..fe7ddfc 100644 --- a/src/crawler/crawler.py +++ b/src/crawler/crawler.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + import sys from .article import Article diff --git a/src/crawler/jina_client.py b/src/crawler/jina_client.py index a3ec732..8cd81ed 100644 --- a/src/crawler/jina_client.py +++ b/src/crawler/jina_client.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + import logging import os diff --git a/src/crawler/readability_extractor.py b/src/crawler/readability_extractor.py index 7bf63e0..a3a22d0 100644 --- a/src/crawler/readability_extractor.py +++ b/src/crawler/readability_extractor.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + from readabilipy import simple_json_from_html_string from .article import Article diff --git a/src/graph/__init__.py b/src/graph/__init__.py index 536aa4c..ec13d9a 100644 --- a/src/graph/__init__.py +++ b/src/graph/__init__.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + from .builder import build_graph __all__ = [ diff --git a/src/graph/builder.py b/src/graph/builder.py index 8425d43..fcb4f39 100644 --- a/src/graph/builder.py +++ b/src/graph/builder.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + from langgraph.graph import StateGraph, START, END from langgraph.checkpoint.memory import MemorySaver from .types import State diff --git a/src/graph/nodes.py b/src/graph/nodes.py index 559abf0..4a7a5ca 100644 --- a/src/graph/nodes.py +++ b/src/graph/nodes.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + import logging import json from typing import Literal, Annotated diff --git a/src/graph/types.py b/src/graph/types.py index 4d8a919..71a208e 100644 --- a/src/graph/types.py +++ b/src/graph/types.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + import operator from langgraph.graph import MessagesState diff --git a/src/llms/__init__.py b/src/llms/__init__.py index e69de29..a74d8cf 100644 --- a/src/llms/__init__.py +++ b/src/llms/__init__.py @@ -0,0 +1,3 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + diff --git a/src/llms/llm.py b/src/llms/llm.py index 767cd99..ca5dc75 100644 --- a/src/llms/llm.py +++ b/src/llms/llm.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + from langchain_openai import ChatOpenAI from src.config import load_yaml_config from pathlib import Path diff --git a/src/prompts/__init__.py b/src/prompts/__init__.py index 3831b7a..e05eaae 100644 --- a/src/prompts/__init__.py +++ b/src/prompts/__init__.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + from .template import apply_prompt_template, get_prompt_template __all__ = [ diff --git a/src/prompts/planner_model.py b/src/prompts/planner_model.py index dc65913..615d701 100644 --- a/src/prompts/planner_model.py +++ b/src/prompts/planner_model.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + from pydantic import BaseModel, Field from typing import List, Optional from enum import Enum diff --git a/src/prompts/template.py b/src/prompts/template.py index e0c022a..beafe27 100644 --- a/src/prompts/template.py +++ b/src/prompts/template.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + import os import dataclasses from datetime import datetime diff --git a/src/server/__init__.py b/src/server/__init__.py index 34f275e..b5f0b02 100644 --- a/src/server/__init__.py +++ b/src/server/__init__.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + from .app import app __all__ = ["app"] diff --git a/src/server/app.py b/src/server/app.py index fe1b494..1eca654 100644 --- a/src/server/app.py +++ b/src/server/app.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + import json import logging from typing import List, cast diff --git a/src/server/chat_request.py b/src/server/chat_request.py index 8a44ee3..55d2472 100644 --- a/src/server/chat_request.py +++ b/src/server/chat_request.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + from typing import List, Optional, Union from pydantic import BaseModel, Field diff --git a/src/tools/__init__.py b/src/tools/__init__.py index 1d34af8..774938f 100644 --- a/src/tools/__init__.py +++ b/src/tools/__init__.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + from .crawl import crawl_tool from .python_repl import python_repl_tool from .search import ( diff --git a/src/tools/crawl.py b/src/tools/crawl.py index fa78c5b..9b1aa97 100644 --- a/src/tools/crawl.py +++ b/src/tools/crawl.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + import logging from typing import Annotated diff --git a/src/tools/decorators.py b/src/tools/decorators.py index 0cf4e9e..a37e82e 100644 --- a/src/tools/decorators.py +++ b/src/tools/decorators.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + import logging import functools from typing import Any, Callable, Type, TypeVar diff --git a/src/tools/python_repl.py b/src/tools/python_repl.py index feb05db..4b9c0ab 100644 --- a/src/tools/python_repl.py +++ b/src/tools/python_repl.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + import logging from typing import Annotated from langchain_core.tools import tool diff --git a/src/tools/search.py b/src/tools/search.py index 9cf8dd2..42441dd 100644 --- a/src/tools/search.py +++ b/src/tools/search.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + import logging import os from langchain_community.tools.tavily_search import TavilySearchResults diff --git a/src/utils/__init__.py b/src/utils/__init__.py index 7507b9d..baffcc7 100644 --- a/src/utils/__init__.py +++ b/src/utils/__init__.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + """ 工具函数包 """ diff --git a/src/utils/json_utils.py b/src/utils/json_utils.py index 9b0d2fb..f9c10ff 100644 --- a/src/utils/json_utils.py +++ b/src/utils/json_utils.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + import logging import json import json_repair diff --git a/src/workflow.py b/src/workflow.py index a6abd76..46437e4 100644 --- a/src/workflow.py +++ b/src/workflow.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + import logging from src.graph import build_graph diff --git a/tests/integration/test_crawler.py b/tests/integration/test_crawler.py index 2672d2d..e4584bd 100644 --- a/tests/integration/test_crawler.py +++ b/tests/integration/test_crawler.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + import pytest from src.crawler import Crawler diff --git a/tests/integration/test_python_repl_tool.py b/tests/integration/test_python_repl_tool.py index becb3d6..bad0333 100644 --- a/tests/integration/test_python_repl_tool.py +++ b/tests/integration/test_python_repl_tool.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + import pytest from src.tools.python_repl import python_repl_tool diff --git a/tests/integration/test_template.py b/tests/integration/test_template.py index d39f997..04eb4d7 100644 --- a/tests/integration/test_template.py +++ b/tests/integration/test_template.py @@ -1,3 +1,6 @@ +# Copyright (c) 2025 Bytedance Ltd. and/or its affiliates +# SPDX-License-Identifier: MIT + import pytest from src.prompts.template import get_prompt_template, apply_prompt_template