-
Notifications
You must be signed in to change notification settings - Fork 111
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
TextSynth support #1919
TextSynth support #1919
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good !
core/src/providers/textsynth.rs
Outdated
|
||
let response = match status { | ||
hyper::StatusCode::OK => { | ||
// print content of c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copilot prompt to cleanup
Some(api_key) => { | ||
self.api_key = Some(api_key.clone()); | ||
} | ||
None => match tokio::task::spawn_blocking(|| std::env::var("TEXTSYNTH_API_KEY")).await? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need spawn blocking ? Would have expected this to not be cpu bound
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah this is cargo-culted... we can clean-up everywhere. The thing is that std::env::var is kinda blocking but we can probably optimize
core/src/providers/textsynth.rs
Outdated
if m == -1 { | ||
let tokens = self.encode(prompt).await?; | ||
max_tokens = Some((self.context_size() - tokens.len()) as i32); | ||
// println!("Using max_tokens = {}", max_tokens.unwrap()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
Adds support for provider
textsynth
with models to be used inllm
blocks.First pass:
Will tackle these in subsequent PRs.