Skip to content

Commit 3ba87a2

Browse files
authored
Merge pull request #52 from AnswerDotAI/cosette-contents-fix
cosette responses api fix
2 parents 80fb2af + 34197ce commit 3ba87a2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

nbs/00_core.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@
664664
"outputs": [],
665665
"source": [
666666
"#| export\n",
667-
"conts = {'anthropic': cla.contents, 'openai': cos.contents}\n",
667+
"conts = {'anthropic': cla.contents, 'openai': lambda r: getattr(r, 'output_text', r)}\n",
668668
"p = r'```(?:bash\\n|\\n)?([^`]+)```'\n",
669669
"def get_res(sage, q, provider, mode='default', verbosity=0):\n",
670670
" if mode == 'command':\n",
@@ -1149,9 +1149,9 @@
11491149
],
11501150
"metadata": {
11511151
"kernelspec": {
1152-
"display_name": "python3",
1152+
"display_name": "python",
11531153
"language": "python",
1154-
"name": "python3"
1154+
"name": "python"
11551155
}
11561156
},
11571157
"nbformat": 4,

shell_sage/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ def trace(msgs):
249249
if tool_use: print(f'Tool use: {tool_use.name}\nTool input: {tool_use.input}')
250250

251251
# %% ../nbs/00_core.ipynb 33
252-
conts = {'anthropic': cla.contents, 'openai': cos.contents}
252+
conts = {'anthropic': cla.contents, 'openai': lambda r: getattr(r, 'output_text', r)}
253253
p = r'```(?:bash\n|\n)?([^`]+)```'
254254
def get_res(sage, q, provider, mode='default', verbosity=0):
255255
if mode == 'command':

0 commit comments

Comments
 (0)