mirror of
https://github.com/dongdongunique/EvoSynth.git
synced 2026-09-02 00:00:46 +02:00
Add context length protection in access_runcontext_history
- Add loop mechanism to reduce history_depth if output exceeds max_total_chars - Prevents context overflow when accessing run context history - Prints reduction info and returns depth_reduced field in result
This commit is contained in:
@@ -2,7 +2,6 @@ from ..base_model import BaseModel
|
||||
from ...core.registry import model_registry
|
||||
import openai
|
||||
import time
|
||||
import torch
|
||||
import base64
|
||||
from io import BytesIO
|
||||
from typing import Any, Optional, List, Dict, Union
|
||||
@@ -265,6 +264,7 @@ class OpenAIModel(BaseModel):
|
||||
A list of floats representing the embedding vector
|
||||
"""
|
||||
try:
|
||||
import torch
|
||||
clean_text = text_input.replace("\n", " ")
|
||||
|
||||
# Use specified model or default embedding model
|
||||
|
||||
Reference in New Issue
Block a user