Test Drive: ell
Published on .
WordPress database error: [<div style="clear:both"> </div><div class="queries" style="clear:both; margin_bottom:2px; border: red dotted thin;">Queries made or created this session were<br/>
<ol>
<li>Raw query:
SELECT * FROM wp_options WHERE </li>
<li>Rewritten:
SELECT * FROM wp_options WHERE </li>
<li>With Placeholders:
SELECT * FROM wp_options WHERE </li>
<li>Prepare:
SELECT * FROM wp_options WHERE </li>
</ol>
</div><div style="clear:both; margin_bottom:2px; border: red dotted thin;" class="error_message" style="border-bottom:dotted blue thin;">Error occurred at line 1644 in Function prepare_query. <br/> Error message was: Problem preparing the PDO SQL Statement. Error was: SQLSTATE[HY000]: General error: 1 incomplete input </div><pre>#0 /home/nattaylor/public_html/wordpress/wp-content/db.php(2746): WP_SQLite_DB\PDOEngine->get_error_message()
#1 /home/nattaylor/public_html/wordpress/wp-content/db.php(3484): WP_SQLite_DB\wpsqlitedb->query('...')
#2 /home/nattaylor/public_html/wordpress/wp-content/db.php(2952): WP_SQLite_DB\PDOSQLiteDriver->execute_duplicate_key_update()
#3 /home/nattaylor/public_html/wordpress/wp-content/db.php(1893): WP_SQLite_DB\PDOSQLiteDriver->rewrite_query('...', '...')
#4 /home/nattaylor/public_html/wordpress/wp-content/db.php(1357): WP_SQLite_DB\PDOEngine->execute_insert_query_new('...')
#5 /home/nattaylor/public_html/wordpress/wp-content/db.php(2739): WP_SQLite_DB\PDOEngine->query('...')
#6 /home/nattaylor/public_html/wordpress/wp-includes/option.php(1143): WP_SQLite_DB\wpsqlitedb->query('...')
#7 /home/nattaylor/public_html/wordpress/wp-includes/option.php(1552): add_option('...', 1758136347, '', '...')
#8 /home/nattaylor/public_html/wordpress/wp-content/plugins/syntax-highlighting-code-block/inc/functions.php(671): set_transient('...', Array, 2592000)
#9 /home/nattaylor/public_html/wordpress/wp-includes/class-wp-block.php(586): Syntax_Highlighting_Code_Block\render_block(Array, '...', Object(WP_Block))
#10 /home/nattaylor/public_html/wordpress/wp-includes/blocks.php(2359): WP_Block->render()
#11 /home/nattaylor/public_html/wordpress/wp-includes/blocks.php(2431): render_block(Array)
#12 /home/nattaylor/public_html/wordpress/wp-includes/class-wp-hook.php(324): do_blocks('...')
#13 /home/nattaylor/public_html/wordpress/wp-includes/plugin.php(205): WP_Hook->apply_filters('...', Array)
#14 /home/nattaylor/public_html/wordpress/wp-includes/post-template.php(256): apply_filters('...', '...')
#15 /home/nattaylor/public_html/wordpress/wp-content/themes/ntdc/index.php(70): the_content()
#16 /home/nattaylor/public_html/wordpress/wp-includes/template-loader.php(106): include('...')
#17 /home/nattaylor/public_html/wordpress/wp-blog-header.php(19): require_once('...')
#18 /home/nattaylor/public_html/wordpress/index.php(17): require('...')
</pre>]
SELECT * FROM wp_options WHERE
WordPress database error: [<div style="clear:both"> </div><div class="queries" style="clear:both; margin_bottom:2px; border: red dotted thin;">Queries made or created this session were<br/>
<ol>
<li>Raw query:
SELECT * FROM wp_options WHERE </li>
<li>Rewritten:
SELECT * FROM wp_options WHERE </li>
<li>With Placeholders:
SELECT * FROM wp_options WHERE </li>
<li>Prepare:
SELECT * FROM wp_options WHERE </li>
</ol>
</div><div style="clear:both; margin_bottom:2px; border: red dotted thin;" class="error_message" style="border-bottom:dotted blue thin;">Error occurred at line 1644 in Function prepare_query. <br/> Error message was: Problem preparing the PDO SQL Statement. Error was: SQLSTATE[HY000]: General error: 1 incomplete input </div><pre>#0 /home/nattaylor/public_html/wordpress/wp-content/db.php(2746): WP_SQLite_DB\PDOEngine->get_error_message()
#1 /home/nattaylor/public_html/wordpress/wp-content/db.php(3484): WP_SQLite_DB\wpsqlitedb->query('...')
#2 /home/nattaylor/public_html/wordpress/wp-content/db.php(2952): WP_SQLite_DB\PDOSQLiteDriver->execute_duplicate_key_update()
#3 /home/nattaylor/public_html/wordpress/wp-content/db.php(1893): WP_SQLite_DB\PDOSQLiteDriver->rewrite_query('...', '...')
#4 /home/nattaylor/public_html/wordpress/wp-content/db.php(1357): WP_SQLite_DB\PDOEngine->execute_insert_query_new('...')
#5 /home/nattaylor/public_html/wordpress/wp-content/db.php(2739): WP_SQLite_DB\PDOEngine->query('...')
#6 /home/nattaylor/public_html/wordpress/wp-includes/option.php(1143): WP_SQLite_DB\wpsqlitedb->query('...')
#7 /home/nattaylor/public_html/wordpress/wp-includes/option.php(1554): add_option('...', Array, '', '...')
#8 /home/nattaylor/public_html/wordpress/wp-content/plugins/syntax-highlighting-code-block/inc/functions.php(671): set_transient('...', Array, 2592000)
#9 /home/nattaylor/public_html/wordpress/wp-includes/class-wp-block.php(586): Syntax_Highlighting_Code_Block\render_block(Array, '...', Object(WP_Block))
#10 /home/nattaylor/public_html/wordpress/wp-includes/blocks.php(2359): WP_Block->render()
#11 /home/nattaylor/public_html/wordpress/wp-includes/blocks.php(2431): render_block(Array)
#12 /home/nattaylor/public_html/wordpress/wp-includes/class-wp-hook.php(324): do_blocks('...')
#13 /home/nattaylor/public_html/wordpress/wp-includes/plugin.php(205): WP_Hook->apply_filters('...', Array)
#14 /home/nattaylor/public_html/wordpress/wp-includes/post-template.php(256): apply_filters('...', '...')
#15 /home/nattaylor/public_html/wordpress/wp-content/themes/ntdc/index.php(70): the_content()
#16 /home/nattaylor/public_html/wordpress/wp-includes/template-loader.php(106): include('...')
#17 /home/nattaylor/public_html/wordpress/wp-blog-header.php(19): require_once('...')
#18 /home/nattaylor/public_html/wordpress/index.php(17): require('...')
</pre>]
SELECT * FROM wp_options WHERE
Today I’m test driving ell “The Language Model Programming Library.” From the tagline, it has captured my attention, although I am wary of anything that stands between me and the prompt. I’m going back to my company industry classification task. The process is simple:
- Install ell
- Write prompt
- Run program
- View in “studio”
I can’t quite get onboard with the syntax since I want my functions to do input-output, but with the ell.simple()
decoration I encode my system prompt into the docstring and then I return my user prompt. Ok fine, it works, but I don’t like it.
Studio is fantastic. Unlike many other observability tools, it doesn’t rely on a running service (cough – a heavy docker-compose system) and instead just writes a SQLite database that you can view at any time. This is great! It also feels very natural to track your prompt engineering automatically, and I guess the commit messages are a good example of “practice what you preach.” I can also see the DAG view coming in handy. The docs are excellent!

import ell
ell.init(store='./logdir', autocommit=True, verbose=True)
desc = """PTT Public Company Limited is a Thailand-based company engaged in the gas and petroleum businesses. The Company supplies, transports and distributes natural gas vehicle (NGV), petroleum products and lubricating oil via service stations throughout Thailand and also exports to overseas markets. Through its subsidiaries and affiliated companies, the Company is involved in exploration, production, refinery, marketing and distribution of petroleum, petrochemical products and aromatics. In addition, the Company operates international trade businesses, including import and export of crude oil, condensates, petroleum products, petrochemicals, and sourcing of international transport vessels and carriers."""
@ell.simple(model="gpt-4o-mini", temperature=1.0)
def classify(desc : str):
"""Determine the full GICS sub-industry code based on the description. Respond only with the code"""
return desc
story = classify(desc, api_params=dict(n=3))