Skip to content

Commit 66a9023

Browse files
committed
Merge branch 'develop'
Signed-off-by: Yam Marcovitz <[email protected]>
2 parents 03020dd + eb0f92a commit 66a9023

File tree

6 files changed

+48
-120
lines changed

6 files changed

+48
-120
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to Parlant will be documented here.
55
## [Unreleased]
66
TBD
77

8+
## [2.1.1] - 2025-04-30
9+
10+
### Fixed
11+
- Fixed rendering relationships in CLI
12+
- Fixed parlant client using old imports from python client SDK
13+
814
## [2.1.0] - 2025-04-29
915

1016
### Added

poetry.lock

Lines changed: 14 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "parlant"
3-
version = "2.1.0"
3+
version = "2.1.1"
44
license = "Apache-2.0"
55
description = ""
66
authors = ["Yam Marcovitz <[email protected]>", "Dor Zohar <[email protected]>"]
@@ -36,7 +36,7 @@ networkx = { extras = ["default"], version = "^3.3" }
3636
openai = "^1.45.0"
3737
openapi3-parser = "1.1.21"
3838
opentelemetry-exporter-otlp-proto-grpc = "1.27.0"
39-
parlant-client = "^1.1.0"
39+
parlant-client = { git = "https://github.com/emcie-co/parlant-client-python.git", tag = "develop.1745947308" }
4040
python = "^3.10"
4141
python-dateutil = "^2.8.2"
4242
python-dotenv = "^1.0.1"

src/parlant/bin/client.py

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
EventInspectionResult,
4747
Guideline,
4848
Relationship,
49-
GuidelineRelationshipKindDto,
49+
RelationshipKindDto,
5050
GuidelineToolAssociation,
5151
GuidelineToolAssociationUpdateParams,
5252
GuidelineTagsUpdateParams,
@@ -439,7 +439,7 @@ def create_relationship(
439439
ctx: click.Context,
440440
source: str,
441441
target: str,
442-
kind: GuidelineRelationshipKindDto,
442+
kind: RelationshipKindDto,
443443
) -> Relationship:
444444
client = cast(ParlantClient, ctx.obj.client)
445445

@@ -460,7 +460,7 @@ def remove_relationship(
460460
id: Optional[str],
461461
source_id: Optional[str],
462462
target_id: Optional[str],
463-
kind: Optional[GuidelineRelationshipKindDto],
463+
kind: Optional[RelationshipKindDto],
464464
) -> str:
465465
client = cast(ParlantClient, ctx.obj.client)
466466

@@ -506,7 +506,7 @@ def list_relationships(
506506
ctx: click.Context,
507507
guideline_id: Optional[str],
508508
tag: Optional[str],
509-
kind: GuidelineRelationshipKindDto,
509+
kind: RelationshipKindDto,
510510
indirect: bool,
511511
) -> list[Relationship]:
512512
client = cast(ParlantClient, ctx.obj.client)
@@ -1633,8 +1633,17 @@ def to_indirect_relationship_item(rel: Relationship) -> OrderedDict[str, str]:
16331633
return OrderedDict(result)
16341634

16351635
if relationships:
1636-
direct = [r for r in relationships if not r.indirect]
1637-
indirect = [r for r in relationships if r.indirect]
1636+
direct = [
1637+
r
1638+
for r in relationships
1639+
if entity in (r.source_guideline, r.target_guideline, r.source_tag, r.target_tag)
1640+
]
1641+
indirect = [
1642+
r
1643+
for r in relationships
1644+
if entity
1645+
not in (r.source_guideline, r.target_guideline, r.source_tag, r.target_tag)
1646+
]
16381647

