mirror of
https://github.com/langchain-ai/kork.git
synced 2026-07-01 22:24:02 -04:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 53421907d6 | |||
| 71b6f3fa8c | |||
| a489293c86 | |||
| e5330b9f9c | |||
| feee9ed2b4 | |||
| 5c6e42d5cd | |||
| ecd1d9f941 |
@@ -11,6 +11,12 @@
|
||||
3. Execute the program generated by the LLM **safely**.
|
||||
4. Program generation takes a single LLM call, as opposed to agents that use a call per action taken.
|
||||
|
||||
## Show me! 😹
|
||||
|
||||
[Image manipulation API using PIL](https://langchain-ai.github.io/kork/examples/image_manipulation.html)
|
||||
|
||||
<img src="assets/cats.png" alt="Cats!!!" style="max-width: 500px;">
|
||||
|
||||
## How
|
||||
|
||||
The chain takes a user query, translates it into a program, and executes it using the `Kork` interpreter.
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 79 KiB |
@@ -184,7 +184,9 @@
|
||||
"pycharm": {
|
||||
"name": "#%%\n"
|
||||
},
|
||||
"tags": []
|
||||
"tags": [
|
||||
"hide-input"
|
||||
]
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
||||
File diff suppressed because one or more lines are too long
+6
-3
@@ -42,8 +42,6 @@ class HtmlResult(TypedDict):
|
||||
class _NoExpectedAnswer:
|
||||
"""A sentinel class to indicate that there is no expected answer."""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
NO_EXPECTED_ANSWER = _NoExpectedAnswer()
|
||||
|
||||
@@ -61,7 +59,12 @@ def as_html_dict(
|
||||
code = code_result["code"].strip()
|
||||
|
||||
if pretty_print:
|
||||
code = AstPrinter().visit(parse(code), pretty_print=True)
|
||||
try:
|
||||
code = AstPrinter().visit(parse(code), pretty_print=True)
|
||||
except Exception:
|
||||
# This is display code. Broad exception handling OK for now
|
||||
# we can make the code more robust later.
|
||||
code = code
|
||||
else:
|
||||
code = code
|
||||
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
[tool.poetry]
|
||||
name = "kork"
|
||||
version = "0.0.2"
|
||||
description = "Programming with LLMs"
|
||||
version = "0.0.3"
|
||||
description = "Natural Language Interfaces Powered by LLMs"
|
||||
authors = ["LangChain"]
|
||||
license = "MIT"
|
||||
readme = "README.md"
|
||||
|
||||
Reference in New Issue
Block a user