Skip to content

Conversation

apascal07
Copy link
Collaborator

No description provided.

@apascal07 apascal07 requested a review from mbleigh May 9, 2024 17:39
@apascal07 apascal07 marked this pull request as ready for review May 9, 2024 17:39
Copy link
Collaborator

@mbleigh mbleigh left a comment

Choose a reason for hiding this comment

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

So the usage for this is:

genkit start src/ai/*.ts --mode harness

is that right?

import * as path from 'path';
import { logger } from '../utils';

async function main() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will this work with loading/transpiling TS files? Does it automatically set GENKIT_ENV=dev?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Tested it with .ts, it worked. The envs are set automatically like in the default app loading.

@apascal07
Copy link
Collaborator Author

apascal07 commented May 9, 2024

So the usage for this is:

genkit start src/ai/*.ts --mode harness

is that right?

Not quite.

You add this to your genkit-tools.conf.ts:

module.exports = {
  runner: {
    mode: 'harness',
    files: ['./src/*.ts'],
  }
};

And then run normally with genkit start.

Copy link
Collaborator

@mbleigh mbleigh left a comment

Choose a reason for hiding this comment

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

Love it! Can you adjust genkit init for next.js to:

  1. Create genkit.config.ts inside a src/ai directory
  2. Automatically configure genkit start for harness mode

@apascal07
Copy link
Collaborator Author

Love it! Can you adjust genkit init for next.js to:

  1. Create genkit.config.ts inside a src/ai directory
  2. Automatically configure genkit start for harness mode

Yep, will do in follow up PR.

@apascal07 apascal07 merged commit 85cb09c into main May 9, 2024
@apascal07 apascal07 deleted the ap-next-js branch May 9, 2024 19:35
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.

2 participants