mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-26 16:43:35 +00:00
Use salt instead of datetime (#8653)
If you want to kick off two runs at the same time it'll cause errors. Use a uuid instead
This commit is contained in:
parent
7ea2b08d1f
commit
206901fa01
@ -6,7 +6,7 @@ import asyncio
|
|||||||
import functools
|
import functools
|
||||||
import itertools
|
import itertools
|
||||||
import logging
|
import logging
|
||||||
from datetime import datetime
|
import uuid
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from typing import (
|
from typing import (
|
||||||
Any,
|
Any,
|
||||||
@ -234,12 +234,12 @@ def _get_project_name(
|
|||||||
"""
|
"""
|
||||||
if project_name is not None:
|
if project_name is not None:
|
||||||
return project_name
|
return project_name
|
||||||
current_time = datetime.now().strftime("%Y-%m-%d-%H-%M-%S")
|
|
||||||
if isinstance(llm_or_chain_factory, BaseLanguageModel):
|
if isinstance(llm_or_chain_factory, BaseLanguageModel):
|
||||||
model_name = llm_or_chain_factory.__class__.__name__
|
model_name = llm_or_chain_factory.__class__.__name__
|
||||||
else:
|
else:
|
||||||
model_name = llm_or_chain_factory().__class__.__name__
|
model_name = llm_or_chain_factory().__class__.__name__
|
||||||
return f"{current_time}-{model_name}"
|
hex = uuid.uuid4().hex
|
||||||
|
return f"{hex}-{model_name}"
|
||||||
|
|
||||||
|
|
||||||
## Shared Validation Utilities
|
## Shared Validation Utilities
|
||||||
|
Loading…
Reference in New Issue
Block a user