diff --git a/main.py b/main.py index 51dcd9e81..ed1356a38 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 62be824f4..a7c424ea7 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 e69de29bb..a74d8cf99 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 1c6d9111a..c235a05e3 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 477b7e277..2a4d3303a 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 f1ad76963..c4639c1e8 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 62be2c1ee..df65b2af8 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 8912b4645..8df7a7f50 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 dff0ed853..a6edfe503 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 3254c1317..21a906c67 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 8b3e5263e..37ee9d689 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 5303aa0cd..4f6a6e7fb 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 ba088b41d..fd0c95e61 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 eb87dcd14..fe7ddfce6 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 a3ec7327f..8cd81ed16 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 7bf63e097..a3a22d05a 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 536aa4ced..ec13d9a5a 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 8425d4326..fcb4f394c 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 559abf071..4a7a5ca2a 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 4d8a9194c..71a208e11 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 e69de29bb..a74d8cf99 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 767cd992b..ca5dc75a3 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 3831b7acc..e05eaae8e 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 dc65913c8..615d7017d 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 e0c022a66..beafe2721 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 34f275ed3..b5f0b0245 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 fe1b49438..1eca65497 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 8a44ee358..55d247204 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 1d34af81e..774938f78 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 fa78c5b06..9b1aa9727 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 0cf4e9e6a..a37e82eb1 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 feb05db0a..4b9c0aba5 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 9cf8dd291..42441ddcc 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 7507b9d7e..baffcc7ac 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 9b0d2fb1b..f9c10ff37 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 a6abd766d..46437e408 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 2672d2d84..e4584bd8d 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 becb3d614..bad033363 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 d39f99779..04eb4d734 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