コード例 #1
0
    def introspect_build_jobs(self, tenant_id: Uuid, config: Union[Callable[[SkillBuildJobReq], None], None] = None) -> \
            Observable[SkillBuildJobRes]:
        if config is not None:
            introspect_req: Callable[[IntrospectionReq], None] = lambda irq: irq.build_jobs(tenant_id, config)
            query_req: Callable[[QueryReq], None] = lambda qr: qr.introspect(introspect_req)
            query_res: Callable[[QueryRes], List[SkillBuildJobRes]] = lambda qs: qs.introspect.build_jobs
            obs = rx.from_callable(lambda: self.client.query(GaiaRequest.query(query_req)), self._scheduler)
            return flat_mapQ(obs, query_res)
        else:
            def failure_cfg(f: FailureReq):
                f.failure_type()
                f.exit_code()
                f.affected_container()
                f.reason()
            def status_cfg(b: SkillStatusReq):
                b.health()
                b.pending()
                b.running()
                b.failures(failure_cfg)

            def job_cfg(b: SkillBuildJobReq):
                b.reference()
                b.name()
                b.tag()
                b.tenant_id()
                b.created()
                b.status(status_cfg)
            introspect_req: Callable[[IntrospectionReq], None] = lambda irq: irq.build_jobs(tenant_id, job_cfg)
            query_req: Callable[[QueryReq], None] = lambda qr: qr.introspect(introspect_req)
            query_res: Callable[[QueryRes], List[SkillBuildJobRes]] = lambda qs: qs.introspect.build_jobs
            obs = rx.from_callable(lambda: self.client.query(GaiaRequest.query(query_req)), self._scheduler)
            return flat_mapQ(obs, query_res)
コード例 #2
0
    def retrieve_knowledge(self, config: Callable[[KnowledgeReq], None]) -> Observable[KnowledgeRes]:
        retrieval_req: Callable[[RetrievalReq], None] = lambda x: x.knowledge(config)
        query_req: Callable[[QueryReq], None] = lambda x: x.retrieve(retrieval_req)
        query_res: Callable[[QueryRes], KnowledgeRes] = lambda x: x.retrieve.knowledge

        observable = rx.from_callable(lambda: self.client.query(GaiaRequest.query(query_req)), self._scheduler)
        return mapQ(observable, query_res)
コード例 #3
0
    def retrieve(
            self, config: Callable[[RetrievalReq],
                                   None]) -> Observable[RetrievalRes]:
        query_req: Callable[[QueryReq], None] = lambda x: x.retrieve(config)
        query_res: Callable[[QueryRes], RetrievalRes] = lambda x: x.retrieve

        observable = rx.of(self.client.query(GaiaRequest.query(query_req)))
        return mapQ(observable, query_res)
コード例 #4
0
    def retrieve_edge(self, source: Uuid, edgeId: Uuid, config: Callable[[EdgeReq], None]) -> Observable[EdgeRes]:
        knowledge_req: Callable[[KnowledgeReq], None] = lambda x: x.edge(source, edgeId, config)
        retrieval_req: Callable[[RetrievalReq], None] = lambda x: x.knowledge(knowledge_req)
        query_req: Callable[[QueryReq], None] = lambda x: x.retrieve(retrieval_req)
        query_res: Callable[[QueryRes], EdgeRes] = lambda x: x.retrieve.knowledge.edge

        observable = rx.from_callable(lambda: self.client.query(GaiaRequest.query(query_req)), self._scheduler)
        return mapQ(observable, query_res)
コード例 #5
0
    def retrieve_identity(self, identityId: Uuid, config: Callable[[IdentityReq], None]) -> Observable[IdentityRes]:
        identities_req: Callable[[IdentityReq], None] = lambda x: x.identity(identityId, config)
        retrieval_req: Callable[[RetrievalReq], None] = lambda x: x.knowledge(identities_req)
        query_req: Callable[[QueryReq], None] = lambda x: x.retrieve(retrieval_req)
        query_res: Callable[[QueryRes], IdentityRes] = lambda x: x.retrieve.knowledge.identity

        observable = rx.from_callable(lambda: self.client.query(GaiaRequest.query(query_req)), self._scheduler)
        return mapQ(observable, query_res)
コード例 #6
0
    def retrieve_fulfilment(self, identityId: Uuid, reference: Uuid, config: Callable[[FulfilmentReq], None]) -> \
            Observable[FulfilmentRes]:
        fulfilment_req: Callable[[FulfilmentReq], None] = lambda x: x.fulfilment(identityId, reference, config)
        retrieval_req: Callable[[RetrievalReq], None] = lambda x: x.knowledge(fulfilment_req)
        query_req: Callable[[QueryReq], None] = lambda x: x.retrieve(retrieval_req)
        query_res: Callable[[QueryRes], FulfilmentRes] = lambda x: x.retrieve.knowledge.fulfilment

        observable = rx.from_callable(lambda: self.client.query(GaiaRequest.query(query_req)), self._scheduler)
        return mapQ(observable, query_res)