16391648
if direct:
16401649
rich.print("\nDirect Relationships:")
@@ -1765,7 +1774,7 @@ def create_relationship(
17651774
ctx: click.Context,
17661775
source_id: str,
17671776
target_id: str,
1768-
kind: GuidelineRelationshipKindDto,
1777+
kind: RelationshipKindDto,
17691778
) -> None:
17701779
try:
17711780
relationship = Actions.create_relationship(
@@ -1786,7 +1795,7 @@ def remove_relationship(
17861795
id: Optional[str],
17871796
source_id: Optional[str],
17881797
target_id: Optional[str],
1789-
kind: Optional[GuidelineRelationshipKindDto],
1798+
kind: Optional[RelationshipKindDto],
17901799
) -> None:
17911800
try:
17921801
relationship_id = Actions.remove_relationship(
@@ -1807,7 +1816,7 @@ def list_relationships(
18071816
ctx: click.Context,
18081817
guideline_id: Optional[str],
18091818
tag: Optional[str],
1810-
kind: GuidelineRelationshipKindDto,
1819+
kind: RelationshipKindDto,
18111820
indirect: bool,
18121821
) -> None:
18131822
try:
@@ -3166,7 +3175,7 @@ def relationship_create(
31663175
ctx: click.Context,
31673176
source: str,
31683177
target: str,
3169-
kind: GuidelineRelationshipKindDto,
3178+
kind: RelationshipKindDto,
31703179
) -> None:
31713180
Interface.create_relationship(
31723181
ctx=ctx,
@@ -3206,7 +3215,7 @@ def relationship_delete(
32063215
id: Optional[str],
32073216
source: Optional[str],
32083217
target: Optional[str],
3209-
kind: Optional[GuidelineRelationshipKindDto],
3218+
kind: Optional[RelationshipKindDto],
32103219
) -> None:
32113220
if id:
32123221
if source or target or kind:
@@ -3256,7 +3265,7 @@ def relationship_list(
32563265
ctx: click.Context,
32573266
guideline_id: Optional[str],
32583267
tag: Optional[str],
3259-
kind: GuidelineRelationshipKindDto,
3268+
kind: RelationshipKindDto,
32603269
indirect: bool,
32613270
) -> None:
32623271
if guideline_id and tag:

src/parlant/core/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
VERSION = "2.1.0"
15+
VERSION = "2.1.1"

tests/e2e/test_client_cli_via_api.py

Lines changed: 4 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -518,8 +518,10 @@ async def test_that_guidelines_can_be_entailed(
518518
)
519519

520520
process = await run_cli(
521-
"guideline",
522-
"entail",
521+
"relationship",
522+
"create",
523+
"--kind",
524+
"entailment",
523525
"--source",
524526
first_guideline["id"],
525527
"--target",
@@ -565,76 +567,6 @@ async def test_that_a_guideline_can_be_deleted(
565567
assert len(guidelines) == 0
566568

567569

568-
async def test_that_a_connection_can_be_deleted(
569-
context: ContextOfTest,
570-
) -> None:
571-
with run_server(context):
572-
while not is_server_responsive(SERVER_PORT):
573-
pass
574-
575-
async with httpx.AsyncClient(
576-
follow_redirects=True,
577-
timeout=httpx.Timeout(30),
578-
) as client:
579-
guidelines_response = await client.post(
580-
f"{SERVER_ADDRESS}/guidelines/",
581-
json={
582-
"condition": "the customer greets you",
583-
"action": "greet them back with 'Hello'",
584-
},
585-
)
586-
guidelines_response.raise_for_status()
587-
588-
first = guidelines_response.json()
589-
590-
guidelines_response = await client.post(
591-
f"{SERVER_ADDRESS}/guidelines/",
592-
json={
593-
"condition": "greeting the customer",
594-
"action": "ask for his health condition",
595-
},
596-
)
597-
guidelines_response.raise_for_status()
598-
599-
second = guidelines_response.json()
600-
601-
first = first["id"]
602-
second = second["id"]
603-
604-
connection_response = await client.patch(
605-
f"{SERVER_ADDRESS}/guidelines/{first}",
606-
json={
607-
"connections": {
608-
"add": [
609-
{
610-
"source": first,
611-
"target": second,
612-
}
613-
],
614-
},
615-
},
616-
)
617-
connection_response.raise_for_status()
618-
619-
process = await run_cli(
620-
"guideline",
621-
"disentail",
622-
"--source",
623-
first,
624-
"--target",
625-
second,
626-
stdout=asyncio.subprocess.PIPE,
627-
stderr=asyncio.subprocess.PIPE,
628-
)
629-
stdout_view, stderr_view = await process.communicate()
630-
output_view = stdout_view.decode() + stderr_view.decode()
631-
assert "Traceback (most recent call last):" not in output_view
632-
assert process.returncode == os.EX_OK
633-
634-
guideline = await context.api.read_guideline(guideline_id=first)
635-
assert len(guideline["connections"]) == 0
636-
637-
638570
async def test_that_a_tool_can_be_enabled_for_a_guideline(
639571
context: ContextOfTest,
640572
) -> None:
@@ -1657,29 +1589,6 @@ async def test_that_tags_can_be_listed(context: ContextOfTest) -> None:
16571589
assert "SecondTag" in output
16581590

16591591

1660-
async def test_that_a_tag_can_be_viewed(context: ContextOfTest) -> None:
1661-
with run_server(context):
1662-
while not is_server_responsive(SERVER_PORT):
1663-
pass
1664-
1665-
tag_id = (await context.api.create_tag("TestViewTag"))["id"]
1666-
1667-
process = await run_cli(
1668-
"tag",
1669-
"view",
1670-
"--id",
1671-
tag_id,
1672-
stdout=asyncio.subprocess.PIPE,
1673-
stderr=asyncio.subprocess.PIPE,
1674-
)
1675-
stdout, stderr = await process.communicate()
1676-
output = stdout.decode() + stderr.decode()
1677-
assert process.returncode == os.EX_OK
1678-
1679-
assert "TestViewTag" in output
1680-
assert tag_id in output
1681-
1682-
16831592
async def test_that_a_tag_can_be_updated(context: ContextOfTest) -> None:
16841593
with run_server(context):
16851594
while not is_server_responsive(SERVER_PORT):

0 commit comments

Comments
 (0)