mirror of
https://github.com/twitter/the-algorithm.git
synced 2024-06-13 22:58:54 +02:00
ef4c5eb65e
Please note we have force-pushed a new initial commit in order to remove some publicly-available Twitter user information. Note that this process may be required in the future.
26 lines
1.0 KiB
Scala
26 lines
1.0 KiB
Scala
package com.twitter.product_mixer.component_library.candidate_source.cr_mixer
|
|
|
|
import com.twitter.cr_mixer.{thriftscala => t}
|
|
import com.twitter.product_mixer.core.functional_component.candidate_source.CandidateSource
|
|
import com.twitter.product_mixer.core.model.common.identifier.CandidateSourceIdentifier
|
|
import com.twitter.stitch.Stitch
|
|
import javax.inject.Inject
|
|
import javax.inject.Singleton
|
|
|
|
/**
|
|
* Returns out-of-network Tweet recommendations by using user recommendations
|
|
* from FollowRecommendationService as an input seed-set to Earlybird
|
|
*/
|
|
@Singleton
|
|
class CrMixerFrsBasedTweetRecommendationsCandidateSource @Inject() (
|
|
crMixerClient: t.CrMixer.MethodPerEndpoint)
|
|
extends CandidateSource[t.FrsTweetRequest, t.FrsTweet] {
|
|
|
|
override val identifier: CandidateSourceIdentifier =
|
|
CandidateSourceIdentifier("CrMixerFrsBasedTweetRecommendations")
|
|
|
|
override def apply(request: t.FrsTweetRequest): Stitch[Seq[t.FrsTweet]] = Stitch
|
|
.callFuture(crMixerClient.getFrsBasedTweetRecommendations(request))
|
|
.map(_.tweets)
|
|
}
|