nonebot-plugin-githubmodels 0.1.4__tar.gz → 0.1.5__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nonebot-plugin-githubmodels
3
- Version: 0.1.4
3
+ Version: 0.1.5
4
4
  Summary: API 调用 GitHub Models 的 GPT-4o 模型
5
5
  Home-page: https://github.com/lyqgzbl/nonebot-plugin-githubmodels
6
6
  License: MIT
@@ -11,7 +11,7 @@ plugin_config = get_plugin_config(Config)
11
11
 
12
12
  TOKEN = plugin_config.github_token
13
13
  MODEL_NAME = plugin_config.ai_model_name
14
- MAX_CONTEXT_LENGTH = plugin_config.MAX_CONTEXT_LENGTH
14
+ MAX_CONTEXT_LENGTH = plugin_config.max_context_length
15
15
 
16
16
  endpoint = "https://models.inference.ai.azure.com"
17
17
  client = AsyncOpenAI(
@@ -0,0 +1,7 @@
1
+ from typing import Optional
2
+ from pydantic import BaseModel, Field
3
+
4
+ class Config(BaseModel):
5
+ github_token: Optional[str] = None
6
+ ai_model_name: str = "gpt-4o-mini"
7
+ max_context_length: int = Field(20, gt=0)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "nonebot-plugin-githubmodels"
3
- version = "0.1.4"
3
+ version = "0.1.5"
4
4
  description = "API 调用 GitHub Models 的 GPT-4o 模型"
5
5
  authors = ["lyqgzbl <admin@lyqgzbl.com>"]
6
6
  license = "MIT"
@@ -1,14 +0,0 @@
1
- from typing import Optional
2
- from pydantic import BaseModel, field_validator
3
-
4
- class Config(BaseModel):
5
- github_token: Optional[str] = None
6
- ai_model_name: str = "gpt-4o-mini"
7
- MAX_CONTEXT_LENGTH: int = 20
8
-
9
- @field_validator("MAX_CONTEXT_LENGTH")
10
- @classmethod
11
- def check_max_context_length(cls, v: int) -> int:
12
- if v > 0:
13
- return v
14
- raise ValueError("MAX_CONTEXT_LENGTH must be greater than 0")