Skip to content

Conversation

@bfollington
Copy link
Contributor

@bfollington bfollington commented Jan 21, 2025

  • Integrate blobby with clipper
  • add /ai/spell/search route
  • add behavior tree implementation + search agent
  • one strategy for search will try to make use of collections, if they exist, by looking at tags starting with # e.g.
    • { key: '#email', value: ['an-email-key', 'another-email-key'] }
  • extract llm and redis library code

The idea is to create a set of building blocks (strategies) we can compose into different behavior trees. Those strategies can mix and match platform features, so I've factored those out into lib. This is basically what I meant by functional-core, imperative-shell the other day. In practice I mean splitting the service concerns from the API concerns, the services do not need to care that they are exposed via HTTP endpoints.

I've got some mixed file naming conventions going on, can do camelCase or kebab-case but it feels a bit weird to export one function called scanForText from a file called scan-for-text.ts?

@bfollington bfollington changed the base branch from main to toolshed January 21, 2025 04:55
@bfollington bfollington requested a review from jakedahn January 21, 2025 05:28
@bfollington bfollington changed the title Search behavior tree (toolshed) /ai/spell/search + clipper integration (toolshed) Jan 21, 2025
Base automatically changed from toolshed to main January 21, 2025 23:07
@bfollington bfollington requested a review from jakedahn January 22, 2025 08:43
@bfollington bfollington changed the title /ai/spell/search + clipper integration (toolshed) /ai/spell/search (toolshed) Jan 22, 2025
@@ -0,0 +1,57 @@
export interface Logger {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a heads up, I already have some fancy logging stuff using pino-logger https://github.com/pinojs/pino

It's currently only hooked up to hono via a middleware, and not super obvious how to use elsewhere: https://github.com/commontoolsinc/labs/blob/main/typescript/packages/toolshed/middlewares/pino-logger.ts

I'm cool merging this as-is, but I'll probably make a follow-up pass at killing pino or this setup in the next week or two.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM! I would prefer to use a library, I was just losing my sanity without context in the logs. Let's rip it out soon 👍

Comment on lines +13 to +17
const app = createApp()
.route("/", router)
.route("/", llmRouter)
.route("/", blobbyRouter);
Deno.serve(app.fetch);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the routes I'm testing using hono/client, they need an actual server to hit I think? Maybe you can pass a router directly to the client.

Regardless, this actually worked but there's no LLM configured in CI so it fails.

Tests are commented out, they work locally for me.

Comment on lines +159 to +162
return c.json(
formatResponse(transcription, chunks, responseType),
200,
);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some tweaks, I had to resolve every type error to run the spell tests

@bfollington bfollington merged commit 0c3e28f into main Jan 23, 2025
2 checks passed
@bfollington bfollington deleted the feat/toolshed/search branch January 23, 2025 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants