26 lines
662 B
Go
26 lines
662 B
Go
package analyzer
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/jobs-scraper/internal/pkg/domain"
|
|
"github.com/jobs-scraper/internal/pkg/openrouter"
|
|
// "github.com/jobs-scraper/internal/pkg/openai"
|
|
// "github.com/jobs-scraper/internal/pkg/openrouter"
|
|
)
|
|
|
|
func GetJobDescription(htmlContent string) (*domain.JobDescription, error) {
|
|
openRouterApiKey := os.Getenv("OPENROUTER_API_KEY")
|
|
openRouterModel := os.Getenv("OPENROUTER_MODEL")
|
|
fmt.Println("key", openRouterApiKey)
|
|
|
|
client := openrouter.NewOpenRouterService(openRouterModel, openRouterApiKey)
|
|
result, err := client.CreateJobDescription(htmlContent)
|
|
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return result, nil
|
|
}
|