コード例 #7
0
    def introspect(
        self, config: Callable[[IntrospectionReq], None]
    ) -> Observable[IntrospectionRes]:
        query_req: Callable[[QueryReq], None] = lambda x: x.introspect(config)
        query_res: Callable[[QueryRes],
                            IntrospectionRes] = lambda x: x.introspect

        observable = rx.of(self.client.query(GaiaRequest.query(query_req)))
        return mapQ(observable, query_res)
コード例 #8
0
    def retrieve_codes(self, identityId: Uuid, config: Callable[[CodeReq], None], limit: int, offset: int) -> \
            Observable[CodeRes]:
        code_req: Callable[[CodeReq], None] = lambda x: x.codes(identityId, limit, offset, None, None, config)
        retrieval_req: Callable[[RetrievalReq], None] = lambda x: x.knowledge(code_req)
        query_req: Callable[[QueryReq], None] = lambda x: x.retrieve(retrieval_req)
        query_res: Callable[[QueryRes], CodeRes] = lambda x: x.retrieve.knowledge.codes

        observable = rx.from_callable(lambda: self.client.query(GaiaRequest.query(query_req)), self._scheduler)
        return flat_mapQ(observable, query_res)
コード例 #9
0
    def retrieve_code(self, identityId: Uuid, reference: Uuid, config: Callable[[CodeReq], None]) -> Observable[
        CodeRes]:
        code_req: Callable[[CodeReq], None] = lambda x: x.code(identityId, reference, config)
        retrieval_req: Callable[[RetrievalReq], None] = lambda x: x.knowledge(code_req)
        query_req: Callable[[QueryReq], None] = lambda x: x.retrieve(retrieval_req)
        query_res: Callable[[QueryRes], CodeRes] = lambda x: x.retrieve.knowledge.code

        observable = rx.from_callable(lambda: self.client.query(GaiaRequest.query(query_req)), self._scheduler)
        return mapQ(observable, query_res)
コード例 #10
0
    def retrieve_behaviour(self, identityId: Uuid, reference: Uuid, config: Callable[[BehaviourReq], None]) -> \
            Observable[BehaviourRes]:
        behaviour_req: Callable[[BehaviourReq], None] = lambda x: x.behaviour(identityId, reference, config)
        retrieval_req: Callable[[RetrievalReq], None] = lambda x: x.knowledge(behaviour_req)
        query_req: Callable[[QueryReq], None] = lambda x: x.retrieve(retrieval_req)
        query_res: Callable[[QueryRes], BehaviourRes] = lambda x: x.retrieve.knowledge.behaviour

        observable = rx.from_callable(lambda: self.client.query(GaiaRequest.query(query_req)), self._scheduler)
        return mapQ(observable, query_res)
コード例 #11
0
    def retrieve_identities(self, config: Callable[[IdentityReq], None], limit: int, offset: int) -> Observable[
        IdentityRes]:
        identities_req: Callable[[IdentityReq], None] = lambda x: x.identities(limit, offset, None, None, config)
        retrieval_req: Callable[[RetrievalReq], None] = lambda x: x.knowledge(identities_req)
        query_req: Callable[[QueryReq], None] = lambda x: x.retrieve(retrieval_req)
        query_res: Callable[[QueryRes], IdentityRes] = lambda x: x.retrieve.knowledge.identities

        observable = rx.from_callable(lambda: self.client.query(GaiaRequest.query(query_req)), self._scheduler)
        return flat_mapQ(observable, query_res)
コード例 #12
0
    def introspect_skills(
        self, config: Callable[[SkillIntrospectionReq], None]
    ) -> Observable[SkillIntrospectionRes]:
        introspect_skills: Callable[[IntrospectionReq],
                                    None] = lambda x: x.skills(config)
        query_req: Callable[[QueryReq],
                            None] = lambda x: x.introspect(introspect_skills)
        query_res: Callable[
            [QueryRes], SkillIntrospectionRes] = lambda x: x.introspect.skills

        observable = rx.of(self.client.query(GaiaRequest.query(query_req)))
        return mapQ(observable, query_res)
