Skip to content

Commit 5a5261d

Browse files
committed
chore(release): bump github-copilot-sdk to 0.6.1 and update READMEs/CHANGELOG
1 parent 8cdc772 commit 5a5261d

4 files changed

Lines changed: 243 additions & 260 deletions

File tree

docs/plugins/actions/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Actions are interactive plugins that:
2323

2424
Intelligently analyzes text content and generates interactive mind maps with beautiful visualizations.
2525

26-
**Version:** 0.9.1
26+
**Version:** 0.9.2
2727

2828
[:octicons-arrow-right-24: Documentation](smart-mind-map.md)
2929

@@ -33,7 +33,7 @@ Actions are interactive plugins that:
3333

3434
Transform text into professional infographics using AntV visualization engine with various templates.
3535

36-
**Version:** 1.4.9
36+
**Version:** 1.5.0
3737

3838
[:octicons-arrow-right-24: Documentation](smart-infographic.md)
3939

plugins/actions/export_to_excel/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 📊 Export to Excel
22

3-
**Author:** [Fu-Jie](https://github.com/Fu-Jie/awesome-openwebui) | **Version:** 0.3.6 | **Project:** [Awesome OpenWebUI](https://github.com/Fu-Jie/awesome-openwebui) | **License:** MIT
3+
**Author:** [Fu-Jie](https://github.com/Fu-Jie/awesome-openwebui) | **Version:** 0.3.7 | **Project:** [Awesome OpenWebUI](https://github.com/Fu-Jie/awesome-openwebui) | **License:** MIT
44

55
Export chat history to an Excel (.xlsx) file directly from the chat interface.
66

plugins/pipes/github-copilot-sdk/github_copilot_sdk.py

Lines changed: 58 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
funding_url: https://github.com/open-webui
66
openwebui_id: ce96f7b4-12fc-4ac3-9a01-875713e69359
77
description: Integrate GitHub Copilot SDK. Supports dynamic models, multi-turn conversation, streaming, multimodal input, infinite sessions, and frontend debug logging.
8-
version: 0.6.0
8+
version: 0.6.1
99
requirements: github-copilot-sdk==0.1.23
1010
"""
1111

@@ -1753,75 +1753,82 @@ def _get_chat_context(
17531753
"chat_id": str(chat_id).strip(),
17541754
}
17551755

1756-
async def _fetch_byok_models(self) -> List[dict]:
1756+
async def _fetch_byok_models(self, uv: "Pipe.UserValves" = None) -> List[dict]:
17571757
"""Fetch BYOK models from configured provider."""
17581758
model_list = []
1759-
if self.valves.BYOK_BASE_URL:
1759+
1760+
# Resolve effective settings (User > Global)
1761+
# Note: We handle the case where uv might be None
1762+
effective_base_url = (uv.BYOK_BASE_URL if uv else "") or self.valves.BYOK_BASE_URL
1763+
effective_type = (uv.BYOK_TYPE if uv else "") or self.valves.BYOK_TYPE
1764+
effective_api_key = (uv.BYOK_API_KEY if uv else "") or self.valves.BYOK_API_KEY
1765+
effective_bearer_token = (uv.BYOK_BEARER_TOKEN if uv else "") or self.valves.BYOK_BEARER_TOKEN
1766+
effective_models = (uv.BYOK_MODELS if uv else "") or self.valves.BYOK_MODELS
1767+
1768+
if effective_base_url:
17601769
try:
1761-
base_url = self.valves.BYOK_BASE_URL.rstrip("/")
1770+
base_url = effective_base_url.rstrip("/")
17621771
url = f"{base_url}/models"
17631772
headers = {}
1764-
provider_type = self.valves.BYOK_TYPE.lower()
1773+
provider_type = effective_type.lower()
17651774

17661775
if provider_type == "anthropic":
1767-
if self.valves.BYOK_API_KEY:
1768-
headers["x-api-key"] = self.valves.BYOK_API_KEY
1776+
if effective_api_key:
1777+
headers["x-api-key"] = effective_api_key
17691778
headers["anthropic-version"] = "2023-06-01"
17701779
else:
1771-
if self.valves.BYOK_BEARER_TOKEN:
1780+
if effective_bearer_token:
17721781
headers["Authorization"] = (
1773-
f"Bearer {self.valves.BYOK_BEARER_TOKEN}"
1782+
f"Bearer {effective_bearer_token}"
17741783
)
1775-
elif self.valves.BYOK_API_KEY:
1776-
headers["Authorization"] = f"Bearer {self.valves.BYOK_API_KEY}"
1784+
elif effective_api_key:
1785+
headers["Authorization"] = f"Bearer {effective_api_key}"
17771786

1778-
timeout = aiohttp.ClientTimeout(total=5)
1787+
timeout = aiohttp.ClientTimeout(total=60)
17791788
async with aiohttp.ClientSession(timeout=timeout) as session:
1780-
async with session.get(url, headers=headers) as resp:
1781-
if resp.status == 200:
1782-
data = await resp.json()
1783-
if (
1784-
isinstance(data, dict)
1785-
and "data" in data
1786-
and isinstance(data["data"], list)
1787-
):
1788-
for item in data["data"]:
1789-
if isinstance(item, dict) and "id" in item:
1790-
model_list.append(item["id"])
1791-
await self._emit_debug_log(
1792-
f"BYOK: Fetched {len(model_list)} models from {url}"
1793-
)
1794-
else:
1795-
await self._emit_debug_log(
1796-
f"BYOK: Failed to fetch models from {url}. Status: {resp.status}"
1797-
)
1789+
for attempt in range(3):
1790+
try:
1791+
async with session.get(url, headers=headers) as resp:
1792+
if resp.status == 200:
1793+
data = await resp.json()
1794+
if (
1795+
isinstance(data, dict)
1796+
and "data" in data
1797+
and isinstance(data["data"], list)
1798+
):
1799+
for item in data["data"]:
1800+
if isinstance(item, dict) and "id" in item:
1801+
model_list.append(item["id"])
1802+
elif isinstance(data, list):
1803+
for item in data:
1804+
if isinstance(item, dict) and "id" in item:
1805+
model_list.append(item["id"])
1806+
1807+
await self._emit_debug_log(
1808+
f"BYOK: Fetched {len(model_list)} models from {url}"
1809+
)
1810+
break
1811+
else:
1812+
await self._emit_debug_log(
1813+
f"BYOK: Failed to fetch models from {url} (Attempt {attempt+1}/3). Status: {resp.status}"
1814+
)
1815+
except Exception as e:
1816+
await self._emit_debug_log(f"BYOK: Model fetch error (Attempt {attempt+1}/3): {e}")
1817+
1818+
if attempt < 2:
1819+
await asyncio.sleep(1)
17981820
except Exception as e:
1799-
await self._emit_debug_log(f"BYOK: Model fetch error: {e}")
1821+
await self._emit_debug_log(f"BYOK: Setup error: {e}")
18001822

18011823
# Fallback to configured list or defaults
18021824
if not model_list:
1803-
if self.valves.BYOK_MODELS.strip():
1825+
if effective_models.strip():
18041826
model_list = [
1805-
m.strip() for m in self.valves.BYOK_MODELS.split(",") if m.strip()
1827+
m.strip() for m in effective_models.split(",") if m.strip()
18061828
]
18071829
await self._emit_debug_log(
18081830
f"BYOK: Using user-configured BYOK_MODELS ({len(model_list)} models)."
18091831
)
1810-
else:
1811-
defaults = {
1812-
"anthropic": [
1813-
"claude-3-5-sonnet-latest",
1814-
"claude-3-5-haiku-latest",
1815-
"claude-3-opus-latest",
1816-
],
1817-
}
1818-
model_list = defaults.get(
1819-
self.valves.BYOK_TYPE.lower(),
1820-
["gpt-4o", "gpt-4o-mini", "claude-3-5-sonnet-latest"],
1821-
)
1822-
await self._emit_debug_log(
1823-
f"BYOK: Using default fallback models for {self.valves.BYOK_TYPE} ({len(model_list)} models)."
1824-
)
18251832

18261833
return [
18271834
{
@@ -1943,13 +1950,14 @@ async def pipes(self, __user__: Optional[dict] = None) -> List[dict]:
19431950

19441951
# Fetch BYOK models if configured
19451952
byok = []
1946-
if self.valves.BYOK_BASE_URL and (
1953+
effective_base_url = uv.BYOK_BASE_URL or self.valves.BYOK_BASE_URL
1954+
if effective_base_url and (
19471955
uv.BYOK_API_KEY
19481956
or self.valves.BYOK_API_KEY
19491957
or uv.BYOK_BEARER_TOKEN
19501958
or self.valves.BYOK_BEARER_TOKEN
19511959
):
1952-
byok = await self._fetch_byok_models()
1960+
byok = await self._fetch_byok_models(uv=uv)
19531961

19541962
standard = []
19551963
if token:

0 commit comments

Comments
 (0)