()
| 214 | } |
| 215 | |
| 216 | func (r *Route) ShouldRunEmbeddings() bool { |
| 217 | if len(r.RequestFormat) != 0 { |
| 218 | return r.RequestFormat == "openai_embeddings" |
| 219 | } |
| 220 | |
| 221 | if len(r.Steps) == 0 { |
| 222 | return false |
| 223 | } |
| 224 | |
| 225 | if r.Steps[0] == nil { |
| 226 | return false |
| 227 | } |
| 228 | |
| 229 | if strings.Contains(r.Steps[0].Model, "ada") { |
| 230 | return true |
| 231 | } |
| 232 | |
| 233 | return false |
| 234 | } |
| 235 | |
| 236 | func InitializeBackoff(strategy string, dur time.Duration) backoff.BackOff { |
| 237 | if strategy == "exponential" { |
no outgoing calls
no test coverage detected