mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-10-29 16:59:47 +00:00
Remove unecessary literal_eval (#4570)
This commit is contained in:
parent
e0895f0ac2
commit
ee7b25b8cf
@ -2,6 +2,7 @@ from typing import Optional, List, Union, Tuple, Dict, Iterator, Any
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import ast
|
import ast
|
||||||
|
import json
|
||||||
from abc import ABC
|
from abc import ABC
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
|
||||||
@ -21,7 +22,7 @@ from haystack.schema import Document, MultiLabel
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
PROMPT_TEMPLATE_ALLOWED_FUNCTIONS = ast.literal_eval(
|
PROMPT_TEMPLATE_ALLOWED_FUNCTIONS = json.loads(
|
||||||
os.environ.get(HAYSTACK_PROMPT_TEMPLATE_ALLOWED_FUNCTIONS, '["join", "to_strings", "replace", "enumerate", "str"]')
|
os.environ.get(HAYSTACK_PROMPT_TEMPLATE_ALLOWED_FUNCTIONS, '["join", "to_strings", "replace", "enumerate", "str"]')
|
||||||
)
|
)
|
||||||
PROMPT_TEMPLATE_SPECIAL_CHAR_ALIAS = {"new_line": "\n", "tab": "\t", "double_quote": '"', "carriage_return": "\r"}
|
PROMPT_TEMPLATE_SPECIAL_CHAR_ALIAS = {"new_line": "\n", "tab": "\t", "double_quote": '"', "carriage_return": "\r"}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user