botrun-hatch 5.3.141__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- botrun_hatch-5.3.141/PKG-INFO +16 -0
- botrun_hatch-5.3.141/README.md +1 -0
- botrun_hatch-5.3.141/botrun_hatch/__init__.py +0 -0
- botrun_hatch-5.3.141/botrun_hatch/models/__init__.py +0 -0
- botrun_hatch-5.3.141/botrun_hatch/models/hatch.py +26 -0
- botrun_hatch-5.3.141/botrun_hatch/models/upload_file.py +24 -0
- botrun_hatch-5.3.141/botrun_hatch/models/user_setting.py +9 -0
- botrun_hatch-5.3.141/pyproject.toml +18 -0
@@ -0,0 +1,16 @@
|
|
1
|
+
Metadata-Version: 2.3
|
2
|
+
Name: botrun-hatch
|
3
|
+
Version: 5.3.141
|
4
|
+
Summary:
|
5
|
+
Author: sebastian-hsu
|
6
|
+
Author-email: sebastian.hsu@gmail.com
|
7
|
+
Requires-Python: >=3.11,<4.0
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
9
|
+
Classifier: Programming Language :: Python :: 3.11
|
10
|
+
Classifier: Programming Language :: Python :: 3.12
|
11
|
+
Classifier: Programming Language :: Python :: 3.13
|
12
|
+
Requires-Dist: pydantic-settings (>=2.5.2,<3.0.0)
|
13
|
+
Description-Content-Type: text/markdown
|
14
|
+
|
15
|
+
# 波孵
|
16
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
# 波孵
|
File without changes
|
File without changes
|
@@ -0,0 +1,26 @@
|
|
1
|
+
from typing import List
|
2
|
+
from pydantic import BaseModel, Field
|
3
|
+
|
4
|
+
from botrun_hatch.models.upload_file import UploadFile
|
5
|
+
|
6
|
+
|
7
|
+
class Hatch(BaseModel):
|
8
|
+
"""
|
9
|
+
@user_prompt_prefix: 每次的 user prompt 前面都會加入這段文字
|
10
|
+
@search_domain_filter: 搜尋的網域限制, 目前只有針對 perplexit 有效, 範例:["*.gov.tw", "-*.gov.cn"]
|
11
|
+
@files: 上傳的檔案,這裡存的是 metadata,真正的檔案會存在 gcs,以 user_id/id 為 key來存,目前只會存extract後純文字的內容
|
12
|
+
"""
|
13
|
+
|
14
|
+
user_id: str
|
15
|
+
id: str
|
16
|
+
model_name: str = ""
|
17
|
+
prompt_template: str
|
18
|
+
user_prompt_prefix: str = ""
|
19
|
+
name: str = "" # 将 name 设为可选字段,默认为空字符串
|
20
|
+
is_default: bool = False
|
21
|
+
enable_search: bool = False
|
22
|
+
related_question_prompt: str = ""
|
23
|
+
search_vendor: str = "perplexity"
|
24
|
+
search_domain_filter: List[str] = []
|
25
|
+
files: List[UploadFile] = []
|
26
|
+
enable_agent: bool = False
|
@@ -0,0 +1,24 @@
|
|
1
|
+
from datetime import datetime, timedelta
|
2
|
+
from pydantic import BaseModel, Field
|
3
|
+
|
4
|
+
|
5
|
+
class UploadFile(BaseModel):
|
6
|
+
id: str = Field(..., description="File ID")
|
7
|
+
name: str = Field(..., description="File name")
|
8
|
+
updated_at: str = Field(..., description="Last update time in ISO format")
|
9
|
+
size: int = Field(..., description="File size in bytes")
|
10
|
+
|
11
|
+
@property
|
12
|
+
def formatted_size(self) -> str:
|
13
|
+
if self.size < 1024:
|
14
|
+
return f"{self.size} B"
|
15
|
+
elif self.size < 1024 * 1024:
|
16
|
+
return f"{self.size / 1024:.1f} KB"
|
17
|
+
elif self.size < 1024 * 1024 * 1024:
|
18
|
+
return f"{self.size / (1024 * 1024):.1f} MB"
|
19
|
+
return f"{self.size / (1024 * 1024 * 1024):.1f} GB"
|
20
|
+
|
21
|
+
@property
|
22
|
+
def formatted_date(self) -> str:
|
23
|
+
date = datetime.fromisoformat(self.updated_at)
|
24
|
+
return date.strftime("%Y-%m-%d")
|
@@ -0,0 +1,18 @@
|
|
1
|
+
[tool.poetry]
|
2
|
+
name = "botrun-hatch"
|
3
|
+
version = "5.3.141"
|
4
|
+
description = ""
|
5
|
+
authors = ["sebastian-hsu <sebastian.hsu@gmail.com>"]
|
6
|
+
readme = "README.md"
|
7
|
+
|
8
|
+
[tool.poetry.dependencies]
|
9
|
+
python = "^3.11"
|
10
|
+
pydantic-settings = "^2.5.2"
|
11
|
+
|
12
|
+
[tool.poetry.dev-dependencies]
|
13
|
+
build = "^1.2.2.post1"
|
14
|
+
twine = "^5.1.1"
|
15
|
+
|
16
|
+
[build-system]
|
17
|
+
requires = ["poetry-core"]
|
18
|
+
build-backend = "poetry.core.masonry.api"
|