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

Adding xef.java module #197

Merged
merged 12 commits into from
Jun 27, 2023
Merged

Adding xef.java module #197

merged 12 commits into from
Jun 27, 2023

Conversation

Yawolf
Copy link
Contributor

@Yawolf Yawolf commented Jun 22, 2023

The idea is to have this in Java:

class Person {
  public String name;
  public Int age;
}

try(AIScope scope = AIScope(...)) {
  Person person = scope.prompt("Give me a person", Person.class, ...)
  ...
}

AIScope from xef-core has been renamed to CoreAIScope for avoiding name collisions in Java and because it's a piece, from core project, needed for creating/instantiating specific AIScope in other implementations. BaseAIScope could work too.

CoreAIScope is now an AutoCloseable object so it can be used with a try-with-resources form Java.

  • Adding a new module for Java implementation
  • prompt compiles and is working
  • promptMessage compiles and is working
  • image compiles and is working
  • pdf compiles and is working
  • contextScope compiles and is working

@nomisRev nomisRev changed the title [WIP] Adding xef.java module Adding xef.java module Jun 26, 2023
@nomisRev
Copy link
Contributor

This PR is now ready for review, and ready to be merged. We want to prevent this PR from growing too large, and we need to investigate what we want to do with PDF, etc in terms of architecture.

When this is merged we can start porting more Java examples.

Copy link
Contributor

@diesalbla diesalbla left a comment

Choose a reason for hiding this comment

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

Couple suggestions...

raulraja
raulraja previously approved these changes Jun 26, 2023
Copy link
Contributor

@raulraja raulraja left a comment

Choose a reason for hiding this comment

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

Looks great @nomisRev @Yawolf !

@nomisRev nomisRev requested a review from diesalbla June 27, 2023 09:20
diesalbla
diesalbla previously approved these changes Jun 27, 2023
@nomisRev nomisRev merged commit 8c8f592 into main Jun 27, 2023
1 check passed
@nomisRev nomisRev deleted the java-module-test branch June 27, 2023 11:34
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.

None yet

4 participants