Skip to content

Commit 521bcc8

Browse files
committed
clean nbs and fix tests
1 parent ab83c50 commit 521bcc8

File tree

2 files changed

+59
-83
lines changed

2 files changed

+59
-83
lines changed

nbs/00_core.ipynb

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2511,38 +2511,12 @@
25112511
{
25122512
"cell_type": "code",
25132513
"execution_count": null,
2514-
"id": "d95e5fe1",
2514+
"id": "84f37879",
25152515
"metadata": {},
2516-
"outputs": [
2517-
{
2518-
"data": {
2519-
"text/markdown": [
2520-
"Hello! How can I help you today?\n",
2521-
"\n",
2522-
"<details>\n",
2523-
"\n",
2524-
"- id: `gen-1763024814-TLZkWYERo4bGvTBZ8YjO`\n",
2525-
"- model: `openai/gpt-oss-20b`\n",
2526-
"- finish_reason: `stop`\n",
2527-
"- usage: `Usage(completion_tokens=57, prompt_tokens=70, total_tokens=127, completion_tokens_details=None, prompt_tokens_details=None)`\n",
2528-
"\n",
2529-
"</details>"
2530-
],
2531-
"text/plain": [
2532-
"ModelResponse(id='gen-1763024814-TLZkWYERo4bGvTBZ8YjO', created=1763024814, model='openai/gpt-oss-20b', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='Hello! How can I help you today?', role='assistant', tool_calls=None, function_call=None, reasoning_content='The user says \"hi\". We need to respond. The instruction: \"You are ChatGPT, a large language model trained by OpenAI.\" There\\'s no special instruction. Just respond politely.', provider_specific_fields={'refusal': None, 'reasoning': 'The user says \"hi\". We need to respond. The instruction: \"You are ChatGPT, a large language model trained by OpenAI.\" There\\'s no special instruction. Just respond politely.', 'reasoning_details': [{'type': 'reasoning.text', 'text': 'The user says \"hi\". We need to respond. The instruction: \"You are ChatGPT, a large language model trained by OpenAI.\" There\\'s no special instruction. Just respond politely.', 'format': 'unknown', 'index': 0}], 'reasoning_content': 'The user says \"hi\". We need to respond. The instruction: \"You are ChatGPT, a large language model trained by OpenAI.\" There\\'s no special instruction. Just respond politely.'}), provider_specific_fields={'native_finish_reason': 'stop'})], usage=Usage(completion_tokens=57, prompt_tokens=70, total_tokens=127, completion_tokens_details=None, prompt_tokens_details=None), service_tier=None, provider='Phala')"
2533-
]
2534-
},
2535-
"execution_count": null,
2536-
"metadata": {},
2537-
"output_type": "execute_result"
2538-
}
2539-
],
2516+
"outputs": [],
25402517
"source": [
2541-
"import os, litellm\n",
2542-
"OPENROUTER_API_KEY = os.getenv(\"OPENROUTER_API_KEY\")\n",
2543-
"OPENROUTER_BASE_URL = \"https://openrouter.ai/api/v1\"\n",
2544-
"c = Chat(\"openai/gpt-oss-20b\", api_key=OPENROUTER_API_KEY, api_base=OPENROUTER_BASE_URL)\n",
2545-
"c(\"hi\")"
2518+
"api_key = os.getenv(\"OPENROUTER_API_KEY\")\n",
2519+
"if api_key: Chat(\"openai/gpt-oss-20b\", api_key=api_key, api_base=\"https://openrouter.ai/api/v1\")(\"hi\")"
25462520
]
25472521
},
25482522
{
@@ -5390,7 +5364,7 @@
53905364
"metadata": {},
53915365
"outputs": [],
53925366
"source": [
5393-
"#| hides\n",
5367+
"#| hide\n",
53945368
"import nbdev; nbdev.nbdev_export()"
53955369
]
53965370
},

0 commit comments

Comments
 (0)