mirror of
https://github.com/run-llama/create-llama.git
synced 2026-07-05 00:46:20 -04:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 670e2631f3 | |||
| afb519d231 |
@@ -99,8 +99,7 @@ async def _stream_content(
|
||||
event: Union[AgentStream, StopEvent],
|
||||
) -> AsyncGenerator[str, None]:
|
||||
if isinstance(event, AgentStream):
|
||||
if event.delta.strip(): # Only yield non-empty deltas
|
||||
yield event.delta
|
||||
yield event.delta
|
||||
elif isinstance(event, StopEvent):
|
||||
if isinstance(event.result, str):
|
||||
yield event.result
|
||||
@@ -108,9 +107,7 @@ async def _stream_content(
|
||||
async for chunk in event.result:
|
||||
if isinstance(chunk, str):
|
||||
yield chunk
|
||||
elif (
|
||||
hasattr(chunk, "delta") and chunk.delta.strip()
|
||||
): # Only yield non-empty deltas
|
||||
elif hasattr(chunk, "delta") and chunk.delta:
|
||||
yield chunk.delta
|
||||
|
||||
stream_started = False
|
||||
|
||||
@@ -5,7 +5,7 @@ from typing import Optional
|
||||
|
||||
import requests
|
||||
|
||||
CHAT_UI_VERSION = "0.0.5"
|
||||
CHAT_UI_VERSION = "0.0.6"
|
||||
|
||||
|
||||
def download_chat_ui(
|
||||
|
||||
@@ -74,7 +74,7 @@ class LlamaCloudFileService:
|
||||
"custom_metadata": {"file_id": file_id, **(custom_metadata or {})},
|
||||
}
|
||||
]
|
||||
files = client.pipelines.add_files_to_pipeline(pipeline_id, request=files)
|
||||
files = client.pipelines.add_files_to_pipeline_api(pipeline_id, request=files)
|
||||
|
||||
if not wait_for_processing:
|
||||
return file_id
|
||||
|
||||
Generated
+457
-443
File diff suppressed because it is too large
Load Diff
@@ -36,7 +36,7 @@ requests = "^2.32.3"
|
||||
pydantic-settings = "^2.8.1"
|
||||
llama-index-core = "0.12.25"
|
||||
llama-index-readers-file = "^0.4.6"
|
||||
llama-index-indices-managed-llama-cloud = "^0.6.3"
|
||||
llama-index-indices-managed-llama-cloud = "0.6.3"
|
||||
|
||||
[tool.poetry.group.dev.dependencies]
|
||||
black = {extras = ["jupyter"], version = "<=23.9.1,>=23.7.0"}
|
||||
|
||||
@@ -229,7 +229,6 @@ class TestEventStream:
|
||||
|
||||
yield ObjectWithDelta("Delta 1")
|
||||
yield ObjectWithDelta("Delta 2")
|
||||
yield ObjectWithDelta(" ") # Should be filtered out by strip check
|
||||
|
||||
yield StopEvent(result=generator())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user