flock-core 0.4.0b7__py3-none-any.whl → 0.4.0b9__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of flock-core might be problematic. Click here for more details.

@@ -196,7 +196,7 @@ class BatchProcessor:
196
196
  run_desc = f"Batch item {index + 1}"
197
197
  logger.debug(f"{run_desc} started.")
198
198
  try:
199
- result = await self.run_async(
199
+ result = await self.flock.run_async(
200
200
  start_agent,
201
201
  full_input,
202
202
  box_result=box_results,
@@ -1,34 +1,34 @@
1
1
  """Tools for interacting with Zendesk."""
2
2
 
3
3
  import os
4
- from collections.abc import Generator
5
4
 
6
5
  import httpx
7
6
 
8
- ZENDESK_EMAIL = os.getenv("ZENDESK_EMAIL")
9
- ZENDESK_API_TOKEN = os.getenv("ZENDESK_API_TOKEN")
7
+ ZENDESK_BEARER_TOKEN = os.getenv("ZENDESK_BEARER_TOKEN")
10
8
 
9
+ HEADERS = {
10
+ "Authorization": f"Bearer {ZENDESK_BEARER_TOKEN}",
11
+ "Accept": "application/json",
12
+ }
11
13
 
12
- AUTH = (f"{ZENDESK_EMAIL}/token", ZENDESK_API_TOKEN)
13
- HEADERS = {"Accept": "application/json"}
14
14
 
15
-
16
- def get_tickets() -> Generator[dict, None, None]:
15
+ def get_tickets(number_of_tickets: int = 10) -> list[dict]:
17
16
  """Get all tickets."""
18
17
  ZENDESK_SUBDOMAIN = os.getenv("ZENDESK_SUBDOMAIN_TICKET")
19
18
  BASE_URL = f"https://{ZENDESK_SUBDOMAIN}.zendesk.com"
20
19
  url = f"{BASE_URL}/api/v2/tickets.json"
21
-
22
- with httpx.Client(auth=AUTH, headers=HEADERS, timeout=30.0) as client:
23
- while url:
20
+ all_tickets = []
21
+ with httpx.Client(headers=HEADERS, timeout=30.0) as client:
22
+ while url and len(all_tickets) < number_of_tickets:
24
23
  response = client.get(url)
25
24
  response.raise_for_status()
26
25
 
27
26
  data = response.json()
28
27
  tickets = data.get("tickets", [])
29
- yield from tickets
28
+ all_tickets.extend(tickets)
30
29
 
31
30
  url = data.get("next_page")
31
+ return all_tickets
32
32
 
33
33
 
34
34
  def get_ticket_by_id(ticket_id: str) -> dict:
@@ -36,10 +36,21 @@ def get_ticket_by_id(ticket_id: str) -> dict:
36
36
  ZENDESK_SUBDOMAIN = os.getenv("ZENDESK_SUBDOMAIN_TICKET")
37
37
  BASE_URL = f"https://{ZENDESK_SUBDOMAIN}.zendesk.com"
38
38
  url = f"{BASE_URL}/api/v2/tickets/{ticket_id}"
39
- with httpx.Client(auth=AUTH, headers=HEADERS, timeout=30.0) as client:
39
+ with httpx.Client(headers=HEADERS, timeout=30.0) as client:
40
+ response = client.get(url)
41
+ response.raise_for_status()
42
+ return response.json()["ticket"]
43
+
44
+
45
+ def get_comments_by_ticket_id(ticket_id: str) -> list[dict]:
46
+ """Get all comments for a ticket."""
47
+ ZENDESK_SUBDOMAIN = os.getenv("ZENDESK_SUBDOMAIN_TICKET")
48
+ BASE_URL = f"https://{ZENDESK_SUBDOMAIN}.zendesk.com"
49
+ url = f"{BASE_URL}/api/v2/tickets/{ticket_id}/comments"
50
+ with httpx.Client(headers=HEADERS, timeout=30.0) as client:
40
51
  response = client.get(url)
41
52
  response.raise_for_status()
42
- return response.json()
53
+ return response.json()["comments"]
43
54
 
44
55
 
45
56
  def get_article_by_id(article_id: str) -> dict:
@@ -50,10 +61,7 @@ def get_article_by_id(article_id: str) -> dict:
50
61
  url = (
51
62
  f"{BASE_URL}/api/v2/help_center/{ZENDESK_LOCALE}/articles/{article_id}"
52
63
  )
53
- with httpx.Client(auth=AUTH, headers=HEADERS, timeout=30.0) as client:
64
+ with httpx.Client(headers=HEADERS, timeout=30.0) as client:
54
65
  response = client.get(url)
55
66
  response.raise_for_status()
56
- return response.json()
57
-
58
-
59
- # get_ticket_by_id("366354")
67
+ return response.json()["article"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flock-core
3
- Version: 0.4.0b7
3
+ Version: 0.4.0b9
4
4
  Summary: Declarative LLM Orchestration at Scale
5
5
  Author-email: Andre Ratzenberger <andre.ratzenberger@whiteduck.de>
6
6
  License-File: LICENSE
@@ -38,7 +38,7 @@ flock/core/context/context.py,sha256=8bjRLZ74oacRNBaHmDNXdQKfB-95poF7Pp03n2k0zcQ
38
38
  flock/core/context/context_manager.py,sha256=FANSWa6DEhdhtZ7t_9Gza0v80UdpoDOhHbfVOccmjkA,1181
39
39
  flock/core/context/context_vars.py,sha256=ASPA29hpENWub4mgRoG62FtTVakCHQZfn6IhJQKe3C8,347
40
40
  flock/core/evaluation/utils.py,sha256=ZJkIMC9YT-HA2SPCZ4_bQ98isW1i6nbltVEYbjze-b0,12827
41
- flock/core/execution/batch_executor.py,sha256=JbOf-VInYA2CoQ7q2aHVA1w5ofEYQ9INFRYLRQdwEDs,13312
41
+ flock/core/execution/batch_executor.py,sha256=0WnC33bs_gw9EYq9iDkrPdrgPkjYECfyeO7oLZvEGmI,13318
42
42
  flock/core/execution/evaluation_executor.py,sha256=D9EO0sU-2qWj3vomjmUUi-DOtHNJNFRf30kGDHuzREE,17702
43
43
  flock/core/execution/local_executor.py,sha256=rnIQvaJOs6zZORUcR3vvyS6LPREDJTjaygl_Db0M8ao,952
44
44
  flock/core/execution/temporal_executor.py,sha256=OF_uXgQsoUGp6U1ZkcuaidAEKyH7XDtbfrtdF10XQ_4,1675
@@ -68,7 +68,7 @@ flock/core/tools/azure_tools.py,sha256=hwLnI2gsEq6QzUoWj5eCGDKTdXY1XUf6K-H5Uwva2
68
68
  flock/core/tools/basic_tools.py,sha256=Ye7nlI4RRkqWRy8nH9CKuItBmh_ZXxUpouGnCOfx0s0,9050
69
69
  flock/core/tools/llm_tools.py,sha256=Bdt4Dpur5dGpxd2KFEQyxjfZazvW1HCDKY6ydMj6UgQ,21811
70
70
  flock/core/tools/markdown_tools.py,sha256=W6fGM48yGHbifVlaOk1jOtVcybfRbRmf20VbDOZv8S4,6031
71
- flock/core/tools/zendesk_tools.py,sha256=qCcE6CrGCKcJUaQO_ZQPS2AcHlox_50bGaODbuMfo4I,1859
71
+ flock/core/tools/zendesk_tools.py,sha256=0JRD48Uu27Hrb3aqVSvIieZ1kK6R-WUr2UzCgo9jDhk,2314
72
72
  flock/core/tools/dev_tools/github.py,sha256=a2OTPXS7kWOVA4zrZHynQDcsmEi4Pac5MfSjQOLePzA,5308
73
73
  flock/core/util/cli_helper.py,sha256=mbxFhAGDES1AySbz5D672Az-EWk88FIvtFIGJMEp6fc,49800
74
74
  flock/core/util/file_path_utils.py,sha256=Odf7uU32C-x1KNighbNERSiMtkzW4h8laABIoFK7A5M,6246
@@ -439,8 +439,8 @@ flock/workflow/activities.py,sha256=eVZDnxGJl_quNO-UTV3YgvTV8LrRaHN3QDAA1ANKzac,
439
439
  flock/workflow/agent_activities.py,sha256=NhBZscflEf2IMfSRa_pBM_TRP7uVEF_O0ROvWZ33eDc,963
440
440
  flock/workflow/temporal_setup.py,sha256=VWBgmBgfTBjwM5ruS_dVpA5AVxx6EZ7oFPGw4j3m0l0,1091
441
441
  flock/workflow/workflow.py,sha256=I9MryXW_bqYVTHx-nl2epbTqeRy27CAWHHA7ZZA0nAk,1696
442
- flock_core-0.4.0b7.dist-info/METADATA,sha256=F6g-4ZtXeV6ZdbsF4bhjV7vQE9883-MRy8UtqbdJXIw,21100
443
- flock_core-0.4.0b7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
444
- flock_core-0.4.0b7.dist-info/entry_points.txt,sha256=rWaS5KSpkTmWySURGFZk6PhbJ87TmvcFQDi2uzjlagQ,37
445
- flock_core-0.4.0b7.dist-info/licenses/LICENSE,sha256=iYEqWy0wjULzM9GAERaybP4LBiPeu7Z1NEliLUdJKSc,1072
446
- flock_core-0.4.0b7.dist-info/RECORD,,
442
+ flock_core-0.4.0b9.dist-info/METADATA,sha256=wwCWOuSp3Aq37T7bTTGNCrkzT7IJsvynCz-7a0rFKM8,21100
443
+ flock_core-0.4.0b9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
444
+ flock_core-0.4.0b9.dist-info/entry_points.txt,sha256=rWaS5KSpkTmWySURGFZk6PhbJ87TmvcFQDi2uzjlagQ,37
445
+ flock_core-0.4.0b9.dist-info/licenses/LICENSE,sha256=iYEqWy0wjULzM9GAERaybP4LBiPeu7Z1NEliLUdJKSc,1072
446
+ flock_core-0.4.0b9.dist-info/RECORD,,