flashlite 0.2.0__py3-none-any.whl → 0.2.1__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.
@@ -333,8 +333,7 @@ class MultiAgentChat:
333
333
  """
334
334
  if agent_name not in self._agents:
335
335
  raise ValueError(
336
- f"Unknown agent: {agent_name}. "
337
- f"Available agents: {list(self._agents.keys())}"
336
+ f"Unknown agent: {agent_name}. Available agents: {list(self._agents.keys())}"
338
337
  )
339
338
 
340
339
  agent = self._agents[agent_name]
@@ -372,12 +371,8 @@ class MultiAgentChat:
372
371
  metadata={
373
372
  "model": response.model,
374
373
  "tokens": response.usage.total_tokens if response.usage else None,
375
- "input_tokens": (
376
- response.usage.input_tokens if response.usage else None
377
- ),
378
- "output_tokens": (
379
- response.usage.output_tokens if response.usage else None
380
- ),
374
+ "input_tokens": (response.usage.input_tokens if response.usage else None),
375
+ "output_tokens": (response.usage.output_tokens if response.usage else None),
381
376
  "latency_ms": round(latency_ms, 1),
382
377
  },
383
378
  visible_to=visible_to,
@@ -395,7 +390,7 @@ class MultiAgentChat:
395
390
 
396
391
  # Validate structured output if requested
397
392
  if response_model is not None:
398
- return self._validate_structured(
393
+ return await self._validate_structured(
399
394
  response=response,
400
395
  response_model=response_model,
401
396
  messages=messages,
@@ -432,8 +427,7 @@ class MultiAgentChat:
432
427
  if "response_format" not in extra_kwargs:
433
428
  resolved_model = (agent.model or self._default_model or "").lower()
434
429
  if any(
435
- p in resolved_model
436
- for p in ["gpt-4", "gpt-3.5", "claude", "gemini", "mistral"]
430
+ p in resolved_model for p in ["gpt-4", "gpt-3.5", "claude", "gemini", "mistral"]
437
431
  ):
438
432
  extra_kwargs["response_format"] = {"type": "json_object"}
439
433
 
@@ -537,14 +531,10 @@ class MultiAgentChat:
537
531
 
538
532
  if msg.agent_name == agent.name:
539
533
  # Agent's own previous messages
540
- messages.append(
541
- assistant_message(msg.content, name=_sanitize_name(agent.name))
542
- )
534
+ messages.append(assistant_message(msg.content, name=_sanitize_name(agent.name)))
543
535
  else:
544
536
  # Other agents'/sources' messages with name attribution
545
- messages.append(
546
- user_message(msg.content, name=_sanitize_name(msg.agent_name))
547
- )
537
+ messages.append(user_message(msg.content, name=_sanitize_name(msg.agent_name)))
548
538
 
549
539
  return messages
550
540
 
@@ -697,9 +687,7 @@ class MultiAgentChat:
697
687
  for line in msg.content.split("\n"):
698
688
  lines.append(f" {line}")
699
689
  if include_metadata and msg.metadata:
700
- meta_str = ", ".join(
701
- f"{k}={v}" for k, v in msg.metadata.items() if v is not None
702
- )
690
+ meta_str = ", ".join(f"{k}={v}" for k, v in msg.metadata.items() if v is not None)
703
691
  if meta_str:
704
692
  lines.append(f" ({meta_str})")
705
693
  lines.append("")
@@ -739,6 +727,5 @@ class MultiAgentChat:
739
727
 
740
728
  def __repr__(self) -> str:
741
729
  return (
742
- f"MultiAgentChat(agents={list(self._agents.keys())}, "
743
- f"messages={len(self._transcript)})"
730
+ f"MultiAgentChat(agents={list(self._agents.keys())}, messages={len(self._transcript)})"
744
731
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flashlite
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Batteries-included wrapper for litellm with rate limiting, retries, templating, and more
5
5
  Author-email: ndalton12 <niall.dalton12@gmail.com>
6
6
  License-File: LICENSE.md
@@ -11,7 +11,7 @@ flashlite/cache/memory.py,sha256=_A4F7NTR9da2KDQW7fcKnUWrC-W_JpaYmb3d6rovX3w,441
11
11
  flashlite/conversation/__init__.py,sha256=zSgC4G697mx3T5bKn8WUEkSaSkMQQeHJsfyLdRUM30w,694
12
12
  flashlite/conversation/context.py,sha256=NQMLi5_WiN1zDYaPZTO9uJG_dJ3JJiVmAFfGAPM4X6c,10164
13
13
  flashlite/conversation/manager.py,sha256=dSQDgtzNt_6T8S1sHSAXKcS3DoBQ2vI9Ig1PZKaTh48,11644
14
- flashlite/conversation/multi_agent.py,sha256=tt5gNzUXqnbvp84_aWtcoCIlShPWSCzVa_Jt48Xuvy8,25427
14
+ flashlite/conversation/multi_agent.py,sha256=uxS90wuAAKWQugQXcM_hdNlkhzph3XtKydqvcrz6WpM,25175
15
15
  flashlite/core/__init__.py,sha256=nWbMMPED_HsD62hkIYv45DDR6zX2_cDWCMPDTNfqSu4,315
16
16
  flashlite/core/completion.py,sha256=NTtAJzJ3ba0N0xVs8lCN5htme0SWEMxYroGjI63crw4,3847
17
17
  flashlite/core/messages.py,sha256=-EUtEjFjSNY1Lzfrynb9xtYw4FZRKnfFoYQqgsUcQZQ,3848
@@ -36,7 +36,7 @@ flashlite/templating/registry.py,sha256=wp8RaibHKNyu5q4tCdOXJ0B4tey7bv-c0qb9h1a7
36
36
  flashlite/tools/__init__.py,sha256=zpQ5KyvZwZaVvaulnpMmL_JjCnMfD08nD_foI95TjVg,1791
37
37
  flashlite/tools/definitions.py,sha256=cqyk6GR1qeMkTPFqsadnJc-YkCG15QVafiaf-OjGYNU,11519
38
38
  flashlite/tools/execution.py,sha256=iQC7V3R5Tx19suISnnuaDpjpgl8wURwOHmKZbsHL16s,10814
39
- flashlite-0.2.0.dist-info/METADATA,sha256=a1YS4nT7UJJD98ibIlguAfWdhUc-2SDN9xQ9jBmjjSA,4293
40
- flashlite-0.2.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
41
- flashlite-0.2.0.dist-info/licenses/LICENSE.md,sha256=z2KZcyoH16ayjxlbeBM01uD-bXn1WTcKFab5ZKBhfJE,1068
42
- flashlite-0.2.0.dist-info/RECORD,,
39
+ flashlite-0.2.1.dist-info/METADATA,sha256=hP_D4Tgs1v6LqFyM5kYn0PIju0JSEOPokkhWEGcX5LE,4293
40
+ flashlite-0.2.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
41
+ flashlite-0.2.1.dist-info/licenses/LICENSE.md,sha256=z2KZcyoH16ayjxlbeBM01uD-bXn1WTcKFab5ZKBhfJE,1068
42
+ flashlite-0.2.1.dist-info/RECORD,,