Skip to content

Commit

Permalink
Merge branch 'master' into fb-dia-1715
Browse files Browse the repository at this point in the history
  • Loading branch information
hakan458 authored Jan 17, 2025
2 parents fed0514 + 92c3169 commit a9e04bd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
5 changes: 4 additions & 1 deletion adala/utils/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ class TemplateChunks(TypedDict):
start: int
end: int
type: str


match_fields_regex = re.compile(r"(?<!\{)\{([a-zA-Z0-9_]+)\}(?!})")


def parse_template(string, include_texts=True) -> List[TemplateChunks]:
Expand All @@ -135,7 +138,7 @@ def parse_template(string, include_texts=True) -> List[TemplateChunks]:
chunks: List[TemplateChunks] = []
last_index = 0

for match in re.finditer(r"(?<!\{)\{(.*?)\}(?!})", string):
for match in match_fields_regex.finditer(string):
# for match in re.finditer(r'\{(.*?)\}', string):
# Text before field
if last_index < match.start() and include_texts:
Expand Down
13 changes: 9 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
[tool.poetry]
[project]
name = "adala"
version = "0.0.4dev"
description = "Adala: Autonomous Data Labeling Agent"
authors = [
"HumanSignal <hello@humansignal.com>"
{ name = "HumanSignal", email = "support@humansignal.com" },
]
readme = "README.md"
license = "Apache-2.0"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
]
requires-python = ">=3.9,<3.13"

[project.urls]
Repository = "https://github.com/HumanSignal/Adala"

[tool.poetry.dependencies]
python = ">=3.9,<3.13"
Expand Down Expand Up @@ -68,7 +74,6 @@ mockafka-py = "^0.1.57"
[tool.poetry.scripts]
adala = "adala.cli:main"


[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
Expand Down

0 comments on commit a9e04bd

Please sign in to comment.