Mirascope provides out-of-the-box integration with HyperDX.
You can install the necessary packages directly or using the hyperdx extras flag:
pipinstall"mirascope[hyperdx]"
You can then use the with_hyperdx decorator to automatically log calls:
frommirascope.coreimportanthropicfrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@anthropic.call(model="claude-3-5-sonnet-20240620")defrecommend_book(genre:str)->str:returnf"Recommend a {genre} book."print(recommend_book("fantasy"))
frommirascope.coreimportanthropicfrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@anthropic.call("claude-3-5-sonnet-20240620")defrecommend_book(genre:str)->str:returnf"Recommend a {genre} book"print(recommend_book("fantasy"))
frommirascope.coreimportmistralfrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@mistral.call("mistral-large-latest")defrecommend_book(genre:str)->str:returnf"Recommend a {genre} book"print(recommend_book("fantasy"))
frommirascope.coreimportgeminifrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@gemini.call("gemini-1.5-flash")defrecommend_book(genre:str)->str:returnf"Recommend a {genre} book"print(recommend_book("fantasy"))
frommirascope.coreimportgroqfrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@groq.call("llama-3.1-70b-versatile")defrecommend_book(genre:str)->str:returnf"Recommend a {genre} book"print(recommend_book("fantasy"))
frommirascope.coreimportcoherefrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@cohere.call("command-r-plus")defrecommend_book(genre:str)->str:returnf"Recommend a {genre} book"print(recommend_book("fantasy"))
frommirascope.coreimportlitellmfrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@litellm.call("gpt-4o-mini")defrecommend_book(genre:str)->str:returnf"Recommend a {genre} book"print(recommend_book("fantasy"))
frommirascope.coreimportazurefrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@azure.call("gpt-4o-mini")defrecommend_book(genre:str)->str:returnf"Recommend a {genre} book"print(recommend_book("fantasy"))
frommirascope.coreimportvertexfrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@vertex.call("gemini-1.5-flash")defrecommend_book(genre:str)->str:returnf"Recommend a {genre} book"print(recommend_book("fantasy"))
frommirascope.coreimportanthropicfrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@anthropic.call(model="claude-3-5-sonnet-20240620")defrecommend_book(genre:str)->str:returnf"Recommend a {genre} book."print(recommend_book("fantasy"))
frommirascope.coreimportMessages,anthropicfrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@anthropic.call(model="claude-3-5-sonnet-20240620")defrecommend_book(genre:str)->Messages.Type:returnMessages.User(f"Recommend a {genre} book.")print(recommend_book("fantasy"))
frommirascope.coreimportMessages,anthropicfrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@anthropic.call("claude-3-5-sonnet-20240620")defrecommend_book(genre:str)->Messages.Type:returnMessages.User(f"Recommend a {genre} book")print(recommend_book("fantasy"))
frommirascope.coreimportMessages,mistralfrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@mistral.call("mistral-large-latest")defrecommend_book(genre:str)->Messages.Type:returnMessages.User(f"Recommend a {genre} book")print(recommend_book("fantasy"))
frommirascope.coreimportMessages,geminifrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@gemini.call("gemini-1.5-flash")defrecommend_book(genre:str)->Messages.Type:returnMessages.User(f"Recommend a {genre} book")print(recommend_book("fantasy"))
frommirascope.coreimportMessages,groqfrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@groq.call("llama-3.1-70b-versatile")defrecommend_book(genre:str)->Messages.Type:returnMessages.User(f"Recommend a {genre} book")print(recommend_book("fantasy"))
frommirascope.coreimportMessages,coherefrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@cohere.call("command-r-plus")defrecommend_book(genre:str)->Messages.Type:returnMessages.User(f"Recommend a {genre} book")print(recommend_book("fantasy"))
frommirascope.coreimportMessages,litellmfrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@litellm.call("gpt-4o-mini")defrecommend_book(genre:str)->Messages.Type:returnMessages.User(f"Recommend a {genre} book")print(recommend_book("fantasy"))
frommirascope.coreimportMessages,azurefrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@azure.call("gpt-4o-mini")defrecommend_book(genre:str)->Messages.Type:returnMessages.User(f"Recommend a {genre} book")print(recommend_book("fantasy"))
frommirascope.coreimportMessages,vertexfrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@vertex.call("gemini-1.5-flash")defrecommend_book(genre:str)->Messages.Type:returnMessages.User(f"Recommend a {genre} book")print(recommend_book("fantasy"))
frommirascope.coreimportMessages,anthropicfrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@anthropic.call(model="claude-3-5-sonnet-20240620")defrecommend_book(genre:str)->Messages.Type:returnMessages.User(f"Recommend a {genre} book.")print(recommend_book("fantasy"))
frommirascope.coreimportanthropic,prompt_templatefrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@anthropic.call(model="claude-3-5-sonnet-20240620")@prompt_template("Recommend a {genre} book")defrecommend_book(genre:str):...print(recommend_book("fantasy"))
frommirascope.coreimportanthropic,prompt_templatefrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@anthropic.call("claude-3-5-sonnet-20240620")@prompt_template("Recommend a {genre} book")defrecommend_book(genre:str):...print(recommend_book("fantasy"))
frommirascope.coreimportmistral,prompt_templatefrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@mistral.call("mistral-large-latest")@prompt_template("Recommend a {genre} book")defrecommend_book(genre:str):...print(recommend_book("fantasy"))
frommirascope.coreimportgemini,prompt_templatefrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@gemini.call("gemini-1.5-flash")@prompt_template("Recommend a {genre} book")defrecommend_book(genre:str):...print(recommend_book("fantasy"))
frommirascope.coreimportgroq,prompt_templatefrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@groq.call("llama-3.1-70b-versatile")@prompt_template("Recommend a {genre} book")defrecommend_book(genre:str):...print(recommend_book("fantasy"))
frommirascope.coreimportcohere,prompt_templatefrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@cohere.call("command-r-plus")@prompt_template("Recommend a {genre} book")defrecommend_book(genre:str):...print(recommend_book("fantasy"))
frommirascope.coreimportlitellm,prompt_templatefrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@litellm.call("gpt-4o-mini")@prompt_template("Recommend a {genre} book")defrecommend_book(genre:str):...print(recommend_book("fantasy"))
frommirascope.coreimportazure,prompt_templatefrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@azure.call("gpt-4o-mini")@prompt_template("Recommend a {genre} book")defrecommend_book(genre:str):...print(recommend_book("fantasy"))
frommirascope.coreimportprompt_template,vertexfrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@vertex.call("gemini-1.5-flash")@prompt_template("Recommend a {genre} book")defrecommend_book(genre:str):...print(recommend_book("fantasy"))
frommirascope.coreimportanthropic,prompt_templatefrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@anthropic.call(model="claude-3-5-sonnet-20240620")@prompt_template("Recommend a {genre} book")defrecommend_book(genre:str):...print(recommend_book("fantasy"))
frommirascope.coreimportBaseMessageParam,anthropicfrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@anthropic.call(model="claude-3-5-sonnet-20240620")defrecommend_book(genre:str)->list[BaseMessageParam]:return[BaseMessageParam(role="user",content=f"Recommend a {genre} book.")]print(recommend_book("fantasy"))
frommirascope.coreimportBaseMessageParam,anthropicfrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@anthropic.call("claude-3-5-sonnet-20240620")defrecommend_book(genre:str)->list[BaseMessageParam]:return[BaseMessageParam(role="user",content=f"Recommend a {genre} book")]print(recommend_book("fantasy"))
frommirascope.coreimportBaseMessageParam,mistralfrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@mistral.call("mistral-large-latest")defrecommend_book(genre:str)->list[BaseMessageParam]:return[BaseMessageParam(role="user",content=f"Recommend a {genre} book")]print(recommend_book("fantasy"))
frommirascope.coreimportBaseMessageParam,geminifrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@gemini.call("gemini-1.5-flash")defrecommend_book(genre:str)->list[BaseMessageParam]:return[BaseMessageParam(role="user",content=f"Recommend a {genre} book")]print(recommend_book("fantasy"))
frommirascope.coreimportBaseMessageParam,groqfrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@groq.call("llama-3.1-70b-versatile")defrecommend_book(genre:str)->list[BaseMessageParam]:return[BaseMessageParam(role="user",content=f"Recommend a {genre} book")]print(recommend_book("fantasy"))
frommirascope.coreimportBaseMessageParam,coherefrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@cohere.call("command-r-plus")defrecommend_book(genre:str)->list[BaseMessageParam]:return[BaseMessageParam(role="user",content=f"Recommend a {genre} book")]print(recommend_book("fantasy"))
frommirascope.coreimportBaseMessageParam,litellmfrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@litellm.call("gpt-4o-mini")defrecommend_book(genre:str)->list[BaseMessageParam]:return[BaseMessageParam(role="user",content=f"Recommend a {genre} book")]print(recommend_book("fantasy"))
frommirascope.coreimportBaseMessageParam,azurefrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@azure.call("gpt-4o-mini")defrecommend_book(genre:str)->list[BaseMessageParam]:return[BaseMessageParam(role="user",content=f"Recommend a {genre} book")]print(recommend_book("fantasy"))
frommirascope.coreimportBaseMessageParam,vertexfrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@vertex.call("gemini-1.5-flash")defrecommend_book(genre:str)->list[BaseMessageParam]:return[BaseMessageParam(role="user",content=f"Recommend a {genre} book")]print(recommend_book("fantasy"))
frommirascope.coreimportBaseMessageParam,bedrockfrommirascope.integrations.otelimportwith_hyperdx@with_hyperdx()@bedrock.call(model="claude-3-5-sonnet-20240620")defrecommend_book(genre:str)->list[BaseMessageParam]:return[BaseMessageParam(role="user",content=f"Recommend a {genre} book.")]print(recommend_book("fantasy"))