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

Model provider abstraction #74

Merged
merged 14 commits into from
Nov 1, 2024
Merged

Model provider abstraction #74

merged 14 commits into from
Nov 1, 2024

Conversation

lalalune
Copy link
Member

@lalalune lalalune commented Oct 29, 2024

Adds model provider abstraction, WIP not ready

@lalalune
Copy link
Member Author

@sirkitree please take a look. I think we need to consider secrets management, but I tested with OpenAI. I think you'll agree it is much better :)

Copy link
Collaborator

@sirkitree sirkitree left a comment

Choose a reason for hiding this comment

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

Whoa. Dat's a bigun... I'm not knowledgeable enough with this codebase yet to provide valid feedback in terms of saying this is good or not.

I'd prefer if you had an issue for this PR, referenced issues that are relevant to the change, and explained the changes and steps to test in your PR. Large PR out of the blue is how this feels currently...

I definitely would like some testing steps.

but let's see here...

Overall you're trying to provide some model abstraction.

Provide More Models

  • anthropic
  • google
  • groq
  • The abstraction in src/core/models.ts is interesting, looks good at the outset but not sure how to test.

Pumpfun

  • added some constants that are passed along for context

Order book

  • uncommented a lot of code here, which introduces some basic order book functionality

Embeddings

  • I'm not clear on what all this is doing, but I gather it's somehow used in the core memory

Error Handling Improvements

  • Adds proper error handling for cases where no appropriate response pattern is found
  • Implements a fallback mechanism to provide default responses when specific patterns aren't matched

Response Formatting

  • Enhances the formatting of bot responses to ensure consistency
  • Modifies the way responses are structured and returned to the user

Code Organization

  • Refactors the response selection logic to be more maintainable
  • Streamlines the pattern matching process for better efficiency

@sirkitree
Copy link
Collaborator

Is this for resolving #72 ?

@lalalune
Copy link
Member Author

lalalune commented Oct 30, 2024

No, this is for dealing with the horrible API key management. It makes it so you just set a model provider in your character file and it uses that one. Replaces a lot of very fragile code.

@lalalune lalalune merged commit 90e4b89 into main Nov 1, 2024
@lalalune lalalune deleted the model-provider-abstraction branch November 1, 2024 00:23
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