コード例 #13
0
    def retrieve_behaviour_execution(self, identity_id: Uuid, process_instance_id: Uuid,
                                     config: Callable[[BehaviourExecutionDetailReq], None]) \
            -> Observable[BehaviourExecutionDetailRes]:
        behaviour_exec_query: Callable[[BehaviourExecutionDetailRes], None] = lambda x: x.behaviour_execution(
            identity_id, process_instance_id, config)
        retrieval_req: Callable[[RetrievalReq], None] = lambda x: x.experience(behaviour_exec_query)
        query_req: Callable[[QueryReq], None] = lambda x: x.retrieve(retrieval_req)
        query_res: Callable[[QueryRes], BehaviourExecutionDetailRes] = lambda \
            x: x.retrieve.experience.behaviour_execution

        observable = rx.from_callable(lambda: self.client.query(GaiaRequest.query(query_req)), self._scheduler)
        return mapQ(observable, query_res)
コード例 #14
0
    def retrieve_codes(
            self, config: Callable[[CodeReq], None]) -> Observable[CodeRes]:
        code_req: Callable[[CodeReq], None] = lambda x: x.codes(config)
        retrieval_req: Callable[[RetrievalReq],
                                None] = lambda x: x.knowledge(code_req)
        query_req: Callable[[QueryReq],
                            None] = lambda x: x.retrieve(retrieval_req)
        query_res: Callable[[QueryRes],
                            CodeRes] = lambda x: x.retrieve.knowledge.codes

        observable = rx.of(self.client.query(GaiaRequest.query(query_req)))
        return flat_mapQ(observable, query_res)
コード例 #15
0
    def retrieve_prompts(
            self, config: Callable[[PromptReq],
                                   None]) -> Observable[PromptRes]:
        prompts_req: Callable[[PromptReq], None] = lambda x: x.prompts(config)
        retrieval_req: Callable[[RetrievalReq],
                                None] = lambda x: x.knowledge(prompts_req)
        query_req: Callable[[QueryReq],
                            None] = lambda x: x.retrieve(retrieval_req)
        query_res: Callable[[QueryRes],
                            PromptRes] = lambda x: x.retrieve.knowledge.prompts

        observable = rx.of(self.client.query(GaiaRequest.query(query_req)))
        return flat_mapQ(observable, query_res)
コード例 #16
0
    def retrieve_behaviour_executions(self, identity_id: Uuid, config: Callable[[BehaviourExecutionReq], None],
                                      limit: int = None, offset: int = None, startDate: str = None, endDate: str = None) \
            -> Observable[BehaviourExecutionRes]:
        executions_req: Callable[[BehaviourExecutionReq], None] = lambda x: x.behaviour_executions(identity_id, limit,
                                                                                                   offset, startDate,
                                                                                                   endDate, config)
        retrieval_req: Callable[[RetrievalReq], None] = lambda x: x.experience(executions_req)

        query_req: Callable[[QueryReq], None] = lambda x: x.retrieve(retrieval_req)
        query_res: Callable[[QueryRes], BehaviourExecutionRes] = lambda x: x.retrieve.experience.behaviour_executions

        observable = rx.from_callable(lambda: self.client.query(GaiaRequest.query(query_req)), self._scheduler)
        return flat_mapQ(observable, query_res)
コード例 #17
0
    def retrieve_fulfilments(
            self, config: Callable[[FulfilmentReq],
                                   None]) -> Observable[FulfilmentRes]:
        fulfilment_req: Callable[[FulfilmentReq],
                                 None] = lambda x: x.fulfilments(config)
        retrieval_req: Callable[[RetrievalReq],
                                None] = lambda x: x.knowledge(fulfilment_req)
        query_req: Callable[[QueryReq],
                            None] = lambda x: x.retrieve(retrieval_req)
        query_res: Callable[
            [QueryRes],
            FulfilmentRes] = lambda x: x.retrieve.knowledge.fulfilments

        observable = rx.of(self.client.query(GaiaRequest.query(query_req)))
        return flat_mapQ(observable, query_res)
コード例 #18
0
    def retrieve_behaviour(
            self, config: Callable[[BehaviourReq],
                                   None]) -> Observable[BehaviourRes]:
        behaviour_req: Callable[[BehaviourReq],
                                None] = lambda x: x.behaviours(config)
        retrieval_req: Callable[[RetrievalReq],
                                None] = lambda x: x.knowledge(behaviour_req)
        query_req: Callable[[QueryReq],
                            None] = lambda x: x.retrieve(retrieval_req)
        query_res: Callable[
            [QueryRes],
            BehaviourRes] = lambda x: x.retrieve.knowledge.behaviours

        observable = rx.of(self.client.query(GaiaRequest.query(query_req)))
        return flat_mapQ(observable, query_res)