Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify entry file heuristics #9

Merged
merged 2 commits into from
May 20, 2024
Merged

Simplify entry file heuristics #9

merged 2 commits into from
May 20, 2024

Conversation

nbsp
Copy link
Member

@nbsp nbsp commented May 18, 2024

still feels unidiomatic and handwavey magic, but it's better.

Suggested-by: lukasIO [email protected]

@nbsp nbsp requested review from davidzhao and lukasIO May 18, 2024 09:02
// SPDX-License-Identifier: Apache-2.0
import type { JobContext } from './job_context.js';

type entryFunction = (job: JobContext) => Promise<void>;
Copy link
Member

Choose a reason for hiding this comment

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

should it return Promise<void | () => void> to reflect that it could return a function?

Copy link
Member Author

@nbsp nbsp May 19, 2024

Choose a reason for hiding this comment

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

does it return anything? all of the examples on Python's agents return void, and regardless we don't do anything with the potential return value of this function, we just run it.
there's no reason to return anything because there's nowhere to return it to

if we really want to allow returning things for whatever reason we should replace void with unknown to prevent type errors

Copy link
Contributor

@lukasIO lukasIO May 19, 2024

Choose a reason for hiding this comment

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

the confusion is my fault, I thought it'd be nice to provide some sort of resource cleanup functionality, but I thought about it just in terms of API and not in terms of what's already implemented... I guess that we should just remove the comment that mentions the return cleanup function and leave the return type as Promise<void>.

still feels unidiomatic and handwavey magic, but it's better.

Suggested-by: lukasIO <[email protected]>
@nbsp
Copy link
Member Author

nbsp commented May 20, 2024

also added ChunkedStreams which were recently implemented in Python agents and made some more changes to the end-user API

@nbsp nbsp merged commit c156d3c into main May 20, 2024
1 check passed
@nbsp nbsp deleted the nbsp/define branch May 20, 2024 07:01
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