mirror of
https://github.com/langchain-ai/kork.git
synced 2026-06-30 22:28:05 -04:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e3f64f277a | |||
| c5f561da6e | |||
| 3ff713763a | |||
| 71b6f3fa8c | |||
| a489293c86 | |||
| e5330b9f9c | |||
| feee9ed2b4 | |||
| 5c6e42d5cd | |||
| ecd1d9f941 |
@@ -1,9 +1,7 @@
|
||||
name: release
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- closed
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
@@ -15,9 +13,8 @@ env:
|
||||
|
||||
jobs:
|
||||
if_release:
|
||||
if: |
|
||||
${{ github.event.pull_request.merged == true }}
|
||||
&& ${{ contains(github.event.pull_request.labels.*.name, 'release') }}
|
||||
# Disallow publishing from branches that aren't `main`.
|
||||
if: github.ref == 'refs/heads/main'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
[](https://github.com/langchain-ai/kork/actions/workflows/test.yml)
|
||||
|
||||
|
||||
# NOT MAINTAINED
|
||||
|
||||
`Kork` was a prototype for agents that can take multiple (dependent) actions at once; i.e., when the input of action 2 depends on the output from action 1.
|
||||
|
||||
This is distinct from parallel tool use where the inputs into the tools are independent of the tools outputs.
|
||||
|
||||
We're currently not maintaining Kork, but you're welcome to use it for your own research.
|
||||
|
||||
# Kork 
|
||||
|
||||
`Kork` is an *experimental* [Langchain chain](https://python.langchain.com/en/latest/modules/chains.html) that helps build natural language APIs powered by LLMs.
|
||||
@@ -11,6 +20,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": [
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
"\n",
|
||||
"Information about these functions will be added into the prompt to let the LLM know it can use them.\n",
|
||||
"\n",
|
||||
"The funtions will also be added as foregin functions into the kork interpreter environment, so the interpreter can actually use them!"
|
||||
"The functions will also be added as foregin functions into the kork interpreter environment, so the interpreter can actually use them!"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
+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