repo
stringlengths
7
90
file_url
stringlengths
81
315
file_path
stringlengths
4
228
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:38:15
2026-01-05 02:33:18
truncated
bool
2 classes
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/knowledge_base/recreate_vector_store_param.py
libs/python-sdk/open_chatcaht/types/knowledge_base/recreate_vector_store_param.py
from pydantic import BaseModel, Field from open_chatcaht._constants import VS_TYPE, EMBEDDING_MODEL, CHUNK_SIZE, OVERLAP_SIZE, ZH_TITLE_ENHANCE class RecreateVectorStoreParam(BaseModel): knowledge_base_name: str = Field(..., examples=["samples"], description='知识库名称'), allow_empty_kb: bool = Field(True), ...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/knowledge_base/__init__.py
libs/python-sdk/open_chatcaht/types/knowledge_base/__init__.py
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/knowledge_base/update_kb_info_param.py
libs/python-sdk/open_chatcaht/types/knowledge_base/update_kb_info_param.py
from pydantic import BaseModel, Field class UpdateKbInfoParam(BaseModel): knowledge_base_name: str = Field( ..., description="知识库名称", examples=["samples"] ), kb_info: str = Field(..., description="知识库介绍", examples=["这是一个知识库"]),
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/knowledge_base/summary/summary_doc_ids_to_vector_store_param.py
libs/python-sdk/open_chatcaht/types/knowledge_base/summary/summary_doc_ids_to_vector_store_param.py
from typing import Optional, List from pydantic import Field, BaseModel from open_chatcaht._constants import VS_TYPE, EMBEDDING_MODEL class SummaryDocIdsToVectorStoreParam(BaseModel): knowledge_base_name: str = Field(..., examples=["samples"]), doc_ids: List = Field([], examples=[["uuid"]]), vs_type: st...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/knowledge_base/summary/summary_file_to_vector_store_param.py
libs/python-sdk/open_chatcaht/types/knowledge_base/summary/summary_file_to_vector_store_param.py
from typing import Optional from pydantic import Field, BaseModel from open_chatcaht._constants import VS_TYPE, EMBEDDING_MODEL class SummaryFileToVectorStoreParam(BaseModel): knowledge_base_name: str = Field(..., examples=["samples"]), file_name: str = Field(..., examples=["test.pdf"]), allow_empty_kb:...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/knowledge_base/summary/recreate_summary_vector_store_param.py
libs/python-sdk/open_chatcaht/types/knowledge_base/summary/recreate_summary_vector_store_param.py
from typing import Optional from pydantic import Field, BaseModel from open_chatcaht._constants import VS_TYPE, EMBEDDING_MODEL class RecreateSummaryVectorStoreParam(BaseModel): knowledge_base_name: str = Field(..., examples=["samples"]), allow_empty_kb: bool = Field(True), vs_type: str = Field(VS_TYPE)...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/knowledge_base/summary/__init__.py
libs/python-sdk/open_chatcaht/types/knowledge_base/summary/__init__.py
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/knowledge_base/doc/upload_temp_docs_param.py
libs/python-sdk/open_chatcaht/types/knowledge_base/doc/upload_temp_docs_param.py
from typing import Union, List from pydantic import BaseModel, Field from open_chatcaht._constants import CHUNK_SIZE, OVERLAP_SIZE, ZH_TITLE_ENHANCE class UploadTempDocsParam(BaseModel): prev_id: str = Field(None, description="前知识库ID"), chunk_size: int = Field(CHUNK_SIZE, description="知识库中单段文本最大长度"), chu...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/knowledge_base/doc/delete_kb_docs_param.py
libs/python-sdk/open_chatcaht/types/knowledge_base/doc/delete_kb_docs_param.py
from typing import List from pydantic import BaseModel, Field class DeleteKbDocsParam(BaseModel): knowledge_base_name: str = Field(..., examples=["samples"]), file_names: List[str] = Field(..., examples=[["file_name.md", "test.txt"]]), delete_content: bool = Field(False), not_refresh_vs_cache: bool =...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/knowledge_base/doc/upload_kb_docs_param.py
libs/python-sdk/open_chatcaht/types/knowledge_base/doc/upload_kb_docs_param.py
from pydantic import BaseModel, Field from open_chatcaht._constants import CHUNK_SIZE, OVERLAP_SIZE, ZH_TITLE_ENHANCE class UploadKbDocsParam(BaseModel): knowledge_base_name: str = Field( ..., description="知识库名称", examples=["samples"] ), override: bool = Field(False, description="覆盖已有文件"), to_...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/knowledge_base/doc/search_kb_docs_param.py
libs/python-sdk/open_chatcaht/types/knowledge_base/doc/search_kb_docs_param.py
from pydantic import BaseModel, Field from open_chatcaht._constants import VECTOR_SEARCH_TOP_K, SCORE_THRESHOLD class SearchKbDocsParam(BaseModel): query: str = Field(description="检索内容") knowledge_base_name: str = Field(description="知识库名称") top_k: int = Field(default=VECTOR_SEARCH_TOP_K, description="匹配向...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/knowledge_base/doc/download_kb_doc_param.py
libs/python-sdk/open_chatcaht/types/knowledge_base/doc/download_kb_doc_param.py
from typing import List from pydantic import BaseModel, Field class DownloadKbDocParam(BaseModel): knowledge_base_name: str = Field( ..., description="知识库名称", examples=["samples"] ), file_name: str = Field(..., description="文件名称", examples=["test.txt"]), preview: bool = Field(False, descripti...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/knowledge_base/doc/__init__.py
libs/python-sdk/open_chatcaht/types/knowledge_base/doc/__init__.py
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/knowledge_base/doc/search_temp_docs_param.py
libs/python-sdk/open_chatcaht/types/knowledge_base/doc/search_temp_docs_param.py
from pydantic import BaseModel, Field from open_chatcaht._constants import VECTOR_SEARCH_TOP_K, SCORE_THRESHOLD class SearchTempDocsParam(BaseModel): knowledge_id: str query: str top_k: int = Field(default=VECTOR_SEARCH_TOP_K, description="匹配向量数") score_threshold: float = Field(default=SCORE_THRESHOL...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/knowledge_base/doc/list_kb_docs_file_param.py
libs/python-sdk/open_chatcaht/types/knowledge_base/doc/list_kb_docs_file_param.py
from pydantic import BaseModel, Field class ListKbDocsFileParam(BaseModel): knowledge_base_name: str = Field(description="知识库名称")
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/server/__init__.py
libs/python-sdk/open_chatcaht/types/server/__init__.py
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/response/__init__.py
libs/python-sdk/open_chatcaht/types/response/__init__.py
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/python-sdk/open_chatcaht/types/response/base.py
libs/python-sdk/open_chatcaht/types/response/base.py
from typing import Any, List from pydantic import BaseModel, Field class BaseResponse(BaseModel): code: int = Field(200, description="API status code") msg: str = Field("success", description="API status message") data: Any = Field(None, description="API data") class Config: json_schema_extr...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/scripts/check_imports.py
libs/chatchat-server/scripts/check_imports.py
import random import string import sys import traceback from importlib.machinery import SourceFileLoader if __name__ == "__main__": files = sys.argv[1:] has_failure = False for file in files: try: module_name = "".join( random.choice(string.ascii_letters) for _ in range(...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/__init__.py
libs/chatchat-server/langchain_chatchat/__init__.py
from langchain_chatchat.agents import PlatformToolsRunnable from langchain_chatchat.chat_models import ChatPlatformAI __all__ = [ "ChatPlatformAI", "PlatformToolsRunnable", ]
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/chat_models/platform_tools_message.py
libs/chatchat-server/langchain_chatchat/chat_models/platform_tools_message.py
# -*- coding: utf-8 -*- import json from typing import Any, Dict, List, Literal, Union from langchain_core.messages import AIMessage from langchain_core.messages.base import ( BaseMessage, BaseMessageChunk, merge_content, ) from langchain_core.messages.tool import ( InvalidToolCall, ToolCall, T...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/chat_models/__init__.py
libs/chatchat-server/langchain_chatchat/chat_models/__init__.py
# -*- coding: utf-8 -*- from langchain_chatchat.chat_models.base import ChatPlatformAI __all__ = [ "ChatPlatformAI", ]
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/chat_models/base.py
libs/chatchat-server/langchain_chatchat/chat_models/base.py
# -*- coding: utf-8 -*- """OpenAI chat wrapper.""" from __future__ import annotations import logging import os from typing import ( TYPE_CHECKING, Any, AsyncIterator, Callable, Dict, Iterator, List, Literal, Mapping, Optional, Sequence, Tuple, Type, TypedDict, ...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agents/all_tools_agent.py
libs/chatchat-server/langchain_chatchat/agents/all_tools_agent.py
# -*- coding: utf-8 -*- from __future__ import annotations import asyncio import logging import time from typing import ( Any, Dict, List, Optional, Tuple, Union, Sequence ) from langchain.agents.agent import AgentExecutor from langchain.agents.tools import InvalidTool from langchain.utilities...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agents/__init__.py
libs/chatchat-server/langchain_chatchat/agents/__init__.py
# -*- coding: utf-8 -*- from langchain_chatchat.agents.platform_tools import PlatformToolsRunnable __all__ = ["PlatformToolsRunnable"]
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agents/platform_tools/schema.py
libs/chatchat-server/langchain_chatchat/agents/platform_tools/schema.py
# -*- coding: utf-8 -*- import json import uuid from abc import abstractmethod from enum import Enum, auto from numbers import Number from typing import Any, Dict, List, Optional, Union from openai import BaseModel from typing_extensions import ClassVar, Self from langchain_chatchat.utils.__init__ import PYDANTIC_V2 f...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agents/platform_tools/__init__.py
libs/chatchat-server/langchain_chatchat/agents/platform_tools/__init__.py
# -*- coding: utf-8 -*- from langchain_chatchat.agents.platform_tools.base import ( PlatformToolsRunnable, ) from langchain_chatchat.agents.platform_tools.schema import ( PlatformToolsAction, PlatformToolsActionToolEnd, PlatformToolsActionToolStart, PlatformToolsBaseComponent, PlatformToolsFinis...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agents/platform_tools/base.py
libs/chatchat-server/langchain_chatchat/agents/platform_tools/base.py
# -*- coding: utf-8 -*- import asyncio import json import logging from typing import ( Any, AsyncIterable, Awaitable, Callable, Dict, List, Optional, Sequence, Tuple, Type, Union, ) import os import sys from langchain import hub from langchain.agents import AgentExecutor from...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agents/structured_chat/platform_knowledge_bind.py
libs/chatchat-server/langchain_chatchat/agents/structured_chat/platform_knowledge_bind.py
# -*- coding: utf-8 -*- from datetime import datetime from typing import Sequence, Union, List, Dict, Any from langchain_core.language_models import BaseLanguageModel from langchain_core.prompts.chat import ChatPromptTemplate from langchain_core.runnables import Runnable, RunnablePassthrough from langchain_core.tools ...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agents/structured_chat/qwen_agent.py
libs/chatchat-server/langchain_chatchat/agents/structured_chat/qwen_agent.py
import json import logging import re from typing import Optional, Sequence, Union, List, Dict, Any from langchain.prompts.chat import ChatPromptTemplate from langchain.schema import AgentAction, AgentFinish, OutputParserException from langchain.schema.language_model import BaseLanguageModel from langchain.tools.base i...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agents/structured_chat/structured_chat_agent.py
libs/chatchat-server/langchain_chatchat/agents/structured_chat/structured_chat_agent.py
from langchain_chatchat.agents.output_parsers import PlatformToolsAgentOutputParser from typing import Optional, Sequence, Union, List, Dict, Any from langchain.prompts.chat import ChatPromptTemplate from langchain.schema.language_model import BaseLanguageModel from langchain.tools.base import BaseTool from langchain_...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agents/structured_chat/glm3_agent.py
libs/chatchat-server/langchain_chatchat/agents/structured_chat/glm3_agent.py
""" This file is a modified version for ChatGLM3-6B the original glm3_agent.py file from the langchain repo. """ import json import logging from typing import Optional, Sequence, Union, List, Dict, Any from langchain.prompts.chat import ChatPromptTemplate from langchain.schema import AgentAction, AgentFinish, OutputP...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agents/structured_chat/platform_tools_bind.py
libs/chatchat-server/langchain_chatchat/agents/structured_chat/platform_tools_bind.py
# -*- coding: utf-8 -*- from typing import Sequence, Union, List, Dict, Any from langchain.agents.agent import NextStepOutput from langchain_core.language_models import BaseLanguageModel from langchain_core.prompts.chat import ChatPromptTemplate from langchain_core.runnables import Runnable, RunnablePassthrough from l...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agents/structured_chat/__init__.py
libs/chatchat-server/langchain_chatchat/agents/structured_chat/__init__.py
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agents/format_scratchpad/all_tools.py
libs/chatchat-server/langchain_chatchat/agents/format_scratchpad/all_tools.py
# -*- coding: utf-8 -*- import json from typing import List, Sequence, Tuple, Union from langchain.agents.output_parsers.tools import ToolAgentAction from langchain_core.agents import AgentAction from langchain_core.messages import ( AIMessage, HumanMessage, BaseMessage, ToolMessage, ) from langchain_c...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agents/output_parsers/structured_chat_output_parsers.py
libs/chatchat-server/langchain_chatchat/agents/output_parsers/structured_chat_output_parsers.py
from __future__ import annotations import json import re from typing import Any, List, Sequence, Tuple, Union from langchain.agents.structured_chat.output_parser import StructuredChatOutputParser from langchain.schema import ( AgentAction, AgentFinish, AIMessage, HumanMessage, OutputParserExceptio...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agents/output_parsers/qwen_output_parsers.py
libs/chatchat-server/langchain_chatchat/agents/output_parsers/qwen_output_parsers.py
from __future__ import annotations import json import logging import re from functools import partial from operator import itemgetter from typing import Any, List, Sequence, Tuple, Union from langchain.agents.agent import AgentExecutor, RunnableAgent from langchain.agents.structured_chat.output_parser import Structur...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agents/output_parsers/platform_tools.py
libs/chatchat-server/langchain_chatchat/agents/output_parsers/platform_tools.py
# -*- coding: utf-8 -*- from typing import List, Union from langchain.agents.agent import MultiActionAgentOutputParser, AgentOutputParser from langchain.agents.output_parsers.tools import ToolAgentAction from langchain.agents.structured_chat.output_parser import StructuredChatOutputParser from langchain_core.agents im...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agents/output_parsers/glm3_output_parsers.py
libs/chatchat-server/langchain_chatchat/agents/output_parsers/glm3_output_parsers.py
""" This file is a modified version for ChatGLM3-6B the original glm3_agent.py file from the langchain repo. """ import json import logging from typing import Optional, Sequence, Union import re import langchain_core.messages import langchain_core.prompts from langchain.agents.agent import AgentOutputParser from langc...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agents/output_parsers/__init__.py
libs/chatchat-server/langchain_chatchat/agents/output_parsers/__init__.py
# -*- coding: utf-8 -*- """Parsing utils to go from string to AgentAction or Agent Finish. AgentAction means that an action should be taken. This contains the name of the tool to use, the input to pass to that tool, and a `log` variable (which contains a log of the agent's thinking). AgentFinish means that a response...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agents/output_parsers/platform_knowledge_output_parsers.py
libs/chatchat-server/langchain_chatchat/agents/output_parsers/platform_knowledge_output_parsers.py
from __future__ import annotations import json import logging import re from functools import partial from operator import itemgetter from typing import Any, List, Sequence, Tuple, Union from langchain.agents.agent import AgentExecutor, RunnableAgent from langchain.agents.output_parsers import ToolsAgentOutputParser ...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agents/output_parsers/tools_output/web_browser.py
libs/chatchat-server/langchain_chatchat/agents/output_parsers/tools_output/web_browser.py
# -*- coding: utf-8 -*- import logging from collections import deque from typing import Deque, List, Union from langchain.agents.output_parsers.tools import ToolAgentAction from langchain_core.exceptions import OutputParserException from langchain_core.messages import ( BaseMessage, ) from langchain_core.utils.jso...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agents/output_parsers/tools_output/tools.py
libs/chatchat-server/langchain_chatchat/agents/output_parsers/tools_output/tools.py
# -*- coding: utf-8 -*- import json import logging from collections import deque from json import JSONDecodeError from typing import List, Union from langchain_core.agents import AgentAction, AgentFinish from langchain_core.exceptions import OutputParserException from langchain_core.messages import ( AIMessage, ...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agents/output_parsers/tools_output/function.py
libs/chatchat-server/langchain_chatchat/agents/output_parsers/tools_output/function.py
# -*- coding: utf-8 -*- import logging from collections import deque from typing import Deque, List, Union from langchain.agents.output_parsers.tools import ToolAgentAction from langchain_core.exceptions import OutputParserException from langchain_core.messages import ( BaseMessage, ) from langchain_core.utils.jso...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agents/output_parsers/tools_output/code_interpreter.py
libs/chatchat-server/langchain_chatchat/agents/output_parsers/tools_output/code_interpreter.py
# -*- coding: utf-8 -*- import logging from collections import deque from typing import Deque, List, Union from langchain.agents.output_parsers.tools import ToolAgentAction from langchain_core.exceptions import OutputParserException from langchain_core.messages import ( BaseMessage, ) from langchain_core.utils.jso...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agents/output_parsers/tools_output/__init__.py
libs/chatchat-server/langchain_chatchat/agents/output_parsers/tools_output/__init__.py
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agents/output_parsers/tools_output/drawing_tool.py
libs/chatchat-server/langchain_chatchat/agents/output_parsers/tools_output/drawing_tool.py
# -*- coding: utf-8 -*- import logging from collections import deque from typing import Deque, List, Union from langchain.agents.output_parsers.tools import ToolAgentAction from langchain_core.exceptions import OutputParserException from langchain_core.messages import ( BaseMessage, ) from langchain_core.utils.jso...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agents/output_parsers/tools_output/base.py
libs/chatchat-server/langchain_chatchat/agents/output_parsers/tools_output/base.py
# -*- coding: utf-8 -*- from typing import Any, Dict, Optional from openai import BaseModel class PlatformToolsMessageToolCall(BaseModel): name: Optional[str] args: Optional[Dict[str, Any]] id: Optional[str] class PlatformToolsMessageToolCallChunk(BaseModel): name: Optional[str] args: Optional[...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agents/output_parsers/tools_output/_utils.py
libs/chatchat-server/langchain_chatchat/agents/output_parsers/tools_output/_utils.py
# -*- coding: utf-8 -*- # Function to find positions of object() instances def find_object_positions(log_chunk, obj): return [i for i, x in enumerate(log_chunk) if x == obj] # Function to concatenate segments based on object positions def concatenate_segments(log_chunk, positions): segments = [] start = 0...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agents/react/create_prompt_template.py
libs/chatchat-server/langchain_chatchat/agents/react/create_prompt_template.py
from __future__ import annotations import langchain_core.messages import langchain_core.prompts from langchain.prompts.chat import ChatPromptTemplate from chatchat.server.pydantic_v1 import Field, model_schema, typing def create_prompt_glm3_template(model_name: str, template: dict): SYSTEM_PROMPT = template.get...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/utils/history.py
libs/chatchat-server/langchain_chatchat/utils/history.py
# -*- coding: utf-8 -*- import logging from functools import lru_cache from typing import Any, Dict, List, Tuple, Union from langchain.prompts.chat import ChatMessagePromptTemplate from langchain_core.messages import ( AIMessage, AIMessageChunk, BaseMessage, BaseMessageChunk, ChatMessage, ChatM...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/utils/try_parse_json_object.py
libs/chatchat-server/langchain_chatchat/utils/try_parse_json_object.py
# Copyright (c) 2024 Microsoft Corporation. # Licensed under the MIT License """Utility functions for the OpenAI API.""" import json import logging import re import ast from json_repair import repair_json log = logging.getLogger(__name__) def try_parse_ast_to_json(function_string: str) -> tuple[str, dict]: ""...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/utils/__init__.py
libs/chatchat-server/langchain_chatchat/utils/__init__.py
# -*- coding: utf-8 -*- from langchain_chatchat.utils.history import History import pydantic PYDANTIC_V2 = pydantic.VERSION.startswith("2.") __all__ = ["History", "PYDANTIC_V2"]
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/callbacks/agent_callback_handler.py
libs/chatchat-server/langchain_chatchat/callbacks/agent_callback_handler.py
# -*- coding: utf-8 -*- from __future__ import annotations from typing import Generic, Iterable, TypeVar import asyncio import json from typing import List, Tuple, Any, Awaitable, Callable, Dict, Optional from uuid import UUID from enum import Enum from langchain_core.load import dumpd, dumps, load, loads from langch...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/callbacks/__init__.py
libs/chatchat-server/langchain_chatchat/callbacks/__init__.py
# -*- coding: utf-8 -*- """**Callback handlers** allow listening to events in LangChain. **Class hierarchy:** .. code-block:: BaseCallbackHandler --> <name>CallbackHandler # Example: AimCallbackHandler """ from langchain_chatchat.callbacks.agent_callback_handler import ( AgentExecutorAsyncIteratorCallbackHa...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/callbacks/core/protocol.py
libs/chatchat-server/langchain_chatchat/callbacks/core/protocol.py
from __future__ import annotations from typing import Generic, Iterable, TypeVar from pydantic import BaseModel, field_validator from datetime import datetime class FunctionCall(BaseModel): run_id: str call_id: str class FunctionCallStatus(BaseModel): requested_at: datetime | None = None responded_...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agent_toolkits/__init__.py
libs/chatchat-server/langchain_chatchat/agent_toolkits/__init__.py
# -*- coding: utf-8 -*- from langchain_chatchat.agent_toolkits.all_tools import AdapterAllTool, BaseToolOutput __all__ = ["BaseToolOutput", "AdapterAllTool"]
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agent_toolkits/mcp_kit/prompts.py
libs/chatchat-server/langchain_chatchat/agent_toolkits/mcp_kit/prompts.py
""" source https://github.com/langchain-ai/langchain-mcp-adapters """ from typing import Any, Optional from langchain_core.messages import AIMessage, HumanMessage from mcp import ClientSession from mcp.types import PromptMessage def convert_mcp_prompt_message_to_langchain_message( message: PromptMessage, ) ...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agent_toolkits/mcp_kit/client.py
libs/chatchat-server/langchain_chatchat/agent_toolkits/mcp_kit/client.py
""" source https://github.com/langchain-ai/langchain-mcp-adapters """ import os from contextlib import AsyncExitStack from types import TracebackType from typing import Any, Literal, Optional, TypedDict, cast from langchain_core.messages import AIMessage, HumanMessage from langchain_core.tools import BaseTool from mc...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agent_toolkits/mcp_kit/tools.py
libs/chatchat-server/langchain_chatchat/agent_toolkits/mcp_kit/tools.py
""" source https://github.com/langchain-ai/langchain-mcp-adapters """ from typing import Any, Type, Dict import inspect from mcp.server.fastmcp.utilities.func_metadata import ArgModelBase from langchain_core.tools import BaseTool, StructuredTool, ToolException from mcp import ClientSession from mcp.types import ( ...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agent_toolkits/all_tools/web_browser_tool.py
libs/chatchat-server/langchain_chatchat/agent_toolkits/all_tools/web_browser_tool.py
# -*- coding: utf-8 -*- import logging from dataclasses import dataclass from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union from langchain_core.agents import AgentAction from langchain_core.callbacks import ( AsyncCallbackManagerForChainRun, AsyncCallbackManagerForToolRun, CallbackMa...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agent_toolkits/all_tools/registry.py
libs/chatchat-server/langchain_chatchat/agent_toolkits/all_tools/registry.py
# -*- coding: utf-8 -*- from typing import Dict, Type from langchain_chatchat.agent_toolkits import AdapterAllTool from langchain_chatchat.agent_toolkits.all_tools.code_interpreter_tool import ( CodeInterpreterAdapterAllTool, ) from langchain_chatchat.agent_toolkits.all_tools.drawing_tool import ( DrawingAdapt...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agent_toolkits/all_tools/struct_type.py
libs/chatchat-server/langchain_chatchat/agent_toolkits/all_tools/struct_type.py
# -*- coding: utf-8 -*- """IndexStructType class.""" from enum import Enum class AdapterAllToolStructType(str, Enum): """ Attributes: DICT ("dict"): """ # TODO: refactor so these are properties on the base class CODE_INTERPRETER = "code_interpreter" DRAWING_TOOL = "drawing_tool" ...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agent_toolkits/all_tools/code_interpreter_tool.py
libs/chatchat-server/langchain_chatchat/agent_toolkits/all_tools/code_interpreter_tool.py
# -*- coding: utf-8 -*- import json import logging from dataclasses import dataclass from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union from langchain_core.agents import AgentAction from langchain_core.callbacks import ( AsyncCallbackManagerForChainRun, AsyncCallbackManagerForToolRun, ...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agent_toolkits/all_tools/__init__.py
libs/chatchat-server/langchain_chatchat/agent_toolkits/all_tools/__init__.py
# -*- coding: utf-8 -*- from langchain_chatchat.agent_toolkits.all_tools.tool import ( AdapterAllTool, BaseToolOutput, ) __all__ = ["BaseToolOutput", "AdapterAllTool"]
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agent_toolkits/all_tools/drawing_tool.py
libs/chatchat-server/langchain_chatchat/agent_toolkits/all_tools/drawing_tool.py
# -*- coding: utf-8 -*- import logging from dataclasses import dataclass from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union from langchain_core.agents import AgentAction from langchain_core.callbacks import ( AsyncCallbackManagerForChainRun, AsyncCallbackManagerForToolRun, CallbackMa...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/agent_toolkits/all_tools/tool.py
libs/chatchat-server/langchain_chatchat/agent_toolkits/all_tools/tool.py
# -*- coding: utf-8 -*- """platform adapter tool """ from __future__ import annotations import json import logging from abc import abstractmethod from dataclasses import dataclass from typing import ( Any, Dict, Generic, Optional, Tuple, TypeVar, Union, List, Callable ) from langc...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/embeddings/__init__.py
libs/chatchat-server/langchain_chatchat/embeddings/__init__.py
# -*- coding: utf-8 -*- __all__ = [ "ZhipuAIAIEmbeddings", ]
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/langchain_chatchat/embeddings/zhipuai.py
libs/chatchat-server/langchain_chatchat/embeddings/zhipuai.py
# -*- coding: utf-8 -*- from __future__ import annotations import logging import os import warnings from typing import ( Any, Dict, Iterable, List, Literal, Mapping, Optional, Sequence, Set, Tuple, Union, cast, ) from langchain_core.embeddings import Embeddings from lan...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/cli.py
libs/chatchat-server/chatchat/cli.py
import click from pathlib import Path import shutil import typing as t from chatchat.startup import main as startup_main from chatchat.init_database import main as kb_main, create_tables, folder2db from chatchat.settings import Settings from chatchat.utils import build_logger from chatchat.server.utils import get_defa...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/pydantic_settings_file.py
libs/chatchat-server/chatchat/pydantic_settings_file.py
from __future__ import annotations from functools import cached_property from io import StringIO import os from pathlib import Path import typing as t from memoization import cached, CachingAlgorithmFlag from pydantic import BaseModel, Field, ConfigDict, computed_field from pydantic_settings import BaseSettings, Pyda...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/webui.py
libs/chatchat-server/chatchat/webui.py
import sys import streamlit as st import streamlit_antd_components as sac from chatchat import __version__ from chatchat.server.utils import api_address from chatchat.webui_pages.dialogue.dialogue import dialogue_page from chatchat.webui_pages.kb_chat import kb_chat from chatchat.webui_pages.mcp import mcp_managemen...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/startup.py
libs/chatchat-server/chatchat/startup.py
import asyncio import logging import logging.config import multiprocessing as mp import os import sys from contextlib import asynccontextmanager from multiprocessing import Process # 设置numexpr最大线程数,默认为CPU核心数 try: import numexpr n_cores = numexpr.utils.detect_number_of_cores() os.environ["NUMEXPR_MAX_THREA...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/utils.py
libs/chatchat-server/chatchat/utils.py
from functools import partial import logging import os import time import typing as t import loguru import loguru._logger from memoization import cached, CachingAlgorithmFlag from chatchat.settings import Settings def _filter_logs(record: dict) -> bool: # hide debug logs if Settings.basic_settings.log_verbose=Fa...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/settings.py
libs/chatchat-server/chatchat/settings.py
from __future__ import annotations import os from pathlib import Path import sys import typing as t import nltk from chatchat import __version__ from chatchat.pydantic_settings_file import * # chatchat 数据目录,必须通过环境变量设置。如未设置则自动使用当前目录。 CHATCHAT_ROOT = Path(os.environ.get("CHATCHAT_ROOT", ".")).resolve() XF_MODELS_TY...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
true
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/__init__.py
libs/chatchat-server/chatchat/__init__.py
__version__ = "0.3.1.3"
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/init_database.py
libs/chatchat-server/chatchat/init_database.py
# Description: 初始化数据库,包括创建表、导入数据、更新向量空间等操作 from datetime import datetime import multiprocessing as mp import sys import time from typing import Dict import click from chatchat.settings import Settings from chatchat.server.knowledge_base.migrate import ( create_tables, folder2db, import_from_db, prune_...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/webui_pages/utils.py
libs/chatchat-server/chatchat/webui_pages/utils.py
# 该文件封装了对api.py的请求,可以被不同的webui使用 # 通过ApiRequest和AsyncApiRequest支持同步/异步调用 import base64 import contextlib import json import logging import os from io import BytesIO from pathlib import Path from typing import * import httpx from chatchat.settings import Settings from chatchat.server.utils import api_address, get_htt...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/webui_pages/kb_chat.py
libs/chatchat-server/chatchat/webui_pages/kb_chat.py
from datetime import datetime import uuid from typing import List, Dict import openai import streamlit as st import streamlit_antd_components as sac from streamlit_chatbox import * from streamlit_extras.bottom_container import bottom from chatchat.settings import Settings from chatchat.server.knowledge_base.utils imp...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/webui_pages/__init__.py
libs/chatchat-server/chatchat/webui_pages/__init__.py
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/webui_pages/model_config/model_config.py
libs/chatchat-server/chatchat/webui_pages/model_config/model_config.py
import streamlit as st from chatchat.webui_pages.utils import * def model_config_page(api: ApiRequest): pass
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/webui_pages/model_config/__init__.py
libs/chatchat-server/chatchat/webui_pages/model_config/__init__.py
from .model_config import model_config_page
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/webui_pages/dialogue/dialogue.py
libs/chatchat-server/chatchat/webui_pages/dialogue/dialogue.py
import base64 import hashlib import io import os import uuid from datetime import datetime from PIL import Image as PILImage from typing import Dict, List from urllib.parse import urlencode # from audio_recorder_streamlit import audio_recorder import openai import streamlit as st import streamlit_antd_components as sa...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/webui_pages/dialogue/utils.py
libs/chatchat-server/chatchat/webui_pages/dialogue/utils.py
import base64 import os from io import BytesIO import streamlit as st def encode_file_to_base64(file): # 将文件内容转换为 Base64 编码 buffer = BytesIO() buffer.write(file.read()) return base64.b64encode(buffer.getvalue()).decode() def process_files(files): result = {"videos": [], "images": [], "audios": ...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/webui_pages/dialogue/__init__.py
libs/chatchat-server/chatchat/webui_pages/dialogue/__init__.py
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/webui_pages/knowledge_base/knowledge_base.py
libs/chatchat-server/chatchat/webui_pages/knowledge_base/knowledge_base.py
import os import time from typing import Dict, Literal, Tuple import pandas as pd import streamlit as st import streamlit_antd_components as sac from st_aggrid import AgGrid, JsCode from st_aggrid.grid_options_builder import GridOptionsBuilder from streamlit_antd_components.utils import ParseItems from chatchat.setti...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/webui_pages/knowledge_base/__init__.py
libs/chatchat-server/chatchat/webui_pages/knowledge_base/__init__.py
from .knowledge_base import knowledge_base_page
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/webui_pages/mcp/dialogue.py
libs/chatchat-server/chatchat/webui_pages/mcp/dialogue.py
import streamlit as st import streamlit_antd_components as sac from chatchat.webui_pages.utils import * from chatchat.settings import Settings import requests import json def mcp_management_page(api: ApiRequest, is_lite: bool = False): """ MCP管理页面 - 连接器设置界面 采用超感官极简主义×液态数字形态主义设计风格 使用Streamlit语法实现 ...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
true
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/webui_pages/mcp/__init__.py
libs/chatchat-server/chatchat/webui_pages/mcp/__init__.py
""" MCP管理页面模块 """ from .dialogue import mcp_management_page __all__ = ["mcp_management_page"]
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/server/llm_api_shutdown.py
libs/chatchat-server/chatchat/server/llm_api_shutdown.py
""" 调用示例: python llm_api_shutdown.py --serve all 可选"all","controller","model_worker","openai_api_server", all表示停止所有服务 """ import os import sys sys.path.append(os.path.dirname(os.path.dirname(__file__))) import argparse import subprocess parser = argparse.ArgumentParser() parser.add_argument( "--serve", choic...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/server/llm_api_stale.py
libs/chatchat-server/chatchat/server/llm_api_stale.py
""" 调用示例: python llm_api_stale.py --model-path-address THUDM/chatglm2-6b@localhost@7650 THUDM/chatglm2-6b-32k@localhost@7651 其他fastchat.server.controller/worker/openai_api_server参数可按照fastchat文档调用 但少数非关键参数如--worker-address,--allowed-origins,--allowed-methods,--allowed-headers不支持 """ import os import sys sys.path.appen...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/server/pydantic_v2.py
libs/chatchat-server/chatchat/server/pydantic_v2.py
from pydantic import * from pydantic import typing from pydantic.fields import FieldInfo
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/server/localai_embeddings.py
libs/chatchat-server/chatchat/server/localai_embeddings.py
from __future__ import annotations import logging import warnings from typing import ( Any, Callable, Dict, List, Literal, Optional, Sequence, Set, Tuple, Union, ) from langchain_community.utils.openai import is_openai_v1 from langchain_core.embeddings import Embeddings from la...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/server/webui_allinone_stale.py
libs/chatchat-server/chatchat/server/webui_allinone_stale.py
"""Usage 加载本地模型: python webui_allinone.py 调用远程api服务: python webui_allinone.py --use-remote-api 后台运行webui服务: python webui_allinone.py --nohup 加载多个非默认模型: python webui_allinone.py --model-path-address model1@host1@port1 model2@host2@port2 多卡启动: python webui_alline.py --model-path-address model@host@port --num-gpus 2 ...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/server/utils.py
libs/chatchat-server/chatchat/server/utils.py
import asyncio import multiprocessing as mp import os import socket import sys from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor, as_completed from pathlib import Path from urllib.parse import urlparse from typing import ( Any, Awaitable, Callable, Dict, Generator, List, ...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
true
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/server/pydantic_v1.py
libs/chatchat-server/chatchat/server/pydantic_v1.py
from langchain_core.pydantic_v1 import * from pydantic.v1.fields import FieldInfo from pydantic.v1.schema import model_schema from pydantic.v1.typing import typing
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/server/__init__.py
libs/chatchat-server/chatchat/server/__init__.py
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/server/api_allinone_stale.py
libs/chatchat-server/chatchat/server/api_allinone_stale.py
"""Usage 调用默认模型: python server/api_allinone.py 加载多个非默认模型: python server/api_allinone.py --model-path-address model1@host1@port1 model2@host2@port2 多卡启动: python server/api_allinone.py --model-path-address model@host@port --num-gpus 2 --gpus 0,1 --max-gpu-memory 10GiB """ import os import sys sys.path.append(os.path...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/server/chat/file_chat.py
libs/chatchat-server/chatchat/server/chat/file_chat.py
import asyncio import json import logging import os from typing import AsyncIterable, List, Optional import nest_asyncio from fastapi import Body, File, Form, UploadFile from langchain.callbacks import AsyncIteratorCallbackHandler from langchain.chains import LLMChain from langchain.prompts.chat import ChatPromptTempl...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false
chatchat-space/Langchain-Chatchat
https://github.com/chatchat-space/Langchain-Chatchat/blob/49165d6af4438aa7e8a1f71ce276db55f4405151/libs/chatchat-server/chatchat/server/chat/human_message_event.py
libs/chatchat-server/chatchat/server/chat/human_message_event.py
from fastapi import Body from chatchat.utils import build_logger from chatchat.server.db.repository import get_human_message_event_by_id, update_human_message_event, \ add_human_message_event_to_db, list_human_message_event from chatchat.server.utils import BaseResponse logger = build_logger() def function_call...
python
Apache-2.0
49165d6af4438aa7e8a1f71ce276db55f4405151
2026-01-04T14:41:43.908377Z
false