Compare commits
2 Commits
71fd688227
...
43ddd8665c
| Author | SHA1 | Date | |
|---|---|---|---|
|
43ddd8665c
|
|||
|
1e1f92461a
|
@@ -10,14 +10,14 @@ import hashlib
|
|||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
from typing import Any, Literal
|
from typing import Any, Literal
|
||||||
from cucyuqing.pg import pool, get_cur
|
from cucyuqing.pg import pool, get_cur
|
||||||
from cucyuqing.config import OPENAI_API_KEY, OPENAI_BASE_URL
|
from cucyuqing.config import OPENAI_EMBEDDING_API_KEY, OPENAI_EMBEDDING_BASE_URL
|
||||||
from cucyuqing.utils import print
|
from cucyuqing.utils import print
|
||||||
|
|
||||||
EmbeddingModel = Literal["acge-large-zh", "text-embedding-3-small"]
|
EmbeddingModel = Literal["acge-large-zh", "text-embedding-3-small"]
|
||||||
|
|
||||||
embedding_client = openai.AsyncOpenAI(
|
embedding_client = openai.AsyncOpenAI(
|
||||||
api_key=OPENAI_API_KEY,
|
api_key=OPENAI_EMBEDDING_API_KEY,
|
||||||
base_url=OPENAI_BASE_URL,
|
base_url=OPENAI_EMBEDDING_BASE_URL,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class ESInterval(pydantic.BaseModel):
|
|||||||
|
|
||||||
|
|
||||||
def format_datetime(dt: datetime.datetime) -> str:
|
def format_datetime(dt: datetime.datetime) -> str:
|
||||||
return dt.strftime("%Y%m%d%H")
|
return dt.strftime("%Y%m%d%H%M%S")
|
||||||
|
|
||||||
|
|
||||||
def parse_unixtime(unixtime: int) -> datetime.datetime:
|
def parse_unixtime(unixtime: int) -> datetime.datetime:
|
||||||
|
|||||||
Reference in New Issue
Block a user